merge with stable
authorMatt Mackall <mpm@selenic.com>
Wed, 22 Sep 2010 18:29:41 -0500
changeset 12380 1e2625fe371b
parent 12377 a5b77eb0409b (diff)
parent 12379 6aa2c86db2eb (current diff)
child 12383 f1e8d6f6e682
merge with stable
hgext/mq.py
tests/test-archive.t
tests/test-mq-safety.t
--- a/contrib/bash_completion	Wed Sep 22 17:13:49 2010 -0500
+++ b/contrib/bash_completion	Wed Sep 22 18:29:41 2010 -0500
@@ -462,6 +462,17 @@
     return 1
 }
 
+_hg_cmd_qqueue()
+{
+    local q
+    local queues
+    local opts="--list --create --rename --delete --purge"
+
+    queues=$( _hg_cmd qqueue --quiet )
+
+    COMPREPLY=( $( compgen -W "${opts} ${queues}" "${cur}" ) )
+}
+
 
 # hbisect
 _hg_cmd_bisect()
--- a/contrib/check-code.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/contrib/check-code.py	Wed Sep 22 18:29:41 2010 -0500
@@ -7,7 +7,7 @@
 # This software may be used and distributed according to the terms of the
 # GNU General Public License version 2 or any later version.
 
-import re, glob
+import re, glob, os, sys
 import optparse
 
 def repquote(m):
@@ -63,6 +63,7 @@
     (r'export.*=', "don't export and assign at once"),
     ('^([^"\']|("[^"]*")|(\'[^\']*\'))*\\^', "^ must be quoted"),
     (r'^source\b', "don't use 'source', use '.'"),
+    (r'touch -d', "don't use 'touch -d', use 'touch -t' instead"),
 ]
 
 testfilters = [
@@ -70,13 +71,42 @@
     (r"<<(\S+)((.|\n)*?\n\1)", rephere),
 ]
 
+uprefix = r"^  \$ "
+utestpats = [
+    (uprefix + r'.*\|\s*sed', "use regex test output patterns instead of sed"),
+    (uprefix + r'(true|exit 0)', "explicit zero exit unnecessary"),
+    (uprefix + r'.*\$\?', "explicit exit code checks unnecessary"),
+    (uprefix + r'.*\|\| echo.*(fail|error)',
+     "explicit exit code checks unnecessary"),
+    (uprefix + r'set -e', "don't use set -e"),
+]
+
+for p, m in testpats:
+    if p.startswith('^'):
+        p = uprefix + p[1:]
+    else:
+        p = uprefix + p
+    utestpats.append((p, m))
+
+utestfilters = [
+    (r"( *)(#([^\n]*\S)?)", repcomment),
+]
+
 pypats = [
+    (r'^\s*def\s*\w+\s*\(.*,\s*\(',
+     "tuple parameter unpacking not available in Python 3+"),
+    (r'lambda\s*\(.*,.*\)',
+     "tuple parameter unpacking not available in Python 3+"),
+    (r'(?<!def)\s+(cmp)\(', "cmp is not available in Python 3+"),
+    (r'\breduce\s*\(.*', "reduce is not available in Python 3+"),
+    (r'\.has_key\b', "dict.has_key is not available in Python 3+"),
     (r'^\s*\t', "don't use tabs"),
     (r'\S;\s*\n', "semicolon"),
     (r'\w,\w', "missing whitespace after ,"),
     (r'\w[+/*\-<>]\w', "missing whitespace in expression"),
     (r'^\s+\w+=\w+[^,)]$', "missing whitespace in assignment"),
     (r'.{85}', "line too long"),
+    (r'.{81}', "warning: line over 80 characters"),
     (r'[^\n]\Z', "no trailing newline"),
 #    (r'^\s+[^_ ][^_. ]+_[^_]+\s*=', "don't use underbars in identifiers"),
 #    (r'\w*[a-z][A-Z]\w*\s*=', "don't use camelcase in identifiers"),
@@ -149,13 +179,14 @@
     ('python', r'.*\.(py|cgi)$', pyfilters, pypats),
     ('test script', r'(.*/)?test-[^.~]*$', testfilters, testpats),
     ('c', r'.*\.c$', cfilters, cpats),
+    ('unified test', r'.*\.t$', utestfilters, utestpats),
 ]
 
 class norepeatlogger(object):
     def __init__(self):
         self._lastseen = None
 
-    def log(self, fname, lineno, line, msg):
+    def log(self, fname, lineno, line, msg, blame):
         """print error related a to given line of a given file.
 
         The faulty line will also be printed but only once in the case
@@ -168,14 +199,26 @@
         """
         msgid = fname, lineno, line
         if msgid != self._lastseen:
-            print "%s:%d:" % (fname, lineno)
+            if blame:
+                print "%s:%d (%s):" % (fname, lineno, blame)
+            else:
+                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):
+def getblame(f):
+    lines = []
+    for l in os.popen('hg annotate -un %s' % f):
+        start, line = l.split(':', 1)
+        user, rev = start.split()
+        lines.append((line[1:-1], user, rev))
+    return lines
+
+def checkfile(f, logfunc=_defaultlogger.log, maxerr=None, warnings=False,
+              blame=False):
     """checks style and portability of a given file
 
     :f: filepath
@@ -186,6 +229,7 @@
 
     return True if no error is found, False otherwise.
     """
+    blamecache = None
     result = True
     for name, match, filters, pats in checks:
         fc = 0
@@ -205,7 +249,16 @@
                 if not warnings and msg.startswith("warning"):
                     continue
                 if re.search(p, l[1]):
-                    logfunc(f, n + 1, l[0], msg)
+                    bd = ""
+                    if blame:
+                        bd = 'working directory'
+                        if not blamecache:
+                            blamecache = getblame(f)
+                        if n < len(blamecache):
+                            bl, bu, br = blamecache[n]
+                            if bl == l[0]:
+                                bd = '%s@%s' % (bu, br)
+                    logfunc(f, n + 1, l[0], msg, bd)
                     fc += 1
                     result = False
             if maxerr is not None and fc >= maxerr:
@@ -214,15 +267,16 @@
         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.add_option("-b", "--blame", action="store_true",
+                      help="use annotate to generate blame info")
 
-    parser.set_defaults(per_file=15, warnings=False)
+    parser.set_defaults(per_file=15, warnings=False, blame=False)
     (options, args) = parser.parse_args()
 
     if len(args) == 0:
@@ -231,4 +285,8 @@
         check = args
 
     for f in check:
-        checkfile(f, maxerr=options.per_file, warnings=options.warnings)
+        ret = 0
+        if not checkfile(f, maxerr=options.per_file, warnings=options.warnings,
+                         blame=options.blame):
+            ret = 1
+    sys.exit(ret)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contrib/compress.py	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,62 @@
+# Copyright 2010 Pradeepkumar Gayam <in3xes@gmail.com>
+#
+# Author(s):
+# Pradeepkumar Gayam <in3xes@gmail.com>
+#
+# This software may be used and distributed according to the terms of the
+# GNU General Public License version 2 or any later version.
+
+
+from mercurial import hg, localrepo
+from mercurial.lock import release
+import weakref
+
+def _copyrevlog(ui, src, dst, tr, progress=None):
+    if progress:
+        desc = 'adding %s' % progress
+        total = len(src)
+        def progress(count):
+            ui.progress(desc, count, unit=('revisions'), total=total)
+    else:
+        progress = lambda x: None
+    for r in src:
+        p = [src.node(i) for i in src.parentrevs(r)]
+        dst.addrevision(src.revision(src.node(r)), tr, src.linkrev(r),
+                        p[0], p[1])
+        progress(r)
+
+def compress(ui, repo, dest):
+    # activate parentdelta
+    ui.setconfig('format', 'parentdelta', 'on')
+    dest = hg.localpath(ui.expandpath(dest))
+    target = localrepo.instance(ui, dest, create=True)
+
+    tr = lock = tlock = None
+    try:
+        lock = repo.lock()
+        tlock = target.lock()
+        tr = target.transaction("compress")
+        trp = weakref.proxy(tr)
+
+        _copyrevlog(ui, repo.manifest, target.manifest, trp, 'manifest')
+
+        # only keep indexes and filter "data/" prefix and ".i" suffix
+        datafiles = [fn[5:-2] for fn, f2, size in repo.store.datafiles()
+                                      if size and fn.endswith('.i')]
+        total = len(datafiles)
+        for cnt, f in enumerate(datafiles):
+            _copyrevlog(ui, repo.file(f), target.file(f), trp)
+            ui.progress(('adding files'), cnt, item=f, unit=('file'),
+                        total=total)
+
+        _copyrevlog(ui, repo.changelog, target.changelog, trp, 'changesets')
+
+        tr.close()
+    finally:
+        if tr:
+            tr.release()
+        release(tlock, lock)
+
+cmdtable = {
+    "compress" : (compress, [], "DEST")
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contrib/debugshell.py	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,21 @@
+# debugshell extension
+"""a python shell with repo, changelog & manifest objects"""
+
+import mercurial
+import code
+
+def debugshell(ui, repo, **opts):
+    objects = {
+        'mercurial': mercurial,
+        'repo': repo,
+        'cl': repo.changelog,
+        'mf': repo.manifest,
+    }
+    bannermsg = "loaded repo : %s\n" \
+                "using source: %s" % (repo.root,
+                                      mercurial.__path__[0])
+    code.interact(bannermsg, local=objects)
+
+cmdtable = {
+    "debugshell|dbsh": (debugshell, [])
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contrib/hgfixes/fix_bytes.py	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,97 @@
+"""Fixer that changes plain strings to bytes strings."""
+
+import re
+
+from lib2to3 import fixer_base
+from lib2to3.pgen2 import token
+from lib2to3.fixer_util import Name
+from lib2to3.pygram import python_symbols as syms
+
+_re = re.compile(r'[rR]?[\'\"]')
+
+# XXX: Implementing a blacklist in 2to3 turned out to be more troublesome than
+# blacklisting some modules inside the fixers. So, this is what I came with.
+
+blacklist = ['mercurial/demandimport.py',
+             'mercurial/py3kcompat.py', # valid python 3 already
+             'mercurial/i18n.py',
+            ]
+
+def isdocstring(node):
+    def isclassorfunction(ancestor):
+        symbols = (syms.funcdef, syms.classdef)
+        # if the current node is a child of a function definition, a class
+        # definition or a file, then it is a docstring
+        if ancestor.type == syms.simple_stmt:
+            try:
+                while True:
+                    if ancestor.type in symbols:
+                        return True
+                    ancestor = ancestor.parent
+            except AttributeError:
+                return False
+        return False
+
+    def ismodule(ancestor):
+        # Our child is a docstring if we are a simple statement, and our
+        # ancestor is file_input. In other words, our child is a lone string in
+        # the source file.
+        try:
+            if (ancestor.type == syms.simple_stmt and
+                ancestor.parent.type == syms.file_input):
+                    return True
+        except AttributeError:
+            return False
+
+    def isdocassignment(ancestor):
+        # Assigning to __doc__, definitely a string
+        try:
+            while True:
+                if (ancestor.type == syms.expr_stmt and
+                    Name('__doc__') in ancestor.children):
+                        return True
+                ancestor = ancestor.parent
+        except AttributeError:
+            return False
+
+    if ismodule(node.parent) or \
+       isdocassignment(node.parent) or \
+       isclassorfunction(node.parent):
+        return True
+    return False
+
+def shouldtransform(node):
+    specialnames = ['__main__']
+
+    if node.value in specialnames:
+        return False
+
+    ggparent = node.parent.parent.parent
+    sggparent = str(ggparent)
+
+    if 'getattr' in sggparent or \
+       'hasattr' in sggparent or \
+       'setattr' in sggparent or \
+       'encode' in sggparent or \
+       'decode' in sggparent:
+           return False
+
+    return True
+
+class FixBytes(fixer_base.BaseFix):
+
+    PATTERN = 'STRING'
+
+    def transform(self, node, results):
+        if self.filename in blacklist:
+            return
+        if node.type == token.STRING:
+            if _re.match(node.value):
+                if isdocstring(node):
+                    return
+                if not shouldtransform(node):
+                    return
+                new = node.clone()
+                new.value = 'b' + new.value
+                return new
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contrib/hgfixes/fix_bytesmod.py	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,63 @@
+"""Fixer that changes bytes % whatever to a function that actually formats
+it."""
+
+from lib2to3 import fixer_base
+from lib2to3.fixer_util import is_tuple, Call, Comma, Name, touch_import
+
+# XXX: Implementing a blacklist in 2to3 turned out to be more troublesome than
+# blacklisting some modules inside the fixers. So, this is what I came with.
+
+blacklist = ['mercurial/demandimport.py',
+             'mercurial/py3kcompat.py',
+             'mercurial/i18n.py',
+            ]
+
+def isnumberremainder(formatstr, data):
+    try:
+        if data.value.isdigit():
+            return True
+    except AttributeError:
+        return False
+
+class FixBytesmod(fixer_base.BaseFix):
+    # XXX: There's one case (I suppose) I can't handle: when a remainder
+    # operation like foo % bar is performed, I can't really know what the
+    # contents of foo and bar are. I believe the best approach is to "correct"
+    # the to-be-converted code and let bytesformatter handle that case in
+    # runtime.
+    PATTERN = '''
+              term< formatstr=STRING '%' data=STRING > |
+              term< formatstr=STRING '%' data=atom > |
+              term< formatstr=NAME '%' data=any > |
+              term< formatstr=any '%' data=any >
+              '''
+
+    def transform(self, node, results):
+        if self.filename in blacklist:
+            return
+        elif self.filename == 'mercurial/util.py':
+            touch_import('.', 'py3kcompat', node=node)
+
+        formatstr = results['formatstr'].clone()
+        data = results['data'].clone()
+        formatstr.prefix = '' # remove spaces from start
+
+        if isnumberremainder(formatstr, data):
+            return
+
+        # We have two possibilities:
+        # 1- An identifier or name is passed, it is going to be a leaf, thus, we
+        #    just need to copy its value as an argument to the formatter;
+        # 2- A tuple is explicitly passed. In this case, we're gonna explode it
+        # to pass to the formatter
+        # TODO: Check for normal strings. They don't need to be translated
+
+        if is_tuple(data):
+            args = [formatstr, Comma().clone()] + \
+                   [c.clone() for c in data.children[:]]
+        else:
+            args = [formatstr, Comma().clone(), data]
+
+        call = Call(Name('bytesformatter', prefix = ' '), args)
+        return call
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contrib/hgfixes/fix_leftover_imports.py	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,108 @@
+"Fixer that translates some APIs ignored by the default 2to3 fixers."
+
+# FIXME: This fixer has some ugly hacks. Its main design is based on that of
+# fix_imports, from lib2to3. Unfortunately, the fix_imports framework only
+# changes module names "without dots", meaning it won't work for some changes
+# in the email module/package. Thus this fixer was born. I believe that with a
+# bit more thinking, a more generic fixer can be implemented, but I'll leave
+# that as future work.
+
+from lib2to3.fixer_util import Name
+from lib2to3.fixes import fix_imports
+
+# This maps the old names to the new names. Note that a drawback of the current
+# design is that the dictionary keys MUST have EXACTLY one dot (.) in them,
+# otherwise things will break. (If you don't need a module hierarchy, you're
+# better of just inherit from fix_imports and overriding the MAPPING dict.)
+
+MAPPING = {'email.Utils': 'email.utils',
+           'email.Errors': 'email.errors',
+           'email.Header': 'email.header',
+           'email.Parser': 'email.parser',
+           'email.Encoders': 'email.encoders',
+           'email.MIMEText': 'email.mime.text',
+           'email.MIMEBase': 'email.mime.base',
+           'email.Generator': 'email.generator',
+           'email.MIMEMultipart': 'email.mime.multipart',
+}
+
+def alternates(members):
+    return "(" + "|".join(map(repr, members)) + ")"
+
+def build_pattern(mapping=MAPPING):
+    packages = {}
+    for key in mapping:
+        # What we are doing here is the following: with dotted names, we'll
+        # have something like package_name <trailer '.' module>. Then, we are
+        # making a dictionary to copy this structure. For example, if
+        # mapping={'A.B': 'a.b', 'A.C': 'a.c'}, it will generate the dictionary
+        # {'A': ['b', 'c']} to, then, generate something like "A <trailer '.'
+        # ('b' | 'c')".
+        name = key.split('.')
+        prefix = name[0]
+        if prefix in packages:
+            packages[prefix].append(name[1:][0])
+        else:
+            packages[prefix] = name[1:]
+
+    mod_list = ' | '.join(["'%s' '.' ('%s')" %
+        (key, "' | '".join(packages[key])) for key in packages])
+    mod_list = '(' + mod_list + ' )'
+    bare_names = alternates(mapping.keys())
+
+    yield """name_import=import_name< 'import' module_name=dotted_name< %s > >
+          """ % mod_list
+
+    yield """name_import=import_name< 'import'
+            multiple_imports=dotted_as_names< any*
+            module_name=dotted_name< %s >
+            any* >
+            >""" % mod_list
+
+    packs = ' | '.join(["'%s' trailer<'.' ('%s')>" % (key,
+               "' | '".join(packages[key])) for key in packages])
+
+    yield "power< package=(%s) trailer<'.' any > any* >" % packs
+
+class FixLeftoverImports(fix_imports.FixImports):
+    # We want to run this fixer after fix_import has run (this shouldn't matter
+    # for hg, though, as setup3k prefers to run the default fixers first)
+    mapping = MAPPING
+
+    def build_pattern(self):
+        return "|".join(build_pattern(self.mapping))
+
+    def transform(self, node, results):
+        # Mostly copied from fix_imports.py
+        import_mod = results.get("module_name")
+        if import_mod:
+            try:
+                mod_name = import_mod.value
+            except AttributeError:
+                # XXX: A hack to remove whitespace prefixes and suffixes
+                mod_name = str(import_mod).strip()
+            new_name = self.mapping[mod_name]
+            import_mod.replace(Name(new_name, prefix=import_mod.prefix))
+            if "name_import" in results:
+                # If it's not a "from x import x, y" or "import x as y" import,
+                # marked its usage to be replaced.
+                self.replace[mod_name] = new_name
+            if "multiple_imports" in results:
+                # This is a nasty hack to fix multiple imports on a line (e.g.,
+                # "import StringIO, urlparse"). The problem is that I can't
+                # figure out an easy way to make a pattern recognize the keys of
+                # MAPPING randomly sprinkled in an import statement.
+                results = self.match(node)
+                if results:
+                    self.transform(node, results)
+        else:
+            # Replace usage of the module.
+            # Now this is, mostly, a hack
+            bare_name = results["package"][0]
+            bare_name_text = ''.join(map(str, results['package'])).strip()
+            new_name = self.replace.get(bare_name_text)
+            prefix = results['package'][0].prefix
+            if new_name:
+                bare_name.replace(Name(new_name, prefix=prefix))
+                results["package"][1].replace(Name(''))
+
--- a/contrib/mergetools.hgrc	Wed Sep 22 17:13:49 2010 -0500
+++ b/contrib/mergetools.hgrc	Wed Sep 22 18:29:41 2010 -0500
@@ -13,6 +13,9 @@
 gvimdiff.regname=path
 gvimdiff.priority=-9
 
+vimdiff.args=$local $other $base
+vimdiff.priority=-10
+
 merge.checkconflicts=True
 merge.priority=-100
 
--- a/contrib/perf.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/contrib/perf.py	Wed Sep 22 18:29:41 2010 -0500
@@ -133,6 +133,16 @@
         title = 'diffopts: %s' % (diffopt and ('-' + diffopt) or 'none')
         timer(d, title)
 
+def perfrevlog(ui, repo, file_, **opts):
+    from mercurial import revlog
+    dist = opts['dist']
+    def d():
+        r = revlog.revlog(lambda fn: open(fn, 'rb'), file_)
+        for x in xrange(0, len(r), dist):
+            r.revision(r.node(x))
+
+    timer(d)
+
 cmdtable = {
     'perflookup': (perflookup, []),
     'perfparents': (perfparents, []),
@@ -149,4 +159,7 @@
                 [('', 'rename', False, 'ask log to follow renames')]),
     'perftemplating': (perftemplating, []),
     'perfdiffwd': (perfdiffwd, []),
+    'perfrevlog': (perfrevlog,
+                   [('d', 'dist', 100, 'distance between the revisions')],
+                   "[INDEXFILE]"),
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contrib/setup3k.py	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,374 @@
+#!/usr/bin/env python
+#
+# This is an experimental py3k-enabled mercurial setup script.
+#
+# 'python setup.py install', or
+# 'python setup.py --help' for more options
+
+from distutils.command.build_py import build_py_2to3
+from lib2to3.refactor import get_fixers_from_package as getfixers
+
+import sys
+if not hasattr(sys, 'version_info') or sys.version_info < (2, 4, 0, 'final'):
+    raise SystemExit("Mercurial requires Python 2.4 or later.")
+
+if sys.version_info[0] >= 3:
+    def b(s):
+        '''A helper function to emulate 2.6+ bytes literals using string
+        literals.'''
+        return s.encode('latin1')
+else:
+    def b(s):
+        '''A helper function to emulate 2.6+ bytes literals using string
+        literals.'''
+        return s
+
+# Solaris Python packaging brain damage
+try:
+    import hashlib
+    sha = hashlib.sha1()
+except:
+    try:
+        import sha
+    except:
+        raise SystemExit(
+            "Couldn't import standard hashlib (incomplete Python install).")
+
+try:
+    import zlib
+except:
+    raise SystemExit(
+        "Couldn't import standard zlib (incomplete Python install).")
+
+try:
+    import bz2
+except:
+    raise SystemExit(
+        "Couldn't import standard bz2 (incomplete Python install).")
+
+import os, subprocess, time
+import shutil
+import tempfile
+from distutils import log
+from distutils.core import setup, Extension
+from distutils.dist import Distribution
+from distutils.command.build import build
+from distutils.command.build_ext import build_ext
+from distutils.command.build_py import build_py
+from distutils.spawn import spawn, find_executable
+from distutils.ccompiler import new_compiler
+from distutils.errors import CCompilerError
+
+scripts = ['hg']
+if os.name == 'nt':
+    scripts.append('contrib/win32/hg.bat')
+
+# simplified version of distutils.ccompiler.CCompiler.has_function
+# that actually removes its temporary files.
+def hasfunction(cc, funcname):
+    tmpdir = tempfile.mkdtemp(prefix='hg-install-')
+    devnull = oldstderr = None
+    try:
+        try:
+            fname = os.path.join(tmpdir, 'funcname.c')
+            f = open(fname, 'w')
+            f.write('int main(void) {\n')
+            f.write('    %s();\n' % funcname)
+            f.write('}\n')
+            f.close()
+            # Redirect stderr to /dev/null to hide any error messages
+            # from the compiler.
+            # This will have to be changed if we ever have to check
+            # for a function on Windows.
+            devnull = open('/dev/null', 'w')
+            oldstderr = os.dup(sys.stderr.fileno())
+            os.dup2(devnull.fileno(), sys.stderr.fileno())
+            objects = cc.compile([fname], output_dir=tmpdir)
+            cc.link_executable(objects, os.path.join(tmpdir, "a.out"))
+        except:
+            return False
+        return True
+    finally:
+        if oldstderr is not None:
+            os.dup2(oldstderr, sys.stderr.fileno())
+        if devnull is not None:
+            devnull.close()
+        shutil.rmtree(tmpdir)
+
+# py2exe needs to be installed to work
+try:
+    import py2exe
+    py2exeloaded = True
+
+    # Help py2exe to find win32com.shell
+    try:
+        import modulefinder
+        import win32com
+        for p in win32com.__path__[1:]: # Take the path to win32comext
+            modulefinder.AddPackagePath("win32com", p)
+        pn = "win32com.shell"
+        __import__(pn)
+        m = sys.modules[pn]
+        for p in m.__path__[1:]:
+            modulefinder.AddPackagePath(pn, p)
+    except ImportError:
+        pass
+
+except ImportError:
+    py2exeloaded = False
+    pass
+
+def runcmd(cmd, env):
+    p = subprocess.Popen(cmd, stdout=subprocess.PIPE,
+                         stderr=subprocess.PIPE, env=env)
+    out, err = p.communicate()
+    # If root is executing setup.py, but the repository is owned by
+    # another user (as in "sudo python setup.py install") we will get
+    # trust warnings since the .hg/hgrc file is untrusted. That is
+    # fine, we don't want to load it anyway.  Python may warn about
+    # a missing __init__.py in mercurial/locale, we also ignore that.
+    err = [e for e in err.splitlines()
+           if not e.startswith(b('Not trusting file')) \
+              and not e.startswith(b('warning: Not importing'))]
+    if err:
+        return ''
+    return out
+
+version = ''
+
+if os.path.isdir('.hg'):
+    # Execute hg out of this directory with a custom environment which
+    # includes the pure Python modules in mercurial/pure. We also take
+    # care to not use any hgrc files and do no localization.
+    pypath = ['mercurial', os.path.join('mercurial', 'pure')]
+    env = {'PYTHONPATH': os.pathsep.join(pypath),
+           'HGRCPATH': '',
+           'LANGUAGE': 'C'}
+    if 'LD_LIBRARY_PATH' in os.environ:
+        env['LD_LIBRARY_PATH'] = os.environ['LD_LIBRARY_PATH']
+    if 'SystemRoot' in os.environ:
+        # Copy SystemRoot into the custom environment for Python 2.6
+        # under Windows. Otherwise, the subprocess will fail with
+        # error 0xc0150004. See: http://bugs.python.org/issue3440
+        env['SystemRoot'] = os.environ['SystemRoot']
+    cmd = [sys.executable, 'hg', 'id', '-i', '-t']
+    l = runcmd(cmd, env).split()
+    while len(l) > 1 and l[-1][0].isalpha(): # remove non-numbered tags
+        l.pop()
+    if len(l) > 1: # tag found
+        version = l[-1]
+        if l[0].endswith('+'): # propagate the dirty status to the tag
+            version += '+'
+    elif len(l) == 1: # no tag found
+        cmd = [sys.executable, 'hg', 'parents', '--template',
+               '{latesttag}+{latesttagdistance}-']
+        version = runcmd(cmd, env) + l[0]
+    if version.endswith('+'):
+        version += time.strftime('%Y%m%d')
+elif os.path.exists('.hg_archival.txt'):
+    kw = dict([[t.strip() for t in l.split(':', 1)]
+               for l in open('.hg_archival.txt')])
+    if 'tag' in kw:
+        version =  kw['tag']
+    elif 'latesttag' in kw:
+        version = '%(latesttag)s+%(latesttagdistance)s-%(node).12s' % kw
+    else:
+        version = kw.get('node', '')[:12]
+
+if version:
+    f = open("mercurial/__version__.py", "w")
+    f.write('# this file is autogenerated by setup.py\n')
+    f.write('version = "%s"\n' % version)
+    f.close()
+
+
+try:
+    from mercurial import __version__
+    version = __version__.version
+except ImportError:
+    version = 'unknown'
+
+class hgbuildmo(build):
+
+    description = "build translations (.mo files)"
+
+    def run(self):
+        if not find_executable('msgfmt'):
+            self.warn("could not find msgfmt executable, no translations "
+                     "will be built")
+            return
+
+        podir = 'i18n'
+        if not os.path.isdir(podir):
+            self.warn("could not find %s/ directory" % podir)
+            return
+
+        join = os.path.join
+        for po in os.listdir(podir):
+            if not po.endswith('.po'):
+                continue
+            pofile = join(podir, po)
+            modir = join('locale', po[:-3], 'LC_MESSAGES')
+            mofile = join(modir, 'hg.mo')
+            mobuildfile = join('mercurial', mofile)
+            cmd = ['msgfmt', '-v', '-o', mobuildfile, pofile]
+            if sys.platform != 'sunos5':
+                # msgfmt on Solaris does not know about -c
+                cmd.append('-c')
+            self.mkpath(join('mercurial', modir))
+            self.make_file([pofile], mobuildfile, spawn, (cmd,))
+
+# Insert hgbuildmo first so that files in mercurial/locale/ are found
+# when build_py is run next.
+build.sub_commands.insert(0, ('build_mo', None))
+# We also need build_ext before build_py. Otherwise, when 2to3 is called (in
+# build_py), it will not find osutil & friends, thinking that those modules are
+# global and, consequently, making a mess, now that all module imports are
+# global.
+build.sub_commands.insert(1, ('build_ext', None))
+
+Distribution.pure = 0
+Distribution.global_options.append(('pure', None, "use pure (slow) Python "
+                                    "code instead of C extensions"))
+
+class hgbuildext(build_ext):
+
+    def build_extension(self, ext):
+        try:
+            build_ext.build_extension(self, ext)
+        except CCompilerError:
+            if not hasattr(ext, 'optional') or not ext.optional:
+                raise
+            log.warn("Failed to build optional extension '%s' (skipping)",
+                     ext.name)
+
+class hgbuildpy(build_py_2to3):
+    fixer_names = sorted(set(getfixers("lib2to3.fixes") +
+                             getfixers("hgfixes")))
+
+    def finalize_options(self):
+        build_py.finalize_options(self)
+
+        if self.distribution.pure:
+            if self.py_modules is None:
+                self.py_modules = []
+            for ext in self.distribution.ext_modules:
+                if ext.name.startswith("mercurial."):
+                    self.py_modules.append("mercurial.pure.%s" % ext.name[10:])
+            self.distribution.ext_modules = []
+
+    def find_modules(self):
+        modules = build_py.find_modules(self)
+        for module in modules:
+            if module[0] == "mercurial.pure":
+                if module[1] != "__init__":
+                    yield ("mercurial", module[1], module[2])
+            else:
+                yield module
+
+    def run(self):
+        # In the build_py_2to3 class, self.updated_files = [], but I couldn't
+        # see when that variable was updated to point to the updated files, as
+        # its names suggests. Thus, I decided to just find_all_modules and feed
+        # them to 2to3. Unfortunately, subsequent calls to setup3k.py will
+        # incur in 2to3 analysis overhead.
+        self.updated_files = [i[2] for i in self.find_all_modules()]
+
+        # Base class code
+        if self.py_modules:
+            self.build_modules()
+        if self.packages:
+            self.build_packages()
+            self.build_package_data()
+
+        # 2to3
+        self.run_2to3(self.updated_files)
+
+        # Remaining base class code
+        self.byte_compile(self.get_outputs(include_bytecode=0))
+
+cmdclass = {'build_mo': hgbuildmo,
+            'build_ext': hgbuildext,
+            'build_py': hgbuildpy}
+
+packages = ['mercurial', 'mercurial.hgweb', 'hgext', 'hgext.convert',
+            'hgext.highlight', 'hgext.zeroconf']
+
+pymodules = []
+
+extmodules = [
+    Extension('mercurial.base85', ['mercurial/base85.c']),
+    Extension('mercurial.bdiff', ['mercurial/bdiff.c']),
+    Extension('mercurial.diffhelpers', ['mercurial/diffhelpers.c']),
+    Extension('mercurial.mpatch', ['mercurial/mpatch.c']),
+    Extension('mercurial.parsers', ['mercurial/parsers.c']),
+    ]
+
+# disable osutil.c under windows + python 2.4 (issue1364)
+if sys.platform == 'win32' and sys.version_info < (2, 5, 0, 'final'):
+    pymodules.append('mercurial.pure.osutil')
+else:
+    extmodules.append(Extension('mercurial.osutil', ['mercurial/osutil.c']))
+
+if sys.platform == 'linux2' and os.uname()[2] > '2.6':
+    # The inotify extension is only usable with Linux 2.6 kernels.
+    # You also need a reasonably recent C library.
+    # In any case, if it fails to build the error will be skipped ('optional').
+    cc = new_compiler()
+    if hasfunction(cc, 'inotify_add_watch'):
+        inotify = Extension('hgext.inotify.linux._inotify',
+                            ['hgext/inotify/linux/_inotify.c'],
+                            ['mercurial'])
+        inotify.optional = True
+        extmodules.append(inotify)
+        packages.extend(['hgext.inotify', 'hgext.inotify.linux'])
+
+packagedata = {'mercurial': ['locale/*/LC_MESSAGES/hg.mo',
+                             'help/*.txt']}
+
+def ordinarypath(p):
+    return p and p[0] != '.' and p[-1] != '~'
+
+for root in ('templates',):
+    for curdir, dirs, files in os.walk(os.path.join('mercurial', root)):
+        curdir = curdir.split(os.sep, 1)[1]
+        dirs[:] = filter(ordinarypath, dirs)
+        for f in filter(ordinarypath, files):
+            f = os.path.join(curdir, f)
+            packagedata['mercurial'].append(f)
+
+datafiles = []
+setupversion = version
+extra = {}
+
+if py2exeloaded:
+    extra['console'] = [
+        {'script':'hg',
+         'copyright':'Copyright (C) 2005-2010 Matt Mackall and others',
+         'product_version':version}]
+
+if os.name == 'nt':
+    # Windows binary file versions for exe/dll files must have the
+    # form W.X.Y.Z, where W,X,Y,Z are numbers in the range 0..65535
+    setupversion = version.split('+', 1)[0]
+
+setup(name='mercurial',
+      version=setupversion,
+      author='Matt Mackall',
+      author_email='mpm@selenic.com',
+      url='http://mercurial.selenic.com/',
+      description='Scalable distributed SCM',
+      license='GNU GPLv2+',
+      scripts=scripts,
+      packages=packages,
+      py_modules=pymodules,
+      ext_modules=extmodules,
+      data_files=datafiles,
+      package_data=packagedata,
+      cmdclass=cmdclass,
+      options=dict(py2exe=dict(packages=['hgext', 'email']),
+                   bdist_mpkg=dict(zipdist=True,
+                                   license='COPYING',
+                                   readme='contrib/macosx/Readme.html',
+                                   welcome='contrib/macosx/Welcome.html')),
+      **extra)
--- a/contrib/shrink-revlog.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/contrib/shrink-revlog.py	Wed Sep 22 18:29:41 2010 -0500
@@ -117,8 +117,8 @@
 
     try:
         group = util.chunkbuffer(r1.group(order, lookup, progress))
-        chunkiter = changegroup.chunkiter(group)
-        r2.addgroup(chunkiter, unlookup, tr)
+        group = changegroup.unbundle10(group, "UN")
+        r2.addgroup(group, unlookup, tr)
     finally:
         ui.progress(_('writing'), None)
 
--- a/contrib/win32/mercurial.iss	Wed Sep 22 17:13:49 2010 -0500
+++ b/contrib/win32/mercurial.iss	Wed Sep 22 18:29:41 2010 -0500
@@ -16,10 +16,22 @@
 #pragma message "Detected Version: " + VERSION
 #endif
 
+#ifndef ARCH
+#define ARCH = "x86"
+#endif
+
 [Setup]
 AppCopyright=Copyright 2005-2010 Matt Mackall and others
 AppName=Mercurial
+#if ARCH == "x64"
+AppVerName=Mercurial {#VERSION} (64-bit)
+OutputBaseFilename=Mercurial-{#VERSION}-x64
+ArchitecturesAllowed=x64
+ArchitecturesInstallIn64BitMode=x64
+#else
 AppVerName=Mercurial {#VERSION}
+OutputBaseFilename=Mercurial-{#VERSION}
+#endif
 InfoAfterFile=contrib/win32/postinstall.txt
 LicenseFile=COPYING
 ShowLanguageDialog=yes
@@ -29,7 +41,6 @@
 AppUpdatesURL=http://mercurial.selenic.com/
 AppID={{4B95A5F1-EF59-4B08-BED8-C891C46121B3}
 AppContact=mercurial@selenic.com
-OutputBaseFilename=Mercurial-{#VERSION}
 DefaultDirName={pf}\Mercurial
 SourceDir=..\..
 VersionInfoDescription=Mercurial distributed SCM (version {#VERSION})
@@ -61,18 +72,21 @@
 Source: contrib\win32\mercurial.ini; DestDir: {app}; DestName: Mercurial.ini; Check: CheckFile; AfterInstall: ConcatenateFiles;
 Source: contrib\win32\postinstall.txt; DestDir: {app}; DestName: ReleaseNotes.txt
 Source: dist\hg.exe; DestDir: {app}; AfterInstall: Touch('{app}\hg.exe.local')
+#if ARCH == "x64"
+Source: dist\*.dll; Destdir: {app}
+Source: dist\*.pyd; Destdir: {app}
+#else
 Source: dist\python*.dll; Destdir: {app}; Flags: skipifsourcedoesntexist
-Source: dist\library.zip; DestDir: {app}
-Source: dist\mfc*.dll; DestDir: {app}; Flags: skipifsourcedoesntexist
 Source: dist\msvc*.dll; DestDir: {app}; Flags: skipifsourcedoesntexist
+Source: dist\w9xpopen.exe; DestDir: {app}
+#endif
 Source: dist\Microsoft.VC*.CRT.manifest; DestDir: {app}; Flags: skipifsourcedoesntexist
-Source: dist\Microsoft.VC*.MFC.manifest; DestDir: {app}; Flags: skipifsourcedoesntexist
-Source: dist\w9xpopen.exe; DestDir: {app}
+Source: dist\library.zip; DestDir: {app}
 Source: dist\add_path.exe; DestDir: {app}
 Source: doc\*.html; DestDir: {app}\Docs
 Source: doc\style.css; DestDir: {app}\Docs
 Source: mercurial\help\*.txt; DestDir: {app}\help
-Source: mercurial\locale\*.*; DestDir: {app}\locale; Flags: recursesubdirs createallsubdirs
+Source: mercurial\locale\*.*; DestDir: {app}\locale; Flags: recursesubdirs createallsubdirs skipifsourcedoesntexist
 Source: mercurial\templates\*.*; DestDir: {app}\Templates; Flags: recursesubdirs createallsubdirs
 Source: CONTRIBUTORS; DestDir: {app}; DestName: Contributors.txt
 Source: COPYING; DestDir: {app}; DestName: Copying.txt
@@ -99,6 +113,7 @@
 
 [UninstallDelete]
 Type: files; Name: "{app}\hg.exe.local"
+
 [Code]
 var
   WriteFile: Boolean;
--- a/contrib/win32/win32-build.txt	Wed Sep 22 17:13:49 2010 -0500
+++ b/contrib/win32/win32-build.txt	Wed Sep 22 18:29:41 2010 -0500
@@ -1,13 +1,17 @@
 The standalone Windows installer for Mercurial is built in a somewhat
 jury-rigged fashion.
 
-It has the following prerequisites, at least as I build it:
+It has the following prerequisites. Ensure to take the packages
+matching the mercurial version you want to build (32-bit or 64-bit).
+
+  Python 2.6 for Windows
+      http://www.python.org/download/releases/
 
-  Python for Windows
-      http://www.python.org/ftp/python/2.4.3/python-2.4.3.msi
-
-  MinGW
+  A compiler:
+    either MinGW
       http://www.mingw.org/
+    or Microsoft Visual C++ 2008 SP1 Express Edition
+      http://www.microsoft.com/express/Downloads/Download-2008.aspx
 
   Python for Windows Extensions
       http://sourceforge.net/projects/pywin32/
@@ -15,19 +19,22 @@
   mfc71.dll (just download, don't install; not needed for Python 2.6)
       http://starship.python.net/crew/mhammond/win32/
 
-  Visual C++ 2008 redistributable package (needed for Python 2.6)
-      http://www.microsoft.com/downloads/details.aspx?familyid=9b2da534-3e03-4391-8a4d-074b9f2bc1bf&displaylang=en
+  Visual C++ 2008 redistributable package (needed for >= Python 2.6 or if you compile with MSVC)
+    for 32-bit:
+      http://www.microsoft.com/downloads/details.aspx?FamilyID=9b2da534-3e03-4391-8a4d-074b9f2bc1bf
+    for 64-bit:
+      http://www.microsoft.com/downloads/details.aspx?familyid=bd2a6171-e2d6-4230-b809-9a8d7548c1b6
       
   The py2exe distutils extension
       http://sourceforge.net/projects/py2exe/
 
-  GnuWin32 gettext utility
+  GnuWin32 gettext utility (if you want to build translations)
       http://gnuwin32.sourceforge.net/packages/gettext.htm
 
   Inno Setup
       http://www.jrsoftware.org/isdl.php#qsp
 
-      Get and install ispack-5.3.4.exe which includes Inno Setup Processor,
+      Get and install ispack-5.3.10.exe which includes Inno Setup Processor,
       which is necessary to package Mercurial.
 
   ISTool - optional
@@ -45,41 +52,44 @@
 Mercurial repository you want to package, and name the repo
 C:\hg\hg-release.
 
-In a shell, build a standalone copy of the hg.exe program:
+In a shell, build a standalone copy of the hg.exe program.
 
+Building instructions for MinGW:
   python setup.py build -c mingw32
-  python setup.py py2exe -b 1
-
+  python setup.py py2exe -b 2
 Note: the previously suggested combined command of "python setup.py build -c
-mingw32 py2exe -b 1" doesn't work correctly anymore as it doesn't include the
+mingw32 py2exe -b 2" doesn't work correctly anymore as it doesn't include the
 extensions in the mercurial subdirectory.
-
 If you want to create a file named setup.cfg with the contents:
-
 [build]
 compiler=mingw32
+you can skip the first build step.
 
-you can skip the first build step.
+Building instructions with MSVC 2008 Express Edition:
+  for 32-bit:
+    "C:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86
+    python setup.py py2exe -b 2
+  for 64-bit:
+    "C:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86_amd64
+    python setup.py py2exe -b 3
 
 Copy add_path.exe into the dist directory that just got created.
 
 If you are using Python up to version 2.5.4, copy mfc71.dll into the dist
 directory that just got created.
 
-If you are using Python 2.6 or later, after installing the Visual C++ 2008
-redistributable package copy into the dist directory that just got created the
-following files:
-  - from the directory starting with
-    Windows/WinSxS/x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8
-    the files named: msvcm90.dll, msvcp90.dll and msvcr90.dll
-  - from the directory starting with
-    Windows/WinSxS/x86_Microsoft.VC90.MFC_1fc8b3b9a1e18e3b_9.0.21022.8
-    the files named: mfc90.dll, mfc90u.dll, mfcm90.dll and mfcm90u.dll
-  - from the directory named Windows/WinSxS/Manifests, the manifest file
-    starting with x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8
-    (rename it to Microsoft.VC90.CRT.manifest) and the manifest file starting
-    with x86_Microsoft.VC90.MFC_1fc8b3b9a1e18e3b_9.0.21022.8 (rename it to
-    Microsoft.VC90.MFC.manifest)
+If you are using Python 2.6 or later, or if you are using MSVC 2008 to compile
+mercurial, you must include the C runtime libraries in the installer. To do so,
+install the Visual C++ 2008 redistributable package. Then in your windows\winsxs
+folder, locate the folder containing the dlls version 9.0.21022.8.
+For x86, it should be named like x86_Microsoft.VC90.CRT_(...)_9.0.21022.8(...).
+For x64, it should be named like amd64_Microsoft.VC90.CRT_(...)_9.0.21022.8(...).
+Copy the files named msvcm90.dll, msvcp90.dll and msvcr90.dll into the dist
+directory.
+Then in the windows\winsxs\manifests folder, locate the corresponding manifest
+file (x86_Microsoft.VC90.CRT_(...)_9.0.21022.8(...).manifest for x86,
+amd64_Microsoft.VC90.CRT_(...)_9.0.21022.8(...).manifest for x64), copy it in the
+dist directory and rename it to Microsoft.VC90.CRT.manifest.
 
 Before building the installer, you have to build Mercurial HTML documentation 
 (or fix mercurial.iss to not reference the doc directory):
@@ -94,21 +104,27 @@
 Otherwise you run the Inno Setup compiler.  Assuming it's in the path
 you should execute:
 
-  iscc contrib\win32\mercurial.iss /DVERSION=foo
+  iscc contrib\win32\mercurial.iss /dVERSION=foo
 
 Where 'foo' is the version number you would like to see in the
 'Add/Remove Applications' tool.  The installer will be placed into
 a directory named Output/ at the root of your repository.
+If the /dVERSION=foo parameter is not given in the command line, the
+installer will retrieve the version information from the __version__.py file.
+
+If you want to build an installer for a 64-bit mercurial, add /dARCH=x64 to
+your command line:
+  iscc contrib\win32\mercurial.iss /dARCH=x64
 
 To automate the steps above you may want to create a batchfile based on the
-following:
+following (MinGW build chain):
 
   echo [build] > setup.cfg
   echo compiler=mingw32 >> setup.cfg
-  python setup.py py2exe -b 1
+  python setup.py py2exe -b 2
   cd doc
   mingw32-make html
   cd ..
-  iscc contrib\win32\mercurial.iss /DVERSION=snapshot
+  iscc contrib\win32\mercurial.iss /dVERSION=snapshot
 
 and run it from the root of the hg repository (c:\hg\hg-release).
--- a/contrib/zsh_completion	Wed Sep 22 17:13:49 2010 -0500
+++ b/contrib/zsh_completion	Wed Sep 22 18:29:41 2010 -0500
@@ -14,7 +14,7 @@
 # compinit
 #
 # Copyright (C) 2005, 2006 Steve Borho <steve@borho.org>
-# Copyright (C) 2006-9 Brendan Cully <brendan@kublai.com>
+# Copyright (C) 2006-10 Brendan Cully <brendan@kublai.com>
 #
 # Permission is hereby granted, without written agreement and without
 # licence or royalty fees, to use, copy, modify, and distribute this
@@ -766,6 +766,31 @@
   ':revision:_hg_tags'
 }
 
+## extensions ##
+
+# bookmarks
+_hg_bookmarks() {
+  typeset -a bookmark bookmarks
+
+  _hg_cmd bookmarks | while read -A bookmark
+  do
+    if test -z ${bookmark[-1]:#[0-9]*}
+    then
+      bookmarks+=($bookmark[-2])
+    fi
+  done
+  (( $#bookmarks )) && _describe -t bookmarks 'bookmarks' bookmarks
+}
+
+_hg_cmd_bookmarks() {
+  _arguments -s -w : $_hg_global_opts \
+  '(--force -f)'{-f,--force}'[force]' \
+  '(--rev -r --delete -d --rename -m)'{-r+,--rev}'[revision]:revision:_hg_tags' \
+  '(--rev -r --delete -d --rename -m)'{-d,--delete}'[delete a given bookmark]' \
+  '(--rev -r --delete -d --rename -m)'{-m+,--rename}'[rename a given bookmark]:bookmark:_hg_bookmarks' \
+  ':bookmark:_hg_bookmarks'
+}
+
 # HGK
 _hg_cmd_view() {
   _arguments -s -w : $_hg_global_opts \
@@ -901,6 +926,7 @@
   '(--merge -m)'{-m+,--merge}'[merge from another queue]:' \
   '(--name -n)'{-n+,--name}'[merge queue name]:' \
   '(--force -f)'{-f,--force}'[apply if the patch has rejects]' \
+  '--move[reorder patch series and apply only the patch]' \
   ':patch:_hg_qunapplied'
 }
 
@@ -947,4 +973,34 @@
   ':revision:_hg_tags'
 }
 
+# Patchbomb
+_hg_cmd_email() {
+  _arguments -s -w : $_hg_global_opts $_hg_remote_opts \
+  '(--git -g)'{-g,--git}'[use git extended diff format]' \
+  '--plain[omit hg patch header]' \
+  '(--outgoing -o)'{-o,--outgoing}'[send changes not found in the target repository]' \
+  '(--bundle -b)'{-b,--bundle}'[send changes not in target as a binary bundle]' \
+  '--bundlename[name of the bundle attachment file (default: bundle)]:' \
+  '*'{-r+,--rev}'[search in given revision range]:revision:_hg_revrange' \
+  '--force[run even when remote repository is unrelated (with -b/--bundle)]' \
+  '*--base[a base changeset to specify instead of a destination (with -b/--bundle)]:revision:_hg_tags' \
+  '--intro[send an introduction email for a single patch]' \
+  '(--inline -i --attach -a)'{-a,--attach}'[send patches as attachments]' \
+  '(--attach -a --inline -i)'{-i,--inline}'[send patches as inline attachments]' \
+  '*--bcc[email addresses of blind carbon copy recipients]:email:' \
+  '*'{-c+,--cc}'[email addresses of copy recipients]:email:' \
+  '(--diffstat -d)'{-d,--diffstat}'[add diffstat output to messages]' \
+  '--date[use the given date as the sending date]:date:' \
+  '--desc[use the given file as the series description]:files:_files' \
+  '(--from -f)'{-f,--from}'[email address of sender]:email:' \
+  '(--test -n)'{-n,--test}'[print messages that would be sent]' \
+  '(--mbox -m)'{-m,--mbox}'[write messages to mbox file instead of sending them]:file:' \
+  '*--reply-to[email addresses replies should be sent to]:email:' \
+  '(--subject -s)'{-s,--subject}'[subject of first message (intro or single patch)]:subject:' \
+  '--in-reply-to[message identifier to reply to]:msgid:' \
+  '*--flag[flags to add in subject prefixes]:flag:' \
+  '*'{-t,--to}'[email addresses of recipients]:email:' \
+  ':revision:_hg_revrange'
+}
+
 _hg "$@"
--- a/hgext/bookmarks.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/hgext/bookmarks.py	Wed Sep 22 18:29:41 2010 -0500
@@ -299,7 +299,7 @@
 
             self.ui.debug("checking for updated bookmarks\n")
             rb = remote.listkeys('bookmarks')
-            changes = 0
+            changed = False
             for k in rb.keys():
                 if k in self._bookmarks:
                     nr, nl = rb[k], self._bookmarks[k]
@@ -310,12 +310,12 @@
                             continue
                         if cr in cl.descendants():
                             self._bookmarks[k] = cr.node()
-                            changes += 1
+                            changed = True
                             self.ui.status(_("updating bookmark %s\n") % k)
                         else:
                             self.ui.warn(_("not updating divergent"
                                            " bookmark %s\n") % k)
-            if changes:
+            if changed:
                 write(repo)
 
             return result
@@ -469,7 +469,7 @@
     lmarks = repo.listkeys('bookmarks')
     rmarks = remote.listkeys('bookmarks')
 
-    diff = set(rmarks) - set(lmarks)
+    diff = sorted(set(rmarks) - set(lmarks))
     for k in diff:
         ui.write("   %-25s %s\n" % (k, rmarks[k][:12]))
 
@@ -504,10 +504,12 @@
 
     entry = extensions.wrapcommand(commands.table, 'pull', pull)
     entry[1].append(('B', 'bookmark', [],
-                     _("bookmark to import")))
+                     _("bookmark to import"),
+                     _('BOOKMARK')))
     entry = extensions.wrapcommand(commands.table, 'push', push)
     entry[1].append(('B', 'bookmark', [],
-                     _("bookmark to export")))
+                     _("bookmark to export"),
+                     _('BOOKMARK')))
     entry = extensions.wrapcommand(commands.table, 'incoming', incoming)
     entry[1].append(('B', 'bookmarks', False,
                      _("compare bookmark")))
--- a/hgext/bugzilla.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/hgext/bugzilla.py	Wed Sep 22 18:29:41 2010 -0500
@@ -437,5 +437,5 @@
                 bz.update(id, ctx)
             bz.notify(ids, util.email(ctx.user()))
     except MySQLdb.MySQLError, err:
-        raise util.Abort(_('database error: %s') % err[1])
+        raise util.Abort(_('database error: %s') % err.args[1])
 
--- a/hgext/churn.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/hgext/churn.py	Wed Sep 22 18:29:41 2010 -0500
@@ -155,7 +155,8 @@
 
     if opts.get('diffstat'):
         width -= 15
-        def format(name, (added, removed)):
+        def format(name, diffstat):
+            added, removed = diffstat
             return "%s %15s %s%s\n" % (pad(name, maxname),
                                        '+%d/-%d' % (added, removed),
                                        ui.label('+' * charnum(added),
--- a/hgext/color.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/hgext/color.py	Wed Sep 22 18:29:41 2010 -0500
@@ -62,6 +62,11 @@
 
   bookmarks.current = green
 
+  branches.active = none
+  branches.closed = black bold
+  branches.current = green
+  branches.inactive = none
+
 The color extension will try to detect whether to use ANSI codes or
 Win32 console APIs, unless it is made explicit::
 
@@ -72,9 +77,9 @@
 
 '''
 
-import os, sys
+import os
 
-from mercurial import commands, dispatch, extensions, ui as uimod
+from mercurial import commands, dispatch, extensions, ui as uimod, util
 from mercurial.i18n import _
 
 # start and stop parameters for effects
@@ -87,6 +92,10 @@
             'cyan_background': 46, 'white_background': 47}
 
 _styles = {'grep.match': 'red bold',
+           'branches.active': 'none',
+           'branches.closed': 'black bold',
+           'branches.current': 'green',
+           'branches.inactive': 'none',
            'diff.changed': 'white',
            'diff.deleted': 'red',
            'diff.diffline': 'bold',
@@ -200,9 +209,12 @@
     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()))):
+        coloropt = opts['color']
+        auto = coloropt == 'auto'
+        always = util.parsebool(coloropt)
+        if (always or
+            (always is None and
+             (auto and (os.environ.get('TERM') != 'dumb' and ui_.formatted())))):
             colorui._colormode = mode
             colorui.__bases__ = (ui_.__class__,)
             ui_.__class__ = colorui
@@ -211,44 +223,50 @@
         return orig(ui_, opts, cmd, cmdfunc)
     extensions.wrapfunction(dispatch, '_runcommand', colorcmd)
 
-commands.globalopts.append(('', 'color', 'auto',
-                            _("when to colorize (always, auto, or never)"),
-                            _('TYPE')))
+commands.globalopts.append(
+    ('', 'color', 'auto',
+     _("when to colorize (boolean, always, auto, or never)"),
+     _('TYPE')))
 
 try:
-    import re, pywintypes
-    from win32console import *
+    import re, pywintypes, win32console as win32c
 
     # http://msdn.microsoft.com/en-us/library/ms682088%28VS.85%29.aspx
     w32effects = {
         'none': -1,
         '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': 0x100,              # unused value > 0x0f
-        '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
+        'red': win32c.FOREGROUND_RED,
+        'green': win32c.FOREGROUND_GREEN,
+        'yellow': win32c.FOREGROUND_RED | win32c.FOREGROUND_GREEN,
+        'blue': win32c.FOREGROUND_BLUE,
+        'magenta': win32c.FOREGROUND_BLUE | win32c.FOREGROUND_RED,
+        'cyan': win32c.FOREGROUND_BLUE | win32c.FOREGROUND_GREEN,
+        'white': (win32c.FOREGROUND_RED | win32c.FOREGROUND_GREEN |
+                  win32c.FOREGROUND_BLUE),
+        'bold': win32c.FOREGROUND_INTENSITY,
+        'black_background': 0x100,                  # unused value > 0x0f
+        'red_background': win32c.BACKGROUND_RED,
+        'green_background': win32c.BACKGROUND_GREEN,
+        'yellow_background': win32c.BACKGROUND_RED | win32c.BACKGROUND_GREEN,
+        'blue_background': win32c.BACKGROUND_BLUE,
+        'purple_background': win32c.BACKGROUND_BLUE | win32c.BACKGROUND_RED,
+        'cyan_background': win32c.BACKGROUND_BLUE | win32c.BACKGROUND_GREEN,
+        'white_background': (win32c.BACKGROUND_RED | win32c.BACKGROUND_GREEN |
+                             win32c.BACKGROUND_BLUE),
+        'bold_background': win32c.BACKGROUND_INTENSITY,
+        'underline': win32c.COMMON_LVB_UNDERSCORE,  # double-byte charsets only
+        'inverse': win32c.COMMON_LVB_REVERSE_VIDEO, # double-byte charsets only
     }
 
-    passthrough = set([FOREGROUND_INTENSITY, BACKGROUND_INTENSITY,
-                       COMMON_LVB_UNDERSCORE, COMMON_LVB_REVERSE_VIDEO])
+    passthrough = set([win32c.FOREGROUND_INTENSITY,
+                       win32c.BACKGROUND_INTENSITY,
+                       win32c.COMMON_LVB_UNDERSCORE,
+                       win32c.COMMON_LVB_REVERSE_VIDEO])
 
-    stdout = GetStdHandle(STD_OUTPUT_HANDLE)
     try:
+        stdout = win32c.GetStdHandle(win32c.STD_OUTPUT_HANDLE)
+        if stdout is None:
+            raise ImportError()
         origattr = stdout.GetConsoleScreenBufferInfo()['Attributes']
     except pywintypes.error:
         # stdout may be defined but not support
--- a/hgext/convert/__init__.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/hgext/convert/__init__.py	Wed Sep 22 18:29:41 2010 -0500
@@ -70,10 +70,10 @@
     updated on each commit copied, so :hg:`convert` can be interrupted
     and can be run repeatedly to copy new commits.
 
-    The username mapping file is a simple text file that maps each
-    source commit author to a destination commit author. It is handy
-    for source SCMs that use unix logins to identify authors (eg:
-    CVS). One line per author mapping and the line format is::
+    The authormap is a simple text file that maps each source commit
+    author to a destination commit author. It is handy for source SCMs
+    that use unix logins to identify authors (eg: CVS). One line per
+    author mapping and the line format is::
 
       source author = destination author
 
@@ -89,7 +89,7 @@
 
       rename path/to/source path/to/destination
 
-    Comment lines start with ``#``. A specificed path matches if it
+    Comment lines start with ``#``. A specified path matches if it
     equals the full relative name of a file or one of its parent
     directories. The ``include`` or ``exclude`` directive with the
     longest matching path applies, so line order does not matter.
@@ -99,8 +99,8 @@
     exclusion of all other files and directories not explicitly
     included. The ``exclude`` directive causes files or directories to
     be omitted. The ``rename`` directive renames a file or directory if
-    is converted. To rename from a subdirectory into the root of the
-    repository, use ``.`` as the path to rename to.
+    it is converted. To rename from a subdirectory into the root of
+    the repository, use ``.`` as the path to rename to.
 
     The splicemap is a file that allows insertion of synthetic
     history, letting you specify the parents of a revision. This is
@@ -274,16 +274,19 @@
 cmdtable = {
     "convert":
         (convert,
-         [('A', 'authors', '',
-           _('username mapping filename'), _('FILE')),
+         [('', 'authors', '',
+           _('username mapping filename (DEPRECATED, use --authormap instead)'),
+           _('FILE')),
+          ('s', 'source-type', '',
+           _('source repository type'), _('TYPE')),
           ('d', 'dest-type', '',
            _('destination repository type'), _('TYPE')),
+          ('r', 'rev', '',
+           _('import up to target revision REV'), _('REV')),
+          ('A', 'authormap', '',
+           _('remap usernames using this file'), _('FILE')),
           ('', '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', '',
--- a/hgext/convert/bzr.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/hgext/convert/bzr.py	Wed Sep 22 18:29:41 2010 -0500
@@ -61,7 +61,7 @@
             try:
                 tree = dir.open_workingtree(recommend_upgrade=False)
                 branch = tree.branch
-            except (errors.NoWorkingTree, errors.NotLocalUrl), e:
+            except (errors.NoWorkingTree, errors.NotLocalUrl):
                 tree = None
                 branch = dir.open_branch()
             if (tree is not None and tree.bzrdir.root_transport.base !=
--- a/hgext/convert/convcmd.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/hgext/convert/convcmd.py	Wed Sep 22 18:29:41 2010 -0500
@@ -112,8 +112,8 @@
         if authorfile and os.path.exists(authorfile):
             self.readauthormap(authorfile)
         # Extend/Override with new author map if necessary
-        if opts.get('authors'):
-            self.readauthormap(opts.get('authors'))
+        if opts.get('authormap'):
+            self.readauthormap(opts.get('authormap'))
             self.authorfile = self.dest.authorfile()
 
         self.splicemap = mapfile(ui, opts.get('splicemap'))
@@ -392,6 +392,10 @@
     orig_encoding = encoding.encoding
     encoding.encoding = 'UTF-8'
 
+    # support --authors as an alias for --authormap
+    if not opts.get('authormap'):
+        opts['authormap'] = opts.get('authors')
+
     if not dest:
         dest = hg.defaultdest(src) + "-hg"
         ui.status(_("assuming destination %s\n") % dest)
--- a/hgext/convert/cvs.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/hgext/convert/cvs.py	Wed Sep 22 18:29:41 2010 -0500
@@ -53,8 +53,6 @@
         try:
             os.chdir(self.path)
             id = None
-            state = 0
-            filerevids = {}
 
             cache = 'update'
             if not self.ui.configbool('convert', 'cvsps.cache', True):
--- a/hgext/convert/filemap.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/hgext/convert/filemap.py	Wed Sep 22 18:29:41 2010 -0500
@@ -33,10 +33,20 @@
     def parse(self, path):
         errs = 0
         def check(name, mapping, listname):
+            if not name:
+                self.ui.warn(_('%s:%d: path to %s is missing\n') %
+                             (lex.infile, lex.lineno, listname))
+                return 1
             if name in mapping:
                 self.ui.warn(_('%s:%d: %r already in %s list\n') %
                              (lex.infile, lex.lineno, name, listname))
                 return 1
+            if (name.startswith('/') or
+                name.endswith('/') or
+                '//' in name):
+                self.ui.warn(_('%s:%d: superfluous / in %s %r\n') %
+                             (lex.infile, lex.lineno, listname, name))
+                return 1
             return 0
         lex = shlex.shlex(open(path), path, True)
         lex.wordchars += '!@#$%^&*()-=+[]{}|;:,./<>?'
@@ -298,7 +308,9 @@
 
         self.origparents[rev] = parents
 
-        if len(mparents) < 2 and not self.wanted(rev, wp):
+        closed = 'close' in self.commits[rev].extra
+
+        if len(mparents) < 2 and not closed and not self.wanted(rev, wp):
             # We don't want this revision.
             # Update our state and tell the convert process to map this
             # revision to the same revision its parent as mapped to.
--- a/hgext/convert/git.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/hgext/convert/git.py	Wed Sep 22 18:29:41 2010 -0500
@@ -7,6 +7,7 @@
 
 import os
 from mercurial import util
+from mercurial.node import hex, nullid
 from mercurial.i18n import _
 
 from common import NoRepo, commit, converter_source, checktool
@@ -59,7 +60,7 @@
         return heads
 
     def catfile(self, rev, type):
-        if rev == "0" * 40:
+        if rev == hex(nullid):
             raise IOError()
         data, ret = self.gitread("git cat-file %s %s" % (type, rev))
         if ret:
--- a/hgext/convert/hg.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/hgext/convert/hg.py	Wed Sep 22 18:29:41 2010 -0500
@@ -175,7 +175,8 @@
         if self.filemapmode and nparents == 1:
             man = self.repo.manifest
             mnode = self.repo.changelog.read(bin(p2))[0]
-            if not man.cmp(m1node, man.revision(mnode)):
+            closed = 'close' in commit.extra
+            if not closed and not man.cmp(m1node, man.revision(mnode)):
                 self.ui.status(_("filtering out empty revision\n"))
                 self.repo.rollback()
                 return parent
--- a/hgext/convert/transport.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/hgext/convert/transport.py	Wed Sep 22 18:29:41 2010 -0500
@@ -98,9 +98,8 @@
             svn.ra.reparent(self.ra, self.svn_url.encode('utf8'))
 
     class Reporter(object):
-        def __init__(self, (reporter, report_baton)):
-            self._reporter = reporter
-            self._baton = report_baton
+        def __init__(self, reporter_data):
+            self._reporter, self._baton = reporter_data
 
         def set_path(self, path, revnum, start_empty, lock_token, pool=None):
             svn.ra.reporter2_invoke_set_path(self._reporter, self._baton,
--- a/hgext/eol.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/hgext/eol.py	Wed Sep 22 18:29:41 2010 -0500
@@ -66,7 +66,7 @@
 """
 
 from mercurial.i18n import _
-from mercurial import util, config, extensions, commands, match, cmdutil
+from mercurial import util, config, extensions, match
 import re, os
 
 # Matches a lone LF, i.e., one that is not part of CRLF.
--- a/hgext/hgcia.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/hgext/hgcia.py	Wed Sep 22 18:29:41 2010 -0500
@@ -40,7 +40,7 @@
 """
 
 from mercurial.i18n import _
-from mercurial.node import *
+from mercurial.node import bin, short
 from mercurial import cmdutil, patch, templater, util, mail
 import email.Parser
 
--- a/hgext/inotify/client.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/hgext/inotify/client.py	Wed Sep 22 18:29:41 2010 -0500
@@ -21,18 +21,16 @@
     Raise QueryFailed if something went wrong
     """
     def decorated_function(self, *args):
-        result = None
         try:
             return function(self, *args)
         except (OSError, socket.error), err:
             autostart = self.ui.configbool('inotify', 'autostart', True)
 
-            if err[0] == errno.ECONNREFUSED:
+            if err.args[0] == errno.ECONNREFUSED:
                 self.ui.warn(_('inotify-client: found dead inotify server '
                                'socket; removing it\n'))
                 os.unlink(os.path.join(self.root, '.hg', 'inotify.sock'))
-            if err[0] in (errno.ECONNREFUSED, errno.ENOENT) and autostart:
-                self.ui.debug('(starting inotify server)\n')
+            if err.args[0] in (errno.ECONNREFUSED, errno.ENOENT) and autostart:
                 try:
                     try:
                         server.start(self.ui, self.dirstate, self.root,
@@ -49,13 +47,13 @@
                         return function(self, *args)
                     except socket.error, err:
                         self.ui.warn(_('inotify-client: could not talk to new '
-                                       'inotify server: %s\n') % err[-1])
-            elif err[0] in (errno.ECONNREFUSED, errno.ENOENT):
+                                       'inotify server: %s\n') % err.args[-1])
+            elif err.args[0] in (errno.ECONNREFUSED, errno.ENOENT):
                 # silently ignore normal errors if autostart is False
                 self.ui.debug('(inotify server not running)\n')
             else:
                 self.ui.warn(_('inotify-client: failed to contact inotify '
-                               'server: %s\n') % err[-1])
+                               'server: %s\n') % err.args[-1])
 
         self.ui.traceback()
         raise QueryFailed('inotify query failed')
@@ -75,7 +73,7 @@
         try:
             self.sock.connect(sockpath)
         except socket.error, err:
-            if err[0] == "AF_UNIX path too long":
+            if err.args[0] == "AF_UNIX path too long":
                 sockpath = os.readlink(sockpath)
                 self.sock.connect(sockpath)
             else:
--- a/hgext/inotify/linux/_inotify.c	Wed Sep 22 17:13:49 2010 -0500
+++ b/hgext/inotify/linux/_inotify.c	Wed Sep 22 18:29:41 2010 -0500
@@ -15,6 +15,15 @@
 #include <sys/ioctl.h>
 #include <unistd.h>
 
+#include <util.h>
+
+/* Variables used in the event string representation */
+static PyObject *join;
+static PyObject *er_wm;
+static PyObject *er_wmc;
+static PyObject *er_wmn;
+static PyObject *er_wmcn;
+
 static PyObject *init(PyObject *self, PyObject *args)
 {
 	PyObject *ret = NULL;
@@ -312,8 +321,8 @@
 };
 
 PyDoc_STRVAR(
-    event_doc,
-    "event: Structure describing an inotify event.");
+	event_doc,
+	"event: Structure describing an inotify event.");
 
 static PyObject *event_new(PyTypeObject *t, PyObject *a, PyObject *k)
 {
@@ -327,20 +336,14 @@
 	Py_XDECREF(evt->cookie);
 	Py_XDECREF(evt->name);
 
-	(*evt->ob_type->tp_free)(evt);
+	Py_TYPE(evt)->tp_free(evt);
 }
 
 static PyObject *event_repr(struct event *evt)
 {
-	int wd = PyInt_AsLong(evt->wd);
 	int cookie = evt->cookie == Py_None ? -1 : PyInt_AsLong(evt->cookie);
 	PyObject *ret = NULL, *pymasks = NULL, *pymask = NULL;
-	PyObject *join = NULL;
-	char *maskstr;
-
-	join = PyString_FromString("|");
-	if (join == NULL)
-		goto bail;
+	PyObject *tuple = NULL, *formatstr = NULL;
 
 	pymasks = decode_mask(PyInt_AsLong(evt->mask));
 	if (pymasks == NULL)
@@ -350,33 +353,35 @@
 	if (pymask == NULL)
 		goto bail;
 
-	maskstr = PyString_AsString(pymask);
-
 	if (evt->name != Py_None) {
-		PyObject *pyname = PyString_Repr(evt->name, 1);
-		char *name = pyname ? PyString_AsString(pyname) : "???";
-
-		if (cookie == -1)
-			ret = PyString_FromFormat(
-				"event(wd=%d, mask=%s, name=%s)",
-				wd, maskstr, name);
-		else
-			ret = PyString_FromFormat("event(wd=%d, mask=%s, "
-						  "cookie=0x%x, name=%s)",
-						  wd, maskstr, cookie, name);
-
-		Py_XDECREF(pyname);
+		if (cookie == -1) {
+			formatstr = er_wmn;
+			tuple = PyTuple_Pack(3, evt->wd, pymask, evt->name);
+		}
+		else {
+			formatstr = er_wmcn;
+			tuple = PyTuple_Pack(4, evt->wd, pymask,
+					     evt->cookie, evt->name);
+		}
 	} else {
-		if (cookie == -1)
-			ret = PyString_FromFormat("event(wd=%d, mask=%s)",
-						  wd, maskstr);
+		if (cookie == -1) {
+			formatstr = er_wm;
+			tuple = PyTuple_Pack(2, evt->wd, pymask);
+		}
 		else {
-			ret = PyString_FromFormat(
-				"event(wd=%d, mask=%s, cookie=0x%x)",
-				wd, maskstr, cookie);
+			formatstr = er_wmc;
+			tuple = PyTuple_Pack(3, evt->wd, pymask, evt->cookie);
 		}
 	}
 
+	if (tuple == NULL)
+		goto bail;
+
+	ret = PyNumber_Remainder(formatstr, tuple);
+
+	if (ret == NULL)
+		goto bail;
+
 	goto done;
 bail:
 	Py_CLEAR(ret);
@@ -384,14 +389,13 @@
 done:
 	Py_XDECREF(pymask);
 	Py_XDECREF(pymasks);
-	Py_XDECREF(join);
+	Py_XDECREF(tuple);
 
 	return ret;
 }
 
 static PyTypeObject event_type = {
-	PyObject_HEAD_INIT(NULL)
-	0,                         /*ob_size*/
+	PyVarObject_HEAD_INIT(NULL, 0)
 	"_inotify.event",             /*tp_name*/
 	sizeof(struct event), /*tp_basicsize*/
 	0,                         /*tp_itemsize*/
@@ -561,6 +565,17 @@
 	return ret;
 }
 
+static int init_globals(void)
+{
+	join = PyString_FromString("|");
+	er_wm = PyString_FromString("event(wd=%d, mask=%s)");
+	er_wmn = PyString_FromString("event(wd=%d, mask=%s, name=%s)");
+	er_wmc = PyString_FromString("event(wd=%d, mask=%s, cookie=0x%x)");
+	er_wmcn = PyString_FromString("event(wd=%d, mask=%s, cookie=0x%x, name=%s)");
+
+	return join && er_wm && er_wmn && er_wmc && er_wmcn;
+}
+
 PyDoc_STRVAR(
 	read_doc,
 	"read(fd, bufsize[=65536]) -> list_of_events\n"
@@ -585,6 +600,35 @@
 	{NULL},
 };
 
+#ifdef IS_PY3K
+static struct PyModuleDef _inotify_module = {
+	PyModuleDef_HEAD_INIT,
+	"_inotify",
+	doc,
+	-1,
+	methods
+};
+
+PyMODINIT_FUNC PyInit__inotify(void)
+{
+	PyObject *mod, *dict;
+
+	mod = PyModule_Create(&_inotify_module);
+
+	if (mod == NULL)
+		return NULL;
+
+	if (!init_globals())
+		return;
+
+	dict = PyModule_GetDict(mod);
+
+	if (dict)
+		define_consts(dict);
+
+	return mod;
+}
+#else
 void init_inotify(void)
 {
 	PyObject *mod, *dict;
@@ -592,6 +636,9 @@
 	if (PyType_Ready(&event_type) == -1)
 		return;
 
+	if (!init_globals())
+		return;
+
 	mod = Py_InitModule3("_inotify", methods, doc);
 
 	dict = PyModule_GetDict(mod);
@@ -599,3 +646,4 @@
 	if (dict)
 		define_consts(dict);
 }
+#endif
--- a/hgext/inotify/linuxserver.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/hgext/inotify/linuxserver.py	Wed Sep 22 18:29:41 2010 -0500
@@ -117,7 +117,7 @@
             try:
                 events = cls.poll.poll(timeout)
             except select.error, err:
-                if err[0] == errno.EINTR:
+                if err.args[0] == errno.EINTR:
                     continue
                 raise
             if events:
--- a/hgext/inotify/server.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/hgext/inotify/server.py	Wed Sep 22 18:29:41 2010 -0500
@@ -336,10 +336,10 @@
         try:
             self.sock.bind(self.sockpath)
         except socket.error, err:
-            if err[0] == errno.EADDRINUSE:
+            if err.args[0] == errno.EADDRINUSE:
                 raise AlreadyStartedException(_('cannot start: socket is '
                                                 'already bound'))
-            if err[0] == "AF_UNIX path too long":
+            if err.args[0] == "AF_UNIX path too long":
                 if os.path.islink(self.sockpath) and \
                         not os.path.exists(self.sockpath):
                     raise util.Abort('inotify-server: cannot start: '
@@ -437,7 +437,7 @@
             finally:
                 sock.shutdown(socket.SHUT_WR)
         except socket.error, err:
-            if err[0] != errno.EPIPE:
+            if err.args[0] != errno.EPIPE:
                 raise
 
 if sys.platform == 'linux2':
@@ -484,5 +484,6 @@
 
     appendpid = ui.configbool('inotify', 'appendpid', False)
 
+    ui.debug('starting inotify server: %s\n' % ' '.join(runargs))
     cmdutil.service(opts, initfn=service.init, runfn=service.run,
                     logfile=logfile, runargs=runargs, appendpid=appendpid)
--- a/hgext/keyword.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/hgext/keyword.py	Wed Sep 22 18:29:41 2010 -0500
@@ -161,9 +161,9 @@
         kwpat = r'\$(%s)(: [^$\n\r]*? )??\$' % '|'.join(escaped)
         self.re_kw = re.compile(kwpat)
 
-        templatefilters.filters['utcdate'] = utcdate
-        templatefilters.filters['svnisodate'] = svnisodate
-        templatefilters.filters['svnutcdate'] = svnutcdate
+        templatefilters.filters.update({'utcdate': utcdate,
+                                        'svnisodate': svnisodate,
+                                        'svnutcdate': svnutcdate})
 
     def substitute(self, data, path, ctx, subfunc):
         '''Replaces keywords in data with expanded template.'''
@@ -514,14 +514,14 @@
         self.lines = kwt.shrinklines(self.fname, self.lines)
 
     def kw_diff(orig, repo, node1=None, node2=None, match=None, changes=None,
-                opts=None):
+                opts=None, prefix=''):
         '''Monkeypatch patch.diff to avoid expansion except when
         comparing against working dir.'''
         if node2 is not None:
             kwt.match = util.never
         elif node1 is not None and node1 != repo['.'].node():
             kwt.restrict = True
-        return orig(repo, node1, node2, match, changes, opts)
+        return orig(repo, node1, node2, match, changes, opts, prefix)
 
     def kwweb_skip(orig, web, req, tmpl):
         '''Wraps webcommands.x turning off keyword expansion.'''
--- a/hgext/mq.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/hgext/mq.py	Wed Sep 22 18:29:41 2010 -0500
@@ -47,7 +47,7 @@
 from mercurial.lock import release
 from mercurial import commands, cmdutil, hg, patch, util
 from mercurial import repair, extensions, url, error
-import os, sys, re, errno
+import os, sys, re, errno, shutil
 
 commands.norepo += " qclone"
 
@@ -513,7 +513,7 @@
 
         # apply failed, strip away that rev and merge.
         hg.clean(repo, head)
-        self.strip(repo, n, update=False, backup='strip')
+        self.strip(repo, [n], update=False, backup='strip')
 
         ctx = repo[rev]
         ret = hg.merge(repo, rev)
@@ -685,7 +685,7 @@
                 p1, p2 = repo.dirstate.parents()
                 repo.dirstate.setparents(p1, merge)
 
-            files = patch.updatedir(self.ui, repo, files)
+            files = cmdutil.updatedir(self.ui, repo, files)
             match = cmdutil.matchfiles(repo, files or [])
             n = repo.commit(message, ph.user, ph.date, match=match, force=True)
 
@@ -771,7 +771,7 @@
         if opts.get('rev'):
             if not self.applied:
                 raise util.Abort(_('no patches applied'))
-            revs = cmdutil.revrange(repo, opts['rev'])
+            revs = cmdutil.revrange(repo, opts.get('rev'))
             if len(revs) > 1 and revs[0] > revs[1]:
                 revs.reverse()
             revpatches = self._revpatches(repo, revs)
@@ -895,7 +895,7 @@
         finally:
             release(wlock)
 
-    def strip(self, repo, rev, update=True, backup="all", force=None):
+    def strip(self, repo, revs, update=True, backup="all", force=None):
         wlock = lock = None
         try:
             wlock = repo.wlock()
@@ -903,12 +903,13 @@
 
             if update:
                 self.check_localchanges(repo, force=force, refresh=False)
-                urev = self.qparents(repo, rev)
+                urev = self.qparents(repo, revs[0])
                 hg.clean(repo, urev)
                 repo.dirstate.write()
 
             self.removeundo(repo)
-            repair.strip(self.ui, repo, rev, backup)
+            for rev in revs:
+                repair.strip(self.ui, repo, rev, backup)
             # strip may have unbundled a set of backed up revisions after
             # the actual strip
             self.removeundo(repo)
@@ -1197,7 +1198,7 @@
             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')
+            self.strip(repo, [rev], update=False, backup='strip')
             if self.applied:
                 self.ui.write(_("now at: %s\n") % self.applied[-1].name)
             else:
@@ -1377,7 +1378,7 @@
                 repo.dirstate.setparents(*cparents)
                 self.applied.pop()
                 self.applied_dirty = 1
-                self.strip(repo, top, update=False,
+                self.strip(repo, [top], update=False,
                            backup='strip')
             except:
                 repo.dirstate.invalidate()
@@ -1535,7 +1536,7 @@
                     update = True
                 else:
                     update = False
-                self.strip(repo, rev, update=update, backup='strip')
+                self.strip(repo, [rev], update=update, backup='strip')
         if qpp:
             self.ui.warn(_("saved queue repository parents: %s %s\n") %
                          (short(qpp[0]), short(qpp[1])))
@@ -1694,11 +1695,22 @@
             if existing:
                 if filename == '-':
                     raise util.Abort(_('-e is incompatible with import from -'))
-                if not patchname:
-                    patchname = normname(filename)
-                self.check_reserved_name(patchname)
-                if not os.path.isfile(self.join(patchname)):
-                    raise util.Abort(_("patch %s does not exist") % patchname)
+                filename = normname(filename)
+                self.check_reserved_name(filename)
+                originpath = self.join(filename)
+                if not os.path.isfile(originpath):
+                    raise util.Abort(_("patch %s does not exist") % filename)
+
+                if patchname:
+                    self.check_reserved_name(patchname)
+                    checkfile(patchname)
+
+                    self.ui.write(_('renaming %s to %s\n')
+                                        % (filename, patchname))
+                    util.rename(originpath, self.join(patchname))
+                else:
+                    patchname = filename
+
             else:
                 try:
                     if filename == '-':
@@ -1744,7 +1756,6 @@
     """print the patches already applied"""
 
     q = repo.mq
-    l = len(q.applied)
 
     if patch:
         if patch not in q.series:
@@ -1813,12 +1824,16 @@
     To import a patch from standard input, pass - as the patch file.
     When importing from standard input, a patch name must be specified
     using the --name flag.
+
+    To import an existing patch while renaming it::
+
+      hg qimport -e existing-patch -n new-name
     """
     q = repo.mq
     try:
-        q.qimport(repo, filename, patchname=opts['name'],
-              existing=opts['existing'], force=opts['force'], rev=opts['rev'],
-              git=opts['git'])
+        q.qimport(repo, filename, patchname=opts.get('name'),
+              existing=opts.get('existing'), force=opts.get('force'),
+              rev=opts.get('rev'), git=opts.get('git'))
     finally:
         q.save_dirty()
 
@@ -1861,7 +1876,7 @@
 
     This command is deprecated. Without -c, it's implied by other relevant
     commands. With -c, use :hg:`init --mq` instead."""
-    return qinit(ui, repo, create=opts['create_repo'])
+    return qinit(ui, repo, create=opts.get('create_repo'))
 
 def clone(ui, source, dest=None, **opts):
     '''clone main and patch repository at same time
@@ -1886,8 +1901,8 @@
     if dest is None:
         dest = hg.defaultdest(source)
     sr = hg.repository(hg.remoteui(ui, opts), ui.expandpath(source))
-    if opts['patches']:
-        patchespath = ui.expandpath(opts['patches'])
+    if opts.get('patches'):
+        patchespath = ui.expandpath(opts.get('patches'))
     else:
         patchespath = patchdir(sr)
     try:
@@ -1910,20 +1925,20 @@
             pass
     ui.note(_('cloning main repository\n'))
     sr, dr = hg.clone(ui, sr.url(), dest,
-                      pull=opts['pull'],
+                      pull=opts.get('pull'),
                       rev=destrev,
                       update=False,
-                      stream=opts['uncompressed'])
+                      stream=opts.get('uncompressed'))
     ui.note(_('cloning patch repository\n'))
-    hg.clone(ui, opts['patches'] or patchdir(sr), patchdir(dr),
-             pull=opts['pull'], update=not opts['noupdate'],
-             stream=opts['uncompressed'])
+    hg.clone(ui, opts.get('patches') or patchdir(sr), patchdir(dr),
+             pull=opts.get('pull'), update=not opts.get('noupdate'),
+             stream=opts.get('uncompressed'))
     if dr.local():
         if qbase:
             ui.note(_('stripping applied patches from destination '
                       'repository\n'))
-            dr.mq.strip(dr, qbase, update=False, backup=None)
-        if not opts['noupdate']:
+            dr.mq.strip(dr, [qbase], update=False, backup=None)
+        if not opts.get('noupdate'):
             ui.note(_('updating destination repository\n'))
             hg.update(dr, dr.changelog.tip())
 
@@ -1939,7 +1954,7 @@
 
 def series(ui, repo, **opts):
     """print the entire series file"""
-    repo.mq.qseries(repo, missing=opts['missing'], summary=opts['summary'])
+    repo.mq.qseries(repo, missing=opts.get('missing'), summary=opts.get('summary'))
     return 0
 
 def top(ui, repo, **opts):
@@ -2006,7 +2021,7 @@
     """
     msg = cmdutil.logmessage(opts)
     def getmsg():
-        return ui.edit(msg, ui.username())
+        return ui.edit(msg, opts.get('user') or ui.username())
     q = repo.mq
     opts['msg'] = msg
     if opts.get('edit'):
@@ -2028,6 +2043,10 @@
     If -s/--short is specified, files currently included in the patch
     will be refreshed just like matched files and remain in the patch.
 
+    If -e/--edit is specified, Mercurial will start your configured editor for
+    you to enter a message. In case qrefresh fails, you will find a backup of
+    your message in ``.hg/last-message.txt``.
+
     hg add/remove/copy/rename work as usual, though you might want to
     use git-style patches (-g/--git or [diff] git=1) to track copies
     and renames. See the diffs help topic for more information on the
@@ -2035,7 +2054,7 @@
     """
     q = repo.mq
     message = cmdutil.logmessage(opts)
-    if opts['edit']:
+    if opts.get('edit'):
         if not q.applied:
             ui.write(_("no patches applied\n"))
             return 1
@@ -2044,6 +2063,10 @@
         patch = q.applied[-1].name
         ph = patchheader(q.join(patch), q.plainmode)
         message = ui.edit('\n'.join(ph.message), ph.user or ui.username())
+        # We don't want to lose the patch message if qrefresh fails (issue2062)
+        msgfile = repo.opener('last-message.txt', 'wb')
+        msgfile.write(message)
+        msgfile.close()
     setupheaderopts(ui, opts)
     ret = q.refresh(repo, pats, msg=message, **opts)
     q.save_dirty()
@@ -2087,7 +2110,7 @@
     q.check_localchanges(repo)
 
     message = cmdutil.logmessage(opts)
-    if opts['edit']:
+    if opts.get('edit'):
         if message:
             raise util.Abort(_('option "-e" incompatible with "-m" or "-l"'))
 
@@ -2097,7 +2120,7 @@
     for f in files:
         p = q.lookup(f)
         if p in patches or p == parent:
-            ui.warn(_('Skipping already folded patch %s') % p)
+            ui.warn(_('Skipping already folded patch %s\n') % p)
         if q.isapplied(p):
             raise util.Abort(_('qfold cannot fold already applied patch %s') % p)
         patches.append(p)
@@ -2111,7 +2134,7 @@
         (patchsuccess, files, fuzz) = q.patch(repo, pf)
         if not patchsuccess:
             raise util.Abort(_('error folding patch %s') % p)
-        patch.updatedir(ui, repo, files)
+        cmdutil.updatedir(ui, repo, files)
 
     if not message:
         ph = patchheader(q.join(parent), q.plainmode)
@@ -2121,7 +2144,7 @@
             message.extend(msg)
         message = '\n'.join(message)
 
-    if opts['edit']:
+    if opts.get('edit'):
         message = ui.edit(message, user or ui.username())
 
     diffopts = q.patchopts(q.diffopts(), *patches)
@@ -2134,9 +2157,9 @@
     q = repo.mq
     patch = q.lookup(patch)
     if q.isapplied(patch):
-        ret = q.pop(repo, patch, force=opts['force'])
+        ret = q.pop(repo, patch, force=opts.get('force'))
     else:
-        ret = q.push(repo, patch, force=opts['force'])
+        ret = q.push(repo, patch, force=opts.get('force'))
     q.save_dirty()
     return ret
 
@@ -2159,7 +2182,15 @@
     '''
     def status(idx):
         guards = q.series_guards[idx] or ['unguarded']
-        ui.write('%s: ' % ui.label(q.series[idx], 'qguard.patch'))
+        if q.series[idx] in applied:
+            state = 'applied'
+        elif q.pushable(idx)[0]:
+            state = 'unapplied'
+        else:
+            state = 'guarded'
+        label = 'qguard.patch qguard.%s qseries.%s' % (state, state)
+        ui.write('%s: ' % ui.label(q.series[idx], label))
+
         for i, guard in enumerate(guards):
             if guard.startswith('+'):
                 ui.write(guard, label='qguard.positive')
@@ -2171,10 +2202,11 @@
                 ui.write(' ')
         ui.write('\n')
     q = repo.mq
+    applied = set(p.name for p in q.applied)
     patch = None
     args = list(args)
-    if opts['list']:
-        if args or opts['none']:
+    if opts.get('list'):
+        if args or opts.get('none'):
             raise util.Abort(_('cannot mix -l/--list with options or arguments'))
         for i in xrange(len(q.series)):
             status(i)
@@ -2187,7 +2219,7 @@
         patch = args.pop(0)
     if patch is None:
         raise util.Abort(_('no patch to work with'))
-    if args or opts['none']:
+    if args or opts.get('none'):
         idx = q.find_series(patch)
         if idx is None:
             raise util.Abort(_('no patch named %s') % patch)
@@ -2244,9 +2276,9 @@
     q = repo.mq
     mergeq = None
 
-    if opts['merge']:
-        if opts['name']:
-            newpath = repo.join(opts['name'])
+    if opts.get('merge'):
+        if opts.get('name'):
+            newpath = repo.join(opts.get('name'))
         else:
             newpath, i = lastsavename(q.path)
         if not newpath:
@@ -2254,7 +2286,7 @@
             return 1
         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'],
+    ret = q.push(repo, patch, force=opts.get('force'), list=opts.get('list'),
                  mergeq=mergeq, all=opts.get('all'), move=opts.get('move'))
     return ret
 
@@ -2266,14 +2298,14 @@
     top of the stack.
     """
     localupdate = True
-    if opts['name']:
-        q = queue(ui, repo.join(""), repo.join(opts['name']))
+    if opts.get('name'):
+        q = queue(ui, repo.join(""), repo.join(opts.get('name')))
         ui.warn(_('using patch queue: %s\n') % q.path)
         localupdate = False
     else:
         q = repo.mq
-    ret = q.pop(repo, patch, force=opts['force'], update=localupdate,
-                all=opts['all'])
+    ret = q.pop(repo, patch, force=opts.get('force'), update=localupdate,
+                all=opts.get('all'))
     q.save_dirty()
     return ret
 
@@ -2347,8 +2379,8 @@
     This command is deprecated, use :hg:`rebase` instead."""
     rev = repo.lookup(rev)
     q = repo.mq
-    q.restore(repo, rev, delete=opts['delete'],
-              qupdate=opts['update'])
+    q.restore(repo, rev, delete=opts.get('delete'),
+              qupdate=opts.get('update'))
     q.save_dirty()
     return 0
 
@@ -2362,36 +2394,34 @@
     if ret:
         return ret
     q.save_dirty()
-    if opts['copy']:
+    if opts.get('copy'):
         path = q.path
-        if opts['name']:
-            newpath = os.path.join(q.basepath, opts['name'])
+        if opts.get('name'):
+            newpath = os.path.join(q.basepath, opts.get('name'))
             if os.path.exists(newpath):
                 if not os.path.isdir(newpath):
                     raise util.Abort(_('destination %s exists and is not '
                                        'a directory') % newpath)
-                if not opts['force']:
+                if not opts.get('force'):
                     raise util.Abort(_('destination %s exists, '
                                        'use -f to force') % newpath)
         else:
             newpath = savename(path)
         ui.warn(_("copy %s to %s\n") % (path, newpath))
         util.copyfiles(path, newpath)
-    if opts['empty']:
+    if opts.get('empty'):
         try:
             os.unlink(q.join(q.status_path))
         except:
             pass
     return 0
 
-def strip(ui, repo, rev, **opts):
-    """strip a changeset and all its descendants from the repository
-
-    The strip command removes all changesets whose local revision
-    number is greater than or equal to REV, and then restores any
-    changesets that are not descendants of REV. If the working
-    directory has uncommitted changes, the operation is aborted unless
-    the --force flag is supplied.
+def strip(ui, repo, *revs, **opts):
+    """strip changesets and all their descendants from the repository
+
+    The strip command removes the specified changesets and all their
+    descendants. If the working directory has uncommitted changes,
+    the operation is aborted unless the --force flag is supplied.
 
     If a parent of the working directory is stripped, then the working
     directory will automatically be updated to the most recent
@@ -2405,39 +2435,51 @@
     the local revision numbers will in general be different after the
     restore.
 
-    Use the --nobackup option to discard the backup bundle once the
+    Use the --no-backup option to discard the backup bundle once the
     operation completes.
     """
     backup = 'all'
-    if opts['backup']:
+    if opts.get('backup'):
         backup = 'strip'
-    elif opts['nobackup']:
+    elif opts.get('no-backup') or opts.get('nobackup'):
         backup = 'none'
 
-    rev = repo.lookup(rev)
-    p = repo.dirstate.parents()
     cl = repo.changelog
-    update = True
-    if p[0] == nullid:
-        update = False
-    elif p[1] == nullid and rev != cl.ancestor(p[0], rev):
-        update = False
-    elif rev not in (cl.ancestor(p[0], rev), cl.ancestor(p[1], rev)):
-        update = False
+    revs = set(cl.rev(repo.lookup(r)) for r in revs)
+
+    descendants = set(cl.descendants(*revs))
+    strippedrevs = revs.union(descendants)
+    roots = revs.difference(descendants)
+
+    update = False
+    # if one of the wdir parent is stripped we'll need
+    # to update away to an earlier revision
+    for p in repo.dirstate.parents():
+        if p != nullid and cl.rev(p) in strippedrevs:
+            update = True
+            break
+
+    rootnodes = set(cl.node(r) for r in roots)
 
     q = repo.mq
     if q.applied:
-        if rev == cl.ancestor(repo.lookup('qtip'), rev):
+        # refresh queue state if we're about to strip
+        # applied patches
+        if cl.rev(repo.lookup('qtip')) in strippedrevs:
             q.applied_dirty = True
             start = 0
             end = len(q.applied)
-            applied_list = [i.node for i in q.applied]
-            if rev in applied_list:
-                start = applied_list.index(rev)
+            for i, statusentry in enumerate(q.applied):
+                if statusentry.node in rootnodes:
+                    # if one of the stripped roots is an applied
+                    # patch, only part of the queue is stripped
+                    start = i
+                    break
             del q.applied[start:end]
             q.save_dirty()
 
-    repo.mq.strip(repo, rev, backup=backup, update=update, force=opts['force'])
+    repo.mq.strip(repo, list(rootnodes), backup=backup, update=update,
+                  force=opts.get('force'))
     return 0
 
 def select(ui, repo, *args, **opts):
@@ -2475,7 +2517,7 @@
 
     q = repo.mq
     guards = q.active()
-    if args or opts['none']:
+    if args or opts.get('none'):
         old_unapplied = q.unapplied(repo)
         old_guarded = [i for i in xrange(len(q.applied)) if
                        not q.pushable(i)[0]]
@@ -2483,7 +2525,7 @@
         q.save_dirty()
         if not args:
             ui.status(_('guards deactivated\n'))
-        if not opts['pop'] and not opts['reapply']:
+        if not opts.get('pop') and not opts.get('reapply'):
             unapplied = q.unapplied(repo)
             guarded = [i for i in xrange(len(q.applied))
                        if not q.pushable(i)[0]]
@@ -2495,7 +2537,7 @@
                 ui.status(_('number of guarded, applied patches has changed '
                             'from %d to %d\n') %
                           (len(old_guarded), len(guarded)))
-    elif opts['series']:
+    elif opts.get('series'):
         guards = {}
         noguards = 0
         for gs in q.series_guards:
@@ -2522,9 +2564,9 @@
                 ui.write(g, '\n')
         else:
             ui.write(_('no active guards\n'))
-    reapply = opts['reapply'] and q.applied and q.appliedname(-1)
+    reapply = opts.get('reapply') and q.applied and q.appliedname(-1)
     popped = False
-    if opts['pop'] or opts['reapply']:
+    if opts.get('pop') or opts.get('reapply'):
         for i in xrange(len(q.applied)):
             pushable, reason = q.pushable(i)
             if not pushable:
@@ -2559,10 +2601,10 @@
     an upstream repository, or if you are about to push your changes
     to upstream.
     """
-    if not opts['applied'] and not revrange:
+    if not opts.get('applied') and not revrange:
         raise util.Abort(_('no revisions specified'))
-    elif opts['applied']:
-        revrange = ('qbase:qtip',) + revrange
+    elif opts.get('applied'):
+        revrange = ('qbase::qtip',) + revrange
 
     q = repo.mq
     if not q.applied:
@@ -2630,7 +2672,9 @@
     def _setactive(name):
         if q.applied:
             raise util.Abort(_('patches applied - cannot set new queue active'))
-
+        _setactivenocheck(name)
+
+    def _setactivenocheck(name):
         fh = repo.opener(_activequeue, 'w')
         if name != 'patches':
             fh.write(name)
@@ -2641,17 +2685,40 @@
         fh.write('%s\n' % (name,))
         fh.close()
 
+    def _queuedir(name):
+        if name == 'patches':
+            return repo.join('patches')
+        else:
+            return repo.join('patches-' + name)
+
     def _validname(name):
         for n in name:
             if n in ':\\/.':
                 return False
         return True
 
+    def _delete(name):
+        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))
+
     if not name or opts.get('list'):
         current = _getcurrent()
         for queue in _getqueues():
             ui.write('%s' % (queue,))
-            if queue == current:
+            if queue == current and not ui.quiet:
                 ui.write(_(' (active)\n'))
             else:
                 ui.write('\n')
@@ -2670,22 +2737,39 @@
             _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'))
-
+    elif opts.get('rename'):
         current = _getcurrent()
-
         if name == current:
-            raise util.Abort(_('cannot delete currently active queue'))
+            raise util.Abort(_('can\'t rename "%s" to its current name') % name)
+        if name in existing:
+            raise util.Abort(_('queue "%s" already exists') % name)
+
+        olddir = _queuedir(current)
+        newdir = _queuedir(name)
+
+        if os.path.exists(newdir):
+            raise util.Abort(_('non-queue directory "%s" already exists') %
+                    newdir)
 
         fh = repo.opener('patches.queues.new', 'w')
         for queue in existing:
-            if queue == name:
-                continue
-            fh.write('%s\n' % (queue,))
+            if queue == current:
+                fh.write('%s\n' % (name,))
+                if os.path.exists(olddir):
+                    util.rename(olddir, newdir)
+            else:
+                fh.write('%s\n' % (queue,))
         fh.close()
         util.rename(repo.join('patches.queues.new'), repo.join(_allqueues))
+        _setactivenocheck(name)
+    elif opts.get('delete'):
+        _delete(name)
+    elif opts.get('purge'):
+        if name in existing:
+            _delete(name)
+        qdir = _queuedir(name)
+        if os.path.exists(qdir):
+            shutil.rmtree(qdir)
     else:
         if name not in existing:
             raise util.Abort(_('use --create to create a new queue'))
@@ -2851,13 +2935,21 @@
     entry = extensions.wrapcommand(commands.table, 'init', mqinit)
     entry[1].extend(mqopt)
 
-    norepo = commands.norepo.split(" ")
-    for cmd in commands.table.keys():
-        cmd = cmdutil.parsealiases(cmd)[0]
-        if cmd in norepo:
-            continue
-        entry = extensions.wrapcommand(commands.table, cmd, mqcommand)
-        entry[1].extend(mqopt)
+    nowrap = set(commands.norepo.split(" ") + ['qrecord'])
+
+    def dotable(cmdtable):
+        for cmd in cmdtable.keys():
+            cmd = cmdutil.parsealiases(cmd)[0]
+            if cmd in nowrap:
+                continue
+            entry = extensions.wrapcommand(cmdtable, cmd, mqcommand)
+            entry[1].extend(mqopt)
+
+    dotable(commands.table)
+
+    for extname, extmodule in extensions.extensions():
+        if extmodule.__file__ != __file__:
+            dotable(getattr(extmodule, 'cmdtable', {}))
 
 seriesopts = [('s', 'summary', None, _('print first line of patch header'))]
 
@@ -3003,8 +3095,9 @@
           ('b', 'backup', None, _('bundle only changesets with local revision'
                                   ' number greater than REV which are not'
                                   ' descendants of REV (DEPRECATED)')),
-           ('n', 'nobackup', None, _('no backups'))],
-          _('hg strip [-f] [-n] REV')),
+           ('n', 'no-backup', None, _('no backups')),
+           ('', 'nobackup', None, _('no backups (DEPRECATED)'))],
+          _('hg strip [-f] [-n] REV...')),
      "qtop": (top, [] + seriesopts, _('hg qtop [-s]')),
     "qunapplied":
         (unapplied,
@@ -3019,7 +3112,9 @@
          [
              ('l', 'list', False, _('list all available queues')),
              ('c', 'create', False, _('create new queue')),
+             ('', 'rename', False, _('rename active queue')),
              ('', 'delete', False, _('delete reference to queue')),
+             ('', 'purge', False, _('delete queue, and remove patch dir')),
          ],
          _('[OPTION] [QUEUE]')),
 }
--- a/hgext/patchbomb.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/hgext/patchbomb.py	Wed Sep 22 18:29:41 2010 -0500
@@ -22,9 +22,9 @@
 and References headers, so they will show up as a sequence in threaded
 mail and news readers, and in mail archives.
 
-With the -d/--diffstat option, you will be prompted for each changeset
-with a diffstat summary and the changeset summary, so you can be sure
-you are sending the right changes.
+With the -d/--diffstat or -c/--confirm options, you will be presented
+with a final summary of all messages and asked for confirmation before
+the messages are sent.
 
 To configure other defaults, add a section like this to your hgrc
 file::
@@ -81,9 +81,7 @@
 from mercurial.node import bin
 
 def prompt(ui, prompt, default=None, rest=':'):
-    if not ui.interactive():
-        if default is not None:
-            return default
+    if not ui.interactive() and default is None:
         raise util.Abort(_("%s Please enter a valid value" % (prompt + rest)))
     if default:
         prompt += ' [%s]' % default
@@ -96,27 +94,18 @@
             return default
         ui.warn(_('Please enter a valid value.\n'))
 
-def cdiffstat(ui, summary, patchlines):
-    s = patch.diffstat(patchlines)
-    if summary:
-        ui.write(summary, '\n')
-        ui.write(s, '\n')
-    ans = prompt(ui, _('does the diffstat above look okay?'), 'y')
-    if not ans.lower().startswith('y'):
-        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):
+def makepatch(ui, repo, patchlines, opts, _charsets, idx, total,
+              patchname=None):
 
     desc = []
     node = None
     body = ''
 
-    for line in patch:
+    for line in patchlines:
         if line.startswith('#'):
             if line.startswith('# Node ID'):
                 node = line.split()[-1]
@@ -134,21 +123,22 @@
         body += '\n\n\n'
 
     if opts.get('plain'):
-        while patch and patch[0].startswith('# '):
-            patch.pop(0)
-        if patch:
-            patch.pop(0)
-        while patch and not patch[0].strip():
-            patch.pop(0)
+        while patchlines and patchlines[0].startswith('# '):
+            patchlines.pop(0)
+        if patchlines:
+            patchlines.pop(0)
+        while patchlines and not patchlines[0].strip():
+            patchlines.pop(0)
 
+    ds = patch.diffstat(patchlines)
     if opts.get('diffstat'):
-        body += cdiffstat(ui, '\n'.join(desc), patch) + '\n\n'
+        body += ds + '\n\n'
 
     if opts.get('attach') or opts.get('inline'):
         msg = email.MIMEMultipart.MIMEMultipart()
         if body:
             msg.attach(mail.mimeencode(ui, body, _charsets, opts.get('test')))
-        p = mail.mimetextpatch('\n'.join(patch), 'x-patch', opts.get('test'))
+        p = mail.mimetextpatch('\n'.join(patchlines), 'x-patch', opts.get('test'))
         binnode = bin(node)
         # if node is mq patch, it will have the patch file's name as a tag
         if not patchname:
@@ -167,7 +157,7 @@
         p['Content-Disposition'] = disposition + '; filename=' + patchname
         msg.attach(p)
     else:
-        body += '\n'.join(patch)
+        body += '\n'.join(patchlines)
         msg = mail.mimetextpatch(body, display=opts.get('test'))
 
     flag = ' '.join(opts.get('flag'))
@@ -182,7 +172,7 @@
         subj = '[PATCH %0*d of %d%s] %s' % (tlen, idx, total, flag, subj)
     msg['Subject'] = mail.headencode(ui, subj, _charsets, opts.get('test'))
     msg['X-Mercurial-Node'] = node
-    return msg, subj
+    return msg, subj, ds
 
 def patchbomb(ui, repo, *revs, **opts):
     '''send changesets by email
@@ -352,17 +342,16 @@
                            prompt(ui, 'Subject: ', rest=subj))
 
             body = ''
-            if opts.get('diffstat'):
-                d = cdiffstat(ui, _('Final summary:\n'), jumbo)
-                if d:
-                    body = '\n' + d
+            ds = patch.diffstat(jumbo)
+            if ds and opts.get('diffstat'):
+                body = '\n' + ds
 
             body = getdescription(body, sender)
             msg = mail.mimeencode(ui, body, _charsets, opts.get('test'))
             msg['Subject'] = mail.headencode(ui, subj, _charsets,
                                              opts.get('test'))
 
-            msgs.insert(0, (msg, subj))
+            msgs.insert(0, (msg, subj, ds))
         return msgs
 
     def getbundlemsgs(bundle):
@@ -381,7 +370,7 @@
         email.Encoders.encode_base64(datapart)
         msg.attach(datapart)
         msg['Subject'] = mail.headencode(ui, subj, _charsets, opts.get('test'))
-        return [(msg, subj)]
+        return [(msg, subj, None)]
 
     sender = (opts.get('from') or ui.config('email', 'from') or
               ui.config('patchbomb', 'from') or
@@ -394,17 +383,25 @@
     else:
         msgs = getpatchmsgs(list(getpatches(revs)))
 
+    showaddrs = []
+
     def getaddrs(opt, prpt=None, default=None):
         addrs = opts.get(opt.replace('-', '_'))
+        if opt != 'reply-to':
+            showaddr = '%s:' % opt.capitalize()
+        else:
+            showaddr = 'Reply-To:'
+
         if addrs:
-            return mail.addrlistencode(ui, addrs, _charsets,
-                                       opts.get('test'))
+            showaddrs.append('%s %s' % (showaddr, ', '.join(addrs)))
+            return mail.addrlistencode(ui, addrs, _charsets, opts.get('test'))
 
-        addrs = (ui.config('email', opt) or
-                 ui.config('patchbomb', opt) or '')
+        addrs = ui.config('email', opt) or ui.config('patchbomb', opt) or ''
         if not addrs and prpt:
             addrs = prompt(ui, prpt, default)
 
+        if addrs:
+            showaddrs.append('%s %s' % (showaddr, addrs))
         return mail.addrlistencode(ui, [addrs], _charsets, opts.get('test'))
 
     to = getaddrs('to', 'To')
@@ -412,6 +409,20 @@
     bcc = getaddrs('bcc')
     replyto = getaddrs('reply-to')
 
+    if opts.get('diffstat') or opts.get('confirm'):
+        ui.write(_('\nFinal summary:\n\n'))
+        ui.write('From: %s\n' % sender)
+        for addr in showaddrs:
+            ui.write('%s\n' % addr)
+        for m, subj, ds in msgs:
+            ui.write('Subject: %s\n' % subj)
+            if ds:
+                ui.write(ds)
+        ui.write('\n')
+        if ui.promptchoice(_('are you sure you want to send (yn)?'),
+                           (_('&Yes'), _('&No'))):
+            raise util.Abort(_('patchbomb canceled'))
+
     ui.write('\n')
 
     parent = opts.get('in_reply_to') or None
@@ -427,7 +438,7 @@
     sender_addr = email.Utils.parseaddr(sender)[1]
     sender = mail.addressencode(ui, sender, _charsets, opts.get('test'))
     sendmail = None
-    for m, subj in msgs:
+    for i, (m, subj, ds) in enumerate(msgs):
         try:
             m['Message-Id'] = genmsgid(m['X-Mercurial-Node'])
         except TypeError:
@@ -469,6 +480,7 @@
                 fp.close()
         elif mbox:
             ui.status(_('Writing '), subj, ' ...\n')
+            ui.progress(_('writing'), i, item=subj, total=len(msgs))
             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
@@ -483,6 +495,7 @@
             if not sendmail:
                 sendmail = mail.connect(ui)
             ui.status(_('Sending '), subj, ' ...\n')
+            ui.progress(_('sending'), i, item=subj, total=len(msgs))
             # Exim does not remove the Bcc field
             del m['Bcc']
             fp = cStringIO.StringIO()
@@ -490,11 +503,15 @@
             generator.flatten(m, 0)
             sendmail(sender, to + bcc + cc, fp.getvalue())
 
+    ui.progress(_('writing'), None)
+    ui.progress(_('sending'), None)
+
 emailopts = [
           ('a', 'attach', None, _('send patches as attachments')),
           ('i', 'inline', None, _('send patches as inline attachments')),
           ('', 'bcc', [], _('email addresses of blind carbon copy recipients')),
           ('c', 'cc', [], _('email addresses of copy recipients')),
+          ('', 'confirm', None, _('ask for confirmation before sending')),
           ('d', 'diffstat', None, _('add diffstat output to messages')),
           ('', 'date', '', _('use the given date as the sending date')),
           ('', 'desc', '', _('use the given file as the series description')),
--- a/hgext/rebase.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/hgext/rebase.py	Wed Sep 22 18:29:41 2010 -0500
@@ -14,7 +14,7 @@
 http://mercurial.selenic.com/wiki/RebaseExtension
 '''
 
-from mercurial import hg, util, repair, merge, cmdutil, commands, error
+from mercurial import hg, util, repair, merge, cmdutil, commands
 from mercurial import extensions, ancestor, copies, patch
 from mercurial.commands import templateopts
 from mercurial.node import nullrev
@@ -148,9 +148,14 @@
             targetancestors = set(repo.changelog.ancestors(target))
             targetancestors.add(target)
 
-        for rev in sorted(state):
+        sortedstate = sorted(state)
+        total = len(sortedstate)
+        pos = 0
+        for rev in sortedstate:
+            pos += 1
             if state[rev] == -1:
-                ui.debug("rebasing %d:%s\n" % (rev, repo[rev]))
+                ui.progress(_("rebasing"), pos, ("%d:%s" % (rev, repo[rev])),
+                            _(' changesets'), total)
                 storestatus(repo, originalwd, target, state, collapsef, keepf,
                                                     keepbranchesf, external)
                 p1, p2 = defineparents(repo, rev, target, state,
@@ -179,6 +184,7 @@
                         skipped.add(rev)
                     state[rev] = p1
 
+        ui.progress(_('rebasing'), None)
         ui.note(_('rebase merging completed\n'))
 
         if collapsef and not keepopen:
--- a/hgext/record.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/hgext/record.py	Wed Sep 22 18:29:41 2010 -0500
@@ -10,7 +10,7 @@
 from mercurial.i18n import gettext, _
 from mercurial import cmdutil, commands, extensions, hg, mdiff, patch
 from mercurial import util
-import copy, cStringIO, errno, operator, os, re, tempfile
+import copy, cStringIO, errno, os, re, tempfile
 
 lines_re = re.compile(r'@@ -(\d+),(\d+) \+(\d+),(\d+) @@\s*(.*)')
 
@@ -97,7 +97,7 @@
             if h.startswith('---'):
                 fp.write(_('%d hunks, %d lines changed\n') %
                          (len(self.hunks),
-                          sum([h.added + h.removed for h in self.hunks])))
+                          sum([max(h.added, h.removed) for h in self.hunks])))
                 break
             fp.write(h)
 
@@ -186,7 +186,8 @@
             self.hunk = []
             self.stream = []
 
-        def addrange(self, (fromstart, fromend, tostart, toend, proc)):
+        def addrange(self, limits):
+            fromstart, fromend, tostart, toend, proc = limits
             self.fromline = int(fromstart)
             self.toline = int(tostart)
             self.proc = proc
@@ -354,8 +355,8 @@
                 applied[chunk.filename()].append(chunk)
             else:
                 fixoffset += chunk.removed - chunk.added
-    return reduce(operator.add, [h for h in applied.itervalues()
-                                 if h[0].special() or len(h) > 1], [])
+    return sum([h for h in applied.itervalues()
+               if h[0].special() or len(h) > 1], [])
 
 def record(ui, repo, *pats, **opts):
     '''interactively select changes to commit
@@ -485,7 +486,8 @@
 
             # 3a. apply filtered patch to clean repo  (clean)
             if backups:
-                hg.revert(repo, repo.dirstate.parents()[0], backups.has_key)
+                hg.revert(repo, repo.dirstate.parents()[0],
+                          lambda key: key in backups)
 
             # 3b. (apply)
             if dopatch:
@@ -495,7 +497,7 @@
                     pfiles = {}
                     patch.internalpatch(fp, ui, 1, repo.root, files=pfiles,
                                         eolmode=None)
-                    patch.updatedir(ui, repo, pfiles)
+                    cmdutil.updatedir(ui, repo, pfiles)
                 except patch.PatchError, err:
                     s = str(err)
                     if s:
--- a/hgext/relink.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/hgext/relink.py	Wed Sep 22 18:29:41 2010 -0500
@@ -7,7 +7,7 @@
 
 """recreates hardlinks between repository clones"""
 
-from mercurial import cmdutil, hg, util
+from mercurial import hg, util
 from mercurial.i18n import _
 import os, stat
 
--- a/hgext/transplant.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/hgext/transplant.py	Wed Sep 22 18:29:41 2010 -0500
@@ -31,7 +31,7 @@
 
         if not opener:
             self.opener = util.opener(self.path)
-        self.transplants = []
+        self.transplants = {}
         self.dirty = False
         self.read()
 
@@ -40,29 +40,34 @@
         if self.transplantfile and os.path.exists(abspath):
             for line in self.opener(self.transplantfile).read().splitlines():
                 lnode, rnode = map(revlog.bin, line.split(':'))
-                self.transplants.append(transplantentry(lnode, rnode))
+                list = self.transplants.setdefault(rnode, [])
+                list.append(transplantentry(lnode, rnode))
 
     def write(self):
         if self.dirty and self.transplantfile:
             if not os.path.isdir(self.path):
                 os.mkdir(self.path)
             fp = self.opener(self.transplantfile, 'w')
-            for c in self.transplants:
-                l, r = map(revlog.hex, (c.lnode, c.rnode))
-                fp.write(l + ':' + r + '\n')
+            for list in self.transplants.itervalues():
+                for t in list:
+                    l, r = map(revlog.hex, (t.lnode, t.rnode))
+                    fp.write(l + ':' + r + '\n')
             fp.close()
         self.dirty = False
 
     def get(self, rnode):
-        return [t for t in self.transplants if t.rnode == rnode]
+        return self.transplants.get(rnode) or []
 
     def set(self, lnode, rnode):
-        self.transplants.append(transplantentry(lnode, rnode))
+        list = self.transplants.setdefault(rnode, [])
+        list.append(transplantentry(lnode, rnode))
         self.dirty = True
 
     def remove(self, transplant):
-        del self.transplants[self.transplants.index(transplant)]
-        self.dirty = True
+        list = self.transplants.get(transplant.rnode)
+        if list:
+            del list[list.index(transplant)]
+            self.dirty = True
 
 class transplanter(object):
     def __init__(self, ui, repo):
@@ -225,7 +230,7 @@
                                      % revlog.hex(node))
                         return None
                 finally:
-                    files = patch.updatedir(self.ui, repo, files)
+                    files = cmdutil.updatedir(self.ui, repo, files)
             except Exception, inst:
                 seriespath = os.path.join(self.path, 'series')
                 if os.path.exists(seriespath):
--- a/hgext/zeroconf/__init__.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/hgext/zeroconf/__init__.py	Wed Sep 22 18:29:41 2010 -0500
@@ -27,7 +27,7 @@
 import socket, time, os
 
 import Zeroconf
-from mercurial import ui, hg, encoding
+from mercurial import ui, hg, encoding, util
 from mercurial import extensions
 from mercurial.hgweb import hgweb_mod
 from mercurial.hgweb import hgwebdir_mod
@@ -107,7 +107,7 @@
         path = self.repo.ui.config("web", "prefix", "").strip('/')
         desc = self.repo.ui.config("web", "description", name)
         publish(name, desc, path,
-                int(self.repo.ui.config("web", "port", 8000)))
+                util.getport(self.repo.ui.config("web", "port", 8000)))
 
 class hgwebdirzc(hgwebdir_mod.hgwebdir):
     def __init__(self, conf, baseui=None):
@@ -119,7 +119,7 @@
             name = os.path.basename(repo)
             path = (prefix + repo).strip('/')
             desc = u.config('web', 'description', name)
-            publish(name, desc, path, int(u.config("web", "port", 8000)))
+            publish(name, desc, path, util.getport(u.config("web", "port", 8000)))
 
 # listen
 
--- a/i18n/da.po	Wed Sep 22 17:13:49 2010 -0500
+++ b/i18n/da.po	Wed Sep 22 18:29:41 2010 -0500
@@ -17,10 +17,11 @@
 msgstr ""
 "Project-Id-Version: Mercurial\n"
 "Report-Msgid-Bugs-To: <mercurial-devel@selenic.com>\n"
-"POT-Creation-Date: 2010-07-01 14:56+0200\n"
-"PO-Revision-Date: 2010-07-01 15:23+0200\n"
+"POT-Creation-Date: 2010-08-15 17:28+0200\n"
+"PO-Revision-Date: 2010-08-26 08:58+0200\n"
 "Last-Translator: <mg@lazybytes.net>\n"
 "Language-Team: Danish\n"
+"Language: \n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
@@ -345,6 +346,9 @@
 msgid "bookmark name cannot contain newlines"
 msgstr "bogmærkenavn kan ikke indeholde linieskift"
 
+msgid "bookmark names cannot consist entirely of whitespace"
+msgstr "bogmærkenavne kan ikke bestå udelukkende af tomrum"
+
 msgid "a bookmark cannot have the name of an existing branch"
 msgstr "et bogmærke kan ikke hedde det samme som en eksisterende gren"
 
@@ -1082,17 +1086,24 @@
 
 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::"
-msgstr ""
-
-msgid "      include path/to/file"
-msgstr ""
-
-msgid "      exclude path/to/file"
-msgstr ""
-
-msgid "      rename from/file to/file"
+"    and directories. Each line can contain one of the following\n"
+"    directives::"
+msgstr ""
+
+msgid "      include path/to/file-or-dir"
+msgstr ""
+
+msgid "      exclude path/to/file-or-dir"
+msgstr ""
+
+msgid "      rename path/to/source path/to/destination"
+msgstr ""
+
+msgid ""
+"    Comment lines start with '#'. A specified path matches if it\n"
+"    equals the full relative name of a file or one of its parent\n"
+"    directories. The 'include' or 'exclude' directive with the longest\n"
+"    matching path applies, so line order does not matter."
 msgstr ""
 
 msgid ""
@@ -1100,9 +1111,9 @@
 "    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."
+"    be omitted. The 'rename' directive renames a file or directory if\n"
+"    it is converted. To rename from a subdirectory into the root of\n"
+"    the repository, use '.' as the path to rename to."
 msgstr ""
 
 msgid ""
@@ -1432,8 +1443,8 @@
 msgid "%s: unknown repository type"
 msgstr "%s: ukendt depottype"
 
-msgid "retrieving file"
-msgstr "henter fil"
+msgid "getting files"
+msgstr "henter filer"
 
 msgid "revisions"
 msgstr "revisioner"
@@ -1615,10 +1626,18 @@
 msgstr "fejl i filafbildning"
 
 #, python-format
+msgid "%s:%d: path to %s is missing\n"
+msgstr ""
+
+#, python-format
 msgid "%s:%d: %r already in %s list\n"
 msgstr "%s:%d: %r er allerede i %s listen\n"
 
 #, python-format
+msgid "%s:%d: superfluous / in %s %r\n"
+msgstr ""
+
+#, python-format
 msgid "%s:%d: unknown directive %r\n"
 msgstr "%s:%d: ukendt direktiv %r\n"
 
@@ -1802,8 +1821,8 @@
 msgid "unable to cope with svn output"
 msgstr "kan ikke håndtere svn output"
 
-msgid "XXX TAGS NOT IMPLEMENTED YET\n"
-msgstr "XXX MÆRKATER ER IKKE IMPLEMENTERET ENDNU\n"
+msgid "writing Subversion tags is not yet implemented\n"
+msgstr ""
 
 msgid "automatically manage newlines in repository files"
 msgstr "automatisk håndtering af linieskift i depotfiler"
@@ -2629,8 +2648,8 @@
 #, python-format
 msgid "*** the current per-user limit on the number of inotify watches is %s\n"
 msgstr ""
-"*** den nuværende grænse pr bruger for antallet af inotify overvågninger er %"
-"s\n"
+"*** den nuværende grænse pr bruger for antallet af inotify overvågninger er "
+"%s\n"
 
 msgid "*** this limit is too low to watch every directory in this repository\n"
 msgstr ""
@@ -3298,9 +3317,8 @@
 msgid "patch series already fully applied\n"
 msgstr "serien af rettelser er allerede anvendt fuldt ud\n"
 
-#, python-format
-msgid "patch '%s' not found"
-msgstr "gren '%s' blev ikke fundet"
+msgid "please specify the patch to move"
+msgstr "angiv venligst lappen der skal flyttes"
 
 msgid "cleaning up working directory..."
 msgstr "rydder op i arbejdskataloget..."
@@ -3436,10 +3454,18 @@
 msgid "patch %s does not exist"
 msgstr "rettelsen %s eksisterer ikke"
 
+#, python-format
+msgid "renaming %s to %s\n"
+msgstr "omdøber %s til %s\n"
+
 msgid "need --name to import a patch from -"
 msgstr "har brug for --name for at importere rettelse fra -"
 
 #, python-format
+msgid "unable to read file %s"
+msgstr "kan ikke læse filen %s"
+
+#, python-format
 msgid "adding %s to series file\n"
 msgstr "tilføjer %s til series filen\n"
 
@@ -3520,14 +3546,21 @@
 msgid ""
 "    To import a patch from standard input, pass - as the patch file.\n"
 "    When importing from standard input, a patch name must be specified\n"
-"    using the --name flag.\n"
-"    "
+"    using the --name flag."
 msgstr ""
 "    Brug - som patch filnavn for at importere en patch fra standard\n"
 "    indput. NÃ¥r der importeres fra standard indput skal der angivet et\n"
 "    patchnavn med --name tilvalget.\n"
 "    "
 
+msgid "    To import an existing patch while renaming it::"
+msgstr ""
+
+msgid ""
+"      hg qimport -e existing-patch -n new-name\n"
+"    "
+msgstr ""
+
 msgid "init a new queue repository (DEPRECATED)"
 msgstr "opret et nyt kø-depot (FORÆLDET)"
 
@@ -3845,10 +3878,6 @@
 msgid "A patch named %s already exists in the series file"
 msgstr "En rettelse ved navn %s eksisterer allerede i serien"
 
-#, python-format
-msgid "renaming %s to %s\n"
-msgstr "omdøber %s til %s\n"
-
 msgid "restore the queue state saved by a revision (DEPRECATED)"
 msgstr ""
 
@@ -3870,15 +3899,13 @@
 msgid "copy %s to %s\n"
 msgstr "kopier %s til %s\n"
 
-msgid "strip a changeset and all its descendants from the repository"
-msgstr "strip en ændring og alle dens efterkommere fra depotet"
-
-msgid ""
-"    The strip command removes all changesets whose local revision\n"
-"    number is greater than or equal to REV, and then restores any\n"
-"    changesets that are not descendants of REV. If the working\n"
-"    directory has uncommitted changes, the operation is aborted unless\n"
-"    the --force flag is supplied."
+msgid "strip changesets and all their descendants from the repository"
+msgstr "strip ændringer og alle deres efterkommere fra depotet"
+
+msgid ""
+"    The strip command removes the specified changesets and all their\n"
+"    descendants. If the working directory has uncommitted changes,\n"
+"    the operation is aborted unless the --force flag is supplied."
 msgstr ""
 
 msgid ""
@@ -4095,7 +4122,7 @@
 msgstr "kan ikke deponere henover en anvendt mq rettelse"
 
 msgid "source has mq patches applied"
-msgstr "målet har mq rettelser anvendt"
+msgstr "kilden har mq rettelser anvendt"
 
 #, python-format
 msgid "mq status file refers to unknown node %s\n"
@@ -4366,8 +4393,8 @@
 msgid "no backups"
 msgstr "ingen backupper"
 
-msgid "hg strip [-f] [-n] REV"
-msgstr "hg strip [-f] [-n] REV"
+msgid "hg strip [-f] [-n] REV..."
+msgstr "hg strip [-f] [-n] REV..."
 
 msgid "hg qtop [-s]"
 msgstr "hg qtop [-s]"
@@ -5115,6 +5142,12 @@
 msgid "cannot use both keepbranches and extrafn"
 msgstr "man kan ikke bruge både keepbranches og extrafn"
 
+msgid "rebasing"
+msgstr ""
+
+msgid " changesets"
+msgstr " ændringer"
+
 msgid "fix unresolved conflicts with hg resolve then run hg rebase --continue"
 msgstr "ret uløste konflikter med hg resolve og kør så hg rebase --continue"
 
@@ -5867,14 +5900,14 @@
 msgstr ""
 
 msgid ""
-"Zeroconf enabled repositories will be announced in a network without\n"
+"Zeroconf-enabled repositories will be announced in a network without\n"
 "the need to configure a server or a service. They can be discovered\n"
 "without knowing their actual IP address."
 msgstr ""
 
 msgid ""
-"To allow other people to discover your repository using run \"hg serve\"\n"
-"in your repository::"
+"To allow other people to discover your repository using run\n"
+":hg:`serve` in your repository::"
 msgstr ""
 
 msgid ""
@@ -5885,7 +5918,8 @@
 "  $ hg serve"
 
 msgid ""
-"You can discover zeroconf enabled repositories by running \"hg paths\"::"
+"You can discover Zeroconf-enabled repositories by running\n"
+":hg:`paths`::"
 msgstr ""
 
 msgid ""
@@ -6020,8 +6054,8 @@
 #, python-format
 msgid "%s has not been committed yet, so no copy data will be stored for %s.\n"
 msgstr ""
-"%s er endnu ikke comitted, så der vil ikke blive gemt kopieringsdata for %"
-"s.\n"
+"%s er endnu ikke comitted, så der vil ikke blive gemt kopieringsdata for "
+"%s.\n"
 
 msgid "no source or destination specified"
 msgstr "ingen kilde eller destination angivet"
@@ -6198,8 +6232,7 @@
 "         $ hg add\n"
 "         adding foo.c\n"
 "         $ hg status\n"
-"         A foo.c\n"
-"    "
+"         A foo.c"
 msgstr ""
 "         $ ls\n"
 "         foo.c\n"
@@ -6208,8 +6241,12 @@
 "         $ hg add\n"
 "         adding foo.c\n"
 "         $ hg status\n"
-"         A foo.c\n"
+"         A foo.c"
+
+msgid ""
+"    Returns 0 if all files are successfully added.\n"
 "    "
+msgstr ""
 
 msgid "add all new files, delete all missing files"
 msgstr "tilføj alle nye filer, fjern alle manglende filer"
@@ -6234,19 +6271,16 @@
 "    every added file and records those similar enough as renames. This\n"
 "    option takes a percentage between 0 (disabled) and 100 (files must\n"
 "    be identical) as its parameter. Detecting renamed files this way\n"
-"    can be expensive."
+"    can be expensive. After using this option, :hg:`status -C` can be\n"
+"    used to check which files were identified as moved or renamed."
 msgstr ""
 "    Brug -s/--similarity tilvalget for at opdage omdøbte filer. Med en\n"
 "    parameter større end 0 bliver hver fjernet fil sammenlignet med\n"
 "    enhver tilføjet fil og filer der er tilstrækkelig ens bliver\n"
 "    opført som omdøbte. Dette tilvalg tager et procenttal mellem 0\n"
 "    (slået fra) og 100 (filer skal være identiske) som parameter. At\n"
-"    opdage omdøbninger på denne måde kan være dyrt."
-
-msgid ""
-"    Returns 0 if all files are successfully added.\n"
-"    "
-msgstr ""
+"    opdage omdøbninger på denne måde kan være dyrt. Brug :hg:`status\n"
+"    -C` for at kontrollere hvilke filer der blev markeret som omdøbt."
 
 msgid "similarity must be a number"
 msgstr "lighedsgrad skal være et tal"
@@ -7217,20 +7251,20 @@
 
 msgid ""
 "    :``%%``: literal \"%\" character\n"
-"    :``%H``: changeset hash (40 bytes of hexadecimal)\n"
+"    :``%H``: changeset hash (40 hexadecimal digits)\n"
 "    :``%N``: number of patches being generated\n"
 "    :``%R``: changeset revision number\n"
 "    :``%b``: basename of the exporting repository\n"
-"    :``%h``: short-form changeset hash (12 bytes of hexadecimal)\n"
+"    :``%h``: short-form changeset hash (12 hexadecimal digits)\n"
 "    :``%n``: zero-padded sequence number, starting at 1\n"
 "    :``%r``: zero-padded changeset revision number"
 msgstr ""
 "    :``%%``: litteral \"%\" tegn\n"
-"    :``%H``: ændringshash (40 byte heksadecimal)\n"
+"    :``%H``: ændringshash (40 hexadecimale cifre)\n"
 "    :``%N``: antallet af rettelser som bliver genereret\n"
 "    :``%R``: revisionnummer for ændringen\n"
 "    :``%b``: grundnavn for det eksporterede depot\n"
-"    :``%h``: kortform ændringshash (12 byte heksadecimal)\n"
+"    :``%h``: kortform ændringshash (12 hexadecimale cifre)\n"
 "    :``%n``: nul-fyldt sekvensnummer, startende ved 1\n"
 "    :``%r``: nul-fyldt revisionsnummer for ændringen"
 
@@ -7427,6 +7461,14 @@
 msgstr "(ingen hjælpetekst tilgængelig)"
 
 #, python-format
+msgid "shell alias for::"
+msgstr "shellalias for::"
+
+#, python-format
+msgid "    %s"
+msgstr "    %s"
+
+#, python-format
 msgid "alias for: hg %s"
 msgstr "alias for: hg %s"
 
@@ -7859,12 +7901,8 @@
 "    :hg:`bundle`) operations."
 msgstr ""
 
-msgid ""
-"    See :hg:`help urls` for more information.\n"
-"    "
-msgstr ""
-"    Se :hg:`help urls` for mere information.\n"
-"    "
+msgid "    See :hg:`help urls` for more information."
+msgstr "    Se :hg:`help urls` for mere information."
 
 msgid "not found!\n"
 msgstr "ikke fundet!\n"
@@ -8517,6 +8555,9 @@
 msgid "tag names must be unique"
 msgstr "mærkatnavne skal være unikke"
 
+msgid "tag names cannot consist entirely of whitespace"
+msgstr "mærkater kan ikke bestå udelukkende af tomrum"
+
 msgid "--rev and --remove are incompatible"
 msgstr "--rev og --remove er inkompatible"
 
@@ -8584,12 +8625,12 @@
 msgstr "    Opdater depotets arbejdskatalog til den angivne ændring."
 
 msgid ""
-"    If no changeset is specified, attempt to update to the head of the\n"
-"    current branch. If this head is a descendant of the working\n"
+"    If no changeset is specified, attempt to update to the tip of the\n"
+"    current branch. If this changeset is a descendant of the working\n"
 "    directory's parent, update to it, otherwise abort."
 msgstr ""
 "    Hvis der ikke er angivet nogen ændring, forsøg da at opdatere til\n"
-"    spidsen af den nuværende gren. Hvis dette hoved nedstammer fra\n"
+"    spidsen af den nuværende gren. Hvis denne ændring nedstammer fra\n"
 "    arbejdskatalogets forælder, da opdateres der til det, ellers\n"
 "    afbrydes der."
 
@@ -9109,7 +9150,7 @@
 msgid "show topological heads only"
 msgstr ""
 
-msgid "show active branchheads only [DEPRECATED]"
+msgid "show active branchheads only (DEPRECATED)"
 msgstr "vis kun aktive gren-hoveder (FORÆLDET)"
 
 msgid "show normal and closed branch heads"
@@ -9564,24 +9605,24 @@
 msgstr "depotet er urelateret"
 
 #, python-format
-msgid "abort: push creates new remote heads on branch '%s'!\n"
-msgstr "afbrudt: skub laver nye hoveder på grenen '%s'!\n"
-
-msgid "abort: push creates new remote heads!\n"
-msgstr "afbrudt: skub laver nye fjern-hoveder!\n"
-
-msgid "(you should pull and merge or use push -f to force)\n"
-msgstr "(du skal hive og sammenføje eller bruge -f for at gennemtvinge)\n"
-
-msgid "(did you forget to merge? use push -f to force)\n"
-msgstr "(glemte du at sammenføje? brug push -f for at gennemtvinge)\n"
-
-#, python-format
-msgid "abort: push creates new remote branches: %s!\n"
-msgstr "afbrudt: skub laver nye grene i fjerndepotet: %s!\n"
-
-msgid "(use 'hg push --new-branch' to create new remote branches)\n"
-msgstr "(brug 'hg push --new-branch' for at lave nye grene i fjerndepotet)\n"
+msgid "push creates new remote branches: %s!"
+msgstr "skub laver nye grene i fjerndepotet: %s!"
+
+msgid "use 'hg push --new-branch' to create new remote branches"
+msgstr "brug 'hg push --new-branch' for at lave nye grene i fjerndepotet"
+
+#, python-format
+msgid "push creates new remote heads on branch '%s'!"
+msgstr "skub laver nye fjern-hoveder på grenen '%s'!"
+
+msgid "push creates new remote heads!"
+msgstr "skub laver nye fjern-hoveder!"
+
+msgid "you should pull and merge or use push -f to force"
+msgstr "du bør hive og sammenføje eller bruge -f for at gennemtvinge"
+
+msgid "did you forget to merge? use push -f to force"
+msgstr "glemte du at sammenføje? brug push -f for at gennemtvinge"
 
 msgid "note: unsynced remote changes!\n"
 msgstr "bemærk: usynkroniserede ændringer i fjernsystemet!\n"
@@ -9591,6 +9632,10 @@
 msgstr "afbrudt: %s\n"
 
 #, python-format
+msgid "(%s)\n"
+msgstr ""
+
+#, python-format
 msgid "hg: parse error at %s: %s\n"
 msgstr "hg: konfigurationsfejl på %s: %s\n"
 
@@ -9598,6 +9643,9 @@
 msgid "hg: parse error: %s\n"
 msgstr "hg: parse fejl: %s\n"
 
+msgid "entering debugger - type c to continue starting hg or h for help\n"
+msgstr ""
+
 #, python-format
 msgid ""
 "hg: command '%s' is ambiguous:\n"
@@ -9700,6 +9748,12 @@
 msgstr "ingen definition for alias '%s'\n"
 
 #, python-format
+msgid ""
+"error in definition for alias '%s': %s may only be given on the command "
+"line\n"
+msgstr ""
+
+#, python-format
 msgid "alias '%s' resolves to unknown command '%s'\n"
 msgstr "alias '%s' oversætter til ukendt kommando '%s'\n"
 
@@ -9712,6 +9766,10 @@
 msgstr "misdannet --config tilvalg: %r (brug --config sektion.navn=værdi)"
 
 #, python-format
+msgid "error getting current working directory: %s"
+msgstr "fejl ved opslag af nuværende arbejdskatalog: %s"
+
+#, python-format
 msgid "extension '%s' overrides commands: %s\n"
 msgstr "udvidelse '%s' overskriver kommandoer: %s\n"
 
@@ -9736,6 +9794,9 @@
 msgid "repository '%s' is not local"
 msgstr "depot '%s' er ikke lokalt"
 
+msgid "warning: --repository ignored\n"
+msgstr "advarsel: --repository ignoreret\n"
+
 msgid "invalid arguments"
 msgstr "ugyldige parametre"
 
@@ -9928,7 +9989,9 @@
 
 msgid ""
 "  not trusting file <repo>/.hg/hgrc from untrusted user USER, group GROUP"
-msgstr "  stoler ikke på filen <depot>/.hg/hgrc fra ubetroet bruger BRUGER, gruppe GRUPPE"
+msgstr ""
+"  stoler ikke på filen <depot>/.hg/hgrc fra ubetroet bruger BRUGER, gruppe "
+"GRUPPE"
 
 msgid ""
 "If this bothers you, the warning can be silenced (the file would still\n"
@@ -10304,7 +10367,7 @@
 "    a remote repository, since new heads may be created by these\n"
 "    operations. Note that the term branch can also be used informally\n"
 "    to describe a development process in which certain development is\n"
-"    done independently of other development.This is sometimes done\n"
+"    done independently of other development. This is sometimes done\n"
 "    explicitly with a named branch, but it can also be done locally,\n"
 "    using bookmarks or clones and anonymous branches."
 msgstr ""
@@ -10399,8 +10462,8 @@
 msgid ""
 "Changeset id\n"
 "    A SHA-1 hash that uniquely identifies a changeset. It may be\n"
-"    represented as either a \"long\" 40-byte hexadecimal string, or a\n"
-"    \"short\" 12-byte hexadecimal string."
+"    represented as either a \"long\" 40 hexadecimal digit string, or a\n"
+"    \"short\" 12 hexadecimal digit string."
 msgstr ""
 
 msgid ""
@@ -10547,7 +10610,7 @@
 "    Mercurial, that will be recorded in the next commit. The working\n"
 "    directory initially corresponds to the snapshot at an existing\n"
 "    changeset, known as the parent of the working directory. See\n"
-"    'Parents, working directory'. The state may be modified by changes\n"
+"    'Parent, working directory'. The state may be modified by changes\n"
 "    to the files introduced manually or by a merge. The repository\n"
 "    metadata exists in the .hg directory inside the working directory."
 msgstr ""
@@ -11101,8 +11164,7 @@
 
 msgid ""
 "``branch(set)``\n"
-"  The branch names are found for changesets in set, and the result is\n"
-"  all changesets belonging to one those branches."
+"  All changesets belonging to the branches of changesets in set."
 msgstr ""
 
 msgid ""
@@ -11127,12 +11189,12 @@
 
 msgid ""
 "``descendants(set)``\n"
-"  Changesets which are decendants of changesets in set."
+"  Changesets which are descendants of changesets in set."
 msgstr ""
 
 msgid ""
 "``file(pattern)``\n"
-"  Changesets which manually affected files matching pattern."
+"  Changesets affecting files matched by pattern."
 msgstr ""
 
 msgid ""
@@ -11172,18 +11234,24 @@
 msgstr ""
 
 msgid ""
+"``min(set)``\n"
+"  Changeset with lowest revision number in set."
+msgstr ""
+
+msgid ""
 "``merge()``\n"
 "  Changeset is a merge changeset."
 msgstr ""
 
 msgid ""
 "``modifies(pattern)``\n"
-"  Changesets which modify files matching pattern."
+"  Changesets modifying files matched by pattern."
 msgstr ""
 
 msgid ""
 "``outgoing([path])``\n"
-"  Changesets missing in path."
+"  Changesets not found in the specified destination repository, or the\n"
+"  default push location."
 msgstr ""
 
 msgid ""
@@ -11329,6 +11397,9 @@
 "    committed. Will be empty if the branch name was default."
 msgstr ""
 
+msgid ":children: List of strings. The children of the changeset."
+msgstr ""
+
 msgid ":date: Date information. The date when the changeset was committed."
 msgstr ""
 
@@ -11365,8 +11436,8 @@
 msgstr ""
 
 msgid ""
-":node: String. The changeset identification hash, as a 40-character\n"
-"    hexadecimal string."
+":node: String. The changeset identification hash, as a 40 hexadecimal\n"
+"    digit string."
 msgstr ""
 
 msgid ":parents: List of strings. The parents of the changeset."
@@ -11500,7 +11571,7 @@
 
 msgid ""
 ":short: Changeset hash. Returns the short form of a changeset hash,\n"
-"    i.e. a 12-byte hexadecimal string."
+"    i.e. a 12 hexadecimal digit string."
 msgstr ""
 
 msgid ":shortdate: Date. Returns a date like \"2006-09-18\"."
@@ -11799,21 +11870,6 @@
 msgid "'%s' uses newer protocol %s"
 msgstr "'%s' bruger nyere protokol %s"
 
-msgid "look up remote revision"
-msgstr ""
-
-msgid "unexpected response:"
-msgstr "uventet svar:"
-
-msgid "look up remote changes"
-msgstr ""
-
-msgid "push failed (unexpected response):"
-msgstr "skub fejlede (uventet svar):"
-
-msgid "remote: "
-msgstr "fjernsystem: "
-
 #, python-format
 msgid "push failed: %s"
 msgstr "skub fejlede: %s"
@@ -11912,6 +11968,9 @@
 "kan ikke deponere en sammenføjning partielt (undgå at specificere filer "
 "eller mønstre)"
 
+msgid "can't commit subrepos without .hgsub"
+msgstr "kan ikke deponere underdepoter uden .hgsub"
+
 msgid "file not found!"
 msgstr "filen blev ikke fundet!"
 
@@ -12117,6 +12176,9 @@
 msgid "&Deleted"
 msgstr ""
 
+msgid "updating"
+msgstr "opdaterer"
+
 #, python-format
 msgid "update failed to remove %s: %s!\n"
 msgstr "opdatering kunne ikke fjerne %s: %s!\n"
@@ -12264,6 +12326,14 @@
 msgstr "tilføjer gren\n"
 
 #, python-format
+msgid "strip failed, full bundle stored in '%s'\n"
+msgstr ""
+
+#, python-format
+msgid "strip failed, partial bundle stored in '%s'\n"
+msgstr ""
+
+#, python-format
 msgid "cannot %s; remote repository does not support the %r capability"
 msgstr "kan ikke %s: fjerdepotet understøtter ikke %r egenskaben"
 
@@ -12322,9 +12392,6 @@
 msgid "missing argument"
 msgstr "manglende parameter"
 
-msgid "can't negate that"
-msgstr ""
-
 #, python-format
 msgid "can't use %s here"
 msgstr ""
@@ -12409,6 +12476,9 @@
 msgid "tagged takes no arguments"
 msgstr ""
 
+msgid "can't negate that"
+msgstr ""
+
 msgid "not a symbol"
 msgstr ""
 
@@ -12441,13 +12511,16 @@
 msgid "no suitable response from remote hg"
 msgstr "intet brugbart svar fra fjernsystemets hg"
 
+msgid "remote: "
+msgstr "fjernsystem: "
+
+msgid "unexpected response:"
+msgstr "uventet svar:"
+
 #, python-format
 msgid "push refused: %s"
 msgstr "skub afvist: %s"
 
-msgid "unsynced changes"
-msgstr ""
-
 #, python-format
 msgid "'%s' does not appear to be an hg repository"
 msgstr "'%s' ser ikke ud til at være et hg depot"
@@ -12470,6 +12543,10 @@
 msgstr "manglende ] i underdepot kilde"
 
 #, python-format
+msgid "bad subrepository pattern in %s: %s"
+msgstr ""
+
+#, python-format
 msgid ""
 " subrepository sources for %s differ\n"
 "use (l)ocal source (%s) or (r)emote source (%s)?"
@@ -12589,6 +12666,10 @@
 msgid "username %s contains a newline\n"
 msgstr "brugernavn %s indeholder et linieskift\n"
 
+#, python-format
+msgid "(deprecated '%%' in path %s=%s from %s)\n"
+msgstr ""
+
 msgid "response expected"
 msgstr "svar forventet"
 
@@ -12881,8 +12962,14 @@
 msgid "user name not available - set USERNAME environment variable"
 msgstr "der er ikke noget brugernavn - sæt USERNAME miljøvariabel"
 
-#~ msgid "failed to update bookmark %s!\n"
-#~ msgstr "kunne ikke opdatere bogmærke %s!\n"
-
-#~ msgid "can't merge with ancestor"
-#~ msgstr "kan ikke sammenføje med forfader"
+msgid "look up remote revision"
+msgstr ""
+
+msgid "look up remote changes"
+msgstr ""
+
+msgid "push failed:"
+msgstr "skub fejlede:"
+
+msgid "push failed (unexpected response):"
+msgstr "skub fejlede (uventet svar):"
--- a/i18n/de.po	Wed Sep 22 17:13:49 2010 -0500
+++ b/i18n/de.po	Wed Sep 22 18:29:41 2010 -0500
@@ -1,31 +1,45 @@
 # German translations for Mercurial
 # Deutsche Übersetzungen für Mercurial
 # Copyright (C) 2009 Matt Mackall and others
-# 
-# Ãœbersetzungen
-# =============
-# branch	Zweig/Verzweigung
-# bundle	Bündel
-# change	Änderung
-# changeset	Änderungssatz
-# check out	auschecken
-# commit	Version
-# commit (v)	übernehmen
-# deprecated	veraltet
-# hook		Aktion
-# merge		zusammenführen
-# notation	Schreibweise
-# repository	(Projekt)archiv
+#
+# Ãœbersetzungshilfen
+# ==================
+#
+# Der Benutzer sollte mit formeller Anrede angesprochen werden. Je nach
+# Fall kann aber auch eine unpersönliche Anrede ("man") verwendet werden.
+#
+# Deutsche Begriffe sind fein, man sollte es aber nicht übertreiben. Ein
+# Hilfstext à la "Beim Versionieren von Etiketten auf Zweigen" hilft
+# niemandem. Erfahrene Benutzer sind kurz irritiert, weil sie bekannte
+# Begriffe vermissen, während neue Nutzer sich eh noch nichts unter den
+# Begriffen vorstellen können und entweder `hg help` oder Google bemühen
+# müssen.
+# Gleichzeitig bringt fördert Suche nach "Mercurial Etikett" wenig
+# Brauchbares zu Tage.
+# Hier sollten diese krassen Eindeutschungen nur in der Erklärung zu "tag"
+# verwendet, sonst aber eher vermieden werden.
+#
+# branch        Branch/Zweig/Verzweigung
+# bundle        Bündel
+# change        Änderung
+# changeset     Änderungssatz
+# check out     auschecken
+# commit        Commit
+# commit (v)    übernehmen
+# deprecated    veraltet
+# hook          Aktion
+# merge         zusammenführen
+# notation      Schreibweise
+# repository    Projektarchiv
 # manage/track  versionieren
-# 
-# Die Koordination der Ãœbersetzung erfolgt auf https://bitbucket.org/FabianKreutz/hg-i18n-de/
+#
 msgid ""
 msgstr ""
 "Project-Id-Version: Mercurial\n"
 "Report-Msgid-Bugs-To: <mercurial-devel@selenic.com>\n"
 "POT-Creation-Date: 2009-11-13 10:15+0200\n"
-"PO-Revision-Date: 2009-10-20 18:09+0200\n"
-"Last-Translator: Fabian Kreutz <fabian.kreutz@starnet.fi>\n"
+"PO-Revision-Date: 2010-09-13 03:38+0100\n"
+"Last-Translator: Christoph Mewes <christoph@webvariants.de>\n"
 "Language-Team: German (Tobias Bell, Fabian Kreutz, Lutz Horn)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -209,11 +223,17 @@
 "a file is compatible with the unified format of GNU diff, which can be\n"
 "used by GNU patch and many other standard tools."
 msgstr ""
+"Das Standardformat von Mercurial für das Anzeigen von Änderungen\n"
+"zwischen zwei Versionen einer Datei ist mit dem Unified-Format von GNU\n"
+"diff kompatibel und kann mit GNU patch und vielen anderen\n"
+"Standard-Werkzeugen genutzt werden."
 
 msgid ""
 "While this standard format is often enough, it does not encode the\n"
 "following information:"
 msgstr ""
+"Obwohl das Standarformat oft ausreichend ist, kodiert es nicht die\n"
+"folgenden Informationen:"
 
 msgid ""
 "- executable status and other permission bits\n"
@@ -221,6 +241,10 @@
 "- changes in binary files\n"
 "- creation or deletion of empty files"
 msgstr ""
+"- Ausführbarkeit und andere Berechtigungen\n"
+"- Kopier- oder Verschiebeoperationen\n"
+"- Änderungen in Binärdateien\n"
+"- Erstellen/Löschen leerer Dateien"
 
 msgid ""
 "Mercurial also supports the extended diff format from the git VCS\n"
@@ -228,6 +252,10 @@
 "by default because a few widespread tools still do not understand this\n"
 "format."
 msgstr ""
+"Mercurial unterstützt auch das erweiterte diff-Format vom Git VCS,\n"
+"das diese Einschränkungen nicht aufweist. Das Git-Format wird nicht\n"
+"standardmäßig erzeugt, da einige weit verbreitete Werkzeuge es noch\n"
+"nicht unterstützen."
 
 msgid ""
 "This means that when generating diffs from a Mercurial repository\n"
@@ -238,6 +266,13 @@
 "pull) are not affected by this, because they use an internal binary\n"
 "format for communicating changes."
 msgstr ""
+"Das bedeutet, dass beim Erzeugen von Diffs für ein Mercurial\n"
+"Projektarchiv (z.B. mit \"hg export\") auf Operationen wie Kopieren,\n"
+"Verschieben und die anderen oben genannten Dinge achten sollte,\n"
+"da beim Anwenden eines Standard-Diffs auf ein anderes Projektarchiv\n"
+"diese Zusatzinformationen verlorengehen. Mercurials interne Operationen\n"
+"(wie Push und Pull) sind davon nicht betroffen, da sie über ein\n"
+"internes, binäres Format zur Kommunikation verwenden."
 
 msgid ""
 "To make Mercurial produce the git extended diff format, use the --git\n"
@@ -245,6 +280,11 @@
 "section of your hgrc. You do not need to set this option when\n"
 "importing diffs in this format or using them in the mq extension.\n"
 msgstr ""
+"Um Mercurial dazu zu bringen, das erweiterte Git-Format zu erzeugen,\n"
+"kann man entweder den für viele Befehle verfügbaren Schalter --git\n"
+"verwenden werden oder 'git = True' in der Sektion [diff] in der\n"
+"hgrc angeben. Wenn Diffs in diesem Format importiert oder mit der mq\n"
+"Erweiterung genutzt werden, muss diese Option nicht angegeben werden.\n"
 
 msgid ""
 "HG\n"
@@ -254,14 +294,23 @@
 "    'hg' (with %PATHEXT% [defaulting to COM/EXE/BAT/CMD] extensions on\n"
 "    Windows) is searched."
 msgstr ""
+"HG\n"
+"    Pfad zur 'hg' Programmdatei, wird automatisch beim Ausführen von\n"
+"    Hooks, Erweiterungen oder externen Werkzeugen übergeben. Wenn nicht\n"
+"    gesetzt oder leer, wird der Name der hg Programmdatei genommen,\n"
+"    wenn dieser eingefroren ist, oder eine Programmdatei namens 'hg'\n"
+"    (mit $PATHEXT% [standardmäßig auf COM/EXE/BAT/CMD gesetzt] als\n"
+"    Erweiterung unter Windows) gesucht."
 
 msgid ""
 "HGEDITOR\n"
 "    This is the name of the editor to run when committing. See EDITOR."
 msgstr ""
+"HGEDITOR\n"
+"    Dies ist der Name des Editors, der zum Bearbeiten der    Versions-Meldung verwendet wird. Siehe auch EDITOR."
 
 msgid "    (deprecated, use .hgrc)"
-msgstr ""
+msgstr "    (veraltet, benutze .hgrc)"
 
 msgid ""
 "HGENCODING\n"
@@ -270,6 +319,11 @@
 "    changeset descriptions, tag names, and branches. This setting can\n"
 "    be overridden with the --encoding command-line option."
 msgstr ""
+"HGENCODING\n"
+"    Dies überschreibt die von Mercurial ermittelte Standard-\n"
+"    Lokalisierung. Diese Einstellung wird zum Konvertieren von\n"
+"    Benutzernamen, Versions-Meldungen, Etiketten und Zweigen. Diese\n"
+"    Einstellung kann über den Schalter --encoding überschrieben werden."
 
 msgid ""
 "HGENCODINGMODE\n"
@@ -280,6 +334,14 @@
 "    \"ignore\", which drops them. This setting can be overridden with\n"
 "    the --encodingmode command-line option."
 msgstr ""
+"HGENCODINGMODE\n"
+"    Dieses steuert, wie sich Mercurial beim Auftreten unbekannter Zeichen\n"
+"    verhält, wenn es Benutzereingaben verarbeitet. Der Standard ist\n"
+"    \"strict\", das zu einem Abbruch führt, wenn ein Zeichen nicht erkannt\n"
+"    werden konnte. Andere Einstellungen sind \"replace\", das unbekannte\n"
+"    Zeichen ersetzt, und \"ignore\", das diese Zeichen verwirft. Diese\n"
+"    Einstellung kann über den Schalter --encondingmode auf der\n"
+"    Kommandozeile überschrieben werden."
 
 msgid ""
 "HGMERGE\n"
@@ -287,6 +349,10 @@
 "    will be executed with three arguments: local file, remote file,\n"
 "    ancestor file."
 msgstr ""
+"HGMERGE\n"
+"    Die Programmdatei, die zum Lösen von Konflikten verwendet werden\n"
+"    soll. Das Programm wird mit drei Argumenten aufgerufen: die lokale\n"
+"    Datei, die entfernte Datei und die Vorgängerdatei."
 
 msgid ""
 "HGRCPATH\n"
@@ -295,20 +361,34 @@
 "    platform default search path is used. If empty, only the .hg/hgrc\n"
 "    from the current repository is read."
 msgstr ""
+"HGRCPATH\n"
+"    Eine Liste von Dateien oder Verzeichnissen, in denen nach hgrc-\n"
+"    Dateien gesucht werden soll. Als Trenner zwischen zwei Elementen\n"
+"    dient \":\" unter Unix und \";\" unter Windows. Wenn HGRCPATH nicht\n"
+"    gesetzt ist, wird der plattformspezifische Standardwert verwendet.\n"
+"    Wenn die Variable gesetzt, aber leer ist, wird nur .hg/hgrc aus dem\n"
+"    aktuellen Projektarchiv ausgewertet."
 
 msgid "    For each element in HGRCPATH:"
-msgstr ""
+msgstr "   Für jedes Element in HGRCPATH gilt:"
 
 msgid ""
 "    - if it's a directory, all files ending with .rc are added\n"
 "    - otherwise, the file itself will be added"
 msgstr ""
+"    - Wenn es ein Verzeichnis ist, werden alle Dateien, die auf .rc\n"
+"      enden, hinzugefügt.\n"
+"    - Ansonsten wird die Datei selbst hinzugefügt."
 
 msgid ""
 "HGUSER\n"
 "    This is the string used as the author of a commit. If not set,\n"
 "    available values will be considered in this order:"
 msgstr ""
+"HGUSER\n"
+"    Diese Angabe wird als Autor von Commits verwendet. Wenn sie nicht\n"
+"    gesetzt ist, werden die verfügbaren Werte in der folgenden\n"
+"    Reihenfolge ausgewertet:"
 
 msgid ""
 "    - HGUSER (deprecated)\n"
@@ -317,21 +397,33 @@
 "    - interactive prompt\n"
 "    - LOGNAME (with ``@hostname`` appended)"
 msgstr ""
+"    - HGUSER (veraltet)\n"
+"    - hgrc-Dateien aus dem HGRCPATH\n"
+"    - EMAIL\n"
+"    - Wert aus einer ineraktiven Eingabeaufforderung\n"
+"    - LOGNAME (mit angefügtem ``@hostname``)"
 
 msgid ""
 "EMAIL\n"
 "    May be used as the author of a commit; see HGUSER."
 msgstr ""
+"EMAIL\n"
+"    Kann als Autor eines Commits verwendet werden; siehe auch HGUSER."
 
 msgid ""
 "LOGNAME\n"
 "    May be used as the author of a commit; see HGUSER."
 msgstr ""
+"LOGNAME\n"
+"    Kann als Autor eines Commits verwendet werden; siehe auch HGUSER."
 
 msgid ""
 "VISUAL\n"
 "    This is the name of the editor to use when committing. See EDITOR."
 msgstr ""
+"VISUAL\n"
+"    Dies ist der Name des Editors, der beim Erzeugen eines Commits\n"
+"    verwendet werden soll. Siehe auch EDITOR."
 
 msgid ""
 "EDITOR\n"
@@ -342,12 +434,23 @@
 "    non-empty one is chosen. If all of them are empty, the editor\n"
 "    defaults to 'vi'."
 msgstr ""
+"EDITOR\n"
+"    Manchmal muss Mercurial eine Textdatei in einem Editor öffnen, damit\n"
+"    der Nutzer sie bearbeiten kann, zum Beispiel when eine Commit-\n"
+"    Nachricht geschrieben wird. Der verwendete Editor wird aus den drei\n"
+"    Umgebungsvariablen HGEDITOR, VISUAL und EDITOR (in dieser Reihenfolge)\n"
+"    ermittelt. Der erste nicht-leere wird verwendet. Wenn alle Angaben\n"
+"    leer sind, wird der Standard 'vi' verwendet."
 
 msgid ""
 "PYTHONPATH\n"
 "    This is used by Python to find imported modules and may need to be\n"
 "    set appropriately if this Mercurial is not installed system-wide.\n"
 msgstr ""
+"PYTHONPATH\n"
+"    Dies wird von Python genutzt, um importierte Module zu finden, und\n"
+"    muss entsprechend angepasst werden, wenn Mercurial nicht\n"
+"    systemweit installiert ist.\n"
 
 msgid ""
 "Mercurial has the ability to add new features through the use of\n"
@@ -355,6 +458,10 @@
 "existing commands, change the default behavior of commands, or\n"
 "implement hooks."
 msgstr ""
+"Mercurial hat die Fähigkeit, neue Funktionen über Erweiterungen\n"
+"einzubinden. Erweiterungen können neue Befehle oder Schalter für\n"
+"bestehende Befehle hinzufügen, das Standardverhalten ändern\n"
+"oder Hooks implementieren."
 
 msgid ""
 "Extensions are not loaded by default for a variety of reasons:\n"
@@ -365,30 +472,46 @@
 "Mercurial. It is thus up to the user to activate extensions as\n"
 "needed."
 msgstr ""
+"Erweiterungen werden aus einer Vielzahl von Gründen nicht standardmäßig\n"
+"geladen: Sie können die Startzeit verlängern; sie können nur für\n"
+"erweiterte Nutzung gedacht sein; sie können möglicherweise gefährliche\n"
+"Fähigkeiten (wie das Zerstören oder Verändern der Projektgeschichte)\n"
+"bereitstellen; sie können noch nicht für den allgemeinen Einsatz bereit\n"
+"sein; oder sie verändern das übliche Verhalten des Kerns von Mercurial.\n"
+"Daher müssen Erweiterungen erst vom Benutzer bei Bedarf aktiviert werden."
 
 msgid ""
 "To enable the \"foo\" extension, either shipped with Mercurial or in\n"
 "the Python search path, create an entry for it in your hgrc, like\n"
 "this::"
 msgstr ""
+"Um die Erweiterung \"foo\", die entweder mit Mercurial ausgeliefert wird\n"
+"oder sich im Python-Suchpfad befindet, zu aktivieren, erstellen Sie einen\n"
+"Eintrag wie den folgenden in Ihrer hgrc::"
 
 msgid ""
 "  [extensions]\n"
 "  foo ="
 msgstr ""
+"  [extensions]\n"
+"  foo ="
 
 msgid "You may also specify the full path to an extension::"
-msgstr ""
+msgstr "Sie können auch den vollen Pfad zu einer Erweiterung angeben::"
 
 msgid ""
 "  [extensions]\n"
 "  myfeature = ~/.hgext/myfeature.py"
 msgstr ""
+"  [extensions]\n"
+"  meinefunktion = ~/.hgext/meinefunktion.py"
 
 msgid ""
 "To explicitly disable an extension enabled in an hgrc of broader\n"
 "scope, prepend its path with !::"
 msgstr ""
+"Um eine Erweiterung explizit zu deaktivieren, die von einer allgemeineren\n"
+"hgrc aktiviert wurde, setzen Sie ein ! vor den Pfad::"
 
 msgid ""
 "  [extensions]\n"
@@ -397,6 +520,11 @@
 "  # ditto, but no path was supplied for extension baz\n"
 "  baz = !\n"
 msgstr ""
+"  [extensions]\n"
+"  # deaktiviert die Erweiterung bar, die im Verzeichnis\n"
+"  # /pfad/zur/erweiterung/bar.py liegt  bar = !/pfad/zur/erweiterung/bar.py\n"
+"  # ditto, aber es wurde kein Pfad für die Erweiterung baz angegeben\n"
+"  baz = !\n"
 
 msgid ""
 "When Mercurial accepts more than one revision, they may be specified\n"
@@ -589,36 +717,55 @@
 "line, via the --template option, or select an existing\n"
 "template-style (--style)."
 msgstr ""
+"Mercurial erlaubt es Ihnen, die Ausgabe von Befehlen mit Vorlagen\n"
+"anzupassen. Sie können eine Vorlage entweder über die Kommandozeile\n"
+"(über den Schalter --template) angeben, oder einen vorhandenen\n"
+"Vorlagenstil auswählen (--style)."
 
 msgid ""
 "You can customize output for any \"log-like\" command: log,\n"
 "outgoing, incoming, tip, parents, heads and glog."
 msgstr ""
+"Sie können die Ausgabe für jeden \"log-ähnlichen\" Befehl anpassen:\n"
+"log, outgoing, incoming, tip, parents, heads und glog."
 
 msgid ""
 "Three styles are packaged with Mercurial: default (the style used\n"
 "when no explicit preference is passed), compact and changelog.\n"
 "Usage::"
 msgstr ""
+"Drei Stile werden mit Mercurial mitgeliefert: default (der Stil, der\n"
+"genutzt wird, wenn kein anderer explizit angegeben wird), compact und\n"
+"changelog. Benutzung::"
 
 msgid "    $ hg log -r1 --style changelog"
-msgstr ""
+msgstr "    $ hg log -r1 --style changelog"
 
 msgid ""
 "A template is a piece of text, with markup to invoke variable\n"
 "expansion::"
 msgstr ""
-
-msgid ""
-"    $ hg log -r1 --template \"{node}\\n\"\n"
+"Ein Template ist ein Stück Text, das Markierungen enthält, die bei der\n"
+"Ausgabe mit den eigentlichen Informationen ersetzt werden::"
+
+msgid ""
+"    $ hg log -r1 --template \"{node}\\n"
+"\"\n"
 "    b56ce7b07c52de7d5fd79fb89701ea538af65746"
 msgstr ""
+"    $ hg log -r1 --template \"{node}\\n"
+"\"\n"
+"    b56ce7b07c52de7d5fd79fb89701ea538af65746"
 
 msgid ""
 "Strings in curly braces are called keywords. The availability of\n"
 "keywords depends on the exact context of the templater. These\n"
 "keywords are usually available for templating a log-like command:"
 msgstr ""
+"Zeichenketten in geschweiften Klammern werden als Schlüsselwörter\n"
+"bezeichnet. Die Verfügbarkeit von Schlüsselwörtern hängt von dem\n"
+"ausgeführten Befehl ab. Diese Schlüsselwörter stehen üblicherweise für\n"
+"Vorlagen von \"log-ähnlichen\" Befehlen zur Verfügung:"
 
 msgid ""
 ":author:    String. The unmodified author of the changeset.\n"
@@ -646,6 +793,31 @@
 "            changeset.\n"
 ":latesttagdistance: Integer. Longest path to the latest tag."
 msgstr ""
+":author:    Zeichenkette. Der unveränderte Autor eines Änderungssatzes.\n"
+":branches:  Zeichenkette. Der Name des Branches, in dem der Änderungssatz\n"
+"            versioniert wurde. Ist leer, wenn der Branch-Name default\n"
+"            ist.\n"
+":date:      Datumsangabe. Das Datum, wann ein Änderungssatz versioniert\n"
+"            wurde.\n"
+":desc:      Zeichenkette. Der Text der Beschreibung eines\n"
+"            Änderungssatzes.\n"
+":diffstat:  Zeichenkette. Statistik über die Änderungen in dem folgenden\n"
+"            Format: \"geänderte Dateien: +hinzugefügt/-entfernte Zeilen\"\n"
+":files:     Liste von Zeichenketten. Alle geänderten, hinzugefügten oder\n"
+"            gelöschten Dateien dieses Änderungssatzes.\n"
+":file_adds: Liste von Zeichenketten. Alle hinzugefügten Dateien.\n"
+":file_mods: Liste von Zeichenketten. Alle geänderten Dateien.\n"
+":file_dels: Liste von Zeichenketten. Alle gelöschten Dateien.\n"
+":node:      Zeichenkette. Die Prüfsumme, die einen Änderungssatz\n"
+"            identifiziert, als 40 Zeichen lange hexadezimale Zeichenkette.\n"
+":parents:   Liste von Zeichenketten. Die Eltern des Änderungssatzes.\n"
+":rev:       Zahl. Die für dieses Projektarchiv geltende Nummer eines\n"
+"            Änderungssatzes.\n"
+":tags:      Liste von Zeichenketten. Alle Tags, die diesem Änderungssatz\n"
+"            zugewiesen wurden.\n"
+":latesttag: Zeichenkette. Aktuellstes globales Tag in den Nachfahren\n"
+"            dieses Änderungssatzes.\n"
+":latesttagdistance: Zahl. Längster Pfad zum aktuellsten Tag."
 
 msgid ""
 "The \"date\" keyword does not produce human-readable output. If you\n"
@@ -654,14 +826,23 @@
 "variable. You can also use a chain of filters to get the desired\n"
 "output::"
 msgstr ""
-
-msgid ""
-"   $ hg tip --template \"{date|isodate}\\n\"\n"
+"Das \"date\" Schlüsselwort erzeugt keine menschenlesbare Ausgabe. Wenn\n"
+"Sie ein Datum in Ihrer Ausgabe verwenden wollen, können Sie einen Filter\n"
+"einsetzen, um es zu verarbeiten. Filter sind Funktionen, die eine\n"
+"Zeichenkette basierend auf der Eingabe-Variablen zurückgeben. Sie können\n"
+"auch mehrere Filter verketten, um das gewünschte Ergebnis zu erhalten::"
+
+msgid ""
+"   $ hg tip --template \"{date|isodate}\\n"
+"\"\n"
 "   2008-08-21 18:22 +0000"
 msgstr ""
+"   $ hg tip --template \"{date|isodate}\\n"
+"\"\n"
+"   2008-08-21 18:22 +0000"
 
 msgid "List of filters:"
-msgstr ""
+msgstr "Liste aller Filter:"
 
 msgid ""
 ":addbreaks:   Any text. Add an XHTML \"<br />\" tag before the end of\n"
@@ -718,6 +899,69 @@
 ":user:        Any text. Returns the user portion of an email\n"
 "              address.\n"
 msgstr ""
+":addbreaks:   Beliebiger Text. Führt ein XHTML \"<br />\"-Tag vor das\n"
+"              Ende jeder Zeile bis auf die letzte ein.\n"
+":age:         Datumsangabe. Gibt eine menschenlesbare Datums- und\n"
+"              Zeitdifferenz zwischen dem gegebenen Datum und der\n"
+"              aktuellen Zeit aus.\n"
+":basename:    Beliebiger Text. Behandelt jeden Text als Pfadangabe und\n"
+"              gibt den letzten Bestandteil des Pfades nach dem Auftrennen\n"
+"              mit dem Trennzeichen für Verzeichnisse zurück (überhängende\n"
+"              Trenner werden ignoriert). Zum Beispiel wird aus\n"
+"              \"foo/bar/baz\" dann \"baz\" und \"foo/bar//\" wird zu\n"
+"              \"bar\".\n"
+":stripdir:    Behandelt den Text als Pfadangabe und entfernt das letzte\n"
+"              Verzeichnis, wenn möglich. Zum Beispiel wird aus \"foo\"\n"
+"              und \"foo/bar//\" dann \"bar\".\n"
+":date:        Datumsangabe. Gibt ein Datum als Unix Datum zurück,\n"
+"              inklusive der Zeitzone: \"Mon Sep 04 15:13:13 2006 0700\".\n"
+":domain:      Beliebiger Text. Findet die erste Zeichenkette, die wie\n"
+"              eine E-Mail-Adresse aussieht, und extrahiert davon die\n"
+"              Domain-Komponente:\n"
+"              Beispiel: ``Nutzer <user@example.com>`` wird zu\n"
+"              ``example.com``.\n"
+":domain:      Beliebiger Text. Extrahiert die erste Zeichenkette, die wie\n"
+"              eine E-Mail-Adresse aussieht.\n"
+"              Beispiel: ``Nutzer <user@example.com>`` wird zu\n"
+"              ``user@example.com``.\n"
+":escape:      Beliebiger Text. Ersetzt die besonderen XML/XHTML-Zeichen\n"
+"              \"&\", \"<\" und \">\" mit XML-Entitäten.\n"
+":fill68:      Beliebiger Text. Umbricht den Text bei 68 Zeichen.\n"
+":fill76:      Beliebiger Text. Umbricht den Text bei 76 Zeichen.\n"
+":firstline:   Beliebiger Text. Gibt die erste Zeile des Texts zurück.\n"
+":nonempty:    Beliebiger Text. Gibt '(none)' für eine leere Zeichenkette\n"
+"              zurück.\n"
+":hgdate:      Datumsangabe. Gibt das Datum als Zahlpaar zurück:\n"
+"              \"1157407993 25200\" (Unix Zeitstempel,\n"
+"              Zeitzonenverschiebung)\n"
+":isodate:     Datumsangabe. Gibt das Datum im ISO 8601-Format zurück:\n"
+"              \"2009-08-18 13:00 +0200\".\n"
+":isodatesec:  Datumsangabe. Gibt das Datum im ISO 8601-Format inklusive\n"
+"              Sekunden zurück: \"2009-08-18 13:00 +0200\". Siehe auch\n"
+"              den rfc3339date-Filter.\n"
+":localdate:   Datumsangabe. Konvertiert ein Datum in das lokale\n"
+"              Datumsformat.\n"
+":obfuscate:   Beliebiger Text. Gibt den Text als Folge von XML-Entitäten\n"
+"              zurück.\n"
+":person:      Beliebiger Text. Gibt den Text vor einer E-Mail-Adresse\n"
+"              zurück.\n"
+":rfc822date:  Datumsangabe. Gibt das Datum im gleichen Format zurück,\n"
+"              das auch in Kopfzeilen von E-Mails verwendet wird:\n"
+"              \"Tue, 18 Aug 2009 13:00:13 +0200\".\n"
+":rfc3339date: Datumsangabe. Gibt das Datum im Internet-Datumsformat,\n"
+"              spezifiziert im RFC 3339, zurück:\n"
+"              \"2009-08-18T13:00:13+02:00\".\n"
+":short:       Prüfsumme. Gibt die Kurzform der Prüfsumme zurück, d.h.\n"
+"              als 12 Zeichen lange hexadezimale Zeichenkette.\n"
+":shortdate:   Datumsangabe. Gibt ein Datum wie \"2006-09-18\" zurück.\n"
+":strip:       Beliebiger Text. Entfernt jeden führenden und überhängenden\n"
+"              Leerraum.\n"
+":tabindent:   Beliebiger Text. Gibt den Text zurück, wobei jede Zeile bis\n"
+"              auf die erste mit einem Tabulator eingerückt ist.\n"
+":urlescape:   Beliebiger Text. Maskiert alle \"besonderen\" Zeichen.\n"
+"              Aus \"foo bar\" wird zum Beispiel \"foo%20bar\".\n"
+":users:       Beliebiger Text. Gibt den Nutzerteil einer E-Mail-Adresse\n"
+"              (vor dem @-Zeichen) zurück.\n"
 
 msgid "Valid URLs are of the form::"
 msgstr "Gültige URLs haben folgende Form::"
@@ -1066,7 +1310,7 @@
 msgstr "Benennt ein gegebenes Lesezeichen um"
 
 msgid "hg bookmarks [-f] [-d] [-m NAME] [-r REV] [NAME]"
-msgstr ""
+msgstr "hg bookmarks [-f] [-d] [-m NAME] [-r REV] [NAME]"
 
 msgid "hooks for integrating with the Bugzilla bug tracker"
 msgstr "Bugzilla integration"
@@ -1227,10 +1471,14 @@
 
 msgid ""
 "  Default 'changeset {node|short} in repo {root} refers '\n"
-"          'to bug {bug}.\\ndetails:\\n\\t{desc|tabindent}'"
-msgstr ""
-"  Standard: 'Änderung {node|short} in Archiv {root} erwähnt Bug {bug}.\\n'\n"
-"            'Details:\\n\\t{desc|tabindent}'"
+"          'to bug {bug}.\\n"
+"details:\\n"
+"\\t{desc|tabindent}'"
+msgstr ""
+"  Standard: 'Änderung {node|short} in Archiv {root} erwähnt Bug {bug}.\\n"
+"'\n"
+"            'Details:\\n"
+"\\t{desc|tabindent}'"
 
 msgid ""
 "strip\n"
@@ -1313,8 +1561,10 @@
 "    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"
+"             {hgweb}/{webroot}/rev/{node|short}\\n"
+"\n"
+"             {desc}\\n"
+"\n"
 "    strip=5"
 msgstr ""
 "    [bugzilla]\n"
@@ -1323,8 +1573,12 @@
 "    version=3.0\n"
 "    bzuser=unknown@domain.com\n"
 "    bzdir=/opt/bugzilla-3.2\n"
-"    template=Änderung {node|short} in Archiv {root|basename}.\\n\n"
-"{hgweb}/{webroot}/rev/{node|short}\\n\\n{desc}\\n\n"
+"    template=Änderung {node|short} in Archiv {root|basename}.\\n"
+"\n"
+"{hgweb}/{webroot}/rev/{node|short}\\n"
+"\\n"
+"{desc}\\n"
+"\n"
 "    strip=5"
 
 msgid ""
@@ -10413,14 +10667,17 @@
 "\n"
 "    "
 
+#, fuzzy
 msgid "create changeset information from CVS"
-msgstr ""
+msgstr "erstellt Änderungssätze aus CVS"
 
 msgid ""
 "    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."
 msgstr ""
+"    Dieser Befehl ist als Debuggingwerkzeug für den Konverter von CVS zu\n"
+"    Mercurial gedacht und kann als direkte Ersetzung für cvsps dienen."
 
 msgid ""
 "    Hg debugcvsps reads the CVS rlog for current directory (or any\n"
@@ -10428,6 +10685,10 @@
 "    series of changesets based on matching commit log entries and\n"
 "    dates."
 msgstr ""
+"    Hg debugcvsps liest das CVS-Logbuch für das aktuelle Verzeichnis\n"
+"    (oder jedes angegebene Verzeichnis) aus dem CVS-Projektarchiv aus\n"
+"    und konvertiert den Log in eine Serie von Änderungssetzen,\n"
+"    basierend auf übereinstimmenden Log-Einträgen und Datumsangaben."
 
 msgid "username mapping filename"
 msgstr "Abbildungsdatei für Benutzernamen"
@@ -10463,37 +10724,38 @@
 msgstr "hg convert [OPTION]... QUELLE [ZIEL [REVMAP]]"
 
 msgid "only return changes on specified branches"
-msgstr ""
+msgstr "nur die Änderungen des angegebenen Branches zurückgeben"
 
 msgid "prefix to remove from file names"
-msgstr ""
+msgstr "Präfix, das von Dateinamen entfernt werden soll"
 
 msgid "only return changes after or between specified tags"
-msgstr ""
+msgstr "nur Änderungen nach oder zwischen angegebenen Tags zurückgeben"
 
 msgid "update cvs log cache"
-msgstr ""
+msgstr "CVS Log-Zwischenspeicher aktualisieren"
 
 msgid "create new cvs log cache"
-msgstr ""
+msgstr "neuen CVS Log-Zwischenspeicher erzeugen"
 
 msgid "set commit time fuzz in seconds"
-msgstr ""
+msgstr "setze erlaubte Abweichung von der Commit-Zeit in Sekunden"
 
 msgid "specify cvsroot"
-msgstr ""
+msgstr "gibt cvsroot an"
 
 msgid "show parent changesets"
-msgstr ""
-
+msgstr "zeigt die Eltern-Änderungssätze an"
+
+#, fuzzy
 msgid "show current changeset in ancestor branches"
-msgstr ""
+msgstr "zeigt den aktuellen Änderungssatz in Vorgänger-Branches"
 
 msgid "ignored for compatibility"
-msgstr ""
+msgstr "ignoriert aus Kompatibilitätsgründen"
 
 msgid "hg debugcvsps [OPTION]... [PATH]..."
-msgstr ""
+msgstr "hg debugcvsps [OPTION]... [PATH]..."
 
 msgid "warning: lightweight checkouts may cause conversion failures, try with a regular branch instead.\n"
 msgstr "Warnung: Leichte Arbeitskopien können zu Konversationsfehlern führen; erwäge einen regulären Zweig zu nutzen.\n"
@@ -10570,7 +10832,7 @@
 
 #, python-format
 msgid "spliced in %s as parents of %s\n"
-msgstr ""
+msgstr "in %s als Eltern von %s verbunden\n"
 
 msgid "scanning source...\n"
 msgstr "Untersuche Quelle...\n"
@@ -10718,17 +10980,17 @@
 msgid "tree analysis stopped because it points to an unregistered archive %s...\n"
 msgstr "Baumanalyse gestoppt, da er ein unregistriertes Archiv referenziert %s...\n"
 
-#, python-format
+#, fuzzy, python-format
 msgid "could not parse cat-log of %s"
-msgstr ""
+msgstr "konnte cat-log von %s nicht verarbeiten"
 
 #, python-format
 msgid "%s is not a local Mercurial repo"
-msgstr ""
-
-#, python-format
+msgstr "%s ist kein lokales Mercurial Projektarchiv"
+
+#, fuzzy, python-format
 msgid "initializing destination %s repository\n"
-msgstr ""
+msgstr "Initialisiere Ziel-Projektarchiv %s\n"
 
 #, python-format
 msgid "pulling from %s into %s\n"
@@ -10764,9 +11026,13 @@
 
 msgid "Mercurial failed to run itself, check hg executable is in PATH"
 msgstr ""
+"Mercurial konnte sich selbst nicht ausführen, prüfen Sie, ob die\n"
+"Programmdatei in PATH enthalten ist."
 
 msgid "svn: cannot probe remote repository, assume it could be a subversion repository. Use --source if you know better.\n"
 msgstr ""
+"svn: Kann entferntes Projektarchiv nicht untersuchen, nehme an, es handelt sich um ein Subversion-Projektarchiv.\n"
+"Verwenden Sie --source, wenn Sie es besser wissen.\n"
 
 msgid "Subversion python bindings could not be loaded"
 msgstr "Pythons Subversion-Unterstützung konnte nicht geladen werden"
@@ -10835,11 +11101,11 @@
 
 #, python-format
 msgid "initializing svn repo %r\n"
-msgstr ""
+msgstr "Initialisiere svn-Projektarchiv %r\n"
 
 #, python-format
 msgid "initializing svn wc %r\n"
-msgstr ""
+msgstr "Initialisiere svn-Arbeitskopie %r\n"
 
 msgid "unexpected svn output:\n"
 msgstr "Unerwartete Ausgabe von Subversion:\n"
@@ -10848,7 +11114,7 @@
 msgstr "Ausgabe von Subversion nicht verstanden"
 
 msgid "XXX TAGS NOT IMPLEMENTED YET\n"
-msgstr ""
+msgstr "XXX TAGS WURDEN NOCH NICHT IMPLEMENTIERT\n"
 
 msgid "command to allow external programs to compare revisions"
 msgstr "Erlaubt externen Programmen, Revisionen zu vergleichen"
@@ -11122,7 +11388,7 @@
 msgstr "Nutzt eine Programm um den Fehlerstatus zu bestimmen"
 
 msgid "error while verifying signature"
-msgstr ""
+msgstr "Fehler beim Überprüfen der Signatur"
 
 #, python-format
 msgid "%s Bad signature from \"%s\"\n"
@@ -11144,7 +11410,7 @@
 msgstr "%s:%d Knoten existiert nicht\n"
 
 msgid "verify all the signatures there may be for a particular revision"
-msgstr ""
+msgstr "überprüfe alle für eine bestimmte Revision vorhandenen Signaturen"
 
 #, python-format
 msgid "No valid signature for %s\n"
@@ -11189,13 +11455,13 @@
 msgstr "Versionsmeldung"
 
 msgid "hg sign [OPTION]... [REVISION]..."
-msgstr ""
+msgstr "hg sign [OPTION]... [REVISION]..."
 
 msgid "hg sigcheck REVISION"
-msgstr ""
+msgstr "hg sigcheck REVISION"
 
 msgid "hg sigs"
-msgstr ""
+msgstr "hg sigs"
 
 #, fuzzy
 msgid "command to view revision graphs from a shell"
@@ -11259,12 +11525,15 @@
 msgstr "hg glog [OPTION]... [DATEI]"
 
 msgid "hooks for integrating with the CIA.vc notification service"
-msgstr ""
+msgstr "Hooks zur Integration mit dem CIA.cv-Benachrichtigungsdienst"
 
 msgid ""
 "This is meant to be run as a changegroup or incoming hook. To\n"
 "configure it, set the following options in your hgrc::"
 msgstr ""
+"Dies ist dafür gedacht, als Hook für changegroup oder incoming\n"
+"eingesetzt zu werden. Um es zu konfigurieren, setzen Sie die\n"
+"folgenden Optionen in Ihrer hgrc::"
 
 msgid ""
 "  [cia]\n"
@@ -11277,7 +11546,8 @@
 "  # Append a diffstat to the log message (optional)\n"
 "  #diffstat = False\n"
 "  # Template to use for log messages (optional)\n"
-"  #template = {desc}\\n{baseurl}/rev/{node}-- {diffstat}\n"
+"  #template = {desc}\\n"
+"{baseurl}/rev/{node}-- {diffstat}\n"
 "  # Style to use (optional)\n"
 "  #style = foo\n"
 "  # The URL of the CIA notification service (optional)\n"
@@ -11288,6 +11558,29 @@
 "  # print message instead of sending it (optional)\n"
 "  #test = False"
 msgstr ""
+"  [cia]\n"
+"  # Ihr registrierter CIA-Benutzername\n"
+"  user = foo\n"
+"  # der Name des Projekts bei CIA\n"
+"  project = foo\n"
+"  # das Modul (Unterprojekt) (optional)\n"
+"  #module = foo\n"
+"  # Hänge eine Statistik über die Änderungen an die Commit-Nachricht an\n"
+"  # (optional)\n"
+"  #diffstat = False\n"
+"  # Vorlage für die Commit-Nachrichten (optional)\n"
+"  #template = {desc}\\n"
+"{baseurl}/rev/{node}-- {diffstat}\n"
+"  # zu verwendender Stil (optional)\n"
+"  #style = foo\n"
+"  # Die URL des CIA Benachrichtigungsdienstes (optional)\n"
+"  # Sie können mailto:-URLs verwenden, um E-Mails zu senden, z.B.\n"
+"  # mailto:cia@cia.vc\n"
+"  # Stellen Sie sicher, dass Sie email.from korrekt eingerichtet haben,\n"
+"  # wenn Sie dies tun.\n"
+"  #url = http://cia.vc/\n"
+"  # Nachrichten ausgeben statt sie zu senden (optional)\n"
+"  #test = False"
 
 msgid ""
 "  [hooks]\n"
@@ -11295,22 +11588,29 @@
 "  changegroup.cia = python:hgcia.hook\n"
 "  #incoming.cia = python:hgcia.hook"
 msgstr ""
+"  [hooks]\n"
+"  # einer von diesen:\n"
+"  changegroup.cia = python:hgcia.hook\n"
+"  #incoming.cia = python:hgcia.hook"
 
 msgid ""
 "  [web]\n"
 "  # If you want hyperlinks (optional)\n"
 "  baseurl = http://server/path/to/repo\n"
 msgstr ""
+"  [web]\n"
+"  # Wenn Sie Hyperlinks möchten (optional)\n"
+"  baseurl = http://server/path/to/repo\n"
 
 #, python-format
 msgid "hgcia: sending update to %s\n"
-msgstr ""
+msgstr "hgcia: Sende Aktualisierung an %s\n"
 
 msgid "email.from must be defined when sending by email"
-msgstr ""
+msgstr "email.from muss definiert werden, wenn E-Mails gesendet werden"
 
 msgid "browse the repository in a graphical way"
-msgstr ""
+msgstr "durchstöbert das Projektarchiv auf grafische Weise"
 
 msgid ""
 "The hgk extension allows browsing the history of a repository in a\n"
@@ -11371,7 +11671,7 @@
 msgstr ""
 
 msgid "print revisions"
-msgstr ""
+msgstr "Änderungen ausgeben"
 
 msgid "print extension options"
 msgstr ""
@@ -11383,13 +11683,14 @@
 msgstr ""
 
 msgid "generate patch"
-msgstr ""
+msgstr "Patch erzeugen"
 
 msgid "recursive"
-msgstr ""
-
+msgstr "rekursiv"
+
+#, fuzzy
 msgid "pretty"
-msgstr ""
+msgstr "hübsch"
 
 msgid "stdin"
 msgstr ""
@@ -11521,23 +11822,23 @@
 msgstr ""
 
 msgid "*** counting directories: "
-msgstr ""
+msgstr "*** zähle Verzeichnisse:"
 
 #, python-format
 msgid "found %d\n"
-msgstr ""
+msgstr "%d gefunden\n"
 
 #, python-format
 msgid "*** to raise the limit from %d to %d (run as root):\n"
-msgstr ""
+msgstr "*** um das Limit von %d auf %d zu heben (als root ausführen):\n"
 
 #, python-format
 msgid "***  echo %d > %s\n"
-msgstr ""
+msgstr "***  echo %d > %s\n"
 
 #, python-format
 msgid "cannot watch %s until inotify watch limit is raised"
-msgstr ""
+msgstr "Kann Verzeichnis %s nicht überwachen, bis das inotify-Limit erhöht wurde."
 
 #, python-format
 msgid "inotify service not available: %s"
@@ -14253,7 +14554,7 @@
 "\n"
 "Bitte eine Einführung für die Patch-Serie eingeben."
 
-#, python-format, fuzzy
+#, fuzzy, python-format
 msgid "This patch series consists of %d patches."
 msgstr "Diese Patch-Serie besteht aus %d Patchen.\n"
 
@@ -16172,7 +16473,7 @@
 msgstr " (Aktuelles patch Werkzeug könnte mit patch inkompatibel or fehlkonfiguriert sein. Prüfe die .hgrc Datei!)\n"
 
 msgid " Internal patcher failure, please report this error to http://mercurial.selenic.com/bts/\n"
-msgstr "Fehlschlag des internen patch Werkzeugs. Bitte melden Sie diesen Fehler bei http://www.selenic.com/mercurial/bts\n"
+msgstr " Fehlschlag des internen patch Werkzeugs. Bitte melden Sie diesen Fehler bei http://www.selenic.com/mercurial/bts\n"
 
 msgid "Checking commit editor...\n"
 msgstr "Prüfe Editor für Versionsmeldungen...\n"
@@ -18900,16 +19201,16 @@
 msgstr "Namen ausschließen, die auf das angegebene Muster passen"
 
 msgid "use <text> as commit message"
-msgstr "Nutzt <text> als Versionsmeldung"
+msgstr "Nutzt <Text> als Commit-Nachricht"
 
 msgid "read commit message from <file>"
-msgstr "Liest Versionsmeldung aus <datei>"
+msgstr "Liest Commit-Nachricht aus <Datei>"
 
 msgid "record datecode as commit date"
-msgstr "Protokolliert Datumscode als Versionsdatum"
+msgstr "Protokolliert Datumscode als Commit-Datum"
 
 msgid "record the specified user as committer"
-msgstr "Protokolliert den angegebenen Nutzer als Versionsersteller"
+msgstr "Protokolliert den angegebenen Nutzer als Autor"
 
 msgid "display using template map file"
 msgstr "Anzeige unter Nutzung der Vorlagenzuordnungsdatei"
@@ -18918,13 +19219,13 @@
 msgstr "Anzeige mit Vorlage"
 
 msgid "do not show merges"
-msgstr "Zeigt keine Zusammenführungen"
+msgstr "Zeigt keine Merges"
 
 msgid "treat all files as text"
 msgstr "Behandelt alle Dateien als Text"
 
 msgid "don't include dates in diff headers"
-msgstr "Fügt Datum nicht im Kopf des Diff an"
+msgstr "Fügt Datum nicht im Kopf des Diff ein"
 
 msgid "show which function each change is in"
 msgstr "Zeigt die Funktion, in der die Änderung passiert ist"
@@ -18948,7 +19249,7 @@
 msgstr "Zusammenfassung der Änderungen im diffstat-Stil"
 
 msgid "guess renamed files by similarity (0<=s<=100)"
-msgstr "Bewertet ähnliche Dateien (0<=s<=100) als Umbenennung"
+msgstr "rät Umbenennungn anhand der Ähnlichkeit (0<=s<=100)"
 
 msgid "[OPTION]... [FILE]..."
 msgstr "[OPTION]... [DATEI]..."
@@ -18981,7 +19282,7 @@
 msgstr "Dateien nicht dekodieren"
 
 msgid "directory prefix for files in archive"
-msgstr "Verzeichnisprefix für Dateien im Archiv"
+msgstr "Verzeichnispräfix für Dateien im Archiv"
 
 msgid "revision to distribute"
 msgstr "zu verteilende Revision"
@@ -19023,37 +19324,37 @@
 msgstr "Führe keine Aktualisierung der Dateien durch"
 
 msgid "[-gbsr] [-c CMD] [REV]"
-msgstr "[-gbsr] [-c PROGRAMM] [REV]"
+msgstr "[-gbsr] [-c BEFEHL] [REV]"
 
 msgid "set branch name even if it shadows an existing branch"
-msgstr "Setzt Zweignamen, selbst wenn es einen bestehenden Zweig verdeckt"
+msgstr "Setzt Branchnamen, selbst wenn es einen bestehenden Branch verdeckt"
 
 msgid "reset branch name to parent branch name"
-msgstr "Setzt Zweignamen zum Namen des Vorgängers zurück"
+msgstr "Setzt Branchnamen zum Namen des Vorgängers zurück"
 
 msgid "[-fC] [NAME]"
 msgstr ""
 
 msgid "show only branches that have unmerged heads"
-msgstr "Zeigt nur Zweige mit mehreren Köpfen"
+msgstr "Zeigt nur Branches mit mehreren Köpfen"
 
 msgid "show normal and closed branches"
-msgstr "Zeigt normale und geschlossene Zweige"
+msgstr "Zeigt normale und geschlossene Branches"
 
 msgid "[-a]"
 msgstr ""
 
 msgid "run even when remote repository is unrelated"
-msgstr "Auch ausführen wenn das entfernte Archiv keinen Bezug hat"
+msgstr "Auch ausführen wenn das entfernte Projektarchiv keinen Bezug hat"
 
 msgid "a changeset up to which you would like to bundle"
-msgstr "Der Änderungssatz bis zu dem gruppiert werden soll"
+msgstr "Der Änderungssatz bis zu dem gebündelt werden soll"
 
 msgid "a base changeset to specify instead of a destination"
 msgstr "Ein Basisänderungssatz anstelle eines Ziels"
 
 msgid "bundle all changesets in the repository"
-msgstr "Gruppiert alle Änderungssätze des Archivs"
+msgstr "Bündelt alle Änderungssätze des Projektarchivs"
 
 msgid "bundle compression type to use"
 msgstr "Kompressionstyp für die Ausgabedatei"
@@ -19074,7 +19375,7 @@
 msgstr "[OPTION]... DATEI..."
 
 msgid "the clone will only contain a repository (no working copy)"
-msgstr "Der Klon wird nur das Archiv enthalten (keine Arbeitskopie)"
+msgstr "Der Klon wird nur das Projektarchiv enthalten (keine Arbeitskopie)"
 
 msgid "revision, tag or branch to check out"
 msgstr ""
@@ -19089,7 +19390,7 @@
 msgstr "Markiert neue/fehlende Dateien als hinzugefügt/entfernt"
 
 msgid "mark a branch as closed, hiding it from the branch list"
-msgstr "Markiert einen Zweig als beendet und blendet ihn in der Zweigliste aus"
+msgstr "Markiert einen Branch als geschlossen und blendet ihn in der Branchlist aus"
 
 msgid "record a copy that has already occurred"
 msgstr "Identifiziert eine Kopie, die bereits stattgefunden hat"
@@ -19113,10 +19414,10 @@
 msgstr "[-o] BEFEHL"
 
 msgid "try extended date formats"
-msgstr "Erlaubt erweiterte Datumsformate"
+msgstr "versuche erweiterte Datumsformate"
 
 msgid "[-e] DATE [RANGE]"
-msgstr "[-e] DATUM [PRÃœFDATUM]"
+msgstr "[-e] DATUM [BEREICH]"
 
 msgid "FILE REV"
 msgstr "DATEI REV"
@@ -19170,7 +19471,7 @@
 msgstr "Folgt der Versionshistorie oder Dateihistorie über Kopien und Umbenennungen hinweg"
 
 msgid "ignore case when matching"
-msgstr "Ignoriert Groß- und Kleinschreibung"
+msgstr "Ignoriert Groß- und Kleinschreibung beim Suchen"
 
 msgid "print only filenames and revisions that match"
 msgstr "Zeigt nur zutreffende Dateinamen und Revisionen"
@@ -19179,7 +19480,7 @@
 msgstr "Zeigt zutreffende Zeilennummern"
 
 msgid "search in given revision range"
-msgstr "Sucht in gegebenem Revisionsintervall"
+msgstr "Sucht in gegebenem Revisionsbereich"
 
 msgid "[OPTION]... PATTERN [FILE]..."
 msgstr "[OPTION]... MUSTER [DATEI]..."
@@ -19188,10 +19489,10 @@
 msgstr "Zeigt nur Köpfe, die Nachkommen dieser Revision sind"
 
 msgid "show only the active branch heads from open branches"
-msgstr "Zeigt nur aktive Köpfe von offenen Zweigen"
+msgstr "Zeigt nur aktive Köpfe von offenen Branches"
 
 msgid "show normal and closed branch heads"
-msgstr "Zeigt normale und geschlossene Kopfversionen"
+msgstr "Zeigt normale und geschlossene Branch-Köpfe"
 
 msgid "[-r STARTREV] [REV]..."
 msgstr ""
@@ -19209,10 +19510,10 @@
 msgstr "Zeigt die globale Revisions-ID"
 
 msgid "show branch"
-msgstr "Zeigt gegebenen Zweig"
+msgstr "Zeigt gegebenen Branch"
 
 msgid "show tags"
-msgstr "Zeigt Etiketten"
+msgstr "Zeigt Tags"
 
 msgid "[-nibt] [-r REV] [SOURCE]"
 msgstr "[-nibt] [-r REV] [QUELLE]"
@@ -19224,10 +19525,10 @@
 msgstr "Basispfad"
 
 msgid "skip check for outstanding uncommitted changes"
-msgstr "Erzwingt trotz lokaler Änderungen im Arbeitsverzeichnis"
+msgstr "überspringt die Überprüfungen auf ausstehende, unversionierte Änderungen"
 
 msgid "don't commit, just update the working directory"
-msgstr "Kein Ãœbernehmen, nur Aktualisierung des Arbeitsverzeichnisses"
+msgstr "Kein Commit, nur Aktualisierung des Arbeitsverzeichnisses"
 
 msgid "apply patch to the nodes from which it was generated"
 msgstr "Wendet Patch auf die Knoten an, von denen er erstellt wurde"
@@ -19239,13 +19540,13 @@
 msgstr ""
 
 msgid "show newest record first"
-msgstr "Zeigt neuste Änderung zuerst"
+msgstr "Zeigt neueste Änderung zuerst"
 
 msgid "file to store the bundles into"
-msgstr "Dateiname zum Zwischenspeichern"
+msgstr "Dateiname zum Speichern der Bündel"
 
 msgid "a specific remote revision up to which you would like to pull"
-msgstr "eine bestimmte enfernte Revision bis zu der geholt werden soll"
+msgstr "eine bestimmte enfernte Revision bis zu der gepullt werden soll"
 
 msgid "[-p] [-n] [-M] [-f] [-r REV]... [--bundle FILENAME] [SOURCE]"
 msgstr "[-p] [-n] [-M] [-f] [-r REV]... [--bundle DATEINAME] [QUELLE]"
@@ -19266,7 +19567,7 @@
 msgstr "[OPTION]... [MUSTER]..."
 
 msgid "only follow the first parent of merge changesets"
-msgstr "Folgt nur dem ersten Vorgänger einer Zusammenführungsversion"
+msgstr "Folgt nur dem ersten Vorgänger von Merges"
 
 msgid "show revisions matching date spec"
 msgstr "Zeigt Revisionen passend zur Datums-Spezifikation"
@@ -19278,19 +19579,19 @@
 msgstr "Sucht unabhängig von Groß- und Kleinschreibung ein Stichwort"
 
 msgid "include revisions where files were removed"
-msgstr "Revisionen hinzufügen, in denen Dateien entfernt wurden"
+msgstr "Revisionen einschließen, in denen Dateien entfernt wurden"
 
 msgid "show only merges"
-msgstr "Zeigt nur Zusammenführungen"
+msgstr "Zeigt nur Merges"
 
 msgid "revisions committed by user"
-msgstr "Revisionen erzeugt vom Nutzer"
+msgstr "Revisionen vom Nutzer"
 
 msgid "show only changesets within the given named branch"
-msgstr "Zeigt nur Änderungssätze innerhalb des angegebenen Zweigs"
+msgstr "Zeigt nur Änderungssätze innerhalb des angegebenen Branches"
 
 msgid "do not display revision or any of its ancestors"
-msgstr "Gibt weder diese Revision noch ihre Nachfolger aus"
+msgstr "Gibt weder diese Revision noch ihre Vorgänger aus"
 
 msgid "[OPTION]... [FILE]"
 msgstr "[OPTION]... [DATEI]"
@@ -19302,10 +19603,10 @@
 msgstr ""
 
 msgid "force a merge with outstanding changes"
-msgstr "Erzwingt eine Zusammenführung mit den ausstehenden Änderungen"
+msgstr "Erzwingt einen Merge mit ausstehenden Änderungen"
 
 msgid "revision to merge"
-msgstr "Zusammenzuführende Revision"
+msgstr "zu mergende Revision"
 
 msgid "review revisions to merge (no merge is performed)"
 msgstr ""
@@ -19314,7 +19615,7 @@
 msgstr ""
 
 msgid "a specific revision up to which you would like to push"
-msgstr "eine bestimmte Revision bis zu der ausgeliefert werden soll"
+msgstr "eine bestimmte Revision bis zu der gepusht werden soll"
 
 msgid "[-M] [-p] [-n] [-f] [-r REV]... [DEST]"
 msgstr "[-M] [-p] [-n] [-f] [-r REV]... [ZIEL]"
@@ -19329,16 +19630,16 @@
 msgstr ""
 
 msgid "update to new tip if changesets were pulled"
-msgstr "Auf die neue Spitze (tip) anheben, falls Änderungssätze geholt wurden"
+msgstr "Auf den neuen tip aktualisieren, falls Änderungssätze geholt wurden"
 
 msgid "[-u] [-f] [-r REV]... [-e CMD] [--remotecmd CMD] [SOURCE]"
-msgstr "[-u] [-f] [-r REV]... [-e CMD] [--remotecmd CMD] [QUELLE]"
+msgstr "[-u] [-f] [-r REV]... [-e BEFEHL] [--remotecmd BEFEHL] [QUELLE]"
 
 msgid "force push"
-msgstr "Erzwingt Auslieferung"
+msgstr "Erzwingt Push"
 
 msgid "[-f] [-r REV]... [-e CMD] [--remotecmd CMD] [DEST]"
-msgstr "[-f] [-r REV]... [-e CMD] [--remotecmd CMD] [ZIEL]"
+msgstr "[-f] [-r REV]... [-e BEFEHL] [--remotecmd BEFEHL] [ZIEL]"
 
 msgid "record delete for missing files"
 msgstr "Protokolliert die Löschung fehlender Dateien"
@@ -19353,10 +19654,10 @@
 msgstr "[OPTION]... QUELLE... ZIEL"
 
 msgid "select all unresolved files"
-msgstr "Wählt alle noch konfliktbehafteten Dateien aus"
+msgstr "Wählt alle konfliktbehafteten Dateien aus"
 
 msgid "list state of files needing merge"
-msgstr "Zeigt Dateien, deren automatische Zusammenführung fehlschlug"
+msgstr "Zeigt Dateien, die einen manuellen Merge erfordern"
 
 msgid "mark files as resolved"
 msgstr "Markiert eine Datei als konfliktfrei"
@@ -19365,13 +19666,13 @@
 msgstr "Markiert eine Datei als konfliktbehaftet"
 
 msgid "hide status prefix"
-msgstr "Verdeckt den Status-Präfix"
+msgstr "Versteckt das Status-Präfix"
 
 msgid "revert all changes when no arguments given"
-msgstr "Nimmt alle lokalen Änderungen zurück (ohne andere Parameter)"
+msgstr "Nimmt alle Änderungen zurück (wenn ohne andere Parameter aufgerufen)"
 
 msgid "tipmost revision matching date"
-msgstr "der Spitze (tip) nächste Revision mit passendem Datum"
+msgstr "dem tip nächste Revision mit passendem Datum"
 
 msgid "revision to revert to"
 msgstr "Revision, bis zu der Änderungen zurückgenommen werden"
@@ -19401,10 +19702,10 @@
 msgstr "Name der auf der Webseite angezeigt wird (Standard: Arbeitsverzeichnis)"
 
 msgid "name of the webdir config file (serve more than one repository)"
-msgstr "Name der webdir-Konfigurationsdatei (mehr als ein Archiv ausliefern)"
+msgstr "Name der webdir-Konfigurationsdatei (mehr als ein Projektarchiv ausliefern)"
 
 msgid "for remote clients"
-msgstr "für entfernte Klienten"
+msgstr "für entfernte Clients"
 
 msgid "web templates to use"
 msgstr "Zu nutzende Web-Vorlagen"
@@ -19416,7 +19717,7 @@
 msgstr "Nutzt IPv6 zusätzlich zu IPv4"
 
 msgid "SSL certificate file"
-msgstr "SSL Zertifikatsdatei"
+msgstr "SSL-Zertifikatsdatei"
 
 msgid "show untrusted configuration options"
 msgstr ""
@@ -19431,7 +19732,7 @@
 msgstr "Zeigt den Status aller Dateien"
 
 msgid "show only modified files"
-msgstr "Zeigt nur modifizierte Dateien"
+msgstr "Zeigt nur geänderte Dateien"
 
 msgid "show only added files"
 msgstr "Zeigt nur hinzugefügte Dateien"
@@ -19440,13 +19741,13 @@
 msgstr "Zeigt nur entfernte Dateien"
 
 msgid "show only deleted (but tracked) files"
-msgstr "Zeigt nur gelöschte (aber überwachte) Dateien"
+msgstr "Zeigt nur gelöschte (aber versionierte) Dateien"
 
 msgid "show only files without changes"
 msgstr "Zeigt nur Dateien ohne Änderungen"
 
 msgid "show only unknown (not tracked) files"
-msgstr "Zeigt nur unbekannte (nicht überwachte) Dateien"
+msgstr "Zeigt nur unbekannte (nicht versionierte) Dateien"
 
 msgid "show only ignored files"
 msgstr "Zeigt nur ignorierte Dateien"
@@ -19455,19 +19756,19 @@
 msgstr "Zeigt die Quelle von kopierten Dateien"
 
 msgid "show difference from revision"
-msgstr "Zeigt die Differenz zu einer Revision"
+msgstr "Zeigt die Unterschiede zu einer Revision"
 
 msgid "replace existing tag"
-msgstr "Ersetzt bereits gesetztes Etikett"
+msgstr "Ersetzt bereits existierendes Tag"
 
 msgid "make the tag local"
-msgstr "Etikett wird nur lokal gesetzt"
+msgstr "Tag wird nur lokal gesetzt"
 
 msgid "revision to tag"
-msgstr "Zu etikettierende Revision"
+msgstr "Zu taggende Revision"
 
 msgid "remove a tag"
-msgstr "Entfernt ein Etikett"
+msgstr "Entfernt ein Tag"
 
 msgid "[-l] [-m TEXT] [-d DATE] [-u USER] [-r REV] NAME..."
 msgstr "[-l] [-m TEXT] [-d DATUM] [-u BENUTZER] [-r REV] NAME..."
@@ -19476,13 +19777,13 @@
 msgstr ""
 
 msgid "update to new tip if changesets were unbundled"
-msgstr "Aktualisiert das Arbeitsverzeichnis auf die neue Spitze"
+msgstr "aktualisiere auf den neuen tip when Änderungssätze entpackt wurden"
 
 msgid "[-u] FILE..."
 msgstr "[-u] DATEI..."
 
 msgid "discard uncommitted changes (no backup)"
-msgstr "Entferne nicht versionierte Änderungen (kein Backup)"
+msgstr "entferne nicht versionierte Änderungen (kein Backup)"
 
 msgid "check for uncommitted changes"
 msgstr "prüft auf nicht versionierte Änderungen"
@@ -19498,14 +19799,18 @@
 msgstr "nicht im Manifest gefunden"
 
 msgid "branch name not in UTF-8!"
-msgstr "Name der Verzweigung nicht in UTF-8!"
+msgstr "Branchname ist nicht in UTF-8!"
 
 msgid "working directory state appears damaged!"
 msgstr "Status des Arbeitsverzeichnis scheint beschädigt zu sein!"
 
 #, python-format
-msgid "'\\n' and '\\r' disallowed in filenames: %r"
-msgstr "'\\n' und '\\r' sind nicht in Dateinamen erlaubt: %r"
+msgid ""
+"'\\n"
+"' and '\\r' disallowed in filenames: %r"
+msgstr ""
+"'\\n"
+"' und '\\r' sind nicht in Dateinamen erlaubt: %r"
 
 #, python-format
 msgid "directory %r already in dirstate"
@@ -19532,7 +19837,7 @@
 msgstr "FIFO"
 
 msgid "socket"
-msgstr "Sockel"
+msgstr "Socket"
 
 msgid "directory"
 msgstr "Verzeichnis"
@@ -19559,11 +19864,11 @@
 
 #, python-format
 msgid "timed out waiting for lock held by %s"
-msgstr "Zeitüberschreitung beim Warten auf %s"
+msgstr "Zeitüberschreitung beim Warten auf Sperre von %s"
 
 #, python-format
 msgid "lock held by %s"
-msgstr "Zur Zeit von %s reserviert"
+msgstr "Zur Zeit von %s gesperrt"
 
 #, python-format
 msgid "abort: %s: %s\n"
@@ -19571,7 +19876,7 @@
 
 #, python-format
 msgid "abort: could not lock %s: %s\n"
-msgstr "Abbruch: Kann %s nicht reservieren: %s\n"
+msgstr "Abbruch: Kann %s nicht sperren: %s\n"
 
 #, python-format
 msgid "hg %s: %s\n"
@@ -19589,21 +19894,21 @@
 msgstr " leere Zeichenkette\n"
 
 msgid "killed!\n"
-msgstr " getötet!\n"
+msgstr "getötet!\n"
 
 #, python-format
 msgid "hg: unknown command '%s'\n"
-msgstr "hg: unbekanntes Kommando '%s'\n"
+msgstr "hg: unbekannter Befehl '%s'\n"
 
 #, python-format
 msgid "abort: could not import module %s!\n"
 msgstr "Abbruch: Kann Modul %s nicht importieren!\n"
 
 msgid "(did you forget to compile extensions?)\n"
-msgstr "(Erweiterungen nicht compiliert?)\n"
+msgstr "(Erweiterungen nicht kompiliert?)\n"
 
 msgid "(is your Python install correct?)\n"
-msgstr "(Python Installation korrekt?)\n"
+msgstr "(Python-Installation korrekt?)\n"
 
 #, python-format
 msgid "abort: error: %s\n"
@@ -19623,7 +19928,7 @@
 "Datenübergabe unterbrochen\n"
 
 msgid "abort: out of memory\n"
-msgstr "Abbruch: Unzureichender Speicherplatz\n"
+msgstr "Abbruch: Unzureichender Arbeitsspeicher\n"
 
 msgid "** unknown exception encountered, details follow\n"
 msgstr "** Unbekannter Fehler, Details folgen\n"
@@ -19656,11 +19961,11 @@
 
 #, python-format
 msgid "malformed --config option: %r (use --config section.name=value)"
-msgstr "missgebildete --config Option: %s (nutze --config Sektion.Name=Wert)"
+msgstr "fehlerhafte --config Option: %s (nutze --config Sektion.Name=Wert)"
 
 #, python-format
 msgid "extension '%s' overrides commands: %s\n"
-msgstr "Erweiterung '%s' überschreibt die Kommandos: %s\n"
+msgstr "Erweiterung '%s' überschreibt die Befehle: %s\n"
 
 msgid "Option --config may not be abbreviated!"
 msgstr "Option --config kann nicht abgekürzt werden!"
@@ -19773,10 +20078,10 @@
 msgstr "Umgebungsvariablen"
 
 msgid "Specifying Single Revisions"
-msgstr "Angabe Einzelner Revisionen"
+msgstr "Angabe einzelner Revisionen"
 
 msgid "Specifying Multiple Revisions"
-msgstr "Angabe Mehrerer Revisionen"
+msgstr "Angabe mehrerer Revisionen"
 
 msgid "Diff Formats"
 msgstr "Diff-Formate"
@@ -19815,26 +20120,26 @@
 msgstr "Quellarchiv unterstützt keine Revisions-Abfragen und lässt daher das Klonen bis zu einer Revision nicht zu"
 
 msgid "clone from remote to remote not supported"
-msgstr "Klonen von entferntem Archiv zu entferntem Archiv nicht möglich"
+msgstr "Klonen von entferntem zu entferntem Projektarchiv nicht möglich"
 
 #, python-format
 msgid "updating to branch %s\n"
-msgstr "Aktualisiere auf Zweig %s\n"
+msgstr "Aktualisiere auf Branch %s\n"
 
 #, python-format
 msgid "%d files updated, %d files merged, %d files removed, %d files unresolved\n"
 msgstr ""
 
 msgid "use 'hg resolve' to retry unresolved file merges\n"
-msgstr "Verwende 'hg resolve', um die Zusammenführung erneut zu versuchen\n"
+msgstr "Nutze 'hg resolve', um ungelöste Merges zu wiederholen\n"
 
 msgid "use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon\n"
 msgstr ""
-"Nutze 'hg resolve', um nicht aufgelöste Zusammenführungen zu wiederholen oder\n"
-"'hg up --clean' um andere Änderungen aufzugeben\n"
+"Nutze 'hg resolve', um ungelöste Merges zu wiederholen\n"
+"oder 'hg update -C' um aufzugeben\n"
 
 msgid "(branch merge, don't forget to commit)\n"
-msgstr "(Zweig-Zusammenführung, vergiss nicht 'hg commit' auszuführen)\n"
+msgstr "(Branch-Merge, vergiss nicht 'hg commit' auszuführen)\n"
 
 #, python-format
 msgid "error reading %s/.hg/hgrc: %s\n"
@@ -19944,14 +20249,14 @@
 msgstr ""
 
 msgid "push failed (unexpected response):"
-msgstr "push fehlgeschlagen (Unerwartete Antwort)"
+msgstr "Push fehlgeschlagen (unerwartete Antwort)"
 
 #, python-format
 msgid "push failed: %s"
-msgstr "push fehlgeschlagen: %s"
+msgstr "Push fehlgeschlagen: %s"
 
 msgid "Python support for SSL and HTTPS is not installed"
-msgstr "Python Unterstützung für SSL und HTTPS ist nicht installiert"
+msgstr "Python-Unterstützung für SSL und HTTPS ist nicht installiert"
 
 msgid "cannot create new http repository"
 msgstr "Kann neues HTTP-Projektarchiv nicht erzeugen"
@@ -19962,7 +20267,7 @@
 
 #, python-format
 msgid "skipping unreadable ignore file '%s': %s\n"
-msgstr "Ãœberspringe nicht lesbare ignore Datei '%s': %s\n"
+msgstr "Ãœberspringe nicht lesbare ignore-Datei '%s': %s\n"
 
 #, python-format
 msgid "repository %s not found"
@@ -19982,10 +20287,10 @@
 
 #, python-format
 msgid "%r cannot be used in a tag name"
-msgstr "%r kann nicht in einem Namen für Etiketten genutzt werden"
+msgstr "%r kann nicht in einem Tagnamen genutzt werden"
 
 msgid "working copy of .hgtags is changed (please commit .hgtags manually)"
-msgstr "Arbeitskopie von .hgtags wurde geändert (Bitte .hgtags manuell versionieren)"
+msgstr "Arbeitskopie von .hgtags wurde geändert (bitte versioniere .hgtags manuell)"
 
 #, python-format
 msgid "working directory has unknown parent '%s'!"
@@ -19996,7 +20301,7 @@
 msgstr "Unbekannte Revision '%s'"
 
 msgid "abandoned transaction found - run hg recover"
-msgstr "unfertige Transaktion gefunden - führe hg recover aus"
+msgstr "abgebrochene Transaktion gefunden - führe hg recover aus"
 
 msgid "rolling back interrupted transaction\n"
 msgstr "Setze unterbrochene Transaktion zurück\n"
@@ -20009,7 +20314,7 @@
 
 #, python-format
 msgid "Named branch could not be reset, current branch still is: %s\n"
-msgstr "Benannter Zweig konnte nicht zurückgesetzt werden, aktueller Zweig ist: %s\n"
+msgstr "Benannter Branch konnte nicht zurückgesetzt werden, aktueller Zweig ist weiterhin: %s\n"
 
 msgid "no rollback information available\n"
 msgstr "Keine rollback-Information verfügbar\n"
@@ -20027,7 +20332,7 @@
 msgstr "Arbeitsverzeichnis von %s"
 
 msgid "cannot partially commit a merge (do not specify files or patterns)"
-msgstr "Eine Zusammenführung kann nicht teilweise versioniert werden (Gib keine Dateien oder Muster an)"
+msgstr "Ein Merge kann nicht teilweise versioniert werden (Gib keine Dateien oder Muster an)"
 
 msgid "file not found!"
 msgstr "Datei nicht gefunden!"
@@ -20036,10 +20341,10 @@
 msgstr "Kein Treffer unterhalb des Verzeichnisses!"
 
 msgid "file not tracked!"
-msgstr "Datei wird nicht nachverfolgt!"
+msgstr "Datei wird nicht versioniert!"
 
 msgid "unresolved merge conflicts (see hg resolve)"
-msgstr "Ungelöster Zusammenführungs-Konflikt (siehe hg resolve)"
+msgstr "Ungelöster Merge-Konflikt (siehe hg resolve)"
 
 #, python-format
 msgid "committing subrepository %s\n"
@@ -20047,7 +20352,7 @@
 
 #, python-format
 msgid "trouble committing %s!\n"
-msgstr "Problem bei Erstellen der neuen Version von %s!\n"
+msgstr "Problem beim Versionieren von %s!\n"
 
 #, python-format
 msgid "%s does not exist!\n"
@@ -20107,17 +20412,17 @@
 msgstr "Fordere alle Änderungen an\n"
 
 msgid "Partial pull cannot be done because other repository doesn't support changegroupsubset."
-msgstr "Teilweise Holen kann nicht ausgeführt werden, da das andere Projektarchiv keine Teilmengen von Änderungsgruppen unterstützt."
+msgstr "Teilweiser Pull kann nicht ausgeführt werden, da das andere Projektarchiv keine Teilmengen von Änderungsgruppen unterstützt."
 
 #, python-format
 msgid "abort: push creates new remote branch '%s'!\n"
-msgstr "Abbruch: Ausliefern erzeugt neuen entfernten Zweig '%s'!\n"
+msgstr "Abbruch: Push erzeugt neuen entfernten Branch '%s'!\n"
 
 msgid "abort: push creates new remote heads!\n"
-msgstr "Abbruch: Ausliefern erzeugt neue entfernte Köpfe!\n"
+msgstr "Abbruch: Push erzeugt neue entfernte Köpfe!\n"
 
 msgid "(did you forget to merge? use push -f to force)\n"
-msgstr "(Hast du vergessen zusammenzuführen? Nutze push -f um zu erzwingen)\n"
+msgstr "(Hast du vergessen zu mergen? Nutze push -f um zu erzwingen)\n"
 
 msgid "note: unsynced remote changes!\n"
 msgstr "Hinweis: Nicht synchronisierte entfernte Änderungen!\n"
@@ -20134,7 +20439,7 @@
 msgstr "Füge Änderungssätze hinzu\n"
 
 msgid "received changelog group is empty"
-msgstr "Erhaltene changelog group ist leer"
+msgstr "Erhaltene Changelog-Gruppe ist leer"
 
 msgid "adding manifests\n"
 msgstr "Füge Manifeste hinzu\n"
@@ -20143,7 +20448,7 @@
 msgstr "Füge Dateiänderungen hinzu\n"
 
 msgid "received file revlog group is empty"
-msgstr "Erhaltene Datei revlog group ist leer"
+msgstr "Revlog-Gruppe der erhaltenen Datei ist leer"
 
 #, python-format
 msgid " (%+d heads)"
@@ -20151,7 +20456,7 @@
 
 #, python-format
 msgid "added %d changesets with %d changes to %d files%s\n"
-msgstr "Fügte %d Änderungssätze mit %d Änderungen zu %d Dateien%s hinzu\n"
+msgstr "Fügte %d Änderungssätze mit %d Änderungen an %d Dateien%s hinzu\n"
 
 msgid "Unexpected response from remote server:"
 msgstr ""
@@ -20382,7 +20687,7 @@
 
 #, python-format
 msgid "Unsupported line endings type: %s"
-msgstr "Nicht unterstützter Typ von Zeilenende: %s"
+msgstr "Nicht unterstütztes Zeilenende: %s"
 
 #, python-format
 msgid " %d files changed, %d insertions(+), %d deletions(-)\n"
@@ -20401,11 +20706,11 @@
 msgstr "Speichere Bündel in %s\n"
 
 msgid "adding branch\n"
-msgstr "füge Zweig hinzu\n"
+msgstr "füge Branch hinzu\n"
 
 #, python-format
 msgid "cannot %s; remote repository does not support the %r capability"
-msgstr "Kann nicht %s; entferntes Archiv hat keine %r-Kapabilität"
+msgstr "Kann nicht %s; entferntes Projektarchiv unterstützt nicht die %r-Fähigkeiten"
 
 #, python-format
 msgid "unknown compression type %r"
@@ -20438,7 +20743,7 @@
 
 #, python-format
 msgid "incompatible revision flag %x"
-msgstr "Inkompatibler Revisions-Schater %x"
+msgstr "Inkompatibler Revisions-Schalter %x"
 
 #, python-format
 msgid "%s not found in the transaction"
@@ -20452,20 +20757,20 @@
 
 #, python-format
 msgid "%s looks like a binary file."
-msgstr "%s scheint eine Binärdatei zu sein"
+msgstr "%s scheint eine Binärdatei zu sein."
 
 msgid "can only specify two labels."
-msgstr "Kann nur zwei Marken angeben"
+msgstr "Kann nur zwei Marken angeben."
 
 msgid "warning: conflicts during merge.\n"
-msgstr "Warnung: Konflikte bei Zusammenführung.\n"
+msgstr "Warnung: Konflikte beim Zusammenführen.\n"
 
 #, python-format
 msgid "couldn't parse location %s"
-msgstr "Kann Ort %s nicht entziffern"
+msgstr "Kann Ort %s nicht analysieren"
 
 msgid "could not create remote repo"
-msgstr "Konnte entferntes Archiv nicht erstellen"
+msgstr "Konnte entferntes Projektarchiv nicht erstellen"
 
 msgid "no suitable response from remote hg"
 msgstr "Keine passende Antwort des entfernten hg"
@@ -20475,20 +20780,20 @@
 
 #, python-format
 msgid "push refused: %s"
-msgstr "Hochladen abgeweisen: %s"
+msgstr "Hochladen abgewiesen: %s"
 
 msgid "unsynced changes"
-msgstr "asynchrone Änderungen"
+msgstr "unsynchronisierte Änderungen"
 
 #, python-format
 msgid "'%s' does not appear to be an hg repository"
-msgstr "'%s' scheint kein hg-Archiv zu sein"
+msgstr "'%s' scheint kein hg-Projektarchiv zu sein"
 
 msgid "cannot lock static-http repository"
-msgstr "Kann statisches http-Archiv nicht abschliessen"
+msgstr "Kann statisches HTTP-Projektarchiv nicht sperren"
 
 msgid "cannot create new static-http repository"
-msgstr "Kann kein neues, statisches http-Archiv erstellen"
+msgstr "Kann kein neues, statisches HTTP-Projektarchiv erstellen"
 
 #, python-format
 msgid "invalid entry in fncache, line %s"
@@ -20499,8 +20804,8 @@
 " subrepository sources for %s differ\n"
 "use (l)ocal source (%s) or (r)emote source (%s)?"
 msgstr ""
-" Unterarchivquellen für %s sind verschieden\n"
-"nutze (l)okale Quelle (%s) oder entfe(r)nte Quelle (%s)?"
+" Unterarchivquellen für %s sind verschieden.\n"
+"Nutze (l)okale Quelle (%s) oder entfe(r)nte Quelle (%s)?"
 
 msgid "&Remote"
 msgstr "Entfe&rnt"
@@ -20510,16 +20815,16 @@
 " local changed subrepository %s which remote removed\n"
 "use (c)hanged version or (d)elete?"
 msgstr ""
-" lokales Unterarchiv ändert %s, aber entferntes löscht\n"
-"nutze (c) geänderte Version oder (d) lösche?"
+" Lokales Unterarchiv ändert %s, aber entferntes löscht.\n"
+"Nutze (c) geänderte Version oder (d) lösche?"
 
 #, python-format
 msgid ""
 " remote changed subrepository %s which local removed\n"
 "use (c)hanged version or (d)elete?"
 msgstr ""
-" Entferntes Unterarchiv ändert %s, aber lokales löscht\n"
-"nutze (c) geänderte Version oder (d) lösche?"
+" Entferntes Unterarchiv ändert %s, aber lokales löscht.\n"
+"Nutze (c) geänderte Version oder (d) lösche?"
 
 #, python-format
 msgid "removing subrepo %s\n"
@@ -20542,14 +20847,14 @@
 
 #, python-format
 msgid "node '%s' is not well formed"
-msgstr "Knoten '%s' ist fehlerhaft"
+msgstr "Knoten '%s' ist nicht wohlgeformt"
 
 msgid "unmatched quotes"
 msgstr "unpassende Klammern"
 
 #, python-format
 msgid "error expanding '%s%%%s'"
-msgstr "Fehler bei Auflösung von '%s%%%s'"
+msgstr "Fehler beim Auflösen von '%s%%%s'"
 
 #, python-format
 msgid "unknown filter '%s'"
@@ -20561,10 +20866,10 @@
 
 #, python-format
 msgid "template file %s: %s"
-msgstr "Vorlagedatei %s: %s"
+msgstr "Vorlagendatei %s: %s"
 
 msgid "cannot use transaction when it is already committed/aborted"
-msgstr "Kann Transaktion nicht verwenden, wenn sie bereits Ãœbernommen/Abgebrochen ist"
+msgstr "Kann Transaktion nicht verwenden, wenn sie bereits übernommen/abgebrochen ist"
 
 #, python-format
 msgid "failed to truncate %s\n"
@@ -20574,10 +20879,10 @@
 msgstr "Transaktionsabbruch!\n"
 
 msgid "rollback completed\n"
-msgstr "Rücknahme abgeschlossen\n"
+msgstr "Zurückrollen abgeschlossen\n"
 
 msgid "rollback failed - please run hg recover\n"
-msgstr "Rücksetzen fehlgeschlagen - bitte führe hg recover aus\n"
+msgstr "Zurückrollen fehlgeschlagen - bitte führe hg recover aus\n"
 
 #, python-format
 msgid "Not trusting file %s from untrusted user %s, group %s\n"
@@ -20585,22 +20890,22 @@
 
 #, python-format
 msgid "Ignored: %s\n"
-msgstr "Ignoriere: %s\n"
+msgstr "Ignoriert: %s\n"
 
 #, python-format
 msgid "ignoring untrusted configuration option %s.%s = %s\n"
-msgstr "Ignoriere nicht vertrauenswürdigen Konfigurationseintrag %s.%s = %s\n"
+msgstr "Ignoriere nicht vertrauenswürdige Einstellung %s.%s = %s\n"
 
 #, python-format
 msgid "%s.%s not a boolean ('%s')"
 msgstr "%s.%s ist kein bool'scher Wert ('%s')"
 
 msgid "enter a commit username:"
-msgstr "Gib einen Benutzernamen für die Version ein:"
+msgstr "Geben Sie einen Benutzernamen für den Commit ein:"
 
 #, python-format
 msgid "No username found, using '%s' instead\n"
-msgstr "Kein Benutzername gefunden, nutze %s stattdessen\n"
+msgstr "Kein Benutzername gefunden, nutze '%s' stattdessen\n"
 
 msgid "no username supplied (see \"hg help config\")"
 msgstr "kein Benutzername angegeben (siehe \"hg help config\")"
@@ -20622,10 +20927,10 @@
 msgstr "Bearbeiten fehlgeschlagen"
 
 msgid "http authorization required"
-msgstr "HTTP-Autorisation benötigt"
+msgstr "HTTP-Authorisierung erforderlich"
 
 msgid "http authorization required\n"
-msgstr "HTTP-Autorisation benötigt\n"
+msgstr "HTTP-Authorisierung erforderlich\n"
 
 #, python-format
 msgid "realm: %s\n"
@@ -20640,7 +20945,7 @@
 
 #, python-format
 msgid "http auth: user %s, password %s\n"
-msgstr "HTTP Auth: Benutzer %s, Passwort%s\n"
+msgstr "HTTP Auth: Benutzer %s, Passwort %s\n"
 
 #, python-format
 msgid "command '%s' failed: %s"
@@ -20648,7 +20953,7 @@
 
 #, python-format
 msgid "path contains illegal component: %s"
-msgstr "Pfad enthält illegalen Teil: %s"
+msgstr "Pfad enthält ungültige Komponente: %s"
 
 #, python-format
 msgid "path %r is inside repo %r"
@@ -20675,54 +20980,54 @@
 
 #, python-format
 msgid "impossible time zone offset: %d"
-msgstr "Unmögliche Zeitzonen Verschiebung: %d"
+msgstr "Unmögliche Zeitzonen-Verschiebung: %d"
 
 #, python-format
 msgid "invalid day spec: %s"
-msgstr "Ungültige Angabe des Tages: %s"
+msgstr "Ungültige Datumsangabe: %s"
 
 #, python-format
 msgid "%.0f GB"
-msgstr ""
+msgstr "%.0f GB"
 
 #, python-format
 msgid "%.1f GB"
-msgstr ""
+msgstr "%.1f GB"
 
 #, python-format
 msgid "%.2f GB"
-msgstr ""
+msgstr "%.2f GB"
 
 #, python-format
 msgid "%.0f MB"
-msgstr ""
+msgstr "%.0f MB"
 
 #, python-format
 msgid "%.1f MB"
-msgstr ""
+msgstr "%.1f MB"
 
 #, python-format
 msgid "%.2f MB"
-msgstr ""
+msgstr "%.2f MB"
 
 #, python-format
 msgid "%.0f KB"
-msgstr ""
+msgstr "%.0f KB"
 
 #, python-format
 msgid "%.1f KB"
-msgstr ""
+msgstr "%.1f KB"
 
 #, python-format
 msgid "%.2f KB"
-msgstr ""
+msgstr "%.2f KB"
 
 #, python-format
 msgid "%.0f bytes"
 msgstr "%.0f Bytes"
 
 msgid "cannot verify bundle or remote repos"
-msgstr "Kann keine Bündel oder entfernte Archive verifizieren"
+msgstr "Kann Bündel oder entfernte Projektarchive nicht verifizieren"
 
 msgid "interrupted"
 msgstr "unterbrochen"
@@ -20733,11 +21038,11 @@
 
 #, python-format
 msgid "data length off by %d bytes"
-msgstr "Datenlänge um %d bytes daneben"
+msgstr "Datenlänge um %d Bytes verschoben"
 
 #, python-format
 msgid "index contains %d extra bytes"
-msgstr "Index enthält %d überflüssige Bytes"
+msgstr "Index enthält %d zusätzliche Bytes"
 
 #, python-format
 msgid "warning: `%s' uses revlog format 1"
@@ -20776,7 +21081,7 @@
 msgstr "Doppelte Revision %d (%d)"
 
 msgid "abandoned transaction found - run hg recover\n"
-msgstr "unfertige Transaktion gefunden - führe hg recover aus\n"
+msgstr "abgebroche Transaktion gefunden - führe hg recover aus\n"
 
 #, python-format
 msgid "repository uses revlog format %d\n"
@@ -20801,10 +21106,10 @@
 
 #, python-format
 msgid "reading manifest delta %s"
-msgstr "Lese Manifest delta %s"
+msgstr "Lese Manifest-Delta %s"
 
 msgid "crosschecking files in changesets and manifests\n"
-msgstr "Gegenüberstellung der Dateien in Änderungssätzen und Manifesten\n"
+msgstr "Überkreuzprüfung der Dateien in Änderungssätzen und Manifesten\n"
 
 #, python-format
 msgid "changeset refers to unknown manifest %s"
@@ -20814,7 +21119,7 @@
 msgstr "im Änderungssatz aber nicht im Manifest"
 
 msgid "in manifest but not in changeset"
-msgstr "im Manifest, aber nicht im Änderungssatz"
+msgstr "im Manifest aber nicht im Änderungssatz"
 
 msgid "checking files\n"
 msgstr "Prüfe Dateien\n"
@@ -20825,7 +21130,7 @@
 
 #, python-format
 msgid "broken revlog! (%s)"
-msgstr "Beschädigtes Revlof! (%s)"
+msgstr "Beschädigtes Revlog! (%s)"
 
 msgid "missing revlog!"
 msgstr "Fehlendes Revlog!"
@@ -20860,7 +21165,7 @@
 
 #, python-format
 msgid "%s in manifests not found"
-msgstr "%s nicht im Manifest gefunden"
+msgstr "%s nicht in den Manifestens gefunden"
 
 #, python-format
 msgid "warning: orphan revlog '%s'"
@@ -20918,3 +21223,4 @@
 "\n"
 "    Siehe 'hg help dates' für eine Liste gültiger Formate für -d/--date.\n"
 "    "
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/i18n/ro.po	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,12576 @@
+# Romanian translation for Mercurial
+# Traducerea în limba română pentru Mercurial
+#
+# Copyright (C) 2010 Matt Mackall <mpm@selenic.com> and others
+#
+#
+# Glosar de traduceri
+# ===================
+# abort         a abandona
+# ancestor      strămoș
+# branch        ramură
+# bundle        pachet (fascicul), a crea un pachet
+# change        modificare
+# changeset     set de modificări
+# changegroup   grup de modificări
+# check out     a actualiza, a extrage, checkout
+# children      fiu
+# commit        depozitare, predare, încredințare, commit
+# commit (v)    a depozita, a preda, a încredința, commit
+# consistency   consistență (termen informatic; sens general: coerență)
+# deprecated    învechit
+# diff          diff
+# dirstate      dirstate
+# discard       a înlătura, a renunța la
+# expand        a extinde
+# fold          a plia
+# flag          indicator
+# given         specificat
+# guard         gardă / a garda
+# head          capăt
+# imply         a implica, a sugera
+# incoming      de primit
+# hook          hook, acțiune, ancoră 
+# merge         a fuziona (a contopi, a îmbina)
+# notation      notație
+# pattern       tipar
+# remove        a înlătura, a elimina
+# repository    depozit (magazie)
+# resolve       a determina (a rezolva)
+# manage        a gestiona
+# manifest      manifest (există în română, ca "declarație/listă de mărfuri")
+# map           corespondență, mapare
+# merge         a fuziona
+# notify        a înștiința
+# outgoing      de trimis
+# outstanding   în suspensie
+# overview      rezumat
+# patch         patch
+# patch queue/stack     o stivă de patch-uri (mq)
+# patch series  serie/suită (completă) de patch-uri
+# pull          (pull), a aduce, a trage, a extrage,
+# push          (push), a duce, a împinge, a difuza, a distribui
+# rebase        a repoziționa, a disloca, a deplasa
+# remote        la distanță
+# rejects       respingeri, rejectări
+# retrieve      a recupera, a regăsi
+# revert        a reveni
+# revlog        revlog
+# rollback      ???
+# shelf         ? raft
+# shelve        ? a pune pe raft
+# switch        a comuta
+# tag           etichetă / a eticheta
+# template      tipar
+# tip           vârf
+# topmost patch ultimul patch aplicat
+# track         a urmări
+# traceback     ?
+# undo          a anula, a reface, a desface
+# unrelated/unversioned/unmanaged/untracked repository          depozit neînrudit/neversionat/negestionat/neurmărit
+# update        a actualiza
+# (un)trusted   ?
+# working directory     directorul de lucru
+#
+# NOTĂ: - Terminologia de mai sus este departe de a fi completă sau perfectă.
+#         De completat și ameliorat
+# 	- Primul termen este cel considerat momentan cel mai potrivit.
+# 	- Măcar pentru primele versiuni, se recomandă păstrarea în paranteze
+# 	  a termenului englezesc, mai ales în cazul comenzilor.
+#
+# Câteva reguli:
+# - în ajutorul pentru o comandă, primul rând începe cu un verb
+#   la prezent fără majusculă
+# - în ajutorul pentru o comandă, descrierea opțiunilor se face
+#   printr-un verb la prezent, pers. a 3-a singular
+#
+# Dicționar de termeni curenți:
+#  - a   patch queue/stack    o stivă de patch-uri (mq)
+#  - the patch series         seria/suita (completă) de patch-uri
+#  -     rejects              respingeri, rejectări
+#  - to  revert               a reveni
+#  - the topmost patch        ultimul patch aplicat
+#  - an  unrelated repository un depozit neînrudit
+#  -     unversioned			neversionat
+#        unmanaged			negestionat
+#        untracked			neurmărit
+#  - the working directory    directorul de lucru
+#
+# Termeni de păstrat din engleză:
+#  - a   diff                 un diff
+#  - a   hook                 un hook
+#  - a   patch                un patch
+#
+# Daniel Dumitriu <daniel.dumitriu@gmail.com>, 2010.
+msgid ""
+msgstr ""
+"Project-Id-Version: Mercurial\n"
+"Report-Msgid-Bugs-To: <mercurial-devel@selenic.com>\n"
+"POT-Creation-Date: 2010-08-25 11:46+0200\n"
+"PO-Revision-Date: 2010-08-26 16:19+0200\n"
+"Last-Translator: Daniel Dumitriu <daniel.dumitriu@gmail.com>\n"
+"Language-Team: Romanian <>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: Plural-Forms: nplurals=3; plural=n==1 ? 0 : (n==0 || (n%100 > "
+"0 && n%100 < 20)) ? 1 : 2;\n"
+"X-Generator: Lokalize 1.0\n"
+
+#, python-format
+msgid " (default: %s)"
+msgstr " (implicit: %s)"
+
+msgid "Options"
+msgstr "Opțiuni"
+
+msgid "Commands"
+msgstr "Comenzi"
+
+msgid "    options:"
+msgstr "    opțiuni:"
+
+#, python-format
+msgid "    aliases: %s"
+msgstr "    alias: %s"
+
+msgid "hooks for controlling repository access"
+msgstr "hook-uri pentru controlul accesului la depozit"
+
+msgid ""
+"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 ""
+"Acest hook realizează permiterea sau interzicerea accesului\n"
+"în scriere la anumite ramuri și căi ale unui depozit, atunci când \n"
+"se primesc seturi de modificări prin pretxnchangegroup și pretxncommit."
+
+msgid ""
+"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)."
+msgstr ""
+"Autorizația este căutată pe baza numelui de utilizator local\n"
+"de pe sistemul unde rulează hook-ul, nu pe baza numelui celui care a\n"
+"publicat setul de modificări original (pentru că acesta e pur informativ)."
+
+msgid ""
+"The acl hook is best used along with a restricted shell like hgsh,\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 ""
+"Hook-ul acl e folosit optim împreună cu un shell restrictiv precum\n"
+"hgsh, care împiedică utilizatorii care doresc să se autentifice să aibă\n"
+"alte acțiuni în afară de push și pull. Hook-ul nu prezintă siguranță\n"
+"dacă utilizatorii au acces la shell interactiv, deoarece astfel ei pot\n"
+"dezactiva hook-ul. De asemenea, nu prezintă siguranță situația în\n"
+"care utilizatorii la distanță partajează un cont, deoarece nu există\n"
+"posibilitatea de a-i distinge."
+
+msgid "The order in which access checks are performed is:"
+msgstr "Ordinea în care se fac verificările de acces este:"
+
+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 ""
+"1) Lista cu interdicții pentru ramuri (secțiunea ``acl.deny.branches``)\n"
+"2) Lista cu permisiuni  pentru ramuri (secțiunea ``acl.allow.branches``)\n"
+"3) Lista cu interdicții pentru căi    (secțiunea ``acl.deny``)\n"
+"4) Lista cu permisiuni  pentru căi    (secțiunea ``acl.allow``)"
+
+msgid "The allow and deny sections take key-value pairs."
+msgstr "Secțiunile cu permisiuni și interdicții conțin perechi cheie-valoare."
+
+msgid ""
+"Branch-based Access Control\n"
+"---------------------------"
+msgstr ""
+"Controlul accesului pe bază de ramură\n"
+"-------------------------------------"
+
+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 ""
+"Utilizați secțiunile ``acl.deny.branches`` și ``acl.allow.branches``\n"
+"pentru a avea controlul accesului pe baza ramurii. În aceste secțiuni,\n"
+"cheile pot fi:"
+
+msgid ""
+"- a branch name, or\n"
+"- an asterisk, to match any branch;"
+msgstr ""
+"- un nume de ramură, sau\n"
+"- un asterisc, însemnând orice ramură;"
+
+msgid "The corresponding values can be either:"
+msgstr "Valorile corespunzatoare pot fi:"
+
+msgid ""
+"- a comma-separated list containing users and groups, or\n"
+"- an asterisk, to match anyone;"
+msgstr ""
+"- o listă separată prin virgule conținând utilizatori și grupuri, sau\n"
+"- un asterisc, însemnând oricine;"
+
+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 ""
+
+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"
+"  # 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 ""
+
+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 ""
+
+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"
+"  # 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 ""
+
+#, python-format
+msgid "group '%s' is undefined"
+msgstr ""
+
+#, python-format
+msgid ""
+"config error - hook type \"%s\" cannot stop incoming changesets nor commits"
+msgstr ""
+
+#, python-format
+msgid "acl: user \"%s\" denied on branch \"%s\" (changeset \"%s\")"
+msgstr ""
+
+#, python-format
+msgid "acl: user \"%s\" not allowed on branch \"%s\" (changeset \"%s\")"
+msgstr ""
+
+#, python-format
+msgid "acl: access denied for changeset %s"
+msgstr ""
+
+msgid "track a line of development with movable markers"
+msgstr ""
+
+msgid ""
+"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."
+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::"
+msgstr ""
+
+msgid ""
+"  [bookmarks]\n"
+"  track.current = True"
+msgstr ""
+
+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 ""
+"    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."
+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"
+"    "
+msgstr ""
+
+msgid "a bookmark of this name does not exist"
+msgstr ""
+
+msgid "a bookmark of the same name already exists"
+msgstr ""
+
+msgid "new bookmark name required"
+msgstr ""
+
+msgid "bookmark name required"
+msgstr ""
+
+msgid "bookmark name cannot contain newlines"
+msgstr ""
+
+msgid "bookmark names cannot consist entirely of whitespace"
+msgstr ""
+
+msgid "a bookmark cannot have the name of an existing branch"
+msgstr ""
+
+msgid "no bookmarks set\n"
+msgstr ""
+
+#, python-format
+msgid "updating bookmark %s\n"
+msgstr "se actualizează semnul de carte %s\n"
+
+#, python-format
+msgid "not updating divergent bookmark %s\n"
+msgstr "nu se actualizează semnul de carte divergent %s\n"
+
+#, python-format
+msgid "updating bookmark %s failed!\n"
+msgstr "actualizarea semnului de carte %s a eșuat!\n"
+
+#, python-format
+msgid "remote bookmark %s not found!"
+msgstr ""
+
+#, python-format
+msgid "importing bookmark %s\n"
+msgstr ""
+
+#, python-format
+msgid "exporting bookmark %s\n"
+msgstr ""
+
+#, python-format
+msgid "deleting remote bookmark %s\n"
+msgstr ""
+
+#, python-format
+msgid "bookmark %s does not exist on the local or remote repository!\n"
+msgstr ""
+
+msgid "searching for changes\n"
+msgstr "se caută modificări\n"
+
+msgid "no changes found\n"
+msgstr "nu s-au găsit modificări\n"
+
+#, python-format
+msgid "comparing with %s\n"
+msgstr "se compară cu %s\n"
+
+msgid "bookmark to import"
+msgstr ""
+
+msgid "bookmark to export"
+msgstr ""
+
+msgid "compare bookmark"
+msgstr ""
+
+msgid "force"
+msgstr ""
+
+msgid "REV"
+msgstr "REV"
+
+msgid "revision"
+msgstr "revizia"
+
+msgid "delete a given bookmark"
+msgstr ""
+
+msgid "NAME"
+msgstr "NUME"
+
+msgid "rename a given bookmark"
+msgstr ""
+
+msgid "hg bookmarks [-f] [-d] [-m NAME] [-r REV] [NAME]"
+msgstr ""
+
+msgid "hooks for integrating with the Bugzilla bug tracker"
+msgstr ""
+
+msgid ""
+"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."
+msgstr ""
+
+msgid ""
+"The hook updates the Bugzilla database directly. Only Bugzilla\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."
+msgstr ""
+
+msgid ""
+"The extension is configured through three different configuration\n"
+"sections. These keys are recognized in the [bugzilla] section:"
+msgstr ""
+
+msgid ""
+"host\n"
+"  Hostname of the MySQL server holding the Bugzilla database."
+msgstr ""
+
+msgid ""
+"db\n"
+"  Name of the Bugzilla database in MySQL. Default 'bugs'."
+msgstr ""
+
+msgid ""
+"user\n"
+"  Username to use to access MySQL server. Default 'bugs'."
+msgstr ""
+
+msgid ""
+"password\n"
+"  Password to use to access MySQL server."
+msgstr ""
+
+msgid ""
+"timeout\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."
+msgstr ""
+
+msgid ""
+"bzuser\n"
+"  Fallback Bugzilla user name to record comments with, if changeset\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'."
+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\"."
+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."
+msgstr ""
+
+msgid ""
+"style\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::"
+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."
+msgstr ""
+
+msgid ""
+"  Default 'changeset {node|short} in repo {root} refers '\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."
+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."
+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\""
+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}."
+msgstr ""
+
+msgid "Activating the extension::"
+msgstr ""
+
+msgid ""
+"    [extensions]\n"
+"    bugzilla ="
+msgstr ""
+
+msgid ""
+"    [hooks]\n"
+"    # run bugzilla hook on every change pulled or pushed in here\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. ::"
+msgstr ""
+
+msgid ""
+"    [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"
+msgstr ""
+
+msgid ""
+"    [web]\n"
+"    baseurl=http://dev.domain.com/hg"
+msgstr ""
+
+msgid ""
+"    [usermap]\n"
+"    user@emaildomain.com=user.name@bugzilladomain.com"
+msgstr ""
+
+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"
+msgstr ""
+
+msgid "    Changeset commit comment. Bug 1234.\n"
+msgstr ""
+
+#, python-format
+msgid "connecting to %s:%s as %s, password %s\n"
+msgstr ""
+
+#, python-format
+msgid "query: %s %s\n"
+msgstr ""
+
+#, python-format
+msgid "failed query: %s %s\n"
+msgstr ""
+
+msgid "unknown database schema"
+msgstr ""
+
+#, python-format
+msgid "bug %d already knows about changeset %s\n"
+msgstr ""
+
+msgid "telling bugzilla to send mail:\n"
+msgstr ""
+
+#, python-format
+msgid "  bug %s\n"
+msgstr ""
+
+#, python-format
+msgid "running notify command %s\n"
+msgstr ""
+
+#, python-format
+msgid "bugzilla notify command %s"
+msgstr ""
+
+msgid "done\n"
+msgstr ""
+
+#, python-format
+msgid "looking up user %s\n"
+msgstr ""
+
+#, python-format
+msgid "cannot find bugzilla user id for %s"
+msgstr ""
+
+#, python-format
+msgid "cannot find bugzilla user id for %s or %s"
+msgstr ""
+
+#, python-format
+msgid "bugzilla version %s not supported"
+msgstr ""
+
+msgid ""
+"changeset {node|short} in repo {root} refers to bug {bug}.\n"
+"details:\n"
+"\t{desc|tabindent}"
+msgstr ""
+
+#, python-format
+msgid "python mysql support not available: %s"
+msgstr ""
+
+#, python-format
+msgid "hook type %s does not pass a changeset id"
+msgstr ""
+
+#, python-format
+msgid "database error: %s"
+msgstr ""
+
+msgid "command to display child changesets"
+msgstr ""
+
+msgid "show the children of the given or working directory revision"
+msgstr "afișează copiii reviziei specificate sau a celei din directorul curent"
+
+msgid ""
+"    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"
+"    file was last changed (after the working directory revision or the\n"
+"    argument to --rev if given) is printed.\n"
+"    "
+msgstr ""
+
+msgid "show children of the specified revision"
+msgstr "afișează fiii reviziei specificate"
+
+msgid "hg children [-r REV] [FILE]"
+msgstr ""
+
+msgid "command to display statistics about repository history"
+msgstr ""
+
+#, python-format
+msgid "Revision %d is a merge, ignoring...\n"
+msgstr ""
+
+msgid "analyzing"
+msgstr ""
+
+msgid "histogram of changes to the repository"
+msgstr ""
+
+msgid ""
+"    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."
+msgstr ""
+
+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 ""
+
+msgid "    Examples::"
+msgstr ""
+
+msgid ""
+"      # display count of changed lines for every committer\n"
+"      hg churn -t '{author|email}'"
+msgstr ""
+
+msgid ""
+"      # display daily activity graph\n"
+"      hg churn -f '%H' -s -c"
+msgstr ""
+
+msgid ""
+"      # display activity of developers by month\n"
+"      hg churn -f '%Y-%m' -s -c"
+msgstr ""
+
+msgid ""
+"      # display count of lines changed in every year\n"
+"      hg churn -f '%Y' -s"
+msgstr ""
+
+msgid ""
+"    It is possible to map alternate email addresses to a main address\n"
+"    by providing a file using the following format::"
+msgstr ""
+
+msgid "      <alias email> = <actual email>"
+msgstr "      <email alias> = <email actual>"
+
+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 ""
+
+msgid "count rate for the specified revision or range"
+msgstr ""
+
+msgid "DATE"
+msgstr ""
+
+msgid "count rate for revisions matching date spec"
+msgstr ""
+
+msgid "TEMPLATE"
+msgstr "ȘABLON"
+
+msgid "template to group changesets"
+msgstr ""
+
+msgid "FORMAT"
+msgstr ""
+
+msgid "strftime-compatible format for grouping by date"
+msgstr ""
+
+msgid "count rate by number of changesets"
+msgstr ""
+
+msgid "sort by key (default: sort by count)"
+msgstr ""
+
+msgid "display added/removed lines separately"
+msgstr ""
+
+msgid "FILE"
+msgstr ""
+
+msgid "file with email aliases"
+msgstr ""
+
+msgid "hg churn [-d DATE] [-r REV] [--aliases FILE] [FILE]"
+msgstr ""
+
+msgid "colorize output from some commands"
+msgstr ""
+
+msgid ""
+"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."
+msgstr ""
+
+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."
+msgstr ""
+
+msgid "Default effects may be overridden from the .hgrc file::"
+msgstr ""
+
+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"
+msgstr ""
+
+msgid ""
+"  # 'none' turns off all effects\n"
+"  status.clean = none\n"
+"  status.copied = none"
+msgstr ""
+
+msgid ""
+"  qseries.applied = blue bold underline\n"
+"  qseries.unapplied = black bold\n"
+"  qseries.missing = red bold"
+msgstr ""
+
+msgid ""
+"  diff.diffline = bold\n"
+"  diff.extended = cyan bold\n"
+"  diff.file_a = red bold\n"
+"  diff.file_b = green bold\n"
+"  diff.hunk = magenta\n"
+"  diff.deleted = red\n"
+"  diff.inserted = green\n"
+"  diff.changed = white\n"
+"  diff.trailingwhitespace = bold red_background"
+msgstr ""
+
+msgid ""
+"  resolve.unresolved = red bold\n"
+"  resolve.resolved = green bold"
+msgstr ""
+
+msgid "  bookmarks.current = green"
+msgstr ""
+
+msgid ""
+"  branches.active = none\n"
+"  branches.closed = black bold\n"
+"  branches.current = green\n"
+"  branches.inactive = none"
+msgstr ""
+
+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 ""
+
+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 ""
+
+msgid "win32console not found, please install pywin32\n"
+msgstr ""
+
+msgid "when to colorize (always, auto, or never)"
+msgstr "când să se coloreze (întotdeauna, auto, sau niciodată)"
+
+msgid "TYPE"
+msgstr ""
+
+msgid "import revisions from foreign VCS repositories into Mercurial"
+msgstr ""
+
+msgid "convert a foreign SCM repository to a Mercurial one."
+msgstr ""
+
+msgid "    Accepted source formats [identifiers]:"
+msgstr ""
+
+msgid ""
+"    - Mercurial [hg]\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]"
+msgstr ""
+
+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."
+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:"
+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."
+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."
+msgstr ""
+
+msgid ""
+"    --sourcesort  try to preserve source revisions order, only\n"
+"                  supported by Mercurial sources."
+msgstr ""
+
+msgid ""
+"    If <REVMAP> isn't given, it will be put in a default location\n"
+"    (<dest>/.hg/shamap by default). The <REVMAP> is a simple text file\n"
+"    that maps each source commit ID to the destination ID for that\n"
+"    revision, like so::"
+msgstr ""
+
+msgid "      <source ID> <destination ID>"
+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."
+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"
+msgstr ""
+
+msgid ""
+"    The filemap is a file that allows filtering and remapping of files\n"
+"    and directories. Each line can contain one of the following\n"
+"    directives::"
+msgstr ""
+
+msgid "      include path/to/file-or-dir"
+msgstr ""
+
+msgid "      exclude path/to/file-or-dir"
+msgstr ""
+
+msgid "      rename path/to/source path/to/destination"
+msgstr ""
+
+msgid ""
+"    Comment lines start with '#'. A specified path matches if it\n"
+"    equals the full relative name of a file or one of its parent\n"
+"    directories. The 'include' or 'exclude' directive with the longest\n"
+"    matching path applies, so line order does not matter."
+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 if\n"
+"    it is converted. To rename from a subdirectory into the root of\n"
+"    the repository, use '.' 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"
+"    graft two disconnected series of history together. Each entry\n"
+"    contains a key, followed by a space, followed by one or two\n"
+"    comma-separated values. The key is the revision ID in the source\n"
+"    revision control system whose parents should be modified (same\n"
+"    format as a key in .hg/shamap). The values are the revision IDs\n"
+"    (in either the source or destination revision control system) that\n"
+"    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."
+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"
+"    to help fix even the most badly mismanaged repositories and turn them\n"
+"    into nicely structured Mercurial repositories. The branchmap contains\n"
+"    lines of the form \"original_branch_name new_branch_name\".\n"
+"    \"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."
+msgstr ""
+
+msgid ""
+"    Mercurial Source\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"
+"        Mercurial.\n"
+"    --config convert.hg.saverev=False         (boolean)\n"
+"        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"
+msgstr ""
+
+msgid ""
+"    CVS Source\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"
+"    repository is :local:. The conversion uses the top level directory\n"
+"    in the sandbox to find the CVS repository, and then uses CVS rlog\n"
+"    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."
+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"
+"    --config convert.cvsps.fuzz=60            (integer)\n"
+"        Specify the maximum time (in seconds) that is allowed between\n"
+"        commits with identical user and log message in a single\n"
+"        changeset. When very large files were checked in as part of a\n"
+"        changeset then the default may not be long enough.\n"
+"    --config convert.cvsps.mergeto='{{mergetobranch ([-\\w]+)}}'\n"
+"        Specify a regular expression to which commit log messages are\n"
+"        matched. If a match occurs, then the conversion process will\n"
+"        insert a dummy revision merging the branch on which this log\n"
+"        message occurs to the branch indicated in the regex.\n"
+"    --config convert.cvsps.mergefrom='{{mergefrombranch ([-\\w]+)}}'\n"
+"        Specify a regular expression to which commit log messages are\n"
+"        matched. If a match occurs, then the conversion process will\n"
+"        add the most recent revision on the branch indicated in the\n"
+"        regex as the second parent of the changeset.\n"
+"    --config hook.cvslog\n"
+"        Specify a Python function to be called at the end of gathering\n"
+"        the CVS log. The function is passed a list with the log entries,\n"
+"        and can modify the entries in-place, or add or delete them.\n"
+"    --config hook.cvschangesets\n"
+"        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."
+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."
+msgstr ""
+
+msgid ""
+"    Subversion Source\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"
+"    replaces the default branch. If \"svn://repo/path/branches\" exists,\n"
+"    its subdirectories are listed as possible branches. If\n"
+"    \"svn://repo/path/tags\" exists, it is looked for tags referencing\n"
+"    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."
+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"
+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."
+msgstr ""
+
+msgid ""
+"    --config convert.svn.startrev=0           (svn revision number)\n"
+"        specify start Subversion revision."
+msgstr ""
+
+msgid ""
+"    Perforce Source\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."
+msgstr ""
+
+msgid ""
+"    It is possible to limit the amount of source history to be\n"
+"    converted by specifying an initial Perforce revision."
+msgstr ""
+
+msgid ""
+"    --config convert.p4.startrev=0            (perforce changelist number)\n"
+"        specify initial Perforce revision."
+msgstr ""
+
+msgid ""
+"    Mercurial Destination\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"
+msgstr ""
+
+msgid "    "
+msgstr ""
+
+msgid "create changeset information from CVS"
+msgstr ""
+
+msgid ""
+"    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."
+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"
+"    dates."
+msgstr ""
+
+msgid "username mapping filename"
+msgstr ""
+
+msgid "destination repository type"
+msgstr ""
+
+msgid "remap file names using contents of file"
+msgstr ""
+
+msgid "import up to target revision REV"
+msgstr ""
+
+msgid "source repository type"
+msgstr ""
+
+msgid "splice synthesized history into place"
+msgstr ""
+
+msgid "change branch names while converting"
+msgstr ""
+
+msgid "try to sort changesets by branches"
+msgstr ""
+
+msgid "try to sort changesets by date"
+msgstr ""
+
+msgid "preserve source changesets order"
+msgstr ""
+
+msgid "hg convert [OPTION]... SOURCE [DEST [REVMAP]]"
+msgstr ""
+
+msgid "only return changes on specified branches"
+msgstr ""
+
+msgid "prefix to remove from file names"
+msgstr ""
+
+msgid "only return changes after or between specified tags"
+msgstr ""
+
+msgid "update cvs log cache"
+msgstr ""
+
+msgid "create new cvs log cache"
+msgstr ""
+
+msgid "set commit time fuzz in seconds"
+msgstr ""
+
+msgid "specify cvsroot"
+msgstr ""
+
+msgid "show parent changesets"
+msgstr "afișează seturile de modificări părinte"
+
+msgid "show current changeset in ancestor branches"
+msgstr "afișează setul de modificări curent în ramurile strămoș"
+
+msgid "ignored for compatibility"
+msgstr ""
+
+msgid "hg debugcvsps [OPTION]... [PATH]..."
+msgstr ""
+
+#, python-format
+msgid "%s does not look like a Bazaar repository"
+msgstr ""
+
+msgid "Bazaar modules could not be loaded"
+msgstr ""
+
+msgid ""
+"warning: lightweight checkouts may cause conversion failures, try with a "
+"regular branch instead.\n"
+msgstr ""
+
+msgid "bzr source type could not be determined\n"
+msgstr ""
+
+#, python-format
+msgid "%s is not a valid revision in current branch"
+msgstr ""
+
+#, python-format
+msgid "%s is not available in %s anymore"
+msgstr ""
+
+#, python-format
+msgid "%s.%s symlink has no target"
+msgstr ""
+
+#, python-format
+msgid "cannot find required \"%s\" tool"
+msgstr ""
+
+#, python-format
+msgid "%s error:\n"
+msgstr ""
+
+#, python-format
+msgid "syntax error in %s(%d): key/value pair expected"
+msgstr ""
+
+#, python-format
+msgid "could not open map file %r: %s"
+msgstr ""
+
+#, python-format
+msgid "%s: invalid source repository type"
+msgstr "%s: tipul depozitului sursă este invalid"
+
+#, python-format
+msgid "%s: missing or unsupported repository"
+msgstr ""
+
+#, python-format
+msgid "%s: invalid destination repository type"
+msgstr ""
+
+#, python-format
+msgid "convert: %s\n"
+msgstr ""
+
+#, python-format
+msgid "%s: unknown repository type"
+msgstr ""
+
+msgid "getting files"
+msgstr "se obțin fișierele"
+
+msgid "revisions"
+msgstr ""
+
+msgid "scanning"
+msgstr ""
+
+#, python-format
+msgid "unknown sort mode: %s"
+msgstr ""
+
+#, python-format
+msgid "cycle detected between %s and %s"
+msgstr ""
+
+msgid "not all revisions were sorted"
+msgstr ""
+
+#, python-format
+msgid "Writing author map file %s\n"
+msgstr ""
+
+#, python-format
+msgid "Ignoring bad line in author map file %s: %s\n"
+msgstr ""
+
+#, python-format
+msgid "mapping author %s to %s\n"
+msgstr ""
+
+#, python-format
+msgid "overriding mapping for author %s, was %s, will be %s\n"
+msgstr ""
+
+#, python-format
+msgid "spliced in %s as parents of %s\n"
+msgstr ""
+
+msgid "scanning source...\n"
+msgstr ""
+
+msgid "sorting...\n"
+msgstr ""
+
+msgid "converting...\n"
+msgstr ""
+
+#, python-format
+msgid "source: %s\n"
+msgstr ""
+
+msgid "converting"
+msgstr ""
+
+#, python-format
+msgid "assuming destination %s\n"
+msgstr ""
+
+msgid "more than one sort mode specified"
+msgstr ""
+
+msgid "--sourcesort is not supported by this data source"
+msgstr ""
+
+#, python-format
+msgid "%s does not look like a CVS checkout"
+msgstr ""
+
+#, python-format
+msgid "revision %s is not a patchset number"
+msgstr ""
+
+#, python-format
+msgid "connecting to %s\n"
+msgstr ""
+
+msgid "CVS pserver authentication failed"
+msgstr ""
+
+#, python-format
+msgid ""
+"unexpected response from CVS server (expected \"Valid-requests\", but got %r)"
+msgstr ""
+
+#, python-format
+msgid "%d bytes missing from remote file"
+msgstr ""
+
+msgid "malformed response from CVS"
+msgstr ""
+
+#, python-format
+msgid "cvs server: %s\n"
+msgstr ""
+
+#, python-format
+msgid "unknown CVS response: %s"
+msgstr ""
+
+msgid "collecting CVS rlog\n"
+msgstr ""
+
+msgid "not a CVS sandbox"
+msgstr ""
+
+#, python-format
+msgid "reading cvs log cache %s\n"
+msgstr ""
+
+#, python-format
+msgid "cache has %d log entries\n"
+msgstr ""
+
+#, python-format
+msgid "error reading cache: %r\n"
+msgstr ""
+
+#, python-format
+msgid "running %s\n"
+msgstr ""
+
+msgid "RCS file must be followed by working file"
+msgstr ""
+
+msgid "must have at least some revisions"
+msgstr ""
+
+msgid "expected revision number"
+msgstr ""
+
+msgid "revision must be followed by date line"
+msgstr ""
+
+msgid "log cache overlaps with new log entries, re-run without cache."
+msgstr ""
+
+#, python-format
+msgid "writing cvs log cache %s\n"
+msgstr ""
+
+#, python-format
+msgid "%d log entries\n"
+msgstr ""
+
+msgid "creating changesets\n"
+msgstr ""
+
+msgid "synthetic changeset cannot have multiple parents"
+msgstr ""
+
+#, python-format
+msgid ""
+"warning: CVS commit message references non-existent branch %r:\n"
+"%s\n"
+msgstr ""
+
+#, python-format
+msgid "%d changeset entries\n"
+msgstr ""
+
+#, python-format
+msgid "%s does not look like a darcs repository"
+msgstr ""
+
+#, python-format
+msgid "darcs version 2.1 or newer needed (found %r)"
+msgstr ""
+
+msgid "Python ElementTree module is not available"
+msgstr ""
+
+msgid "internal calling inconsistency"
+msgstr ""
+
+msgid "errors in filemap"
+msgstr ""
+
+#, python-format
+msgid "%s:%d: path to %s is missing\n"
+msgstr ""
+
+#, python-format
+msgid "%s:%d: %r already in %s list\n"
+msgstr ""
+
+#, python-format
+msgid "%s:%d: superfluous / in %s %r\n"
+msgstr ""
+
+#, python-format
+msgid "%s:%d: unknown directive %r\n"
+msgstr ""
+
+msgid "source repository doesn't support --filemap"
+msgstr ""
+
+#, python-format
+msgid "%s does not look like a Git repository"
+msgstr ""
+
+msgid "cannot retrieve git heads"
+msgstr ""
+
+#, python-format
+msgid "cannot read %r object at %s"
+msgstr ""
+
+#, python-format
+msgid "cannot read changes in %s"
+msgstr ""
+
+#, python-format
+msgid "cannot read tags from %s"
+msgstr ""
+
+#, python-format
+msgid "%s does not look like a GNU Arch repository"
+msgstr ""
+
+msgid "cannot find a GNU Arch tool"
+msgstr ""
+
+#, python-format
+msgid "analyzing tree version %s...\n"
+msgstr ""
+
+#, python-format
+msgid ""
+"tree analysis stopped because it points to an unregistered archive %s...\n"
+msgstr ""
+
+#, python-format
+msgid "could not parse cat-log of %s"
+msgstr ""
+
+#, python-format
+msgid "%s is not a local Mercurial repository"
+msgstr ""
+
+#, python-format
+msgid "initializing destination %s repository\n"
+msgstr ""
+
+#, python-format
+msgid "could not create hg repository %s as sink"
+msgstr ""
+
+#, python-format
+msgid "pulling from %s into %s\n"
+msgstr ""
+
+msgid "filtering out empty revision\n"
+msgstr ""
+
+msgid "updating tags\n"
+msgstr "se actualizează etichetele\n"
+
+#, python-format
+msgid "%s is not a valid start revision"
+msgstr ""
+
+#, python-format
+msgid "ignoring: %s\n"
+msgstr ""
+
+#, python-format
+msgid "%s does not look like a monotone repository"
+msgstr ""
+
+#, python-format
+msgid "copying file in renamed directory from '%s' to '%s'"
+msgstr ""
+
+#, python-format
+msgid "%s does not look like a P4 repository"
+msgstr ""
+
+msgid "reading p4 views\n"
+msgstr ""
+
+msgid "collecting p4 changelists\n"
+msgstr ""
+
+msgid "Mercurial failed to run itself, check hg executable is in PATH"
+msgstr ""
+
+msgid ""
+"svn: cannot probe remote repository, assume it could be a subversion "
+"repository. Use --source-type if you know better.\n"
+msgstr ""
+
+#, python-format
+msgid "%s does not look like a Subversion repository"
+msgstr "%s nu pare a fi un depozit Subversion"
+
+msgid "Subversion python bindings could not be loaded"
+msgstr ""
+
+#, python-format
+msgid "Subversion python bindings %d.%d found, 1.4 or later required"
+msgstr ""
+
+msgid "Subversion python bindings are too old, 1.4 or later required"
+msgstr ""
+
+#, python-format
+msgid "svn: revision %s is not an integer"
+msgstr ""
+
+#, python-format
+msgid "svn: start revision %s is not an integer"
+msgstr ""
+
+#, python-format
+msgid "no revision found in module %s"
+msgstr ""
+
+#, python-format
+msgid "expected %s to be at %r, but not found"
+msgstr ""
+
+#, python-format
+msgid "found %s at %r\n"
+msgstr ""
+
+#, python-format
+msgid "ignoring empty branch %s\n"
+msgstr ""
+
+#, python-format
+msgid "found branch %s at %d\n"
+msgstr ""
+
+msgid "svn: start revision is not supported with more than one branch"
+msgstr ""
+
+#, python-format
+msgid "svn: no revision found after start revision %d"
+msgstr ""
+
+#, python-format
+msgid "%s not found up to revision %d"
+msgstr ""
+
+msgid "scanning paths"
+msgstr ""
+
+#, python-format
+msgid "found parent of branch %s at %d: %s\n"
+msgstr ""
+
+#, python-format
+msgid "fetching revision log for \"%s\" from %d to %d\n"
+msgstr ""
+
+#, python-format
+msgid "svn: branch has no revision %s"
+msgstr ""
+
+#, python-format
+msgid "initializing svn repository %r\n"
+msgstr ""
+
+#, python-format
+msgid "initializing svn working copy %r\n"
+msgstr ""
+
+msgid "unexpected svn output:\n"
+msgstr ""
+
+msgid "unable to cope with svn output"
+msgstr ""
+
+msgid "writing Subversion tags is not yet implemented\n"
+msgstr ""
+
+msgid "automatically manage newlines in repository files"
+msgstr ""
+
+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 ""
+
+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 ""
+
+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 ""
+
+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 ""
+
+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 ""
+
+msgid "Example versioned ``.hgeol`` file::"
+msgstr ""
+
+msgid ""
+"  [patterns]\n"
+"  **.py = native\n"
+"  **.vcproj = CRLF\n"
+"  **.txt = native\n"
+"  Makefile = LF\n"
+"  **.jpg = BIN"
+msgstr ""
+
+msgid ""
+"  [repository]\n"
+"  native = LF"
+msgstr ""
+
+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 ""
+
+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 ""
+
+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 ""
+
+msgid ""
+"See :hg:`help patterns` for more information about the glob patterns\n"
+"used.\n"
+msgstr ""
+
+#, python-format
+msgid "%s should not have CRLF line endings"
+msgstr ""
+
+#, python-format
+msgid "%s should not have LF line endings"
+msgstr ""
+
+msgid "the eol extension is incompatible with the win32text extension"
+msgstr ""
+
+#, python-format
+msgid "ignoring unknown EOL style '%s' from %s\n"
+msgstr ""
+
+#, python-format
+msgid "inconsistent newline style in %s\n"
+msgstr ""
+
+msgid "command to allow external programs to compare revisions"
+msgstr ""
+
+msgid ""
+"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."
+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. ::"
+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"
+msgstr ""
+
+msgid ""
+"  # add new command called vdiff, runs kdiff3\n"
+"  vdiff = kdiff3"
+msgstr ""
+
+msgid ""
+"  # add new command called meld, runs meld (no need to name twice)\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)'"
+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 ""
+
+msgid ""
+"  [diff-tools]\n"
+"  kdiff3.diffargs=--L1 '$plabel1' --L2 '$clabel' $parent $child"
+msgstr ""
+
+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
+msgid "making snapshot of %d files from rev %s\n"
+msgstr ""
+
+#, python-format
+msgid "making snapshot of %d files from working directory\n"
+msgstr ""
+
+msgid "cannot specify --rev and --change at the same time"
+msgstr ""
+
+msgid "cleaning up temp directory\n"
+msgstr ""
+
+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\"."
+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."
+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"
+"    revisions are specified, the working directory files are compared\n"
+"    to its parent."
+msgstr ""
+
+msgid "CMD"
+msgstr "CMD"
+
+msgid "comparison program to run"
+msgstr ""
+
+msgid "OPT"
+msgstr ""
+
+msgid "pass option to comparison program"
+msgstr ""
+
+msgid "change made by revision"
+msgstr ""
+
+msgid "hg extdiff [OPT]... [FILE]..."
+msgstr ""
+
+#, python-format
+msgid "use %(path)s to diff repository (or selected files)"
+msgstr ""
+
+#, python-format
+msgid ""
+"    Show differences between revisions for the specified files, using\n"
+"    the %(path)s program."
+msgstr ""
+
+#, python-format
+msgid "hg %s [OPTION]... [FILE]..."
+msgstr "hg %s [OPȚIUNE]... [FIȘIER]..."
+
+msgid "pull, update and merge in one command"
+msgstr ""
+
+msgid "pull changes from a remote repository, merge new changes if needed."
+msgstr ""
+
+msgid ""
+"    This finds all changes from the repository at the specified path\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."
+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."
+msgstr ""
+
+msgid ""
+"    See :hg:`help dates` for a list of formats valid for -d/--date.\n"
+"    "
+msgstr ""
+"    Vezi :hg:`help dates` pentru o listă de formate valide cu d/--date.\n"
+"    "
+
+msgid ""
+"working dir not at branch tip (use \"hg update\" to check out branch tip)"
+msgstr ""
+
+msgid "outstanding uncommitted merge"
+msgstr "fuziune nedepozitată în suspensie"
+
+msgid "outstanding uncommitted changes"
+msgstr "modificări nedepozitate în suspensie"
+
+msgid "working directory is missing some files"
+msgstr ""
+
+msgid ""
+"multiple heads in this branch (use \"hg heads .\" and \"hg merge\" to merge)"
+msgstr ""
+
+#, python-format
+msgid "pulling from %s\n"
+msgstr ""
+
+msgid ""
+"Other repository doesn't support revision lookup, so a rev cannot be "
+"specified."
+msgstr ""
+
+#, python-format
+msgid ""
+"not merging with %d other new branch heads (use \"hg heads .\" and \"hg merge"
+"\" to merge them)\n"
+msgstr ""
+
+#, python-format
+msgid "updating to %d:%s\n"
+msgstr "se actualizează la %d:%s\n"
+
+#, python-format
+msgid "merging with %d:%s\n"
+msgstr ""
+
+#, python-format
+msgid "new changeset %d:%s merges remote changes with local\n"
+msgstr ""
+
+msgid "a specific revision you would like to pull"
+msgstr ""
+
+msgid "edit commit message"
+msgstr ""
+
+msgid "edit commit message (DEPRECATED)"
+msgstr ""
+
+msgid "switch parents when merging"
+msgstr ""
+
+msgid "hg fetch [SOURCE]"
+msgstr ""
+
+msgid "commands to sign and verify changesets"
+msgstr ""
+
+msgid "error while verifying signature"
+msgstr ""
+
+#, python-format
+msgid "%s Bad signature from \"%s\"\n"
+msgstr ""
+
+#, python-format
+msgid "%s Note: Signature has expired (signed by: \"%s\")\n"
+msgstr ""
+
+#, python-format
+msgid "%s Note: This key has expired (signed by: \"%s\")\n"
+msgstr ""
+
+msgid "list signed changesets"
+msgstr ""
+
+#, python-format
+msgid "%s:%d node does not exist\n"
+msgstr ""
+
+msgid "verify all the signatures there may be for a particular revision"
+msgstr ""
+
+#, python-format
+msgid "No valid signature for %s\n"
+msgstr ""
+
+msgid "add a signature for the current or given revision"
+msgstr ""
+
+msgid ""
+"    If no revision is given, the parent of the working directory is used,\n"
+"    or tip if no revision is checked out."
+msgstr ""
+
+msgid "uncommitted merge - please provide a specific revision"
+msgstr ""
+
+#, python-format
+msgid "Signing %d:%s\n"
+msgstr ""
+
+msgid "Error while signing"
+msgstr ""
+
+msgid ""
+"working copy of .hgsigs is changed (please commit .hgsigs manually or use --"
+"force)"
+msgstr ""
+
+msgid "unknown signature version"
+msgstr ""
+
+msgid "make the signature local"
+msgstr ""
+
+msgid "sign even if the sigfile is modified"
+msgstr ""
+
+msgid "do not commit the sigfile after signing"
+msgstr ""
+
+msgid "ID"
+msgstr ""
+
+msgid "the key id to sign with"
+msgstr ""
+
+msgid "TEXT"
+msgstr ""
+
+msgid "commit message"
+msgstr ""
+
+msgid "hg sign [OPTION]... [REVISION]..."
+msgstr "hg sign [OPÈšIUNE]... [REVIZIE].."
+
+msgid "hg sigcheck REVISION"
+msgstr ""
+
+msgid "hg sigs"
+msgstr ""
+
+msgid "command to view revision graphs from a shell"
+msgstr ""
+
+msgid ""
+"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 ""
+
+#, python-format
+msgid "--graph option is incompatible with --%s"
+msgstr ""
+
+msgid "show revision history alongside an ASCII revision graph"
+msgstr "afișează istoricul reviziilor împreună cu un graf ASCII al reviziilor"
+
+msgid ""
+"    Print a revision history alongside a revision graph drawn with\n"
+"    ASCII characters."
+msgstr ""
+"    Afișează un istoric al reviziilor împreună cu un graf al reviziilor\n"
+"    desenat cu caractere ASCII."
+
+msgid ""
+"    Nodes printed as an @ character are parents of the working\n"
+"    directory.\n"
+"    "
+msgstr ""
+"    Nodurile afișate cu un caracter @ sunt părinți ai directorului de "
+"lucru.\n"
+"    "
+
+msgid "show the revision DAG"
+msgstr "afișează graful (DAG) reviziilor"
+
+msgid "NUM"
+msgstr ""
+
+msgid "limit number of changes displayed"
+msgstr "limitează numărul de modificări afișat"
+
+msgid "show patch"
+msgstr "afișează patch-ul"
+
+msgid "show the specified revision or range"
+msgstr "afișează revizia sau intervalul specificat"
+
+msgid "hg glog [OPTION]... [FILE]"
+msgstr ""
+
+msgid "hooks for integrating with the CIA.vc notification service"
+msgstr ""
+
+msgid ""
+"This is meant to be run as a changegroup or incoming hook. To\n"
+"configure it, set the following options in your hgrc::"
+msgstr ""
+
+msgid ""
+"  [cia]\n"
+"  # your registered CIA user name\n"
+"  user = foo\n"
+"  # the name of the project in CIA\n"
+"  project = foo\n"
+"  # the module (subproject) (optional)\n"
+"  #module = foo\n"
+"  # Append a diffstat to the log message (optional)\n"
+"  #diffstat = False\n"
+"  # Template to use for log messages (optional)\n"
+"  #template = {desc}\\n{baseurl}/rev/{node}-- {diffstat}\n"
+"  # Style to use (optional)\n"
+"  #style = foo\n"
+"  # The URL of the CIA notification service (optional)\n"
+"  # You can use mailto: URLs to send by email, eg\n"
+"  # mailto:cia@cia.vc\n"
+"  # 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"
+msgstr ""
+
+msgid ""
+"  [hooks]\n"
+"  # one of these:\n"
+"  changegroup.cia = python:hgcia.hook\n"
+"  #incoming.cia = python:hgcia.hook"
+msgstr ""
+
+msgid ""
+"  [web]\n"
+"  # If you want hyperlinks (optional)\n"
+"  baseurl = http://server/path/to/repo\n"
+msgstr ""
+
+#, python-format
+msgid "%s returned an error: %s"
+msgstr ""
+
+#, python-format
+msgid "hgcia: sending update to %s\n"
+msgstr ""
+
+msgid "email.from must be defined when sending by email"
+msgstr ""
+
+msgid "browse the repository in a graphical way"
+msgstr ""
+
+msgid ""
+"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.)"
+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."
+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::"
+msgstr ""
+
+msgid ""
+"  [hgk]\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::"
+msgstr ""
+
+msgid ""
+"  [hgk]\n"
+"  vdiff=vdiff"
+msgstr ""
+
+msgid ""
+"Revisions context menu will now display additional entries to fire\n"
+"vdiff on hovered and selected revisions.\n"
+msgstr ""
+
+msgid "diff trees from two commits"
+msgstr ""
+
+msgid "output common ancestor information"
+msgstr ""
+
+msgid "cat a specific revision"
+msgstr ""
+
+msgid "cat-file: type or revision not supplied\n"
+msgstr ""
+
+msgid "aborting hg cat-file only understands commits\n"
+msgstr "se abandonează hg cat-fișierul înțelege doar depozitări\n"
+
+msgid "parse given revisions"
+msgstr ""
+
+msgid "print revisions"
+msgstr ""
+
+msgid "print extension options"
+msgstr ""
+
+msgid "start interactive history viewer"
+msgstr ""
+
+msgid "hg view [-l LIMIT] [REVRANGE]"
+msgstr ""
+
+msgid "generate patch"
+msgstr ""
+
+msgid "recursive"
+msgstr ""
+
+msgid "pretty"
+msgstr ""
+
+msgid "stdin"
+msgstr ""
+
+msgid "detect copies"
+msgstr ""
+
+msgid "search"
+msgstr ""
+
+msgid "hg git-diff-tree [OPTION]... NODE1 NODE2 [FILE]..."
+msgstr ""
+
+msgid "hg debug-cat-file [OPTION]... TYPE FILE"
+msgstr ""
+
+msgid "hg debug-config"
+msgstr ""
+
+msgid "hg debug-merge-base REV REV"
+msgstr ""
+
+msgid "ignored"
+msgstr ""
+
+msgid "hg debug-rev-parse REV"
+msgstr ""
+
+msgid "header"
+msgstr ""
+
+msgid "topo-order"
+msgstr ""
+
+msgid "parents"
+msgstr ""
+
+msgid "max-count"
+msgstr ""
+
+msgid "hg debug-rev-list [OPTION]... REV..."
+msgstr ""
+
+msgid "syntax highlighting for hgweb (requires Pygments)"
+msgstr ""
+
+msgid ""
+"It depends on the Pygments syntax highlighting library:\n"
+"http://pygments.org/"
+msgstr ""
+
+msgid "There is a single configuration option::"
+msgstr ""
+
+msgid ""
+"  [web]\n"
+"  pygments_style = <style>"
+msgstr ""
+
+msgid "The default is 'colorful'.\n"
+msgstr ""
+
+msgid "accelerate status report using Linux's inotify service"
+msgstr ""
+
+msgid "start an inotify server for this repository"
+msgstr ""
+
+msgid "debugging information for inotify extension"
+msgstr ""
+
+msgid ""
+"    Prints the list of directories being watched by the inotify server.\n"
+"    "
+msgstr ""
+
+msgid "directories being watched:\n"
+msgstr ""
+
+msgid "run server in background"
+msgstr ""
+
+msgid "used internally by daemon mode"
+msgstr ""
+
+msgid "minutes to sit idle before exiting"
+msgstr ""
+
+msgid "name of file to write process ID to"
+msgstr ""
+
+msgid "hg inserve [OPTION]..."
+msgstr ""
+
+msgid "inotify-client: found dead inotify server socket; removing it\n"
+msgstr ""
+
+#, python-format
+msgid "inotify-client: could not start inotify server: %s\n"
+msgstr ""
+
+#, python-format
+msgid "inotify-client: could not talk to new inotify server: %s\n"
+msgstr ""
+
+#, python-format
+msgid "inotify-client: failed to contact inotify server: %s\n"
+msgstr ""
+
+msgid "inotify-client: received empty answer from inotify server"
+msgstr ""
+
+#, python-format
+msgid "(inotify: received response from incompatible server version %d)\n"
+msgstr ""
+
+#, python-format
+msgid "(inotify: received '%s' response when expecting '%s')\n"
+msgstr ""
+
+msgid "this system does not seem to support inotify"
+msgstr ""
+
+#, python-format
+msgid "*** the current per-user limit on the number of inotify watches is %s\n"
+msgstr ""
+
+msgid "*** this limit is too low to watch every directory in this repository\n"
+msgstr ""
+
+msgid "*** counting directories: "
+msgstr ""
+
+#, python-format
+msgid "found %d\n"
+msgstr ""
+
+#, python-format
+msgid "*** to raise the limit from %d to %d (run as root):\n"
+msgstr ""
+
+#, python-format
+msgid "***  echo %d > %s\n"
+msgstr ""
+
+#, python-format
+msgid "cannot watch %s until inotify watch limit is raised"
+msgstr ""
+
+#, python-format
+msgid "inotify service not available: %s"
+msgstr ""
+
+#, python-format
+msgid "watching %r\n"
+msgstr ""
+
+#, python-format
+msgid "watching directories under %r\n"
+msgstr ""
+
+#, python-format
+msgid "%s event: created %s\n"
+msgstr ""
+
+#, python-format
+msgid "%s event: deleted %s\n"
+msgstr ""
+
+#, python-format
+msgid "%s event: modified %s\n"
+msgstr ""
+
+#, python-format
+msgid "filesystem containing %s was unmounted\n"
+msgstr ""
+
+#, python-format
+msgid "%s readable: %d bytes\n"
+msgstr ""
+
+#, python-format
+msgid "%s below threshold - unhooking\n"
+msgstr ""
+
+#, python-format
+msgid "%s reading %d events\n"
+msgstr ""
+
+#, python-format
+msgid "%s hooking back up with %d bytes readable\n"
+msgstr ""
+
+msgid "finished setup\n"
+msgstr ""
+
+#, python-format
+msgid "status: %r %s -> %s\n"
+msgstr ""
+
+msgid "rescanning due to .hgignore change\n"
+msgstr ""
+
+msgid "cannot start: socket is already bound"
+msgstr ""
+
+msgid ""
+"cannot start: tried linking .hg/inotify.sock to a temporary socket but .hg/"
+"inotify.sock already exists"
+msgstr ""
+
+#, python-format
+msgid "answering query for %r\n"
+msgstr ""
+
+#, python-format
+msgid "received query from incompatible client version %d\n"
+msgstr ""
+
+#, python-format
+msgid "unrecognized query type: %s\n"
+msgstr ""
+
+msgid "expand expressions into changelog and summaries"
+msgstr ""
+
+msgid ""
+"This extension allows the use of a special syntax in summaries, which\n"
+"will be automatically expanded into links or any other arbitrary\n"
+"expression, much like InterWiki does."
+msgstr ""
+
+msgid ""
+"A few example patterns (link to bug tracking, etc.) that may be used\n"
+"in your hgrc::"
+msgstr ""
+
+msgid ""
+"  [interhg]\n"
+"  issues = s!issue(\\d+)!<a href=\"http://bts/issue\\1\">issue\\1</a>!\n"
+"  bugzilla = s!((?:bug|b=|(?=#?\\d{4,}))(?:\\s*#?)(\\d+))!<a..=\\2\">\\1</a>!"
+"i\n"
+"  boldify = s!(^|\\s)#(\\d+)\\b! <b>#\\2</b>!\n"
+msgstr ""
+
+#, python-format
+msgid "interhg: invalid pattern for %s: %s\n"
+msgstr ""
+
+#, python-format
+msgid "interhg: invalid regexp for %s: %s\n"
+msgstr ""
+
+msgid "expand keywords in tracked files"
+msgstr ""
+
+msgid ""
+"This extension expands RCS/CVS-like or self-customized $Keywords$ in\n"
+"tracked text files selected by your configuration."
+msgstr ""
+
+msgid ""
+"Keywords are only expanded in local repositories and not stored in the\n"
+"change history. The mechanism can be regarded as a convenience for the\n"
+"current user or for archive distribution."
+msgstr ""
+
+msgid ""
+"Configuration is done in the [keyword], [keywordset] and [keywordmaps]\n"
+"sections of hgrc files."
+msgstr ""
+
+msgid "Example::"
+msgstr ""
+
+msgid ""
+"    [keyword]\n"
+"    # expand keywords in every python file except those matching \"x*\"\n"
+"    **.py =\n"
+"    x*    = ignore"
+msgstr ""
+
+msgid ""
+"    [keywordset]\n"
+"    # prefer svn- over cvs-like default keywordmaps\n"
+"    svn = True"
+msgstr ""
+
+msgid ""
+"NOTE: the more specific you are in your filename patterns the less you\n"
+"lose speed in huge repositories."
+msgstr ""
+
+msgid ""
+"For [keywordmaps] template mapping and expansion demonstration and\n"
+"control run :hg:`kwdemo`. See :hg:`help templates` for a list of\n"
+"available templates and filters."
+msgstr ""
+
+msgid "Three additional date template filters are provided::"
+msgstr ""
+
+msgid ""
+"    utcdate      \"2006/09/18 15:13:13\"\n"
+"    svnutcdate   \"2006-09-18 15:13:13Z\"\n"
+"    svnisodate   \"2006-09-18 08:13:13 -700 (Mon, 18 Sep 2006)\""
+msgstr ""
+
+msgid ""
+"The default template mappings (view with :hg:`kwdemo -d`) can be\n"
+"replaced with customized keywords and templates. Again, run\n"
+":hg:`kwdemo` to control the results of your config changes."
+msgstr ""
+
+msgid ""
+"Before changing/disabling active keywords, run :hg:`kwshrink` to avoid\n"
+"the risk of inadvertently storing expanded keywords in the change\n"
+"history."
+msgstr ""
+
+msgid ""
+"To force expansion after enabling it, or a configuration change, run\n"
+":hg:`kwexpand`."
+msgstr ""
+
+msgid ""
+"Expansions spanning more than one line and incremental expansions,\n"
+"like CVS' $Log$, are not supported. A keyword template map \"Log =\n"
+"{desc}\" expands to the first line of the changeset description.\n"
+msgstr ""
+
+#, python-format
+msgid "overwriting %s expanding keywords\n"
+msgstr ""
+
+#, python-format
+msgid "overwriting %s shrinking keywords\n"
+msgstr ""
+
+msgid "[keyword] patterns cannot match"
+msgstr ""
+
+msgid "no [keyword] patterns configured"
+msgstr ""
+
+msgid "print [keywordmaps] configuration and an expansion example"
+msgstr ""
+
+msgid ""
+"    Show current, custom, or default keyword template maps and their\n"
+"    expansions."
+msgstr ""
+
+msgid ""
+"    Extend the current configuration by specifying maps as arguments\n"
+"    and using -f/--rcfile to source an external hgrc file."
+msgstr ""
+
+msgid "    Use -d/--default to disable current configuration."
+msgstr ""
+
+msgid ""
+"    See :hg:`help templates` for information on templates and filters.\n"
+"    "
+msgstr ""
+
+#, python-format
+msgid "creating temporary repository at %s\n"
+msgstr ""
+
+msgid ""
+"\n"
+"\tconfiguration using custom keyword template maps\n"
+msgstr ""
+
+msgid "\textending current template maps\n"
+msgstr ""
+
+msgid "\toverriding default template maps\n"
+msgstr ""
+
+msgid ""
+"\n"
+"\tconfiguration using default keyword template maps\n"
+msgstr ""
+
+msgid "\tdisabling current template maps\n"
+msgstr ""
+
+msgid ""
+"\n"
+"\tconfiguration using current keyword template maps\n"
+msgstr ""
+
+#, python-format
+msgid ""
+"\n"
+"keywords written to %s:\n"
+msgstr ""
+
+msgid "hg keyword configuration and expansion example"
+msgstr ""
+
+msgid ""
+"\n"
+"\tkeywords expanded\n"
+msgstr ""
+
+msgid "expand keywords in the working directory"
+msgstr ""
+
+msgid "    Run after (re)enabling keyword expansion."
+msgstr ""
+
+msgid ""
+"    kwexpand refuses to run if given files contain local changes.\n"
+"    "
+msgstr ""
+
+msgid "show files configured for keyword expansion"
+msgstr "afișează fișierele configurate pentru expandarea cuvintelor cheie"
+
+msgid ""
+"    List which files in the working directory are matched by the\n"
+"    [keyword] configuration patterns."
+msgstr ""
+
+msgid ""
+"    Useful to prevent inadvertent keyword expansion and to speed up\n"
+"    execution by including only files that are actual candidates for\n"
+"    expansion."
+msgstr ""
+
+msgid ""
+"    See :hg:`help keyword` on how to construct patterns both for\n"
+"    inclusion and exclusion of files."
+msgstr ""
+
+msgid ""
+"    With -A/--all and -v/--verbose the codes used to show the status\n"
+"    of files are::"
+msgstr ""
+
+msgid ""
+"      K = keyword expansion candidate\n"
+"      k = keyword expansion candidate (not tracked)\n"
+"      I = ignored\n"
+"      i = ignored (not tracked)\n"
+"    "
+msgstr ""
+
+msgid "revert expanded keywords in the working directory"
+msgstr ""
+
+msgid ""
+"    Run before changing/disabling active keywords or if you experience\n"
+"    problems with :hg:`import` or :hg:`merge`."
+msgstr ""
+
+msgid ""
+"    kwshrink refuses to run if given files contain local changes.\n"
+"    "
+msgstr ""
+
+#, fuzzy
+msgid "show default keyword template maps"
+msgstr "afișează corespondențele șabloanelor implicite de cuvinte cheie"
+
+msgid "read maps from rcfile"
+msgstr ""
+
+msgid "hg kwdemo [-d] [-f RCFILE] [TEMPLATEMAP]..."
+msgstr ""
+
+msgid "hg kwexpand [OPTION]... [FILE]..."
+msgstr ""
+
+msgid "show keyword status flags of all files"
+msgstr ""
+
+msgid "show files excluded from expansion"
+msgstr "afișează fișierele excluse de la expandare"
+
+msgid "only show unknown (not tracked) files"
+msgstr "afișează doar fișierele necunoscute (neurmărite)"
+
+msgid "hg kwfiles [OPTION]... [FILE]..."
+msgstr ""
+
+msgid "hg kwshrink [OPTION]... [FILE]..."
+msgstr ""
+
+msgid "manage a stack of patches"
+msgstr ""
+
+msgid ""
+"This extension lets you work with a stack of patches in a Mercurial\n"
+"repository. It manages two stacks of patches - all known patches, and\n"
+"applied patches (subset of known patches)."
+msgstr ""
+
+msgid ""
+"Known patches are represented as patch files in the .hg/patches\n"
+"directory. Applied patches are both patch files and changesets."
+msgstr ""
+
+msgid "Common tasks (use :hg:`help command` for more details)::"
+msgstr ""
+
+msgid ""
+"  create new patch                          qnew\n"
+"  import existing patch                     qimport"
+msgstr ""
+
+msgid ""
+"  print patch series                        qseries\n"
+"  print applied patches                     qapplied"
+msgstr ""
+
+msgid ""
+"  add known patch to applied stack          qpush\n"
+"  remove patch from applied stack           qpop\n"
+"  refresh contents of top applied patch     qrefresh"
+msgstr ""
+
+msgid ""
+"By default, mq will automatically use git patches when required to\n"
+"avoid losing file mode changes, copy records, binary files or empty\n"
+"files creations or deletions. This behaviour can be configured with::"
+msgstr ""
+
+msgid ""
+"  [mq]\n"
+"  git = auto/keep/yes/no"
+msgstr ""
+
+msgid ""
+"If set to 'keep', mq will obey the [diff] section configuration while\n"
+"preserving existing git patches upon qrefresh. If set to 'yes' or\n"
+"'no', mq will override the [diff] section and always generate git or\n"
+"regular patches, possibly losing data in the second case."
+msgstr ""
+
+msgid ""
+"You will by default be managing a patch queue named \"patches\". You can\n"
+"create other, independent patch queues with the :hg:`qqueue` command.\n"
+msgstr ""
+
+#, python-format
+msgid "mq.git option can be auto/keep/yes/no got %s"
+msgstr ""
+
+#, python-format
+msgid "%s appears more than once in %s"
+msgstr ""
+
+msgid "guard cannot be an empty string"
+msgstr ""
+
+#, python-format
+msgid "guard %r starts with invalid character: %r"
+msgstr ""
+
+#, python-format
+msgid "invalid character in guard %r: %r"
+msgstr ""
+
+#, python-format
+msgid "guard %r too short"
+msgstr ""
+
+#, python-format
+msgid "guard %r starts with invalid char"
+msgstr ""
+
+#, python-format
+msgid "allowing %s - no guards in effect\n"
+msgstr ""
+
+#, python-format
+msgid "allowing %s - no matching negative guards\n"
+msgstr ""
+
+#, python-format
+msgid "allowing %s - guarded by %r\n"
+msgstr ""
+
+#, python-format
+msgid "skipping %s - guarded by %r\n"
+msgstr "se omite %s - gardat de către %r\n"
+
+#, python-format
+msgid "skipping %s - no matching guards\n"
+msgstr "se omite %s - nu există gărzi care se potrivesc\n"
+
+#, python-format
+msgid "error removing undo: %s\n"
+msgstr ""
+
+#, python-format
+msgid "apply failed for patch %s"
+msgstr ""
+
+#, python-format
+msgid "patch didn't work out, merging %s\n"
+msgstr ""
+
+#, python-format
+msgid "update returned %d"
+msgstr ""
+
+msgid "repo commit failed"
+msgstr ""
+
+#, python-format
+msgid "unable to read %s"
+msgstr ""
+
+#, python-format
+msgid "patch %s does not exist\n"
+msgstr ""
+
+#, python-format
+msgid "patch %s is not applied\n"
+msgstr ""
+
+msgid "patch failed, unable to continue (try -v)\n"
+msgstr ""
+
+#, python-format
+msgid "applying %s\n"
+msgstr ""
+
+#, python-format
+msgid "unable to read %s\n"
+msgstr ""
+
+#, python-format
+msgid "patch %s is empty\n"
+msgstr ""
+
+msgid "patch failed, rejects left in working dir\n"
+msgstr ""
+
+msgid "fuzz found when applying patch, stopping\n"
+msgstr ""
+
+#, python-format
+msgid "revision %d is not managed"
+msgstr ""
+
+#, python-format
+msgid "cannot delete revision %d above applied patches"
+msgstr ""
+
+#, python-format
+msgid "patch %s finalized without changeset message\n"
+msgstr ""
+
+msgid "qdelete requires at least one revision or patch name"
+msgstr ""
+
+#, python-format
+msgid "cannot delete applied patch %s"
+msgstr ""
+
+#, python-format
+msgid "patch %s not in series file"
+msgstr ""
+
+msgid "no patches applied"
+msgstr ""
+
+msgid "working directory revision is not qtip"
+msgstr ""
+
+msgid "local changes found, refresh first"
+msgstr ""
+
+msgid "local changes found"
+msgstr ""
+
+#, python-format
+msgid "\"%s\" cannot be used as the name of a patch"
+msgstr ""
+
+#, python-format
+msgid "patch \"%s\" already exists"
+msgstr ""
+
+msgid "cannot manage merge changesets"
+msgstr ""
+
+#, python-format
+msgid "error unlinking %s\n"
+msgstr ""
+
+#, python-format
+msgid "patch name \"%s\" is ambiguous:\n"
+msgstr ""
+
+#, python-format
+msgid "patch %s not in series"
+msgstr ""
+
+msgid "(working directory not at a head)\n"
+msgstr ""
+
+msgid "no patches in series\n"
+msgstr ""
+
+#, python-format
+msgid "cannot push to a previous patch: %s"
+msgstr ""
+
+#, python-format
+msgid "qpush: %s is already at the top\n"
+msgstr ""
+
+#, python-format
+msgid "guarded by %r"
+msgstr ""
+
+msgid "no matching guards"
+msgstr ""
+
+#, python-format
+msgid "cannot push '%s' - %s\n"
+msgstr ""
+
+msgid "all patches are currently applied\n"
+msgstr ""
+
+msgid "patch series already fully applied\n"
+msgstr ""
+
+msgid "please specify the patch to move"
+msgstr ""
+
+msgid "cleaning up working directory..."
+msgstr ""
+
+#, python-format
+msgid "errors during apply, please fix and refresh %s\n"
+msgstr ""
+
+#, python-format
+msgid "now at: %s\n"
+msgstr ""
+
+#, python-format
+msgid "patch %s is not applied"
+msgstr ""
+
+msgid "no patches applied\n"
+msgstr ""
+
+#, python-format
+msgid "qpop: %s is already at the top\n"
+msgstr ""
+
+msgid "qpop: forcing dirstate update\n"
+msgstr ""
+
+#, python-format
+msgid "trying to pop unknown node %s"
+msgstr ""
+
+msgid "popping would remove a revision not managed by this patch queue"
+msgstr ""
+
+msgid "deletions found between repo revs"
+msgstr ""
+
+#, python-format
+msgid "popping %s\n"
+msgstr ""
+
+msgid "patch queue now empty\n"
+msgstr ""
+
+msgid "cannot refresh a revision with children"
+msgstr ""
+
+msgid ""
+"refresh interrupted while patch was popped! (revert --all, qpush to "
+"recover)\n"
+msgstr ""
+
+msgid "patch queue directory already exists"
+msgstr ""
+
+#, python-format
+msgid "patch %s is not in series file"
+msgstr ""
+
+msgid "No saved patch data found\n"
+msgstr ""
+
+#, python-format
+msgid "restoring status: %s\n"
+msgstr ""
+
+msgid "save entry has children, leaving it alone\n"
+msgstr ""
+
+#, python-format
+msgid "removing save entry %s\n"
+msgstr ""
+
+#, python-format
+msgid "saved queue repository parents: %s %s\n"
+msgstr ""
+
+#, fuzzy
+msgid "queue directory updating\n"
+msgstr "actualizarea directorului se introduce în coadă\n"
+
+msgid "Unable to load queue repository\n"
+msgstr ""
+
+msgid "save: no patches applied, exiting\n"
+msgstr ""
+
+msgid "status is already saved\n"
+msgstr ""
+
+msgid "hg patches saved state"
+msgstr ""
+
+msgid "repo commit failed\n"
+msgstr ""
+
+#, python-format
+msgid "patch %s is already in the series file"
+msgstr ""
+
+msgid "option \"-r\" not valid when importing files"
+msgstr ""
+
+msgid "option \"-n\" not valid when importing multiple patches"
+msgstr ""
+
+#, python-format
+msgid "revision %d is the root of more than one branch"
+msgstr ""
+
+#, python-format
+msgid "revision %d is already managed"
+msgstr ""
+
+#, python-format
+msgid "revision %d is not the parent of the queue"
+msgstr ""
+
+#, python-format
+msgid "revision %d has unmanaged children"
+msgstr ""
+
+#, python-format
+msgid "cannot import merge revision %d"
+msgstr ""
+
+#, python-format
+msgid "revision %d is not the parent of %d"
+msgstr ""
+
+msgid "-e is incompatible with import from -"
+msgstr ""
+
+#, python-format
+msgid "patch %s does not exist"
+msgstr ""
+
+#, python-format
+msgid "renaming %s to %s\n"
+msgstr ""
+
+msgid "need --name to import a patch from -"
+msgstr ""
+
+#, python-format
+msgid "unable to read file %s"
+msgstr ""
+
+#, python-format
+msgid "adding %s to series file\n"
+msgstr ""
+
+msgid "remove patches from queue"
+msgstr ""
+
+msgid ""
+"    The patches must not be applied, and at least one patch is required. "
+"With\n"
+"    -k/--keep, the patch files are preserved in the patch directory."
+msgstr ""
+
+msgid ""
+"    To stop managing a patch and move it into permanent history,\n"
+"    use the :hg:`qfinish` command."
+msgstr ""
+
+msgid "print the patches already applied"
+msgstr ""
+
+msgid "only one patch applied\n"
+msgstr ""
+
+msgid "print the patches not yet applied"
+msgstr ""
+
+msgid "all patches applied\n"
+msgstr ""
+
+msgid "import a patch"
+msgstr ""
+
+msgid ""
+"    The patch is inserted into the series after the last applied\n"
+"    patch. If no patches have been applied, qimport prepends the patch\n"
+"    to the series."
+msgstr ""
+
+msgid ""
+"    The patch will have the same name as its source file unless you\n"
+"    give it a new one with -n/--name."
+msgstr ""
+
+msgid ""
+"    You can register an existing patch inside the patch directory with\n"
+"    the -e/--existing flag."
+msgstr ""
+
+msgid ""
+"    With -f/--force, an existing patch of the same name will be\n"
+"    overwritten."
+msgstr ""
+
+msgid ""
+"    An existing changeset may be placed under mq control with -r/--rev\n"
+"    (e.g. qimport --rev tip -n patch will place tip under mq control).\n"
+"    With -g/--git, patches imported with --rev will use the git diff\n"
+"    format. See the diffs help topic for information on why this is\n"
+"    important for preserving rename/copy information and permission\n"
+"    changes."
+msgstr ""
+
+msgid ""
+"    To import a patch from standard input, pass - as the patch file.\n"
+"    When importing from standard input, a patch name must be specified\n"
+"    using the --name flag."
+msgstr ""
+
+msgid "    To import an existing patch while renaming it::"
+msgstr ""
+
+msgid ""
+"      hg qimport -e existing-patch -n new-name\n"
+"    "
+msgstr ""
+
+msgid "init a new queue repository (DEPRECATED)"
+msgstr ""
+
+msgid ""
+"    The queue repository is unversioned by default. If\n"
+"    -c/--create-repo is specified, qinit will create a separate nested\n"
+"    repository for patches (qinit -c may also be run later to convert\n"
+"    an unversioned patch repository into a versioned one). You can use\n"
+"    qcommit to commit changes to this queue repository."
+msgstr ""
+
+msgid ""
+"    This command is deprecated. Without -c, it's implied by other relevant\n"
+"    commands. With -c, use :hg:`init --mq` instead."
+msgstr ""
+
+msgid "clone main and patch repository at same time"
+msgstr ""
+
+msgid ""
+"    If source is local, destination will have no patches applied. If\n"
+"    source is remote, this command can not check if patches are\n"
+"    applied in source, so cannot guarantee that patches are not\n"
+"    applied in destination. If you clone remote repository, be sure\n"
+"    before that it has no patches applied."
+msgstr ""
+
+msgid ""
+"    Source patch repository is looked for in <src>/.hg/patches by\n"
+"    default. Use -p <url> to change."
+msgstr ""
+
+msgid ""
+"    The patch directory must be a nested Mercurial repository, as\n"
+"    would be created by :hg:`init --mq`.\n"
+"    "
+msgstr ""
+
+msgid "versioned patch repository not found (see init --mq)"
+msgstr ""
+
+msgid "cloning main repository\n"
+msgstr ""
+
+msgid "cloning patch repository\n"
+msgstr ""
+
+msgid "stripping applied patches from destination repository\n"
+msgstr ""
+
+msgid "updating destination repository\n"
+msgstr "se actualizează depozitul destinație\n"
+
+msgid "commit changes in the queue repository (DEPRECATED)"
+msgstr ""
+
+msgid "    This command is deprecated; use :hg:`commit --mq` instead."
+msgstr ""
+
+msgid "print the entire series file"
+msgstr ""
+
+msgid "print the name of the current patch"
+msgstr ""
+
+msgid "print the name of the next patch"
+msgstr ""
+
+msgid "print the name of the previous patch"
+msgstr ""
+
+msgid "create a new patch"
+msgstr ""
+
+msgid ""
+"    qnew creates a new patch on top of the currently-applied patch (if\n"
+"    any). The patch will be initialized with any outstanding changes\n"
+"    in the working directory. You may also use -I/--include,\n"
+"    -X/--exclude, and/or a list of files after the patch name to add\n"
+"    only changes to matching files to the new patch, leaving the rest\n"
+"    as uncommitted modifications."
+msgstr ""
+
+msgid ""
+"    -u/--user and -d/--date can be used to set the (given) user and\n"
+"    date, respectively. -U/--currentuser and -D/--currentdate set user\n"
+"    to current user and date to current date."
+msgstr ""
+
+msgid ""
+"    -e/--edit, -m/--message or -l/--logfile set the patch header as\n"
+"    well as the commit message. If none is specified, the header is\n"
+"    empty and the commit message is '[mq]: PATCH'."
+msgstr ""
+
+msgid ""
+"    Use the -g/--git option to keep the patch in the git extended diff\n"
+"    format. Read the diffs help topic for more information on why this\n"
+"    is important for preserving permission changes and copy/rename\n"
+"    information.\n"
+"    "
+msgstr ""
+
+msgid "update the current patch"
+msgstr ""
+
+msgid ""
+"    If any file patterns are provided, the refreshed patch will\n"
+"    contain only the modifications that match those patterns; the\n"
+"    remaining modifications will remain in the working directory."
+msgstr ""
+
+msgid ""
+"    If -s/--short is specified, files currently included in the patch\n"
+"    will be refreshed just like matched files and remain in the patch."
+msgstr ""
+
+msgid ""
+"    If -e/--edit is specified, Mercurial will start your configured editor "
+"for\n"
+"    you to enter a message. In case qrefresh fails, you will find a backup "
+"of\n"
+"    your message in ``.hg/last-message.txt``."
+msgstr ""
+
+msgid ""
+"    hg add/remove/copy/rename work as usual, though you might want to\n"
+"    use git-style patches (-g/--git or [diff] git=1) to track copies\n"
+"    and renames. See the diffs help topic for more information on the\n"
+"    git diff format.\n"
+"    "
+msgstr ""
+
+msgid "option \"-e\" incompatible with \"-m\" or \"-l\""
+msgstr ""
+
+msgid "diff of the current patch and subsequent modifications"
+msgstr ""
+
+msgid ""
+"    Shows a diff which includes the current patch as well as any\n"
+"    changes which have been made in the working directory since the\n"
+"    last refresh (thus showing what the current patch would become\n"
+"    after a qrefresh)."
+msgstr ""
+
+msgid ""
+"    Use :hg:`diff` if you only want to see the changes made since the\n"
+"    last qrefresh, or :hg:`export qtip` if you want to see changes\n"
+"    made by the current patch without including changes made since the\n"
+"    qrefresh.\n"
+"    "
+msgstr ""
+
+msgid "fold the named patches into the current patch"
+msgstr ""
+
+msgid ""
+"    Patches must not yet be applied. Each patch will be successively\n"
+"    applied to the current patch in the order given. If all the\n"
+"    patches apply successfully, the current patch will be refreshed\n"
+"    with the new cumulative patch, and the folded patches will be\n"
+"    deleted. With -k/--keep, the folded patch files will not be\n"
+"    removed afterwards."
+msgstr ""
+
+msgid ""
+"    The header for each folded patch will be concatenated with the\n"
+"    current patch header, separated by a line of '* * *'."
+msgstr ""
+
+msgid "qfold requires at least one patch name"
+msgstr ""
+
+msgid "No patches applied"
+msgstr ""
+
+#, python-format
+msgid "Skipping already folded patch %s"
+msgstr "Se omite patch-ul deja pliat %s"
+
+#, python-format
+msgid "qfold cannot fold already applied patch %s"
+msgstr ""
+
+#, python-format
+msgid "Error folding patch %s"
+msgstr ""
+
+msgid "push or pop patches until named patch is at top of stack"
+msgstr ""
+
+msgid "set or print guards for a patch"
+msgstr ""
+
+msgid ""
+"    Guards control whether a patch can be pushed. A patch with no\n"
+"    guards is always pushed. A patch with a positive guard (\"+foo\") is\n"
+"    pushed only if the :hg:`qselect` command has activated it. A patch with\n"
+"    a negative guard (\"-foo\") is never pushed if the :hg:`qselect` "
+"command\n"
+"    has activated it."
+msgstr ""
+
+msgid ""
+"    With no arguments, print the currently active guards.\n"
+"    With arguments, set guards for the named patch.\n"
+"    NOTE: Specifying negative guards now requires '--'."
+msgstr ""
+
+msgid "    To set guards on another patch::"
+msgstr ""
+
+msgid ""
+"      hg qguard other.patch -- +2.6.17 -stable\n"
+"    "
+msgstr ""
+
+msgid "cannot mix -l/--list with options or arguments"
+msgstr ""
+
+msgid "no patch to work with"
+msgstr ""
+
+#, python-format
+msgid "no patch named %s"
+msgstr ""
+
+msgid "print the header of the topmost or specified patch"
+msgstr ""
+
+msgid "push the next patch onto the stack"
+msgstr ""
+
+msgid ""
+"    When -f/--force is applied, all local changes in patched files\n"
+"    will be lost.\n"
+"    "
+msgstr ""
+
+msgid "no saved queues found, please use -n\n"
+msgstr ""
+
+#, python-format
+msgid "merging with queue at: %s\n"
+msgstr ""
+
+msgid "pop the current patch off the stack"
+msgstr ""
+
+msgid ""
+"    By default, pops off the top of the patch stack. If given a patch\n"
+"    name, keeps popping off patches until the named patch is at the\n"
+"    top of the stack.\n"
+"    "
+msgstr ""
+
+#, python-format
+msgid "using patch queue: %s\n"
+msgstr ""
+
+msgid "rename a patch"
+msgstr ""
+
+msgid ""
+"    With one argument, renames the current patch to PATCH1.\n"
+"    With two arguments, renames PATCH1 to PATCH2."
+msgstr ""
+
+#, python-format
+msgid "%s already exists"
+msgstr ""
+
+#, python-format
+msgid "A patch named %s already exists in the series file"
+msgstr ""
+
+msgid "restore the queue state saved by a revision (DEPRECATED)"
+msgstr ""
+
+msgid "    This command is deprecated, use rebase --mq instead."
+msgstr ""
+
+msgid "save current queue state (DEPRECATED)"
+msgstr ""
+
+#, python-format
+msgid "destination %s exists and is not a directory"
+msgstr ""
+
+#, python-format
+msgid "destination %s exists, use -f to force"
+msgstr ""
+
+#, python-format
+msgid "copy %s to %s\n"
+msgstr ""
+
+msgid "strip changesets and all their descendants from the repository"
+msgstr ""
+
+msgid ""
+"    The strip command removes the specified changesets and all their\n"
+"    descendants. If the working directory has uncommitted changes,\n"
+"    the operation is aborted unless the --force flag is supplied."
+msgstr ""
+
+msgid ""
+"    If a parent of the working directory is stripped, then the working\n"
+"    directory will automatically be updated to the most recent\n"
+"    available ancestor of the stripped parent after the operation\n"
+"    completes."
+msgstr ""
+
+msgid ""
+"    Any stripped changesets are stored in ``.hg/strip-backup`` as a\n"
+"    bundle (see :hg:`help bundle` and :hg:`help unbundle`). They can\n"
+"    be restored by running :hg:`unbundle .hg/strip-backup/BUNDLE`,\n"
+"    where BUNDLE is the bundle file created by the strip. Note that\n"
+"    the local revision numbers will in general be different after the\n"
+"    restore."
+msgstr ""
+
+msgid ""
+"    Use the --nobackup option to discard the backup bundle once the\n"
+"    operation completes.\n"
+"    "
+msgstr ""
+
+msgid "set or print guarded patches to push"
+msgstr ""
+
+msgid ""
+"    Use the :hg:`qguard` command to set or print guards on patch, then use\n"
+"    qselect to tell mq which guards to use. A patch will be pushed if\n"
+"    it has no guards or any positive guards match the currently\n"
+"    selected guard, but will not be pushed if any negative guards\n"
+"    match the current guard. For example::"
+msgstr ""
+
+msgid ""
+"        qguard foo.patch -stable    (negative guard)\n"
+"        qguard bar.patch +stable    (positive guard)\n"
+"        qselect stable"
+msgstr ""
+
+msgid ""
+"    This activates the \"stable\" guard. mq will skip foo.patch (because\n"
+"    it has a negative match) but push bar.patch (because it has a\n"
+"    positive match)."
+msgstr ""
+
+msgid ""
+"    With no arguments, prints the currently active guards.\n"
+"    With one argument, sets the active guard."
+msgstr ""
+
+msgid ""
+"    Use -n/--none to deactivate guards (no other arguments needed).\n"
+"    When no guards are active, patches with positive guards are\n"
+"    skipped and patches with negative guards are pushed."
+msgstr ""
+
+msgid ""
+"    qselect can change the guards on applied patches. It does not pop\n"
+"    guarded patches by default. Use --pop to pop back to the last\n"
+"    applied patch that is not guarded. Use --reapply (which implies\n"
+"    --pop) to push back to the current patch afterwards, but skip\n"
+"    guarded patches."
+msgstr ""
+
+msgid ""
+"    Use -s/--series to print a list of all guards in the series file\n"
+"    (no other arguments needed). Use -v for more information."
+msgstr ""
+
+msgid "guards deactivated\n"
+msgstr ""
+
+#, python-format
+msgid "number of unguarded, unapplied patches has changed from %d to %d\n"
+msgstr ""
+
+#, python-format
+msgid "number of guarded, applied patches has changed from %d to %d\n"
+msgstr ""
+
+msgid "guards in series file:\n"
+msgstr ""
+
+msgid "no guards in series file\n"
+msgstr ""
+
+msgid "active guards:\n"
+msgstr ""
+
+msgid "no active guards\n"
+msgstr ""
+
+msgid "popping guarded patches\n"
+msgstr ""
+
+msgid "reapplying unguarded patches\n"
+msgstr ""
+
+msgid "move applied patches into repository history"
+msgstr ""
+
+msgid ""
+"    Finishes the specified revisions (corresponding to applied\n"
+"    patches) by moving them out of mq control into regular repository\n"
+"    history."
+msgstr ""
+
+msgid ""
+"    Accepts a revision range or the -a/--applied option. If --applied\n"
+"    is specified, all applied mq revisions are removed from mq\n"
+"    control. Otherwise, the given revisions must be at the base of the\n"
+"    stack of applied patches."
+msgstr ""
+
+msgid ""
+"    This can be especially useful if your changes have been applied to\n"
+"    an upstream repository, or if you are about to push your changes\n"
+"    to upstream.\n"
+"    "
+msgstr ""
+
+msgid "no revisions specified"
+msgstr ""
+
+msgid "manage multiple patch queues"
+msgstr ""
+
+msgid ""
+"    Supports switching between different patch queues, as well as creating\n"
+"    new patch queues and deleting existing ones."
+msgstr ""
+
+msgid ""
+"    Omitting a queue name or specifying -l/--list will show you the "
+"registered\n"
+"    queues - by default the \"normal\" patches queue is registered. The "
+"currently\n"
+"    active queue will be marked with \"(active)\"."
+msgstr ""
+
+msgid ""
+"    To create a new queue, use -c/--create. The queue is automatically made\n"
+"    active, except in the case where there are applied patches from the\n"
+"    currently active queue in the repository. Then the queue will only be\n"
+"    created and switching will fail."
+msgstr ""
+
+msgid ""
+"    To delete an existing queue, use --delete. You cannot delete the "
+"currently\n"
+"    active queue.\n"
+"    "
+msgstr ""
+
+msgid "patches applied - cannot set new queue active"
+msgstr ""
+
+msgid "cannot delete queue that does not exist"
+msgstr ""
+
+msgid "cannot delete currently active queue"
+msgstr ""
+
+msgid " (active)\n"
+msgstr ""
+
+msgid "invalid queue name, may not contain the characters \":\\/.\""
+msgstr ""
+
+#, python-format
+msgid "queue \"%s\" already exists"
+msgstr ""
+
+#, python-format
+msgid "can't rename \"%s\" to its current name"
+msgstr ""
+
+#, fuzzy, python-format
+msgid "non-queue directory \"%s\" already exists"
+msgstr "depozitul %s neaflat în coadă există deja"
+
+msgid "use --create to create a new queue"
+msgstr ""
+
+msgid "cannot commit over an applied mq patch"
+msgstr ""
+
+msgid "source has mq patches applied"
+msgstr ""
+
+#, python-format
+msgid "mq status file refers to unknown node %s\n"
+msgstr ""
+
+#, python-format
+msgid "Tag %s overrides mq patch of the same name\n"
+msgstr ""
+
+msgid "cannot import over an applied patch"
+msgstr ""
+
+msgid "only a local queue repository may be initialized"
+msgstr ""
+
+msgid "There is no Mercurial repository here (.hg not found)"
+msgstr ""
+
+msgid "no queue repository"
+msgstr ""
+
+#, python-format
+msgid "%d applied"
+msgstr ""
+
+#, python-format
+msgid "%d unapplied"
+msgstr ""
+
+msgid "mq:     (empty queue)\n"
+msgstr ""
+
+msgid "operate on patch repository"
+msgstr "operează pe depozitul de patch-uri"
+
+msgid "print first line of patch header"
+msgstr ""
+
+msgid "show only the last patch"
+msgstr "afișează doar ultimul patch"
+
+msgid "hg qapplied [-1] [-s] [PATCH]"
+msgstr ""
+
+msgid "use pull protocol to copy metadata"
+msgstr "folosește protocolul 'pull' pentru a copia metadatele"
+
+msgid "do not update the new working directories"
+msgstr ""
+
+msgid "use uncompressed transfer (fast over LAN)"
+msgstr "folosește transfer necomprimat (rapid în LAN)"
+
+msgid "REPO"
+msgstr ""
+
+msgid "location of source patch repository"
+msgstr ""
+
+msgid "hg qclone [OPTION]... SOURCE [DEST]"
+msgstr ""
+
+msgid "hg qcommit [OPTION]... [FILE]..."
+msgstr ""
+
+msgid "hg qdiff [OPTION]... [FILE]..."
+msgstr ""
+
+msgid "keep patch file"
+msgstr "păstrează fișierul patch"
+
+msgid "stop managing a revision (DEPRECATED)"
+msgstr ""
+
+msgid "hg qdelete [-k] [-r REV]... [PATCH]..."
+msgstr ""
+
+msgid "edit patch header"
+msgstr ""
+
+msgid "keep folded patch files"
+msgstr ""
+
+msgid "hg qfold [-e] [-k] [-m TEXT] [-l FILE] PATCH..."
+msgstr ""
+
+msgid "overwrite any local changes"
+msgstr ""
+
+msgid "hg qgoto [OPTION]... PATCH"
+msgstr ""
+
+msgid "list all patches and guards"
+msgstr ""
+
+msgid "drop all guards"
+msgstr ""
+
+msgid "hg qguard [-l] [-n] [PATCH] [-- [+GUARD]... [-GUARD]...]"
+msgstr ""
+
+msgid "hg qheader [PATCH]"
+msgstr ""
+
+msgid "import file in patch directory"
+msgstr ""
+
+msgid "name of patch file"
+msgstr ""
+
+msgid "overwrite existing files"
+msgstr ""
+
+msgid "place existing revisions under mq control"
+msgstr ""
+
+msgid "use git extended diff format"
+msgstr "folosește formatul diff extins al lui git"
+
+msgid "qpush after importing"
+msgstr ""
+
+msgid "hg qimport [-e] [-n NAME] [-f] [-g] [-P] [-r REV]... FILE..."
+msgstr ""
+
+msgid "create queue repository"
+msgstr ""
+
+msgid "hg qinit [-c]"
+msgstr ""
+
+msgid "import uncommitted changes (DEPRECATED)"
+msgstr ""
+
+msgid "add \"From: <current user>\" to patch"
+msgstr ""
+
+msgid "USER"
+msgstr ""
+
+msgid "add \"From: <USER>\" to patch"
+msgstr ""
+
+msgid "add \"Date: <current date>\" to patch"
+msgstr ""
+
+msgid "add \"Date: <DATE>\" to patch"
+msgstr ""
+
+msgid "hg qnew [-e] [-m TEXT] [-l FILE] PATCH [FILE]..."
+msgstr ""
+
+msgid "hg qnext [-s]"
+msgstr ""
+
+msgid "hg qprev [-s]"
+msgstr ""
+
+msgid "pop all patches"
+msgstr ""
+
+msgid "queue name to pop (DEPRECATED)"
+msgstr ""
+
+msgid "forget any local changes to patched files"
+msgstr ""
+
+msgid "hg qpop [-a] [-n NAME] [-f] [PATCH | INDEX]"
+msgstr ""
+
+msgid "apply if the patch has rejects"
+msgstr ""
+
+msgid "list patch name in commit text"
+msgstr ""
+
+msgid "apply all patches"
+msgstr ""
+
+msgid "merge from another queue (DEPRECATED)"
+msgstr ""
+
+msgid "merge queue name (DEPRECATED)"
+msgstr ""
+
+msgid "reorder patch series and apply only the patch"
+msgstr ""
+
+msgid "hg qpush [-f] [-l] [-a] [-m] [-n NAME] [--move] [PATCH | INDEX]"
+msgstr ""
+
+msgid "refresh only files already in the patch and specified files"
+msgstr ""
+
+msgid "add/update author field in patch with current user"
+msgstr ""
+
+msgid "add/update author field in patch with given user"
+msgstr ""
+
+msgid "add/update date field in patch with current date"
+msgstr ""
+
+msgid "add/update date field in patch with given date"
+msgstr ""
+
+msgid "hg qrefresh [-I] [-X] [-e] [-m TEXT] [-l FILE] [-s] [FILE]..."
+msgstr ""
+
+msgid "hg qrename PATCH1 [PATCH2]"
+msgstr ""
+
+msgid "delete save entry"
+msgstr ""
+
+msgid "update queue working directory"
+msgstr ""
+
+msgid "hg qrestore [-d] [-u] REV"
+msgstr ""
+
+msgid "copy patch directory"
+msgstr ""
+
+msgid "copy directory name"
+msgstr ""
+
+msgid "clear queue status file"
+msgstr ""
+
+msgid "force copy"
+msgstr ""
+
+msgid "hg qsave [-m TEXT] [-l FILE] [-c] [-n NAME] [-e] [-f]"
+msgstr ""
+
+msgid "disable all guards"
+msgstr ""
+
+msgid "list all guards in series file"
+msgstr ""
+
+msgid "pop to before first guarded applied patch"
+msgstr ""
+
+msgid "pop, then reapply patches"
+msgstr ""
+
+msgid "hg qselect [OPTION]... [GUARD]..."
+msgstr ""
+
+msgid "print patches not in series"
+msgstr ""
+
+msgid "hg qseries [-ms]"
+msgstr ""
+
+msgid ""
+"force removal of changesets even if the working directory has uncommitted "
+"changes"
+msgstr ""
+
+msgid ""
+"bundle only changesets with local revision number greater than REV which are "
+"not descendants of REV (DEPRECATED)"
+msgstr ""
+
+msgid "no backups"
+msgstr ""
+
+msgid "hg strip [-f] [-n] REV..."
+msgstr ""
+
+msgid "hg qtop [-s]"
+msgstr ""
+
+msgid "show only the first patch"
+msgstr "afișează doar primul patch"
+
+msgid "hg qunapplied [-1] [-s] [PATCH]"
+msgstr ""
+
+msgid "finish all applied changesets"
+msgstr ""
+
+msgid "hg qfinish [-a] [REV]..."
+msgstr ""
+
+msgid "list all available queues"
+msgstr ""
+
+msgid "create new queue"
+msgstr ""
+
+msgid "rename active queue"
+msgstr ""
+
+msgid "delete reference to queue"
+msgstr ""
+
+msgid "delete queue, and remove patch dir"
+msgstr ""
+
+msgid "[OPTION] [QUEUE]"
+msgstr "[OPÈšIUNE] [COADÄ‚]"
+
+msgid "hooks for sending email notifications at commit/push time"
+msgstr ""
+
+msgid ""
+"Subscriptions can be managed through a hgrc file. Default mode is to\n"
+"print messages to stdout, for testing and configuring."
+msgstr ""
+
+msgid ""
+"To use, configure the notify extension and enable it in hgrc like\n"
+"this::"
+msgstr ""
+
+msgid ""
+"  [extensions]\n"
+"  notify ="
+msgstr ""
+
+msgid ""
+"  [hooks]\n"
+"  # one email for each incoming changeset\n"
+"  incoming.notify = python:hgext.notify.hook\n"
+"  # batch emails when many changesets incoming at one time\n"
+"  changegroup.notify = python:hgext.notify.hook"
+msgstr ""
+
+msgid ""
+"  [notify]\n"
+"  # config items go here"
+msgstr ""
+
+msgid "Required configuration items::"
+msgstr ""
+
+msgid "  config = /path/to/file # file containing subscriptions"
+msgstr ""
+
+msgid "Optional configuration items::"
+msgstr ""
+
+msgid ""
+"  test = True            # print messages to stdout for testing\n"
+"  strip = 3              # number of slashes to strip for url paths\n"
+"  domain = example.com   # domain to use if committer missing domain\n"
+"  style = ...            # style file to use when formatting email\n"
+"  template = ...         # template to use when formatting email\n"
+"  incoming = ...         # template to use when run as incoming hook\n"
+"  changegroup = ...      # template when run as changegroup hook\n"
+"  maxdiff = 300          # max lines of diffs to include (0=none, -1=all)\n"
+"  maxsubject = 67        # truncate subject line longer than this\n"
+"  diffstat = True        # add a diffstat before the diff content\n"
+"  sources = serve        # notify if source of incoming changes in this "
+"list\n"
+"                         # (serve == ssh or http, push, pull, bundle)\n"
+"  merge = False          # send notification for merges (default True)\n"
+"  [email]\n"
+"  from = user@host.com   # email address to send as if none given\n"
+"  [web]\n"
+"  baseurl = http://hgserver/... # root of hg web site for browsing commits"
+msgstr ""
+
+msgid ""
+"The notify config file has same format as a regular hgrc file. It has\n"
+"two sections so you can express subscriptions in whatever way is\n"
+"handier for you."
+msgstr ""
+
+msgid ""
+"  [usersubs]\n"
+"  # key is subscriber email, value is \",\"-separated list of glob patterns\n"
+"  user@host = pattern"
+msgstr ""
+
+msgid ""
+"  [reposubs]\n"
+"  # key is glob pattern, value is \",\"-separated list of subscriber emails\n"
+"  pattern = user@host"
+msgstr ""
+
+msgid "Glob patterns are matched against path to repository root."
+msgstr ""
+
+msgid ""
+"If you like, you can put notify config file in repository that users\n"
+"can push changes to, they can manage their own subscriptions.\n"
+msgstr ""
+
+#, python-format
+msgid "%s: %d new changesets"
+msgstr ""
+
+#, python-format
+msgid "notify: sending %d subscribers %d changes\n"
+msgstr ""
+
+#, python-format
+msgid ""
+"\n"
+"diffs (truncated from %d to %d lines):"
+msgstr ""
+
+#, python-format
+msgid ""
+"\n"
+"diffs (%d lines):"
+msgstr ""
+
+#, python-format
+msgid "notify: suppressing notification for merge %d:%s\n"
+msgstr ""
+
+msgid "browse command output with an external pager"
+msgstr ""
+
+msgid "To set the pager that should be used, set the application variable::"
+msgstr ""
+
+msgid ""
+"  [pager]\n"
+"  pager = LESS='FSRX' less"
+msgstr ""
+
+msgid ""
+"If no pager is set, the pager extensions uses the environment variable\n"
+"$PAGER. If neither pager.pager, nor $PAGER is set, no pager is used."
+msgstr ""
+
+msgid ""
+"If you notice \"BROKEN PIPE\" error messages, you can disable them by\n"
+"setting::"
+msgstr ""
+
+msgid ""
+"  [pager]\n"
+"  quiet = True"
+msgstr ""
+
+msgid ""
+"You can disable the pager for certain commands by adding them to the\n"
+"pager.ignore list::"
+msgstr ""
+
+msgid ""
+"  [pager]\n"
+"  ignore = version, help, update"
+msgstr ""
+
+msgid ""
+"You can also enable the pager only for certain commands using\n"
+"pager.attend. Below is the default list of commands to be paged::"
+msgstr ""
+
+msgid ""
+"  [pager]\n"
+"  attend = annotate, cat, diff, export, glog, log, qdiff"
+msgstr ""
+
+msgid ""
+"Setting pager.attend to an empty value will cause all commands to be\n"
+"paged."
+msgstr ""
+
+msgid "If pager.attend is present, pager.ignore will be ignored."
+msgstr ""
+
+msgid ""
+"To ignore global commands like :hg:`version` or :hg:`help`, you have\n"
+"to specify them in the global .hgrc\n"
+msgstr ""
+
+msgid "interpret suffixes to refer to ancestor revisions"
+msgstr ""
+
+msgid ""
+"This extension allows you to use git-style suffixes to refer to the\n"
+"ancestors of a specific revision."
+msgstr ""
+
+msgid "For example, if you can refer to a revision as \"foo\", then::"
+msgstr ""
+
+msgid ""
+"  foo^N = Nth parent of foo\n"
+"  foo^0 = foo\n"
+"  foo^1 = first parent of foo\n"
+"  foo^2 = second parent of foo\n"
+"  foo^  = foo^1"
+msgstr ""
+
+msgid ""
+"  foo~N = Nth first grandparent of foo\n"
+"  foo~0 = foo\n"
+"  foo~1 = foo^1 = foo^ = first parent of foo\n"
+"  foo~2 = foo^1^1 = foo^^ = first parent of first parent of foo\n"
+msgstr ""
+
+msgid "command to send changesets as (a series of) patch emails"
+msgstr ""
+
+msgid ""
+"The series is started off with a \"[PATCH 0 of N]\" introduction, which\n"
+"describes the series as a whole."
+msgstr ""
+
+msgid ""
+"Each patch email has a Subject line of \"[PATCH M of N] ...\", using the\n"
+"first line of the changeset description as the subject text. The\n"
+"message contains two or three body parts:"
+msgstr ""
+
+msgid ""
+"- The changeset description.\n"
+"- [Optional] The result of running diffstat on the patch.\n"
+"- The patch itself, as generated by :hg:`export`."
+msgstr ""
+
+msgid ""
+"Each message refers to the first in the series using the In-Reply-To\n"
+"and References headers, so they will show up as a sequence in threaded\n"
+"mail and news readers, and in mail archives."
+msgstr ""
+
+msgid ""
+"With the -d/--diffstat option, you will be prompted for each changeset\n"
+"with a diffstat summary and the changeset summary, so you can be sure\n"
+"you are sending the right changes."
+msgstr ""
+
+msgid ""
+"To configure other defaults, add a section like this to your hgrc\n"
+"file::"
+msgstr ""
+
+msgid ""
+"  [email]\n"
+"  from = My Name <my@email>\n"
+"  to = recipient1, recipient2, ...\n"
+"  cc = cc1, cc2, ...\n"
+"  bcc = bcc1, bcc2, ...\n"
+"  reply-to = address1, address2, ..."
+msgstr ""
+
+msgid ""
+"Use ``[patchbomb]`` as configuration section name if you need to\n"
+"override global ``[email]`` address settings."
+msgstr ""
+
+msgid ""
+"Then you can use the :hg:`email` command to mail a series of\n"
+"changesets as a patchbomb."
+msgstr ""
+
+msgid ""
+"To avoid sending patches prematurely, it is a good idea to first run\n"
+"the :hg:`email` command with the \"-n\" option (test only). You will be\n"
+"prompted for an email recipient address, a subject and an introductory\n"
+"message describing the patches of your patchbomb. Then when all is\n"
+"done, patchbomb messages are displayed. If the PAGER environment\n"
+"variable is set, your pager will be fired up once for each patchbomb\n"
+"message, so you can verify everything is alright."
+msgstr ""
+
+msgid ""
+"The -m/--mbox option is also very useful. Instead of previewing each\n"
+"patchbomb message in a pager or sending the messages directly, it will\n"
+"create a UNIX mailbox file with the patch emails. This mailbox file\n"
+"can be previewed with any mail user agent which supports UNIX mbox\n"
+"files, e.g. with mutt::"
+msgstr ""
+
+msgid "  % mutt -R -f mbox"
+msgstr ""
+
+msgid ""
+"When you are previewing the patchbomb messages, you can use ``formail``\n"
+"(a utility that is commonly installed as part of the procmail\n"
+"package), to send each message out::"
+msgstr ""
+
+msgid "  % formail -s sendmail -bm -t < mbox"
+msgstr ""
+
+msgid "That should be all. Now your patchbomb is on its way out."
+msgstr ""
+
+msgid ""
+"You can also either configure the method option in the email section\n"
+"to be a sendmail compatible mailer or fill out the [smtp] section so\n"
+"that the patchbomb extension can automatically send patchbombs\n"
+"directly from the commandline. See the [email] and [smtp] sections in\n"
+"hgrc(5) for details.\n"
+msgstr ""
+
+#, python-format
+msgid "%s Please enter a valid value"
+msgstr ""
+
+msgid "Please enter a valid value.\n"
+msgstr ""
+
+msgid "does the diffstat above look okay?"
+msgstr ""
+
+msgid "diffstat rejected"
+msgstr ""
+
+msgid "send changesets by email"
+msgstr ""
+
+msgid ""
+"    By default, diffs are sent in the format generated by\n"
+"    :hg:`export`, one per message. The series starts with a \"[PATCH 0\n"
+"    of N]\" introduction, which describes the series as a whole."
+msgstr ""
+
+msgid ""
+"    Each patch email has a Subject line of \"[PATCH M of N] ...\", using\n"
+"    the first line of the changeset description as the subject text.\n"
+"    The message contains two or three parts. First, the changeset\n"
+"    description. Next, (optionally) if the diffstat program is\n"
+"    installed and -d/--diffstat is used, the result of running\n"
+"    diffstat on the patch. Finally, the patch itself, as generated by\n"
+"    :hg:`export`."
+msgstr ""
+
+msgid ""
+"    By default the patch is included as text in the email body for\n"
+"    easy reviewing. Using the -a/--attach option will instead create\n"
+"    an attachment for the patch. With -i/--inline an inline attachment\n"
+"    will be created."
+msgstr ""
+
+msgid ""
+"    With -o/--outgoing, emails will be generated for patches not found\n"
+"    in the destination repository (or only those which are ancestors\n"
+"    of the specified revisions if any are provided)"
+msgstr ""
+
+msgid ""
+"    With -b/--bundle, changesets are selected as for --outgoing, but a\n"
+"    single email containing a binary Mercurial bundle as an attachment\n"
+"    will be sent."
+msgstr ""
+
+msgid ""
+"      hg email -r 3000          # send patch 3000 only\n"
+"      hg email -r 3000 -r 3001  # send patches 3000 and 3001\n"
+"      hg email -r 3000:3005     # send patches 3000 through 3005\n"
+"      hg email 3000             # send patch 3000 (deprecated)"
+msgstr ""
+
+msgid ""
+"      hg email -o               # send all patches not in default\n"
+"      hg email -o DEST          # send all patches not in DEST\n"
+"      hg email -o -r 3000       # send all ancestors of 3000 not in default\n"
+"      hg email -o -r 3000 DEST  # send all ancestors of 3000 not in DEST"
+msgstr ""
+
+msgid ""
+"      hg email -b               # send bundle of all patches not in default\n"
+"      hg email -b DEST          # send bundle of all patches not in DEST\n"
+"      hg email -b -r 3000       # bundle of all ancestors of 3000 not in "
+"default\n"
+"      hg email -b -r 3000 DEST  # bundle of all ancestors of 3000 not in DEST"
+msgstr ""
+
+msgid ""
+"    Before using this command, you will need to enable email in your\n"
+"    hgrc. See the [email] section in hgrc(5) for details.\n"
+"    "
+msgstr ""
+
+msgid "specify at least one changeset with -r or -o"
+msgstr ""
+
+msgid "--outgoing mode always on with --bundle; do not re-specify --outgoing"
+msgstr ""
+
+msgid "too many destinations"
+msgstr ""
+
+msgid "use only one form to specify the revision"
+msgstr ""
+
+msgid ""
+"\n"
+"Write the introductory message for the patch series."
+msgstr ""
+
+#, python-format
+msgid "This patch series consists of %d patches."
+msgstr ""
+
+msgid "Final summary:\n"
+msgstr ""
+
+msgid "Displaying "
+msgstr ""
+
+msgid "Writing "
+msgstr ""
+
+msgid "Sending "
+msgstr ""
+
+msgid "send patches as attachments"
+msgstr ""
+
+msgid "send patches as inline attachments"
+msgstr ""
+
+msgid "email addresses of blind carbon copy recipients"
+msgstr ""
+
+msgid "email addresses of copy recipients"
+msgstr ""
+
+msgid "add diffstat output to messages"
+msgstr ""
+
+msgid "use the given date as the sending date"
+msgstr ""
+
+msgid "use the given file as the series description"
+msgstr ""
+
+msgid "email address of sender"
+msgstr ""
+
+msgid "print messages that would be sent"
+msgstr ""
+
+msgid "write messages to mbox file instead of sending them"
+msgstr ""
+
+msgid "email addresses replies should be sent to"
+msgstr ""
+
+msgid "subject of first message (intro or single patch)"
+msgstr ""
+
+msgid "message identifier to reply to"
+msgstr ""
+
+msgid "flags to add in subject prefixes"
+msgstr ""
+
+msgid "email addresses of recipients"
+msgstr ""
+
+msgid "omit hg patch header"
+msgstr ""
+
+msgid "send changes not found in the target repository"
+msgstr ""
+
+msgid "send changes not in target as a binary bundle"
+msgstr ""
+
+msgid "name of the bundle attachment file"
+msgstr ""
+
+msgid "a revision to send"
+msgstr ""
+
+msgid "run even when remote repository is unrelated (with -b/--bundle)"
+msgstr ""
+
+msgid "a base changeset to specify instead of a destination (with -b/--bundle)"
+msgstr ""
+
+msgid "send an introduction email for a single patch"
+msgstr ""
+
+msgid "hg email [OPTION]... [DEST]..."
+msgstr ""
+
+msgid "show progress bars for some actions"
+msgstr "afișează bare de progres pentru anumite acțiuni"
+
+msgid ""
+"This extension uses the progress information logged by hg commands\n"
+"to draw progress bars that are as informative as possible. Some progress\n"
+"bars only offer indeterminate information, while others have a definite\n"
+"end point."
+msgstr ""
+
+msgid "The following settings are available::"
+msgstr ""
+
+msgid ""
+"  [progress]\n"
+"  delay = 3 # number of seconds (float) before showing the progress bar\n"
+"  refresh = 0.1 # time in seconds between refreshes of the progress bar\n"
+"  format = topic bar number # format of the progress bar\n"
+"  width = <none> # if set, the maximum width of the progress information\n"
+"                 # (that is, min(width, term width) will be used)\n"
+"  clear-complete = True # clear the progress bar after it's done\n"
+"  disable = False # if true, don't show a progress bar\n"
+"  assume-tty = False # if true, ALWAYS show a progress bar, unless\n"
+"                     # disable is given"
+msgstr ""
+
+msgid ""
+"Valid entries for the format field are topic, bar, number, unit, and\n"
+"item. item defaults to the last 20 characters of the item, but this\n"
+"can be changed by adding either ``-<num>`` which would take the last\n"
+"num characters, or ``+<num>`` for the first num characters.\n"
+msgstr ""
+
+msgid "command to delete untracked files from the working directory"
+msgstr ""
+
+msgid "removes files not tracked by Mercurial"
+msgstr ""
+
+msgid ""
+"    Delete files not known to Mercurial. This is useful to test local\n"
+"    and uncommitted changes in an otherwise-clean source tree."
+msgstr ""
+
+msgid "    This means that purge will delete:"
+msgstr ""
+
+msgid ""
+"    - Unknown files: files marked with \"?\" by :hg:`status`\n"
+"    - Empty directories: in fact Mercurial ignores directories unless\n"
+"      they contain files under source control management"
+msgstr ""
+
+msgid "    But it will leave untouched:"
+msgstr ""
+
+msgid ""
+"    - Modified and unmodified tracked files\n"
+"    - Ignored files (unless --all is specified)\n"
+"    - New files added to the repository (with :hg:`add`)"
+msgstr ""
+
+msgid ""
+"    If directories are given on the command line, only files in these\n"
+"    directories are considered."
+msgstr ""
+
+msgid ""
+"    Be careful with purge, as you could irreversibly delete some files\n"
+"    you forgot to add to the repository. If you only want to print the\n"
+"    list of files that this program would delete, use the --print\n"
+"    option.\n"
+"    "
+msgstr ""
+
+#, python-format
+msgid "%s cannot be removed"
+msgstr ""
+
+#, python-format
+msgid "warning: %s\n"
+msgstr ""
+
+#, python-format
+msgid "Removing file %s\n"
+msgstr ""
+
+#, python-format
+msgid "Removing directory %s\n"
+msgstr ""
+
+msgid "abort if an error occurs"
+msgstr ""
+
+msgid "purge ignored files too"
+msgstr ""
+
+msgid "print filenames instead of deleting them"
+msgstr ""
+
+msgid "end filenames with NUL, for use with xargs (implies -p/--print)"
+msgstr ""
+
+msgid "hg purge [OPTION]... [DIR]..."
+msgstr ""
+
+msgid "command to move sets of revisions to a different ancestor"
+msgstr ""
+
+msgid ""
+"This extension lets you rebase changesets in an existing Mercurial\n"
+"repository."
+msgstr ""
+
+msgid ""
+"For more information:\n"
+"http://mercurial.selenic.com/wiki/RebaseExtension\n"
+msgstr ""
+
+msgid "move changeset (and descendants) to a different branch"
+msgstr ""
+
+msgid ""
+"    Rebase uses repeated merging to graft changesets from one part of\n"
+"    history (the source) onto another (the destination). This can be\n"
+"    useful for linearizing *local* changes relative to a master\n"
+"    development tree."
+msgstr ""
+
+msgid ""
+"    You should not rebase changesets that have already been shared\n"
+"    with others. Doing so will force everybody else to perform the\n"
+"    same rebase or they will end up with duplicated changesets after\n"
+"    pulling in your rebased changesets."
+msgstr ""
+
+msgid ""
+"    If you don't specify a destination changeset (``-d/--dest``),\n"
+"    rebase uses the tipmost head of the current named branch as the\n"
+"    destination. (The destination changeset is not modified by\n"
+"    rebasing, but new changesets are added as its descendants.)"
+msgstr ""
+
+msgid ""
+"    You can specify which changesets to rebase in two ways: as a\n"
+"    \"source\" changeset or as a \"base\" changeset. Both are shorthand\n"
+"    for a topologically related set of changesets (the \"source\n"
+"    branch\"). If you specify source (``-s/--source``), rebase will\n"
+"    rebase that changeset and all of its descendants onto dest. If you\n"
+"    specify base (``-b/--base``), rebase will select ancestors of base\n"
+"    back to but not including the common ancestor with dest. Thus,\n"
+"    ``-b`` is less precise but more convenient than ``-s``: you can\n"
+"    specify any changeset in the source branch, and rebase will select\n"
+"    the whole branch. If you specify neither ``-s`` nor ``-b``, rebase\n"
+"    uses the parent of the working directory as the base."
+msgstr ""
+
+msgid ""
+"    By default, rebase recreates the changesets in the source branch\n"
+"    as descendants of dest and then destroys the originals. Use\n"
+"    ``--keep`` to preserve the original source changesets. Some\n"
+"    changesets in the source branch (e.g. merges from the destination\n"
+"    branch) may be dropped if they no longer contribute any change."
+msgstr ""
+
+msgid ""
+"    One result of the rules for selecting the destination changeset\n"
+"    and source branch is that, unlike ``merge``, rebase will do\n"
+"    nothing if you are at the latest (tipmost) head of a named branch\n"
+"    with two heads. You need to explicitly specify source and/or\n"
+"    destination (or ``update`` to the other head, if it's the head of\n"
+"    the intended source branch)."
+msgstr ""
+
+msgid ""
+"    If a rebase is interrupted to manually resolve a merge, it can be\n"
+"    continued with --continue/-c or aborted with --abort/-a."
+msgstr ""
+
+msgid ""
+"    Returns 0 on success, 1 if nothing to rebase.\n"
+"    "
+msgstr ""
+
+msgid "cannot use both abort and continue"
+msgstr "abort și continue nu se pot folosi împreună"
+
+msgid "cannot use collapse with continue or abort"
+msgstr "collapse nu se poate folosi cu continue sau abort"
+
+msgid "cannot use detach with continue or abort"
+msgstr "detach nu se poate folosi cu continue sau abort"
+
+msgid "abort and continue do not allow specifying revisions"
+msgstr ""
+
+msgid "cannot specify both a revision and a base"
+msgstr ""
+
+msgid "detach requires a revision to be specified"
+msgstr ""
+
+msgid "cannot specify a base with detach"
+msgstr ""
+
+msgid "nothing to rebase\n"
+msgstr ""
+
+msgid "cannot use both keepbranches and extrafn"
+msgstr ""
+
+msgid "rebasing"
+msgstr ""
+
+msgid " changesets"
+msgstr "seturi de modificări"
+
+msgid "fix unresolved conflicts with hg resolve then run hg rebase --continue"
+msgstr ""
+
+#, python-format
+msgid "no changes, revision %d skipped\n"
+msgstr "nu există modificări, se omite revizia %d\n"
+
+msgid "rebase merging completed\n"
+msgstr ""
+
+msgid "warning: new changesets detected on source branch, not stripping\n"
+msgstr ""
+
+msgid "rebase completed\n"
+msgstr ""
+
+#, python-format
+msgid "%d revisions have been skipped\n"
+msgstr "%d revizii au fost omise\n"
+
+msgid "unable to collapse, there is more than one external parent"
+msgstr "nu se poate restrânge, există mai mult de un părinte extern"
+
+#, python-format
+msgid "cannot use revision %d as base, result would have 3 parents"
+msgstr ""
+
+msgid "no rebase in progress"
+msgstr ""
+
+msgid "warning: new changesets detected on target branch, can't abort\n"
+msgstr ""
+"avertisment: au fost detectate seturi de modificări noi în ramura\n"
+", destinație, nu se poate abandona\n"
+
+msgid "rebase aborted\n"
+msgstr ""
+
+msgid "cannot rebase onto an applied mq patch"
+msgstr ""
+
+msgid "source is ancestor of destination"
+msgstr ""
+
+msgid "source is descendant of destination"
+msgstr ""
+
+msgid "rebase working directory to branch head"
+msgstr ""
+
+msgid "rebase from the specified changeset"
+msgstr ""
+
+msgid ""
+"rebase from the base of the specified changeset (up to greatest common "
+"ancestor of base and dest)"
+msgstr ""
+
+msgid "rebase onto the specified changeset"
+msgstr "dislocă către setul de modificări specificat"
+
+msgid "collapse the rebased changesets"
+msgstr "restrânge seturile de modificări repoziționate"
+
+msgid "keep original changesets"
+msgstr ""
+
+msgid "keep original branch names"
+msgstr ""
+
+msgid "force detaching of source from its original branch"
+msgstr ""
+
+msgid "continue an interrupted rebase"
+msgstr "continuă o repoziționare întreruptă"
+
+msgid "abort an interrupted rebase"
+msgstr "abandonează o repoziționare întreruptă"
+
+msgid ""
+"hg rebase [-s REV | -b REV] [-d REV] [options]\n"
+"hg rebase {-a|-c}"
+msgstr ""
+"hg rebase [-s REV | -b REV] [-d REV] [opțiuni]\n"
+"hg rebase {-a|-c}"
+
+msgid "commands to interactively select changes for commit/qrefresh"
+msgstr ""
+
+msgid "this modifies a binary file (all or nothing)\n"
+msgstr ""
+
+msgid "this is a binary file\n"
+msgstr ""
+
+#, python-format
+msgid "%d hunks, %d lines changed\n"
+msgstr ""
+
+msgid "[Ynsfdaq?]"
+msgstr ""
+
+msgid "&Yes, record this change"
+msgstr ""
+
+msgid "&No, skip this change"
+msgstr "&Nu, omite această modificare"
+
+msgid "&Skip remaining changes to this file"
+msgstr "&Omite restul modificărilor pentru acest fișier"
+
+msgid "Record remaining changes to this &file"
+msgstr ""
+
+msgid "&Done, skip remaining changes and files"
+msgstr "În&cheiat, omite restul modificărilor și fișierelor"
+
+msgid "Record &all changes to all remaining files"
+msgstr ""
+
+msgid "&Quit, recording no changes"
+msgstr ""
+
+msgid "&?"
+msgstr ""
+
+msgid "user quit"
+msgstr ""
+
+#, python-format
+msgid "examine changes to %s?"
+msgstr ""
+
+msgid " and "
+msgstr ""
+
+#, python-format
+msgid "record this change to %r?"
+msgstr ""
+
+#, python-format
+msgid "record change %d/%d to %r?"
+msgstr ""
+
+msgid "interactively select changes to commit"
+msgstr ""
+
+msgid ""
+"    If a list of files is omitted, all changes reported by :hg:`status`\n"
+"    will be candidates for recording."
+msgstr ""
+
+msgid "    See :hg:`help dates` for a list of formats valid for -d/--date."
+msgstr ""
+"    Vezi :hg:`help dates` pentru o listă de formate valide cu d/--date."
+
+msgid ""
+"    You will be prompted for whether to record changes to each\n"
+"    modified file, and for files with multiple changes, for each\n"
+"    change to use. For each query, the following responses are\n"
+"    possible::"
+msgstr ""
+
+msgid ""
+"      y - record this change\n"
+"      n - skip this change"
+msgstr ""
+"      y - înregistrează această modificare\n"
+"      n - omite această modificare"
+
+msgid ""
+"      s - skip remaining changes to this file\n"
+"      f - record remaining changes to this file"
+msgstr ""
+"      s - omite restul modificărilor la acest fișier\n"
+"      f - înregistrează restul modificărilor la acest fișier"
+
+msgid ""
+"      d - done, skip remaining changes and files\n"
+"      a - record all changes to all remaining files\n"
+"      q - quit, recording no changes"
+msgstr ""
+"      d - încheiat, omite restul modificărilor și fișierelor\n"
+"      a - înregistrează toate modificările pentru tot restul fișierelor\n"
+"      q - ieși fără a înregistra vreo modificare"
+
+msgid "      ? - display help"
+msgstr "      ? - afișează ajutorul"
+
+msgid "    This command is not available when committing a merge."
+msgstr ""
+
+msgid "'mq' extension not loaded"
+msgstr ""
+
+msgid "running non-interactively, use commit instead"
+msgstr ""
+
+msgid "cannot partially commit a merge (use hg commit instead)"
+msgstr ""
+
+msgid "no changes to record\n"
+msgstr ""
+
+msgid "patch failed to apply"
+msgstr ""
+
+msgid "hg record [OPTION]... [FILE]..."
+msgstr "hg record [OPȚIUNE]... [FIȘIER]..."
+
+msgid "hg qrecord [OPTION]... PATCH [FILE]..."
+msgstr ""
+
+msgid "recreates hardlinks between repository clones"
+msgstr ""
+
+msgid "recreate hardlinks between two repositories"
+msgstr ""
+
+msgid ""
+"    When repositories are cloned locally, their data files will be\n"
+"    hardlinked so that they only use the space of a single repository."
+msgstr ""
+
+msgid ""
+"    Unfortunately, subsequent pulls into either repository will break\n"
+"    hardlinks for any files touched by the new changesets, even if\n"
+"    both repositories end up pulling the same changes."
+msgstr ""
+
+msgid ""
+"    Similarly, passing --rev to \"hg clone\" will fail to use any\n"
+"    hardlinks, falling back to a complete copy of the source\n"
+"    repository."
+msgstr ""
+
+msgid ""
+"    This command lets you recreate those hardlinks and reclaim that\n"
+"    wasted space."
+msgstr ""
+
+msgid ""
+"    This repository will be relinked to share space with ORIGIN, which\n"
+"    must be on the same local disk. If ORIGIN is omitted, looks for\n"
+"    \"default-relink\", then \"default\", in [paths]."
+msgstr ""
+
+msgid ""
+"    Do not attempt any read operations on this repository while the\n"
+"    command is running. (Both repositories will be locked against\n"
+"    writes.)\n"
+"    "
+msgstr ""
+
+msgid "hardlinks are not supported on this system"
+msgstr ""
+
+#, python-format
+msgid "relinking %s to %s\n"
+msgstr ""
+
+#, python-format
+msgid "tip has %d files, estimated total number of files: %s\n"
+msgstr ""
+
+msgid "collecting"
+msgstr ""
+
+msgid "files"
+msgstr ""
+
+#, python-format
+msgid "collected %d candidate storage files\n"
+msgstr ""
+
+msgid "source and destination are on different devices"
+msgstr ""
+
+#, python-format
+msgid "not linkable: %s\n"
+msgstr ""
+
+msgid " files"
+msgstr ""
+
+msgid "pruning"
+msgstr ""
+
+#, python-format
+msgid "pruned down to %d probably relinkable files\n"
+msgstr ""
+
+msgid "relinking"
+msgstr ""
+
+#, python-format
+msgid "relinked %d files (%d bytes reclaimed)\n"
+msgstr ""
+
+msgid "[ORIGIN]"
+msgstr ""
+
+msgid "extend schemes with shortcuts to repository swarms"
+msgstr ""
+
+msgid ""
+"This extension allows you to specify shortcuts for parent URLs with a\n"
+"lot of repositories to act like a scheme, for example::"
+msgstr ""
+
+msgid ""
+"  [schemes]\n"
+"  py = http://code.python.org/hg/"
+msgstr ""
+
+msgid "After that you can use it like::"
+msgstr ""
+
+msgid "  hg clone py://trunk/"
+msgstr ""
+
+msgid ""
+"Additionally there is support for some more complex schemas, for\n"
+"example used by Google Code::"
+msgstr ""
+
+msgid ""
+"  [schemes]\n"
+"  gcode = http://{1}.googlecode.com/hg/"
+msgstr ""
+
+msgid ""
+"The syntax is taken from Mercurial templates, and you have unlimited\n"
+"number of variables, starting with ``{1}`` and continuing with\n"
+"``{2}``, ``{3}`` and so on. This variables will receive parts of URL\n"
+"supplied, split by ``/``. Anything not specified as ``{part}`` will be\n"
+"just appended to an URL."
+msgstr ""
+
+msgid "For convenience, the extension adds these schemes by default::"
+msgstr ""
+
+msgid ""
+"  [schemes]\n"
+"  py = http://hg.python.org/\n"
+"  bb = https://bitbucket.org/\n"
+"  bb+ssh = ssh://hg@bitbucket.org/\n"
+"  gcode = https://{1}.googlecode.com/hg/\n"
+"  kiln = https://{1}.kilnhg.com/Repo/"
+msgstr ""
+
+msgid ""
+"You can override a predefined scheme by defining a new scheme with the\n"
+"same name.\n"
+msgstr ""
+
+msgid "share a common history between several working directories"
+msgstr ""
+
+msgid "create a new shared repository"
+msgstr ""
+
+msgid ""
+"    Initialize a new repository and working directory that shares its\n"
+"    history with another repository."
+msgstr ""
+
+msgid ""
+"    NOTE: using rollback or extensions that destroy/modify history\n"
+"    (mq, rebase, etc.) can cause considerable confusion with shared\n"
+"    clones. In particular, if two shared clones are both updated to\n"
+"    the same changeset, and one of them destroys that changeset with\n"
+"    rollback, the other clone will suddenly stop working: all\n"
+"    operations will fail with \"abort: working directory has unknown\n"
+"    parent\". The only known workaround is to use debugsetparents on\n"
+"    the broken clone to reset it to a changeset that still exists\n"
+"    (e.g. tip).\n"
+"    "
+msgstr ""
+
+msgid "do not create a working copy"
+msgstr ""
+
+msgid "[-U] SOURCE [DEST]"
+msgstr ""
+
+msgid "command to transplant changesets from another branch"
+msgstr ""
+
+msgid "This extension allows you to transplant patches from another branch."
+msgstr ""
+
+msgid ""
+"Transplanted patches are recorded in .hg/transplant/transplants, as a\n"
+"map from a changeset hash to its hash in the source repository.\n"
+msgstr ""
+
+#, python-format
+msgid "skipping already applied revision %s\n"
+msgstr "se omite revizia %s, deja aplicată\n"
+
+#, python-format
+msgid "skipping merge changeset %s:%s\n"
+msgstr "se omite setul de modificări de fuziune %s:%s\n"
+
+#, python-format
+msgid "%s merged at %s\n"
+msgstr ""
+
+#, python-format
+msgid "%s transplanted to %s\n"
+msgstr ""
+
+#, python-format
+msgid "filtering %s\n"
+msgstr ""
+
+msgid "filter failed"
+msgstr ""
+
+msgid "can only omit patchfile if merging"
+msgstr ""
+
+#, python-format
+msgid "%s: empty changeset"
+msgstr ""
+
+msgid "Fix up the merge and run hg transplant --continue"
+msgstr ""
+
+#, python-format
+msgid "%s transplanted as %s\n"
+msgstr ""
+
+msgid "transplant log file is corrupt"
+msgstr ""
+
+#, python-format
+msgid "working dir not at transplant parent %s"
+msgstr ""
+
+msgid "commit failed"
+msgstr ""
+
+msgid ""
+"y: transplant this changeset\n"
+"n: skip this changeset\n"
+"m: merge at this changeset\n"
+"p: show patch\n"
+"c: commit selected changesets\n"
+"q: cancel transplant\n"
+"?: show this help\n"
+msgstr ""
+"y: transplantează acest set de modificări\n"
+"n: sari omite set de modificări\n"
+"m: fuzionează la acest set de modificări\n"
+"p: afișează patch-ul\n"
+"c: depozitează seturile de modificări selectate\n"
+"q: anulează transplantul\n"
+"?: afișează acest ajutor\n"
+
+msgid "apply changeset? [ynmpcq?]:"
+msgstr ""
+
+msgid "no such option\n"
+msgstr "opțiune inexistentă\n"
+
+msgid "transplant changesets from another branch"
+msgstr ""
+
+msgid ""
+"    Selected changesets will be applied on top of the current working\n"
+"    directory with the log of the original changeset. If --log is\n"
+"    specified, log messages will have a comment appended of the form::"
+msgstr ""
+
+msgid "      (transplanted from CHANGESETHASH)"
+msgstr ""
+
+msgid ""
+"    You can rewrite the changelog message with the --filter option.\n"
+"    Its argument will be invoked with the current changelog message as\n"
+"    $1 and the patch as $2."
+msgstr ""
+
+msgid ""
+"    If --source/-s is specified, selects changesets from the named\n"
+"    repository. If --branch/-b is specified, selects changesets from\n"
+"    the branch holding the named revision, up to that revision. If\n"
+"    --all/-a is specified, all changesets on the branch will be\n"
+"    transplanted, otherwise you will be prompted to select the\n"
+"    changesets you want."
+msgstr ""
+
+msgid ""
+"    :hg:`transplant --branch REVISION --all` will rebase the selected\n"
+"    branch (up to the named revision) onto your current working\n"
+"    directory."
+msgstr ""
+
+msgid ""
+"    You can optionally mark selected transplanted changesets as merge\n"
+"    changesets. You will not be prompted to transplant any ancestors\n"
+"    of a merged transplant, and you can merge descendants of them\n"
+"    normally instead of transplanting them."
+msgstr ""
+
+msgid ""
+"    If no merges or revisions are provided, :hg:`transplant` will\n"
+"    start an interactive changeset browser."
+msgstr ""
+
+msgid ""
+"    If a changeset application fails, you can fix the merge by hand\n"
+"    and then resume where you left off by calling :hg:`transplant\n"
+"    --continue/-c`.\n"
+"    "
+msgstr ""
+
+msgid "--continue is incompatible with branch, all or merge"
+msgstr ""
+
+msgid "no source URL, branch tag or revision list provided"
+msgstr ""
+
+msgid "--all requires a branch revision"
+msgstr ""
+
+msgid "--all is incompatible with a revision list"
+msgstr ""
+
+msgid "no revision checked out"
+msgstr ""
+
+msgid "outstanding uncommitted merges"
+msgstr "fuziuni nedepozitate în suspensie"
+
+msgid "outstanding local changes"
+msgstr "modificări locale în suspensie"
+
+msgid "pull patches from REPO"
+msgstr ""
+
+msgid "BRANCH"
+msgstr "RAMURÄ‚"
+
+msgid "pull patches from branch BRANCH"
+msgstr ""
+
+msgid "pull all changesets up to BRANCH"
+msgstr ""
+
+msgid "skip over REV"
+msgstr "omite REV"
+
+msgid "merge at REV"
+msgstr ""
+
+msgid "append transplant info to log message"
+msgstr ""
+
+msgid "continue last transplant session after repair"
+msgstr ""
+
+msgid "filter changesets through command"
+msgstr ""
+
+msgid "hg transplant [-s REPO] [-b BRANCH [-a]] [-p REV] [-m REV] [REV]..."
+msgstr "hg transplant [-s DEPOZIT] [-b RAMURÄ‚ [-a]] [-p REV] [-m REV] [REV]..."
+
+msgid "allow the use of MBCS paths with problematic encodings"
+msgstr ""
+
+msgid ""
+"Some MBCS encodings are not good for some path operations (i.e.\n"
+"splitting path, case conversion, etc.) with its encoded bytes. We call\n"
+"such a encoding (i.e. shift_jis and big5) as \"problematic encoding\".\n"
+"This extension can be used to fix the issue with those encodings by\n"
+"wrapping some functions to convert to Unicode string before path\n"
+"operation."
+msgstr ""
+
+msgid "This extension is useful for:"
+msgstr ""
+
+msgid ""
+"- Japanese Windows users using shift_jis encoding.\n"
+"- Chinese Windows users using big5 encoding.\n"
+"- All users who use a repository with one of problematic encodings on\n"
+"  case-insensitive file system."
+msgstr ""
+
+msgid "This extension is not needed for:"
+msgstr ""
+
+msgid ""
+"- Any user who use only ASCII chars in path.\n"
+"- Any user who do not use any of problematic encodings."
+msgstr ""
+
+msgid "Note that there are some limitations on using this extension:"
+msgstr ""
+
+msgid "- You should use single encoding in one repository."
+msgstr ""
+
+msgid ""
+"\n"
+"By default, win32mbcs uses encoding.encoding decided by Mercurial.\n"
+"You can specify the encoding by config option::"
+msgstr ""
+
+msgid ""
+" [win32mbcs]\n"
+" encoding = sjis"
+msgstr ""
+
+msgid "It is useful for the users who want to commit with UTF-8 log message.\n"
+msgstr ""
+
+#, python-format
+msgid "[win32mbcs] filename conversion failed with %s encoding\n"
+msgstr ""
+
+msgid "[win32mbcs] cannot activate on this platform.\n"
+msgstr ""
+
+msgid "perform automatic newline conversion"
+msgstr ""
+
+msgid ""
+"  Deprecation: The win32text extension requires each user to configure\n"
+"  the extension again and again for each clone since the configuration\n"
+"  is not copied when cloning."
+msgstr ""
+
+msgid ""
+"  We have therefore made the ``eol`` as an alternative. The ``eol``\n"
+"  uses a version controlled file for its configuration and each clone\n"
+"  will therefore use the right settings from the start."
+msgstr ""
+
+msgid "To perform automatic newline conversion, use::"
+msgstr ""
+
+msgid ""
+"  [extensions]\n"
+"  win32text =\n"
+"  [encode]\n"
+"  ** = cleverencode:\n"
+"  # or ** = macencode:"
+msgstr ""
+
+msgid ""
+"  [decode]\n"
+"  ** = cleverdecode:\n"
+"  # or ** = macdecode:"
+msgstr ""
+
+msgid ""
+"If not doing conversion, to make sure you do not commit CRLF/CR by accident::"
+msgstr ""
+
+msgid ""
+"  [hooks]\n"
+"  pretxncommit.crlf = python:hgext.win32text.forbidcrlf\n"
+"  # or pretxncommit.cr = python:hgext.win32text.forbidcr"
+msgstr ""
+
+msgid ""
+"To do the same check on a server to prevent CRLF/CR from being\n"
+"pushed or pulled::"
+msgstr ""
+
+msgid ""
+"  [hooks]\n"
+"  pretxnchangegroup.crlf = python:hgext.win32text.forbidcrlf\n"
+"  # or pretxnchangegroup.cr = python:hgext.win32text.forbidcr\n"
+msgstr ""
+
+#, python-format
+msgid ""
+"WARNING: %s already has %s line endings\n"
+"and does not need EOL conversion by the win32text plugin.\n"
+"Before your next commit, please reconsider your encode/decode settings in \n"
+"Mercurial.ini or %s.\n"
+msgstr ""
+
+#, python-format
+msgid "Attempt to commit or push text file(s) using %s line endings\n"
+msgstr ""
+
+#, python-format
+msgid "in %s: %s\n"
+msgstr ""
+
+#, python-format
+msgid ""
+"\n"
+"To prevent this mistake in your local repository,\n"
+"add to Mercurial.ini or .hg/hgrc:"
+msgstr ""
+
+#, python-format
+msgid ""
+"[hooks]\n"
+"pretxncommit.%s = python:hgext.win32text.forbid%s"
+msgstr ""
+
+#, python-format
+msgid "and also consider adding:"
+msgstr ""
+
+#, python-format
+msgid ""
+"[extensions]\n"
+"win32text =\n"
+"[encode]\n"
+"** = %sencode:\n"
+"[decode]\n"
+"** = %sdecode:\n"
+msgstr ""
+
+msgid "discover and advertise repositories on the local network"
+msgstr ""
+
+msgid ""
+"Zeroconf-enabled repositories will be announced in a network without\n"
+"the need to configure a server or a service. They can be discovered\n"
+"without knowing their actual IP address."
+msgstr ""
+
+msgid ""
+"To allow other people to discover your repository using run\n"
+":hg:`serve` in your repository::"
+msgstr ""
+
+msgid ""
+"  $ cd test\n"
+"  $ hg serve"
+msgstr ""
+
+msgid ""
+"You can discover Zeroconf-enabled repositories by running\n"
+":hg:`paths`::"
+msgstr ""
+
+msgid ""
+"  $ hg paths\n"
+"  zc-test = http://example.com:8000/test\n"
+msgstr ""
+
+msgid "archive prefix contains illegal components"
+msgstr ""
+
+msgid "cannot give prefix when archiving to files"
+msgstr ""
+
+#, python-format
+msgid "unknown archive type '%s'"
+msgstr ""
+
+msgid "invalid changegroup"
+msgstr ""
+
+msgid "unknown parent"
+msgstr ""
+
+#, python-format
+msgid "integrity check failed on %s:%d"
+msgstr ""
+
+#, python-format
+msgid "%s: not a Mercurial bundle file"
+msgstr ""
+
+#, python-format
+msgid "%s: unknown bundle version"
+msgstr ""
+
+#, python-format
+msgid "%s: unknown bundle compression type"
+msgstr ""
+
+msgid "cannot create new bundle repository"
+msgstr ""
+
+#, python-format
+msgid "premature EOF reading chunk (got %d bytes, expected %d)"
+msgstr ""
+
+msgid "empty username"
+msgstr ""
+
+#, python-format
+msgid "username %s contains a newline"
+msgstr ""
+
+#, python-format
+msgid "the name '%s' is reserved"
+msgstr ""
+
+msgid "options --message and --logfile are mutually exclusive"
+msgstr ""
+
+#, python-format
+msgid "can't read commit message '%s': %s"
+msgstr ""
+
+msgid "limit must be a positive integer"
+msgstr ""
+
+msgid "limit must be positive"
+msgstr ""
+
+msgid "too many revisions specified"
+msgstr ""
+
+#, python-format
+msgid "invalid format spec '%%%s' in output filename"
+msgstr ""
+
+#, python-format
+msgid "adding %s\n"
+msgstr "se adaugă %s\n"
+
+#, python-format
+msgid "removing %s\n"
+msgstr ""
+
+#, python-format
+msgid "recording removal of %s as rename to %s (%d%% similar)\n"
+msgstr ""
+
+#, python-format
+msgid "%s: not copying - file is not managed\n"
+msgstr ""
+
+#, python-format
+msgid "%s: not copying - file has been marked for remove\n"
+msgstr ""
+
+#, python-format
+msgid "%s: not overwriting - %s collides with %s\n"
+msgstr ""
+
+#, python-format
+msgid "%s: not overwriting - file exists\n"
+msgstr ""
+
+#, python-format
+msgid "%s: not recording move - %s does not exist\n"
+msgstr ""
+
+#, python-format
+msgid "%s: not recording copy - %s does not exist\n"
+msgstr ""
+
+#, python-format
+msgid "%s: deleted in working copy\n"
+msgstr ""
+
+#, python-format
+msgid "%s: cannot copy - %s\n"
+msgstr ""
+
+#, python-format
+msgid "moving %s to %s\n"
+msgstr ""
+
+#, python-format
+msgid "copying %s to %s\n"
+msgstr ""
+
+#, python-format
+msgid "%s has not been committed yet, so no copy data will be stored for %s.\n"
+msgstr ""
+
+msgid "no source or destination specified"
+msgstr ""
+
+msgid "no destination specified"
+msgstr ""
+
+msgid "with multiple sources, destination must be an existing directory"
+msgstr ""
+
+#, python-format
+msgid "destination %s is not a directory"
+msgstr ""
+
+msgid "no files to copy"
+msgstr ""
+
+msgid "(consider using --after)\n"
+msgstr ""
+
+msgid "child process failed to start"
+msgstr ""
+
+#, python-format
+msgid "changeset:   %d:%s\n"
+msgstr "set de modificări:   %d:%s\n"
+
+#, python-format
+msgid "branch:      %s\n"
+msgstr "ramură:              %s\n"
+
+#, python-format
+msgid "tag:         %s\n"
+msgstr "etichetă:            %s\n"
+
+#, python-format
+msgid "parent:      %d:%s\n"
+msgstr "părinte:             %d:%s\n"
+
+#, python-format
+msgid "manifest:    %d:%s\n"
+msgstr "manifest:            %d:%s\n"
+
+#, python-format
+msgid "user:        %s\n"
+msgstr "utilizator:          %s\n"
+
+#, python-format
+msgid "date:        %s\n"
+msgstr "dată:                %s\n"
+
+msgid "files+:"
+msgstr "fișiere+:"
+
+msgid "files-:"
+msgstr "fișiere-:"
+
+msgid "files:"
+msgstr "fișiere:"
+
+#, python-format
+msgid "files:       %s\n"
+msgstr "fișiere:             %s\n"
+
+#, python-format
+msgid "copies:      %s\n"
+msgstr "copii:               %s\n"
+
+#, python-format
+msgid "extra:       %s=%s\n"
+msgstr "extra:         %s=%s\n"
+
+msgid "description:\n"
+msgstr "descriere:\n"
+
+#, python-format
+msgid "summary:     %s\n"
+msgstr "rezumat:             %s\n"
+
+#, python-format
+msgid "%s: no key named '%s'"
+msgstr ""
+
+#, python-format
+msgid "Found revision %s from %s\n"
+msgstr ""
+
+msgid "revision matching date not found"
+msgstr ""
+
+#, python-format
+msgid "cannot follow nonexistent file: \"%s\""
+msgstr ""
+
+msgid "can only follow copies/renames for explicit filenames"
+msgstr ""
+
+msgid "HG: Enter commit message.  Lines beginning with 'HG:' are removed."
+msgstr ""
+
+msgid "HG: Leave message empty to abort commit."
+msgstr ""
+
+#, python-format
+msgid "HG: user: %s"
+msgstr "HG: utilizator: %s"
+
+msgid "HG: branch merge"
+msgstr ""
+
+#, python-format
+msgid "HG: branch '%s'"
+msgstr ""
+
+#, python-format
+msgid "HG: subrepo %s"
+msgstr ""
+
+#, python-format
+msgid "HG: added %s"
+msgstr ""
+
+#, python-format
+msgid "HG: changed %s"
+msgstr ""
+
+#, python-format
+msgid "HG: removed %s"
+msgstr ""
+
+msgid "HG: no files changed"
+msgstr ""
+
+msgid "empty commit message"
+msgstr ""
+
+msgid "add the specified files on the next commit"
+msgstr "adaugă fișierele specificate la următoarea depozitare ('commit')"
+
+msgid ""
+"    Schedule files to be version controlled and added to the\n"
+"    repository."
+msgstr ""
+"    Planifică fișierele pentru a fi luate în evidența sistemului de\n"
+"    control al versiunilor și adăugate în depozit."
+
+msgid ""
+"    The files will be added to the repository at the next commit. To\n"
+"    undo an add before that, see :hg:`forget`."
+msgstr ""
+"    Fișierele vor fi adăugate în depozit la următoarea depozitare "
+"('commit').\n"
+"    Pentru a anula acțiunea înainte de efectuare, folosiți :hg:`forget`."
+
+msgid "    If no names are given, add all files to the repository."
+msgstr ""
+"    Dacă nu se specifică niciun nume, vor fi adăugate în depozit toate "
+"fișierele."
+
+msgid "    .. container:: verbose"
+msgstr ""
+
+msgid ""
+"       An example showing how new (unknown) files are added\n"
+"       automatically by :hg:`add`::"
+msgstr ""
+
+msgid ""
+"         $ ls\n"
+"         foo.c\n"
+"         $ hg status\n"
+"         ? foo.c\n"
+"         $ hg add\n"
+"         adding foo.c\n"
+"         $ hg status\n"
+"         A foo.c"
+msgstr ""
+
+msgid ""
+"    Returns 0 if all files are successfully added.\n"
+"    "
+msgstr ""
+"    Returnează 0 dacă toate fișierele sunt adăugate cu succes.\n"
+"    "
+
+msgid "add all new files, delete all missing files"
+msgstr ""
+
+msgid ""
+"    Add all new files and remove all missing files from the\n"
+"    repository."
+msgstr ""
+
+msgid ""
+"    New files are ignored if they match any of the patterns in\n"
+"    .hgignore. As with add, these changes take effect at the next\n"
+"    commit."
+msgstr ""
+
+msgid ""
+"    Use the -s/--similarity option to detect renamed files. With a\n"
+"    parameter greater than 0, this compares every removed file with\n"
+"    every added file and records those similar enough as renames. This\n"
+"    option takes a percentage between 0 (disabled) and 100 (files must\n"
+"    be identical) as its parameter. Detecting renamed files this way\n"
+"    can be expensive. After using this option, :hg:`status -C` can be\n"
+"    used to check which files were identified as moved or renamed."
+msgstr ""
+
+msgid "similarity must be a number"
+msgstr ""
+
+msgid "similarity must be between 0 and 100"
+msgstr ""
+
+msgid "show changeset information by line for each file"
+msgstr ""
+"afișează informațiile despre setul de modificări line cu linie\n "
+"pentru fiecare fișier"
+
+msgid ""
+"    List changes in files, showing the revision id responsible for\n"
+"    each line"
+msgstr ""
+
+msgid ""
+"    This command is useful for discovering when a change was made and\n"
+"    by whom."
+msgstr ""
+
+msgid ""
+"    Without the -a/--text option, annotate will avoid processing files\n"
+"    it detects as binary. With -a, annotate will annotate the file\n"
+"    anyway, although the results will probably be neither useful\n"
+"    nor desirable."
+msgstr ""
+
+msgid ""
+"    Returns 0 on success.\n"
+"    "
+msgstr ""
+"    Returnează 0 în caz de succes.\n"
+"    "
+
+msgid "at least one filename or pattern is required"
+msgstr ""
+
+msgid "at least one of -n/-c is required for -l"
+msgstr ""
+
+#, python-format
+msgid "%s: binary file\n"
+msgstr ""
+
+msgid "create an unversioned archive of a repository revision"
+msgstr ""
+
+msgid ""
+"    By default, the revision used is the parent of the working\n"
+"    directory; use -r/--rev to specify a different revision."
+msgstr ""
+
+msgid ""
+"    The archive type is automatically detected based on file\n"
+"    extension (or override using -t/--type)."
+msgstr ""
+
+msgid "    Valid types are:"
+msgstr ""
+
+msgid ""
+"    :``files``: a directory full of files (default)\n"
+"    :``tar``:   tar archive, uncompressed\n"
+"    :``tbz2``:  tar archive, compressed using bzip2\n"
+"    :``tgz``:   tar archive, compressed using gzip\n"
+"    :``uzip``:  zip archive, uncompressed\n"
+"    :``zip``:   zip archive, compressed using deflate"
+msgstr ""
+
+msgid ""
+"    The exact name of the destination archive or directory is given\n"
+"    using a format string; see :hg:`help export` for details."
+msgstr ""
+
+msgid ""
+"    Each member added to an archive file has a directory prefix\n"
+"    prepended. Use -p/--prefix to specify a format string for the\n"
+"    prefix. The default is the basename of the archive, with suffixes\n"
+"    removed."
+msgstr ""
+
+msgid "no working directory: please specify a revision"
+msgstr ""
+
+msgid "repository root cannot be destination"
+msgstr ""
+
+msgid "cannot archive plain files to stdout"
+msgstr ""
+
+msgid "reverse effect of earlier changeset"
+msgstr ""
+
+msgid ""
+"    Commit the backed out changes as a new changeset. The new\n"
+"    changeset is a child of the backed out changeset."
+msgstr ""
+
+msgid ""
+"    If you backout a changeset other than the tip, a new head is\n"
+"    created. This head will be the new tip and you should merge this\n"
+"    backout changeset with another head."
+msgstr ""
+
+msgid ""
+"    The --merge option remembers the parent of the working directory\n"
+"    before starting the backout, then merges the new head with that\n"
+"    changeset afterwards. This saves you from doing the merge by hand.\n"
+"    The result of this merge is not committed, as with a normal merge."
+msgstr ""
+
+msgid "please specify just one revision"
+msgstr ""
+
+msgid "please specify a revision to backout"
+msgstr ""
+
+msgid "cannot backout change on a different branch"
+msgstr ""
+
+msgid "cannot backout a change with no parents"
+msgstr ""
+
+msgid "cannot backout a merge changeset without --parent"
+msgstr ""
+
+#, python-format
+msgid "%s is not a parent of %s"
+msgstr ""
+
+msgid "cannot use --parent on non-merge changeset"
+msgstr ""
+
+#, python-format
+msgid "changeset %s backs out changeset %s\n"
+msgstr ""
+
+#, python-format
+msgid "merging with changeset %s\n"
+msgstr ""
+
+msgid "the backout changeset is a new head - do not forget to merge\n"
+msgstr ""
+
+msgid "(use \"backout --merge\" if you want to auto-merge)\n"
+msgstr ""
+
+msgid "subdivision search of changesets"
+msgstr ""
+
+msgid ""
+"    This command helps to find changesets which introduce problems. To\n"
+"    use, mark the earliest changeset you know exhibits the problem as\n"
+"    bad, then mark the latest changeset which is free from the problem\n"
+"    as good. Bisect will update your working directory to a revision\n"
+"    for testing (unless the -U/--noupdate option is specified). Once\n"
+"    you have performed tests, mark the working directory as good or\n"
+"    bad, and bisect will either update to another candidate changeset\n"
+"    or announce that it has found the bad revision."
+msgstr ""
+
+msgid ""
+"    As a shortcut, you can also use the revision argument to mark a\n"
+"    revision as good or bad without checking it out first."
+msgstr ""
+"   Ca scurtătură, puteți folosi argumentul reviziei pentru a marca o    "
+"revizie ca bună sau rea, fără a o actualiza în prealabil."
+
+msgid ""
+"    If you supply a command, it will be used for automatic bisection.\n"
+"    Its exit status will be used to mark revisions as good or bad:\n"
+"    status 0 means good, 125 means to skip the revision, 127\n"
+"    (command not found) will abort the bisection, and any other\n"
+"    non-zero exit status means the revision is bad."
+msgstr ""
+"    Dacă furnizați o comandă, aceasta va fi folosită pentru bisecția\n"
+"    automată. Starea ei la ieșire va fi folosită pentru a marca\n"
+"    reviziile drept bune sau rele: starea 0 înseamnă bun, 125 înseamnă\n"
+"    omiterea reviziei, 127 (comandă negăsită) va abandona bisecția,\n"
+"    iar orice altă stare la ieșire diferită de 0 înseamnă revizie rea."
+
+msgid "The first good revision is:\n"
+msgstr ""
+
+msgid "The first bad revision is:\n"
+msgstr ""
+
+msgid "Due to skipped revisions, the first good revision could be any of:\n"
+msgstr ""
+"Datorită reviziilor omise, prima revizie bună ar putea fi oricare\n"
+"dintre:\n"
+
+msgid "Due to skipped revisions, the first bad revision could be any of:\n"
+msgstr ""
+"Datorită reviziilor omise, prima revizie rea ar putea fi oricare\n"
+"dintre:\n"
+
+msgid "cannot bisect (no known good revisions)"
+msgstr ""
+
+msgid "cannot bisect (no known bad revisions)"
+msgstr ""
+
+msgid "(use of 'hg bisect <cmd>' is deprecated)\n"
+msgstr ""
+
+msgid "incompatible arguments"
+msgstr ""
+
+#, python-format
+msgid "failed to execute %s"
+msgstr ""
+
+#, python-format
+msgid "%s killed"
+msgstr ""
+
+#, python-format
+msgid "Changeset %d:%s: %s\n"
+msgstr ""
+
+#, python-format
+msgid "Testing changeset %d:%s (%d changesets remaining, ~%d tests)\n"
+msgstr ""
+
+msgid "set or show the current branch name"
+msgstr "setează sau afișează numele ramurii curente"
+
+msgid ""
+"    With no argument, show the current branch name. With one argument,\n"
+"    set the working directory branch name (the branch will not exist\n"
+"    in the repository until the next commit). Standard practice\n"
+"    recommends that primary development take place on the 'default'\n"
+"    branch."
+msgstr ""
+
+msgid ""
+"    Unless -f/--force is specified, branch will not let you set a\n"
+"    branch name that already exists, even if it's inactive."
+msgstr ""
+
+msgid ""
+"    Use -C/--clean to reset the working directory branch to that of\n"
+"    the parent of the working directory, negating a previous branch\n"
+"    change."
+msgstr ""
+
+msgid ""
+"    Use the command :hg:`update` to switch to an existing branch. Use\n"
+"    :hg:`commit --close-branch` to mark this branch as closed."
+msgstr ""
+
+#, python-format
+msgid "reset working directory to branch %s\n"
+msgstr ""
+
+msgid ""
+"a branch of the same name already exists (use 'hg update' to switch to it)"
+msgstr ""
+
+#, python-format
+msgid "marked working directory as branch %s\n"
+msgstr ""
+
+msgid "list repository named branches"
+msgstr ""
+
+msgid ""
+"    List the repository's named branches, indicating which ones are\n"
+"    inactive. If -c/--closed is specified, also list branches which have\n"
+"    been marked closed (see :hg:`commit --close-branch`)."
+msgstr ""
+
+msgid ""
+"    If -a/--active is specified, only show active branches. A branch\n"
+"    is considered active if it contains repository heads."
+msgstr ""
+
+msgid "    Use the command :hg:`update` to switch to an existing branch."
+msgstr ""
+
+msgid ""
+"    Returns 0.\n"
+"    "
+msgstr ""
+
+msgid " (closed)"
+msgstr ""
+
+msgid " (inactive)"
+msgstr ""
+
+msgid "create a changegroup file"
+msgstr ""
+
+msgid ""
+"    Generate a compressed changegroup file collecting changesets not\n"
+"    known to be in another repository."
+msgstr ""
+
+msgid ""
+"    If you omit the destination repository, then hg assumes the\n"
+"    destination will have all the nodes you specify with --base\n"
+"    parameters. To create a bundle containing all changesets, use\n"
+"    -a/--all (or --base null)."
+msgstr ""
+
+msgid ""
+"    You can change compression method with the -t/--type option.\n"
+"    The available compression methods are: none, bzip2, and\n"
+"    gzip (by default, bundles are compressed using bzip2)."
+msgstr ""
+
+msgid ""
+"    The bundle file can then be transferred using conventional means\n"
+"    and applied to another repository with the unbundle or pull\n"
+"    command. This is useful when direct push and pull are not\n"
+"    available or when exporting an entire repository is undesirable."
+msgstr ""
+
+msgid ""
+"    Applying bundles preserves all changeset contents including\n"
+"    permissions, copy/rename information, and revision history."
+msgstr ""
+
+msgid ""
+"    Returns 0 on success, 1 if no changes found.\n"
+"    "
+msgstr ""
+"    Returnează 0 în caz de succes, 1 dacă nu s-au găsit modificări.\n"
+"    "
+
+msgid "--base is incompatible with specifying a destination"
+msgstr ""
+
+msgid "unknown bundle type specified with --type"
+msgstr ""
+
+msgid "output the current or given revision of files"
+msgstr ""
+
+msgid ""
+"    Print the specified files as they were at the given revision. If\n"
+"    no revision is given, the parent of the working directory is used,\n"
+"    or tip if no revision is checked out."
+msgstr ""
+
+msgid ""
+"    Output may be to a file, in which case the name of the file is\n"
+"    given using a format string. The formatting rules are the same as\n"
+"    for the export command, with the following additions:"
+msgstr ""
+
+msgid ""
+"    :``%s``: basename of file being printed\n"
+"    :``%d``: dirname of file being printed, or '.' if in repository root\n"
+"    :``%p``: root-relative path name of file being printed"
+msgstr ""
+
+msgid "make a copy of an existing repository"
+msgstr "realizează o copie a unui depozit existent"
+
+msgid "    Create a copy of an existing repository in a new directory."
+msgstr "    Creează o copie a unui depozit existent, într-un director nou."
+
+msgid ""
+"    If no destination directory name is specified, it defaults to the\n"
+"    basename of the source."
+msgstr ""
+"    Dacă nu se specifică numele directorului destinație, acesta va fi\n"
+"    implicit numele de bază (basename) al sursei."
+
+msgid ""
+"    The location of the source is added to the new repository's\n"
+"    .hg/hgrc file, as the default to be used for future pulls."
+msgstr ""
+"    Amplasarea sursei este adăugată în fișierul .hg/hgrc al noului\n"
+"    depozit, ca amplasarea implicită pentru viitoarele comenzi 'pull'."
+
+msgid "    See :hg:`help urls` for valid source format details."
+msgstr ""
+"    Vezi :hg:`help urls` pentru detalii legate de formate valide de surse."
+
+msgid ""
+"    It is possible to specify an ``ssh://`` URL as the destination, but no\n"
+"    .hg/hgrc and working directory will be created on the remote side.\n"
+"    Please see :hg:`help urls` for important details about ``ssh://`` URLs."
+msgstr ""
+"    Ca destinație se poate specifica un URL ``ssh://``, dar nu va fi creat.\n"
+"    niciun fișier .hg/hgrc pe mașina la distanță.\n"
+"    Vezi :hg:`help urls` pentru detalii importante despre URL-urile ``ssh://"
+"``."
+
+msgid ""
+"    A set of changesets (tags, or branch names) to pull may be specified\n"
+"    by listing each changeset (tag, or branch name) with -r/--rev.\n"
+"    If -r/--rev is used, the cloned repository will contain only a subset\n"
+"    of the changesets of the source repository. Only the set of changesets\n"
+"    defined by all -r/--rev options (including all their ancestors)\n"
+"    will be pulled into the destination repository.\n"
+"    No subsequent changesets (including subsequent tags) will be present\n"
+"    in the destination."
+msgstr ""
+"    O colecție de seturi de modificări (etichete sau nume de ramuri) care\n"
+"    urmează a fi recuperate poate fi specificată prin listarea fiecărui set\n"
+"    de modificări (etichete sau nume de ramuri) cu -r/--rev.\n"
+"    Dacă se folosește -r/--rev, depozitul clonat va conține numai un subset\n"
+"    al seturilor de modificări ale depozitului sursă. Numai colecția de\n"
+"     seturi de modificări definite de toate opțiunile -r/--rev (inclusiv "
+"toți\n"
+"    strămoșii) va fi adusă (pulled) in depozitul destinație.\n"
+"    Nici un set de modificări ulterior (inclusiv etichete ulterioare) nu se\n"
+"    va regăsi în destinație."
+
+msgid ""
+"    Using -r/--rev (or 'clone src#rev dest') implies --pull, even for\n"
+"    local source repositories."
+msgstr ""
+"    Folosirea -r/--rev (sau 'clone src#rev dest') implică --pull, chiar\n"
+"    și pentru depozite sursă locale."
+
+msgid ""
+"    For efficiency, hardlinks are used for cloning whenever the source\n"
+"    and destination are on the same filesystem (note this applies only\n"
+"    to the repository data, not to the working directory). Some\n"
+"    filesystems, such as AFS, implement hardlinking incorrectly, but\n"
+"    do not report errors. In these cases, use the --pull option to\n"
+"    avoid hardlinking."
+msgstr ""
+"    Pentru eficiență, se folosesc link-uri hard ori de câte ori sursa și\n"
+"    destinația se află pe același sistem de fișiere (remarcați ca aceasta\n"
+"    este valabil doar pentru datele din depozit, nu și pentru directorul\n"
+"    de lucru). Unele sisteme de fișiere, precum AFS, implementează\n"
+"    link-urile hard în mod incorect, dar nu raportează erori. În aceste\n"
+"    cazuri, folosiți opțiunea --pull pentru a evita link-urile hard."
+
+msgid ""
+"    In some cases, you can clone repositories and the working directory\n"
+"    using full hardlinks with ::"
+msgstr ""
+"    În unele cazuri, puteți clona depozitele și directorul de lucru "
+"utilizând\n"
+"    link-uri hard complete cu:"
+
+msgid "      $ cp -al REPO REPOCLONE"
+msgstr "      $ cp -al DEP CLONA_DEP"
+
+msgid ""
+"    This is the fastest way to clone, but it is not always safe. The\n"
+"    operation is not atomic (making sure REPO is not modified during\n"
+"    the operation is up to you) and you have to make sure your editor\n"
+"    breaks hardlinks (Emacs and most Linux Kernel tools do so). Also,\n"
+"    this is not compatible with certain extensions that place their\n"
+"    metadata under the .hg directory, such as mq."
+msgstr ""
+"    Acesta este cel mai rapid mod de a clona, dar nu este întotdeauna\n"
+"    sigur. Operația nu este atomică (rămâne în sarcina dvs. să vă asigurați\n"
+"    că DEP nu este modificat în timpul operației) și trebuie să vă\n"
+"    asigurați că editorul dvs. desface link-urile hard (Emacs si cele mai\n"
+"    multe unelte din kernelul Linux o vor face ). De asemenea, acest mod\n"
+"    nu este compatibil cu anumite extensii care își plasează metadatele\n"
+"    în directorul .hg, precum mq."
+
+msgid ""
+"    Mercurial will update the working directory to the first applicable\n"
+"    revision from this list:"
+msgstr ""
+"    Mercurial va actualiza directorul de lucru la prima revizie\n"
+"    aplicabilă din această listă:"
+
+msgid ""
+"    a) null if -U or the source repository has no changesets\n"
+"    b) if -u . and the source repository is local, the first parent of\n"
+"       the source repository's working directory\n"
+"    c) the changeset specified with -u (if a branch name, this means the\n"
+"       latest head of that branch)\n"
+"    d) the changeset specified with -r\n"
+"    e) the tipmost head specified with -b\n"
+"    f) the tipmost head specified with the url#branch source syntax\n"
+"    g) the tipmost head of the default branch\n"
+"    h) tip"
+msgstr ""
+"    a) null, dacă s-a menționat -U sau depozitul sursă nu are seturi de "
+"modificări\n"
+"    b) dacă s-a menționat -u . iar depozitul sursă este local, primul "
+"părinte al\n"
+"       directorului de lucru al depozitului sursă\n"
+"    c) setul de modificări specificat cu -u (dacă este un nume de ramură,\n"
+"       înseamnă cel mai recent capăt al acelei ramuri)\n"
+"    d) setul de modificări specificat cu -r\n"
+"    e) capătul cel mai apropiat de vârf specificat cu -b\n"
+"    f) capătul cel mai apropiat de vârf specificat cu sintaxa sursă "
+"url#branch\n"
+"    g) capătul cel mai apropiat de vârf al ramurii default\n"
+"    h) vârful"
+
+msgid "cannot specify both --noupdate and --updaterev"
+msgstr ""
+
+msgid "commit the specified files or all outstanding changes"
+msgstr "depozitează fișierele specificate sau toate modificările în suspensie"
+
+msgid ""
+"    Commit changes to the given files into the repository. Unlike a\n"
+"    centralized RCS, this operation is a local operation. See\n"
+"    :hg:`push` for a way to actively distribute your changes."
+msgstr ""
+"    Depozitează modificările fișierelor date în depozit. Spre deosebire\n"
+"    de un sistem de control al versiunilor centralizat, această operație\n"
+"    este locală. Vezi :hg:`push` pentru o cale de a vă distribui în mod\n"
+"    activ modificările."
+
+msgid ""
+"    If a list of files is omitted, all changes reported by :hg:`status`\n"
+"    will be committed."
+msgstr ""
+"    Dacă se omite lista de fișiere, vor fi depozitate toate modificările\n"
+"    raportate de :hg:`status`."
+
+msgid ""
+"    If you are committing the result of a merge, do not provide any\n"
+"    filenames or -I/-X filters."
+msgstr ""
+"    Dacă depozitați rezultatul unei fuziuni, nu furnizați niciun nume de\n"
+"    fișier sau filtrele -I/-X."
+
+msgid ""
+"    If no commit message is specified, Mercurial starts your\n"
+"    configured editor where you can enter a message. In case your\n"
+"    commit fails, you will find a backup of your message in\n"
+"    ``.hg/last-message.txt``."
+msgstr ""
+"    Dacă nu se specifică nici un mesaj de depozitare, Mercurial va\n"
+"    porni editorul configurat de dvs., unde veți putea introduce un\n"
+"    mesaj. În cazul în care depozitarea eșuează, veți găsi o copie\n"
+"    de siguranță a mesajului dvs. în ``.hg/last-message.txt``."
+
+msgid ""
+"    Returns 0 on success, 1 if nothing changed.\n"
+"    "
+msgstr ""
+"    Returnează 0 în caz de succes, 1 dacă nu s-a modificat nimic.\n"
+"    "
+
+msgid "can only close branch heads"
+msgstr ""
+
+msgid "nothing changed\n"
+msgstr ""
+
+msgid "created new head\n"
+msgstr ""
+
+#, python-format
+msgid "reopening closed branch head %d\n"
+msgstr ""
+
+#, python-format
+msgid "committed changeset %d:%s\n"
+msgstr ""
+
+msgid "mark files as copied for the next commit"
+msgstr ""
+
+msgid ""
+"    Mark dest as having copies of source files. If dest is a\n"
+"    directory, copies are put in that directory. If dest is a file,\n"
+"    the source must be a single file."
+msgstr ""
+
+msgid ""
+"    By default, this command copies the contents of files as they\n"
+"    exist in the working directory. If invoked with -A/--after, the\n"
+"    operation is recorded, but no copying is performed."
+msgstr ""
+
+msgid ""
+"    This command takes effect with the next commit. To undo a copy\n"
+"    before that, see :hg:`revert`."
+msgstr ""
+
+msgid ""
+"    Returns 0 on success, 1 if errors are encountered.\n"
+"    "
+msgstr ""
+"    Returnează 0 în caz de succes, 1 dacă au apărut erori.\n"
+"    "
+
+msgid "find the ancestor revision of two revisions in a given index"
+msgstr ""
+
+msgid "either two or three arguments required"
+msgstr ""
+
+msgid "builds a repo with a given dag from scratch in the current empty repo"
+msgstr ""
+
+msgid "    Elements:"
+msgstr ""
+
+msgid ""
+"     - \"+n\" is a linear run of n nodes based on the current default "
+"parent\n"
+"     - \".\" is a single node based on the current default parent\n"
+"     - \"$\" resets the default parent to null (implied at the start);\n"
+"           otherwise the default parent is always the last node created\n"
+"     - \"<p\" sets the default parent to the backref p\n"
+"     - \"*p\" is a fork at parent p, which is a backref\n"
+"     - \"*p1/p2\" is a merge of parents p1 and p2, which are backrefs\n"
+"     - \"/p2\" is a merge of the preceding node and p2\n"
+"     - \":tag\" defines a local tag for the preceding node\n"
+"     - \"@branch\" sets the named branch for subsequent nodes\n"
+"     - \"!command\" runs the command using your shell\n"
+"     - \"!!my command\\n\" is like \"!\", but to the end of the line\n"
+"     - \"#...\\n\" is a comment up to the end of the line"
+msgstr ""
+
+msgid "    Whitespace between the above elements is ignored."
+msgstr ""
+
+msgid "    A backref is either"
+msgstr ""
+
+msgid ""
+"     - a number n, which references the node curr-n, where curr is the "
+"current\n"
+"       node, or\n"
+"     - the name of a local tag you placed earlier using \":tag\", or\n"
+"     - empty to denote the default parent."
+msgstr ""
+
+msgid ""
+"    All string valued-elements are either strictly alphanumeric, or must\n"
+"    be enclosed in double quotes (\"...\"), with \"\\\" as escape character."
+msgstr ""
+
+msgid ""
+"    Note that the --overwritten-file and --appended-file options imply the\n"
+"    use of \"HGMERGE=internal:local\" during DAG buildup.\n"
+"    "
+msgstr ""
+
+msgid "need at least one of -m, -a, -o, -n"
+msgstr ""
+
+msgid "repository is not empty"
+msgstr ""
+
+#, python-format
+msgid "%s command %s"
+msgstr ""
+
+msgid "list all available commands and options"
+msgstr "afișează toate comenzile și opțiunile disponibile"
+
+msgid "returns the completion list associated with the given command"
+msgstr ""
+
+msgid "show information detected about current filesystem"
+msgstr "afișează informațiile detectate despre sistemul de fișiere curent"
+
+msgid "rebuild the dirstate as it would look like for the given revision"
+msgstr ""
+
+msgid "validate the correctness of the current dirstate"
+msgstr ""
+
+#, python-format
+msgid "%s in state %s, but not in manifest1\n"
+msgstr ""
+
+#, python-format
+msgid "%s in state %s, but also in manifest1\n"
+msgstr ""
+
+#, python-format
+msgid "%s in state %s, but not in either manifest\n"
+msgstr ""
+
+#, python-format
+msgid "%s in manifest1, but listed as state %s"
+msgstr ""
+
+msgid ".hg/dirstate inconsistent with current parent's manifest"
+msgstr ""
+
+msgid "show combined config settings from all hgrc files"
+msgstr "afișează setările de configurare combinate din toate fișierele hgrc"
+
+msgid "    With no arguments, print names and values of all config items."
+msgstr ""
+
+msgid ""
+"    With one argument of the form section.name, print just the value\n"
+"    of that config item."
+msgstr ""
+
+msgid ""
+"    With multiple arguments, print names and values of all config\n"
+"    items with matching section names."
+msgstr ""
+
+msgid ""
+"    With --debug, the source (filename and line number) is printed\n"
+"    for each config item."
+msgstr ""
+
+#, python-format
+msgid "read config from: %s\n"
+msgstr ""
+
+msgid "only one config item permitted"
+msgstr ""
+
+msgid "access the pushkey key/value protocol"
+msgstr ""
+
+msgid "    With two args, list the keys in the given namespace."
+msgstr ""
+
+msgid ""
+"    With five args, set a key to new if it currently is set to old.\n"
+"    Reports success or failure.\n"
+"    "
+msgstr ""
+
+msgid "parse and apply a revision specification"
+msgstr ""
+
+msgid "manually set the parents of the current working directory"
+msgstr ""
+
+msgid ""
+"    This is useful for writing repository conversion tools, but should\n"
+"    be used with care."
+msgstr ""
+
+msgid "show the contents of the current dirstate"
+msgstr "afișează conținutul dirstate-ului curent"
+
+#, python-format
+msgid "copy: %s -> %s\n"
+msgstr ""
+
+msgid "format the changelog or an index DAG as a concise textual description"
+msgstr ""
+
+msgid ""
+"    If you pass a revlog index, the revlog's DAG is emitted. If you list\n"
+"    revision numbers, they get labelled in the output as rN."
+msgstr ""
+
+msgid ""
+"    Otherwise, the changelog DAG of the current repo is emitted.\n"
+"    "
+msgstr ""
+
+msgid "need repo for changelog dag"
+msgstr ""
+
+msgid "dump the contents of a data file revision"
+msgstr ""
+
+#, python-format
+msgid "invalid revision identifier %s"
+msgstr ""
+
+msgid "parse and display a date"
+msgstr ""
+
+msgid "dump the contents of an index file"
+msgstr ""
+
+msgid "dump an index DAG as a graphviz dot file"
+msgstr ""
+
+msgid "test Mercurial installation"
+msgstr ""
+
+#, python-format
+msgid "Checking encoding (%s)...\n"
+msgstr "Se verifică codificarea (%s)...\n"
+
+msgid " (check that your locale is properly set)\n"
+msgstr ""
+
+#, python-format
+msgid "Checking installed modules (%s)...\n"
+msgstr "Se verifică modulele instalate (%s)...\n"
+
+msgid " One or more extensions could not be found"
+msgstr ""
+
+msgid " (check that you compiled the extensions)\n"
+msgstr ""
+
+msgid "Checking templates...\n"
+msgstr "Se verifică șabloanele...\n"
+
+msgid " (templates seem to have been installed incorrectly)\n"
+msgstr ""
+
+msgid "Checking patch...\n"
+msgstr "Se verifică patch-ul\n"
+
+msgid " patch call failed:\n"
+msgstr ""
+
+msgid " unexpected patch output!\n"
+msgstr ""
+
+msgid " patch test failed!\n"
+msgstr ""
+
+msgid ""
+" (Current patch tool may be incompatible with patch, or misconfigured. "
+"Please check your .hgrc file)\n"
+msgstr ""
+
+msgid ""
+" Internal patcher failure, please report this error to http://mercurial."
+"selenic.com/bts/\n"
+msgstr ""
+
+msgid "Checking commit editor...\n"
+msgstr "Se verifică editorul pentru commit...\n"
+
+msgid " No commit editor set and can't find vi in PATH\n"
+msgstr ""
+
+msgid " (specify a commit editor in your .hgrc file)\n"
+msgstr ""
+
+#, python-format
+msgid " Can't find editor '%s' in PATH\n"
+msgstr ""
+
+msgid "Checking username...\n"
+msgstr "Se verifică numele de utilizator...\n"
+
+msgid " (specify a username in your .hgrc file)\n"
+msgstr ""
+
+msgid "No problems detected\n"
+msgstr ""
+
+#, python-format
+msgid "%s problems detected, please check your install!\n"
+msgstr ""
+
+msgid "dump rename information"
+msgstr ""
+
+#, python-format
+msgid "%s renamed from %s:%s\n"
+msgstr ""
+
+#, python-format
+msgid "%s not renamed\n"
+msgstr ""
+
+msgid "show how files match on given patterns"
+msgstr "afișează modul în care fișierele se potrivesc cu tiparele specificate"
+
+msgid "diff repository (or selected files)"
+msgstr ""
+
+msgid "    Show differences between revisions for the specified files."
+msgstr ""
+
+msgid "    Differences between files are shown using the unified diff format."
+msgstr ""
+
+msgid ""
+"    NOTE: diff may generate unexpected results for merges, as it will\n"
+"    default to comparing against the working directory's first parent\n"
+"    changeset if no revisions are specified."
+msgstr ""
+
+msgid ""
+"    Alternatively you can specify -c/--change with a revision to see\n"
+"    the changes in that changeset relative to its first parent."
+msgstr ""
+
+msgid ""
+"    Without the -a/--text option, diff will avoid generating diffs of\n"
+"    files it detects as binary. With -a, diff will generate a diff\n"
+"    anyway, probably with undesirable results."
+msgstr ""
+
+msgid ""
+"    Use the -g/--git option to generate diffs in the git extended diff\n"
+"    format. For more information, read :hg:`help diffs`."
+msgstr ""
+
+msgid "dump the header and diffs for one or more changesets"
+msgstr ""
+
+msgid "    Print the changeset header and diffs for one or more revisions."
+msgstr ""
+
+msgid ""
+"    The information shown in the changeset header is: author, date,\n"
+"    branch name (if non-default), changeset hash, parent(s) and commit\n"
+"    comment."
+msgstr ""
+
+msgid ""
+"    NOTE: export may generate unexpected diff output for merge\n"
+"    changesets, as it will compare the merge changeset against its\n"
+"    first parent only."
+msgstr ""
+
+msgid ""
+"    Output may be to a file, in which case the name of the file is\n"
+"    given using a format string. The formatting rules are as follows:"
+msgstr ""
+
+msgid ""
+"    :``%%``: literal \"%\" character\n"
+"    :``%H``: changeset hash (40 hexadecimal digits)\n"
+"    :``%N``: number of patches being generated\n"
+"    :``%R``: changeset revision number\n"
+"    :``%b``: basename of the exporting repository\n"
+"    :``%h``: short-form changeset hash (12 hexadecimal digits)\n"
+"    :``%n``: zero-padded sequence number, starting at 1\n"
+"    :``%r``: zero-padded changeset revision number"
+msgstr ""
+
+msgid ""
+"    Without the -a/--text option, export will avoid generating diffs\n"
+"    of files it detects as binary. With -a, export will generate a\n"
+"    diff anyway, probably with undesirable results."
+msgstr ""
+
+msgid ""
+"    Use the -g/--git option to generate diffs in the git extended diff\n"
+"    format. See :hg:`help diffs` for more information."
+msgstr ""
+
+msgid ""
+"    With the --switch-parent option, the diff will be against the\n"
+"    second parent. It can be useful to review a merge."
+msgstr ""
+
+msgid "export requires at least one changeset"
+msgstr ""
+
+msgid "exporting patches:\n"
+msgstr ""
+
+msgid "exporting patch:\n"
+msgstr ""
+
+msgid "forget the specified files on the next commit"
+msgstr ""
+
+msgid ""
+"    Mark the specified files so they will no longer be tracked\n"
+"    after the next commit."
+msgstr ""
+
+msgid ""
+"    This only removes files from the current branch, not from the\n"
+"    entire project history, and it does not delete them from the\n"
+"    working directory."
+msgstr ""
+
+msgid "    To undo a forget before the next commit, see :hg:`add`."
+msgstr ""
+
+msgid "no files specified"
+msgstr ""
+
+#, python-format
+msgid "not removing %s: file is already untracked\n"
+msgstr ""
+
+msgid "search for a pattern in specified files and revisions"
+msgstr ""
+
+msgid "    Search revisions of files for a regular expression."
+msgstr ""
+
+msgid ""
+"    This command behaves differently than Unix grep. It only accepts\n"
+"    Python/Perl regexps. It searches repository history, not the\n"
+"    working directory. It always prints the revision number in which a\n"
+"    match appears."
+msgstr ""
+
+msgid ""
+"    By default, grep only prints output for the first revision of a\n"
+"    file in which it finds a match. To get it to print every revision\n"
+"    that contains a change in match status (\"-\" for a match that\n"
+"    becomes a non-match, or \"+\" for a non-match that becomes a match),\n"
+"    use the --all flag."
+msgstr ""
+
+msgid ""
+"    Returns 0 if a match is found, 1 otherwise.\n"
+"    "
+msgstr ""
+"    Returnează 0 dacă se găsește o potrivire, 1 altfel.\n"
+"    "
+
+#, python-format
+msgid "grep: invalid match pattern: %s\n"
+msgstr ""
+
+msgid "show current repository heads or show branch heads"
+msgstr "afișează capetele curente ale depozitului sau capetele de ramură"
+
+msgid "    With no arguments, show all repository branch heads."
+msgstr ""
+
+msgid ""
+"    Repository \"heads\" are changesets with no child changesets. They are\n"
+"    where development generally takes place and are the usual targets\n"
+"    for update and merge operations. Branch heads are changesets that have\n"
+"    no child changeset on the same branch."
+msgstr ""
+
+msgid ""
+"    If one or more REVs are given, only branch heads on the branches\n"
+"    associated with the specified changesets are shown."
+msgstr ""
+
+msgid ""
+"    If -c/--closed is specified, also show branch heads marked closed\n"
+"    (see :hg:`commit --close-branch`)."
+msgstr ""
+
+msgid ""
+"    If STARTREV is specified, only those heads that are descendants of\n"
+"    STARTREV will be displayed."
+msgstr ""
+
+msgid ""
+"    If -t/--topo is specified, named branch mechanics will be ignored and "
+"only\n"
+"    changesets without children will be shown."
+msgstr ""
+
+msgid ""
+"    Returns 0 if matching heads are found, 1 if not.\n"
+"    "
+msgstr ""
+"    Returnează 0 dacă se găsesc capete care se potrivesc, 1 altfel.\n"
+"    "
+
+#, python-format
+msgid "no open branch heads found on branches %s"
+msgstr ""
+
+#, python-format
+msgid " (started at %s)"
+msgstr ""
+
+msgid "show help for a given topic or a help overview"
+msgstr ""
+"afișează ajutorul pentru un anumit subiect sau un rezumat al ajutorului"
+
+msgid ""
+"    With no arguments, print a list of commands with short help messages."
+msgstr ""
+
+msgid ""
+"    Given a topic, extension, or command name, print help for that\n"
+"    topic."
+msgstr ""
+
+msgid ""
+"    Returns 0 if successful.\n"
+"    "
+msgstr ""
+"    Returnează 0 în caz de succes.\n"
+"    "
+
+msgid "global options:"
+msgstr "opțiuni globale:"
+
+msgid "use \"hg help\" for the full list of commands"
+msgstr "folosiți \"hg help\" pentru lista completă a comenzilor"
+
+msgid "use \"hg help\" for the full list of commands or \"hg -v\" for details"
+msgstr ""
+"folosiți \"hg help\" pentru lista completă a comenzilor sau \"hg -v\" pentru "
+"detalii"
+
+#, python-format
+msgid "use \"hg -v help%s\" to show aliases and global options"
+msgstr ""
+"folosiți \"hg -v help%s\" pentru afișarea alias-urilor și a opțiunilor "
+"globale"
+
+#, python-format
+msgid "use \"hg -v help %s\" to show global options"
+msgstr "folosiți \"hg -v help %s\" pentru afișarea opțiunilor globale"
+
+msgid "list of commands:"
+msgstr "lista comenzilor:"
+
+#, python-format
+msgid ""
+"\n"
+"aliases: %s\n"
+msgstr ""
+"\n"
+"alias: %s\n"
+
+msgid "(no help text available)"
+msgstr ""
+
+#, python-format
+msgid "shell alias for::"
+msgstr "alias de shell pentru:"
+
+#, python-format
+msgid "    %s"
+msgstr ""
+
+#, python-format
+msgid "alias for: hg %s"
+msgstr "alias pentru: hg %s"
+
+#, python-format
+msgid "%s"
+msgstr ""
+
+#, python-format
+msgid ""
+"\n"
+"use \"hg -v help %s\" to show verbose help\n"
+msgstr ""
+"\n"
+"folosiți \"hg -v help %s\" pentru afișarea ajutorului detaliat\n"
+
+msgid "options:\n"
+msgstr "opțiuni:\n"
+
+msgid "no commands defined\n"
+msgstr ""
+
+msgid "no help text available"
+msgstr ""
+
+#, python-format
+msgid "%s extension - %s"
+msgstr ""
+
+msgid "use \"hg help extensions\" for information on enabling extensions\n"
+msgstr ""
+
+#, python-format
+msgid "'%s' is provided by the following extension:"
+msgstr ""
+
+msgid "Mercurial Distributed SCM\n"
+msgstr "Mercurial - gestionar distribuit pentru controlul codului sursă\n"
+
+msgid "basic commands:"
+msgstr ""
+
+msgid "enabled extensions:"
+msgstr "extensii activate:"
+
+msgid "VALUE"
+msgstr "VALOARE"
+
+msgid "DEPRECATED"
+msgstr ""
+
+msgid ""
+"\n"
+"[+] marked option can be specified multiple times"
+msgstr ""
+"\n"
+"[+] opțiunea marcată poate fi specificată de mai multe ori"
+
+msgid ""
+"\n"
+"additional help topics:"
+msgstr ""
+"\n"
+"subiecte de ajutor suplimentare:"
+
+msgid "identify the working copy or specified revision"
+msgstr ""
+
+msgid ""
+"    With no revision, print a summary of the current state of the\n"
+"    repository."
+msgstr ""
+
+msgid ""
+"    Specifying a path to a repository root or Mercurial bundle will\n"
+"    cause lookup to operate on that repository/bundle."
+msgstr ""
+
+msgid ""
+"    This summary identifies the repository state using one or two\n"
+"    parent hash identifiers, followed by a \"+\" if there are\n"
+"    uncommitted changes in the working directory, a list of tags for\n"
+"    this revision and a branch name for non-default branches."
+msgstr ""
+
+msgid "import an ordered set of patches"
+msgstr ""
+
+msgid ""
+"    Import a list of patches and commit them individually (unless\n"
+"    --no-commit is specified)."
+msgstr ""
+
+msgid ""
+"    If there are outstanding changes in the working directory, import\n"
+"    will abort unless given the -f/--force flag."
+msgstr ""
+
+msgid ""
+"    You can import a patch straight from a mail message. Even patches\n"
+"    as attachments work (to use the body part, it must have type\n"
+"    text/plain or text/x-patch). From and Subject headers of email\n"
+"    message are used as default committer and commit message. All\n"
+"    text/plain body parts before first diff are added to commit\n"
+"    message."
+msgstr ""
+
+msgid ""
+"    If the imported patch was generated by :hg:`export`, user and\n"
+"    description from patch override values from message headers and\n"
+"    body. Values given on command line with -m/--message and -u/--user\n"
+"    override these."
+msgstr ""
+
+msgid ""
+"    If --exact is specified, import will set the working directory to\n"
+"    the parent of each patch before applying it, and will abort if the\n"
+"    resulting changeset has a different ID than the one recorded in\n"
+"    the patch. This may happen due to character set problems or other\n"
+"    deficiencies in the text patch format."
+msgstr ""
+
+msgid ""
+"    With -s/--similarity, hg will attempt to discover renames and\n"
+"    copies in the patch in the same way as 'addremove'."
+msgstr ""
+
+msgid ""
+"    To read a patch from standard input, use \"-\" as the patch name. If\n"
+"    a URL is specified, the patch will be downloaded from it.\n"
+"    See :hg:`help dates` for a list of formats valid for -d/--date."
+msgstr ""
+
+msgid "to working directory"
+msgstr ""
+
+msgid "not a Mercurial patch"
+msgstr ""
+
+msgid "patch is damaged or loses information"
+msgstr ""
+
+msgid "applying patch from stdin\n"
+msgstr ""
+
+#, python-format
+msgid "applied %s\n"
+msgstr ""
+
+msgid "no diffs found"
+msgstr ""
+
+msgid "show new changesets found in source"
+msgstr "afișează seturile de modificări noi găsite în sursă"
+
+msgid ""
+"    Show new changesets found in the specified path/URL or the default\n"
+"    pull location. These are the changesets that would have been pulled\n"
+"    if a pull at the time you issued this command."
+msgstr ""
+
+msgid ""
+"    For remote repository, using --bundle avoids downloading the\n"
+"    changesets twice if the incoming is followed by a pull."
+msgstr ""
+
+msgid "    See pull for valid source format details."
+msgstr "    Vezi pull pentru detalii legate de formate valide de surse."
+
+msgid ""
+"    Returns 0 if there are incoming changes, 1 otherwise.\n"
+"    "
+msgstr ""
+"    Returnează 0 dacă există modificări de primit, 1 altfel.\n"
+"    "
+
+msgid "create a new repository in the given directory"
+msgstr "creează un nou depozit în directorul specificat"
+
+msgid ""
+"    Initialize a new repository in the given directory. If the given\n"
+"    directory does not exist, it will be created."
+msgstr ""
+"    Inițializează un depozit nou în directorul specificat. Dacă\n"
+"    directorul nu există, va fi creat."
+
+msgid "    If no directory is given, the current directory is used."
+msgstr ""
+"    Dacă nu se specifică niciun director, va fi folosit directorul curent."
+
+msgid ""
+"    It is possible to specify an ``ssh://`` URL as the destination.\n"
+"    See :hg:`help urls` for more information."
+msgstr ""
+"    Ca destinație se poate specifica un URL ``ssh://``.\n"
+"    Vezi :hg:`help urls` pentru mai multe detalii."
+
+msgid "locate files matching specific patterns"
+msgstr ""
+
+msgid ""
+"    Print files under Mercurial control in the working directory whose\n"
+"    names match the given patterns."
+msgstr ""
+
+msgid ""
+"    By default, this command searches all directories in the working\n"
+"    directory. To search just the current directory and its\n"
+"    subdirectories, use \"--include .\"."
+msgstr ""
+
+msgid ""
+"    If no patterns are given to match, this command prints the names\n"
+"    of all files under Mercurial control in the working directory."
+msgstr ""
+
+msgid ""
+"    If you want to feed the output of this command into the \"xargs\"\n"
+"    command, use the -0 option to both this command and \"xargs\". This\n"
+"    will avoid the problem of \"xargs\" treating single filenames that\n"
+"    contain whitespace as multiple filenames."
+msgstr ""
+
+msgid "show revision history of entire repository or files"
+msgstr ""
+"afișează istoricul reviziilor pentru întregul depozit sau pentru unele "
+"fișiere"
+
+msgid ""
+"    Print the revision history of the specified files or the entire\n"
+"    project."
+msgstr ""
+"    Afișează istoricul reviziilor pentru fișierele specificate sau\n"
+"    pentru întregul proiect."
+
+msgid ""
+"    File history is shown without following rename or copy history of\n"
+"    files. Use -f/--follow with a filename to follow history across\n"
+"    renames and copies. --follow without a filename will only show\n"
+"    ancestors or descendants of the starting revision. --follow-first\n"
+"    only follows the first parent of merge revisions."
+msgstr ""
+"    Istoricul fișierelor este afișat fără a urmări istoricul redenumirilor\n"
+"    sau al copierii acestora - pentru aceasta, folosiți -f/--follow cu un\n"
+"    nume de fișier. Fără un nume de fișier, --follow va afișa doar\n"
+"    strămoși sau descendenți ai reviziei de stat. --follow-first\n"
+"    urmărește doar primul părinte al reviziilor fuzionate."
+
+msgid ""
+"    If no revision range is specified, the default is tip:0 unless\n"
+"    --follow is set, in which case the working directory parent is\n"
+"    used as the starting revision. You can specify a revision set for\n"
+"    log, see :hg:`help revsets` for more information."
+msgstr ""
+"    Dacă nu se specifică niciun interval de revizii, acesta este implicit\n"
+"    tip:0 (vârf:0), cu excepția cazului când --follow este setat, în "
+"această\n"
+"    situație părintele directorului de lucru este folosit ca revizie de "
+"stat.\n"
+"    Puteți specifica un set de revizii pentru 'log'; pentru mai multe\n"
+"    informații, vezi :hg:`help revsets`."
+
+msgid ""
+"    By default this command prints revision number and changeset id,\n"
+"    tags, non-trivial parents, user, date and time, and a summary for\n"
+"    each commit. When the -v/--verbose switch is used, the list of\n"
+"    changed files and full commit message are shown."
+msgstr ""
+"    Implicit, această comandă afișează numărul reviziei și id-ul setului\n"
+"    de modificări, etichete, părinți netriviali, utilizatorul, data și ora\n"
+"    și un rezumat al fiecărei depozitări. Când se folosește -v/--verbose,\n"
+"    se afișează lista fișierelor modificate și mesajul de depozitare complet."
+
+msgid ""
+"    NOTE: log -p/--patch may generate unexpected diff output for merge\n"
+"    changesets, as it will only compare the merge changeset against\n"
+"    its first parent. Also, only files different from BOTH parents\n"
+"    will appear in files:."
+msgstr ""
+"    NOTĂ: log -p/--patch poate genera afișaj diff neașteptat pentru seturi\n"
+"    de modificări de fuziune, deoarece va compara setul de modificări de\n"
+"    fuziune doar cu primul părinte. De asemenea, doar fișierele diferite\n"
+"    față de AMBII părinți vor apărea în lista de fișiere."
+
+msgid "output the current or given revision of the project manifest"
+msgstr ""
+
+msgid ""
+"    Print a list of version controlled files for the given revision.\n"
+"    If no revision is given, the first parent of the working directory\n"
+"    is used, or the null revision if no revision is checked out."
+msgstr ""
+
+msgid ""
+"    With -v, print file permissions, symlink and executable bits.\n"
+"    With --debug, print file revision hashes."
+msgstr ""
+
+msgid "merge working directory with another revision"
+msgstr "fuzionează directorul de lucru cu o altă revizie"
+
+msgid ""
+"    The current working directory is updated with all changes made in\n"
+"    the requested revision since the last common predecessor revision."
+msgstr ""
+"    Directorul de lucru curent este actualizat cu toate modificările\n"
+"    făcute în revizia cerută, de la ultima revizie precedentă comună."
+
+msgid ""
+"    Files that changed between either parent are marked as changed for\n"
+"    the next commit and a commit must be performed before any further\n"
+"    updates to the repository are allowed. The next commit will have\n"
+"    two parents."
+msgstr ""
+"    Fișierele care au fost modificate între oricare din părinți sunt\n"
+"    marcate drept modificate pentru următoarea depozitare, și o\n"
+"    depozitare trebuie să fie executată înainte de a se permite orice\n"
+"    altă actualizare a depozitului. Următoarea depozitare va avea\n"
+"    doi părinți."
+
+msgid ""
+"    If no revision is specified, the working directory's parent is a\n"
+"    head revision, and the current branch contains exactly one other\n"
+"    head, the other head is merged with by default. Otherwise, an\n"
+"    explicit revision with which to merge with must be provided."
+msgstr ""
+"    Dacă nu se specifică niciun părinte, părintele directorului de\n"
+"    lucru este o revizie capăt, iar ramura curentă conține exact\n"
+"    un singur alt capăt, atunci implicit fuziunea are loc cu celălalt\n"
+"    capăt. Altfel, o revizie explicită cu care să aibă loc fuziunea\n"
+"    trebuie specificată."
+
+msgid ""
+"    To undo an uncommitted merge, use :hg:`update --clean .` which\n"
+"    will check out a clean copy of the original merge parent, losing\n"
+"    all changes."
+msgstr ""
+"    Pentru a anula o fuziune nedepozitată, folosiți\n"
+"    :hg:`update --clean .`, care va extrage o copie curată a\n"
+"    părintelui original al fuziunii, renunțând la toate modificările."
+
+msgid ""
+"    Returns 0 on success, 1 if there are unresolved files.\n"
+"    "
+msgstr ""
+"    Returnează 0 în caz de succes, 1 dacă există fișiere nerezolvate.\n"
+"    "
+
+#, python-format
+msgid ""
+"branch '%s' has %d heads - please merge with an explicit rev\n"
+"(run 'hg heads .' to see heads)"
+msgstr ""
+
+#, python-format
+msgid ""
+"branch '%s' has one head - please merge with an explicit rev\n"
+"(run 'hg heads' to see all heads)"
+msgstr ""
+
+msgid "there is nothing to merge"
+msgstr ""
+
+#, python-format
+msgid "%s - use \"hg update\" instead"
+msgstr ""
+
+msgid ""
+"working dir not at a head rev - use \"hg update\" or merge with an explicit "
+"rev"
+msgstr ""
+
+msgid "show changesets not found in the destination"
+msgstr "afișează seturile de modificări negăsite în destinație"
+
+msgid ""
+"    Show changesets not found in the specified destination repository\n"
+"    or the default push location. These are the changesets that would\n"
+"    be pushed if a push was requested."
+msgstr ""
+
+msgid "    See pull for details of valid destination formats."
+msgstr ""
+
+msgid ""
+"    Returns 0 if there are outgoing changes, 1 otherwise.\n"
+"    "
+msgstr ""
+"    Returnează 0 dacă există modificări de trimis, 1 altfel.\n"
+"    "
+
+msgid "show the parents of the working directory or revision"
+msgstr "afișează părinții directorului de lucru sau al reviziei"
+
+msgid ""
+"    Print the working directory's parent revisions. If a revision is\n"
+"    given via -r/--rev, the parent of that revision will be printed.\n"
+"    If a file argument is given, the revision in which the file was\n"
+"    last changed (before the working directory revision or the\n"
+"    argument to --rev if given) is printed."
+msgstr ""
+
+msgid "can only specify an explicit filename"
+msgstr ""
+
+#, python-format
+msgid "'%s' not found in manifest!"
+msgstr "'%s' nu a fost găsit în manifest!"
+
+msgid "show aliases for remote repositories"
+msgstr "afișează alias-urile pentru depozitele la distanță"
+
+msgid ""
+"    Show definition of symbolic path name NAME. If no name is given,\n"
+"    show definition of all available names."
+msgstr ""
+
+msgid ""
+"    Path names are defined in the [paths] section of\n"
+"    ``/etc/mercurial/hgrc`` and ``$HOME/.hgrc``. If run inside a\n"
+"    repository, ``.hg/hgrc`` is used, too."
+msgstr ""
+
+msgid ""
+"    The path names ``default`` and ``default-push`` have a special\n"
+"    meaning.  When performing a push or pull operation, they are used\n"
+"    as fallbacks if no location is specified on the command-line.\n"
+"    When ``default-push`` is set, it will be used for push and\n"
+"    ``default`` will be used for pull; otherwise ``default`` is used\n"
+"    as the fallback for both.  When cloning a repository, the clone\n"
+"    source is written as ``default`` in ``.hg/hgrc``.  Note that\n"
+"    ``default`` and ``default-push`` apply to all inbound (e.g.\n"
+"    :hg:`incoming`) and outbound (e.g. :hg:`outgoing`, :hg:`email` and\n"
+"    :hg:`bundle`) operations."
+msgstr ""
+
+msgid "    See :hg:`help urls` for more information."
+msgstr ""
+
+msgid "not found!\n"
+msgstr ""
+
+msgid "not updating, since new heads added\n"
+msgstr "nu se actualizează deoarece au fost adăugate noi capete\n"
+
+msgid "(run 'hg heads' to see heads, 'hg merge' to merge)\n"
+msgstr ""
+
+msgid "(run 'hg update' to get a working copy)\n"
+msgstr ""
+
+msgid "pull changes from the specified source"
+msgstr ""
+
+msgid "    Pull changes from a remote repository to a local one."
+msgstr ""
+
+msgid ""
+"    This finds all changes from the repository at the specified path\n"
+"    or URL and adds them to a local repository (the current one unless\n"
+"    -R is specified). By default, this does not update the copy of the\n"
+"    project in the working directory."
+msgstr ""
+
+msgid ""
+"    Use :hg:`incoming` if you want to see what would have been added\n"
+"    by a pull at the time you issued this command. If you then decide\n"
+"    to add those changes to the repository, you should use :hg:`pull\n"
+"    -r X` where ``X`` is the last changeset listed by :hg:`incoming`."
+msgstr ""
+
+msgid ""
+"    If SOURCE is omitted, the 'default' path will be used.\n"
+"    See :hg:`help urls` for more information."
+msgstr ""
+
+msgid ""
+"    Returns 0 on success, 1 if an update had unresolved files.\n"
+"    "
+msgstr ""
+"    Returnează 0 în caz de succes, 1 dacă o actualizare a avut\n"
+"    fișiere nerezolvate.\n"
+"    "
+
+msgid "push changes to the specified destination"
+msgstr ""
+
+msgid ""
+"    Push changesets from the local repository to the specified\n"
+"    destination."
+msgstr ""
+
+msgid ""
+"    This operation is symmetrical to pull: it is identical to a pull\n"
+"    in the destination repository from the current one."
+msgstr ""
+
+msgid ""
+"    By default, push will not allow creation of new heads at the\n"
+"    destination, since multiple heads would make it unclear which head\n"
+"    to use. In this situation, it is recommended to pull and merge\n"
+"    before pushing."
+msgstr ""
+
+msgid ""
+"    Use --new-branch if you want to allow push to create a new named\n"
+"    branch that is not present at the destination. This allows you to\n"
+"    only create a new branch without forcing other changes."
+msgstr ""
+
+msgid ""
+"    Use -f/--force to override the default behavior and push all\n"
+"    changesets on all branches."
+msgstr ""
+
+msgid ""
+"    If -r/--rev is used, the specified revision and all its ancestors\n"
+"    will be pushed to the remote repository."
+msgstr ""
+
+msgid ""
+"    Please see :hg:`help urls` for important details about ``ssh://``\n"
+"    URLs. If DESTINATION is omitted, a default path will be used."
+msgstr ""
+
+msgid ""
+"    Returns 0 if push was successful, 1 if nothing to push.\n"
+"    "
+msgstr ""
+"    Returnează 0 dacă 'push' s-a încheiat cu succes, 1 dacă nu există\n"
+"    nimic pentru 'push'.\n"
+"    "
+
+#, python-format
+msgid "pushing to %s\n"
+msgstr ""
+
+msgid "roll back an interrupted transaction"
+msgstr ""
+
+msgid "    Recover from an interrupted commit or pull."
+msgstr ""
+
+msgid ""
+"    This command tries to fix the repository status after an\n"
+"    interrupted operation. It should only be necessary when Mercurial\n"
+"    suggests it."
+msgstr ""
+
+msgid ""
+"    Returns 0 if successful, 1 if nothing to recover or verify fails.\n"
+"    "
+msgstr ""
+"    Returnează 0 în caz de succes, 1 dacă nu există nimic de recuperat\n"
+"    sau verificarea eșuează.\n"
+"    "
+
+msgid "remove the specified files on the next commit"
+msgstr "înlătură fișierele specificate la următoarea depozitare"
+
+msgid "    Schedule the indicated files for removal from the repository."
+msgstr "    Planifică fișierele indicate spre a fi înlăturate din depozit."
+
+msgid ""
+"    This only removes files from the current branch, not from the\n"
+"    entire project history. -A/--after can be used to remove only\n"
+"    files that have already been deleted, -f/--force can be used to\n"
+"    force deletion, and -Af can be used to remove files from the next\n"
+"    revision without deleting them from the working directory."
+msgstr ""
+"    Aceasta înlătură doar fișiere din ramura curentă, nu din întregul\n"
+"    istoric al proiectului. -A/--after poate fi folosit pentru a\n"
+"    înlătura doar fișiere care au fost deja șterse, -f/--force poate\n"
+"    fi folosit pentru a forța ștergerea, iar -Af poate fi folosit\n"
+"    pentru a înlătura fișiere din revizia următoare, fără a le șterge\n"
+"    din directorul de lucru."
+
+msgid ""
+"    The following table details the behavior of remove for different\n"
+"    file states (columns) and option combinations (rows). The file\n"
+"    states are Added [A], Clean [C], Modified [M] and Missing [!] (as\n"
+"    reported by :hg:`status`). The actions are Warn, Remove (from\n"
+"    branch) and Delete (from disk)::"
+msgstr ""
+"    Tabelul următor detaliază comportamentul comenzii pentru diferite\n"
+"    stări ale fișierelor (pe coloane) și combinații de opțiuni (pe\n"
+"    rânduri). Stările fișierelor sunt Adăugat [A], Curat [C],\n"
+"    Modificat [M] și Lipsă [!]. Acțiunile sunt Avertizează [V],\n"
+"    Înlătură [Î] (din ramură) și Șterge [Ș] (de pe disc)::"
+
+msgid ""
+"             A  C  M  !\n"
+"      none   W  RD W  R\n"
+"      -f     R  RD RD R\n"
+"      -A     W  W  W  R\n"
+"      -Af    R  R  R  R"
+msgstr ""
+"              A  C  M  !\n"
+"      nimic   V  ÎȘ V  Î\n"
+"      -f      Î  ÎȘ ÎȘ Î\n"
+"      -A      V  V  V  ÃŽ\n"
+"      -Af     ÃŽ  ÃŽ  ÃŽ  ÃŽ"
+
+msgid ""
+"    This command schedules the files to be removed at the next commit.\n"
+"    To undo a remove before that, see :hg:`revert`."
+msgstr ""
+"    Această comandă planifică fișierele spre a fi înlăturate la\n"
+"    următoarea depozitare. Pentru a anula planificarea înainte\n"
+"    de a avea loc, vezi :hg:`revert`."
+
+msgid ""
+"    Returns 0 on success, 1 if any warnings encountered.\n"
+"    "
+msgstr ""
+"    Returnează 0 în caz de succes, 1 dacă au apărut avertismente.\n"
+"    "
+
+#, python-format
+msgid "not removing %s: file is untracked\n"
+msgstr ""
+
+#, python-format
+msgid "not removing %s: file %s (use -f to force removal)\n"
+msgstr ""
+
+msgid "still exists"
+msgstr ""
+
+msgid "is modified"
+msgstr ""
+
+msgid "has been marked for add"
+msgstr ""
+
+msgid "rename files; equivalent of copy + remove"
+msgstr ""
+
+msgid ""
+"    Mark dest as copies of sources; mark sources for deletion. If dest\n"
+"    is a directory, copies are put in that directory. If dest is a\n"
+"    file, there can only be one source."
+msgstr ""
+
+msgid ""
+"    This command takes effect at the next commit. To undo a rename\n"
+"    before that, see :hg:`revert`."
+msgstr ""
+
+msgid "redo merges or set/view the merge status of files"
+msgstr ""
+
+msgid ""
+"    Merges with unresolved conflicts are often the result of\n"
+"    non-interactive merging using the ``internal:merge`` hgrc setting,\n"
+"    or a command-line merge tool like ``diff3``. The resolve command\n"
+"    is used to manage the files involved in a merge, after :hg:`merge`\n"
+"    has been run, and before :hg:`commit` is run (i.e. the working\n"
+"    directory must have two parents)."
+msgstr ""
+
+msgid "    The resolve command can be used in the following ways:"
+msgstr ""
+
+msgid ""
+"    - :hg:`resolve FILE...`: attempt to re-merge the specified files,\n"
+"      discarding any previous merge attempts. Re-merging is not\n"
+"      performed for files already marked as resolved. Use ``--all/-a``\n"
+"      to selects all unresolved files."
+msgstr ""
+
+msgid ""
+"    - :hg:`resolve -m [FILE]`: mark a file as having been resolved\n"
+"      (e.g. after having manually fixed-up the files). The default is\n"
+"      to mark all unresolved files."
+msgstr ""
+
+msgid ""
+"    - :hg:`resolve -u [FILE]...`: mark a file as unresolved. The\n"
+"      default is to mark all resolved files."
+msgstr ""
+
+msgid ""
+"    - :hg:`resolve -l`: list files which had or still have conflicts.\n"
+"      In the printed list, ``U`` = unresolved and ``R`` = resolved."
+msgstr ""
+
+msgid ""
+"    Note that Mercurial will not let you commit files with unresolved\n"
+"    merge conflicts. You must use :hg:`resolve -m ...` before you can\n"
+"    commit after a conflicting merge."
+msgstr ""
+
+msgid ""
+"    Returns 0 on success, 1 if any files fail a resolve attempt.\n"
+"    "
+msgstr ""
+"    Returnează 0 în caz de succes, 1 dacă există vreun fișier\n"
+"    pentru care tentativa de rezolvare a eșuat.\n"
+"    "
+
+msgid "too many options specified"
+msgstr ""
+
+msgid "can't specify --all and patterns"
+msgstr ""
+
+msgid "no files or directories specified; use --all to remerge all files"
+msgstr ""
+
+msgid "restore individual files or directories to an earlier state"
+msgstr ""
+
+msgid ""
+"    NOTE: This command is most likely not what you are looking for. revert\n"
+"    will partially overwrite content in the working directory without "
+"changing\n"
+"    the working directory parents. Use :hg:`update -r rev` to check out "
+"earlier\n"
+"    revisions, or :hg:`update --clean .` to undo a merge which has added\n"
+"    another parent."
+msgstr ""
+
+msgid ""
+"    With no revision specified, revert the named files or directories\n"
+"    to the contents they had in the parent of the working directory.\n"
+"    This restores the contents of the affected files to an unmodified\n"
+"    state and unschedules adds, removes, copies, and renames. If the\n"
+"    working directory has two parents, you must explicitly specify a\n"
+"    revision."
+msgstr ""
+
+msgid ""
+"    Using the -r/--rev option, revert the given files or directories\n"
+"    to their contents as of a specific revision. This can be helpful\n"
+"    to \"roll back\" some or all of an earlier change. See :hg:`help\n"
+"    dates` for a list of formats valid for -d/--date."
+msgstr ""
+
+msgid ""
+"    Revert modifies the working directory. It does not commit any\n"
+"    changes, or change the parent of the working directory. If you\n"
+"    revert to a revision other than the parent of the working\n"
+"    directory, the reverted files will thus appear modified\n"
+"    afterwards."
+msgstr ""
+
+msgid ""
+"    If a file has been deleted, it is restored. If the executable mode\n"
+"    of a file was changed, it is reset."
+msgstr ""
+
+msgid ""
+"    If names are given, all files matching the names are reverted.\n"
+"    If no arguments are given, no files are reverted."
+msgstr ""
+
+msgid ""
+"    Modified files are saved with a .orig suffix before reverting.\n"
+"    To disable these backups, use --no-backup."
+msgstr ""
+
+msgid "you can't specify a revision and a date"
+msgstr ""
+
+msgid "no files or directories specified; use --all to revert the whole repo"
+msgstr ""
+
+#, python-format
+msgid "forgetting %s\n"
+msgstr "se neglijează %s\n"
+
+#, python-format
+msgid "reverting %s\n"
+msgstr ""
+
+#, python-format
+msgid "undeleting %s\n"
+msgstr ""
+
+#, python-format
+msgid "saving current version of %s as %s\n"
+msgstr ""
+
+#, python-format
+msgid "file not managed: %s\n"
+msgstr ""
+
+#, python-format
+msgid "no changes needed to %s\n"
+msgstr ""
+
+msgid "roll back the last transaction (dangerous)"
+msgstr ""
+
+msgid ""
+"    This command should be used with care. There is only one level of\n"
+"    rollback, and there is no way to undo a rollback. It will also\n"
+"    restore the dirstate at the time of the last transaction, losing\n"
+"    any dirstate changes since that time. This command does not alter\n"
+"    the working directory."
+msgstr ""
+
+msgid ""
+"    Transactions are used to encapsulate the effects of all commands\n"
+"    that create new changesets or propagate existing changesets into a\n"
+"    repository. For example, the following commands are transactional,\n"
+"    and their effects can be rolled back:"
+msgstr ""
+
+msgid ""
+"    - commit\n"
+"    - import\n"
+"    - pull\n"
+"    - push (with this repository as the destination)\n"
+"    - unbundle"
+msgstr ""
+
+msgid ""
+"    This command is not intended for use on public repositories. Once\n"
+"    changes are visible for pull by other users, rolling a transaction\n"
+"    back locally is ineffective (someone else may already have pulled\n"
+"    the changes). Furthermore, a race is possible with readers of the\n"
+"    repository; for example an in-progress pull from the repository\n"
+"    may fail if a rollback is performed."
+msgstr ""
+
+msgid ""
+"    Returns 0 on success, 1 if no rollback data is available.\n"
+"    "
+msgstr ""
+
+msgid "print the root (top) of the current working directory"
+msgstr ""
+
+msgid "    Print the root directory of the current repository."
+msgstr ""
+
+msgid "start stand-alone webserver"
+msgstr ""
+
+msgid ""
+"    Start a local HTTP repository browser and pull server. You can use\n"
+"    this for ad-hoc sharing and browing of repositories. It is\n"
+"    recommended to use a real web server to serve a repository for\n"
+"    longer periods of time."
+msgstr ""
+
+msgid ""
+"    Please note that the server does not implement access control.\n"
+"    This means that, by default, anybody can read from the server and\n"
+"    nobody can write to it by default. Set the ``web.allow_push``\n"
+"    option to ``*`` to allow everybody to push to the server. You\n"
+"    should use a real web server if you need to authenticate users."
+msgstr ""
+
+msgid ""
+"    By default, the server logs accesses to stdout and errors to\n"
+"    stderr. Use the -A/--accesslog and -E/--errorlog options to log to\n"
+"    files."
+msgstr ""
+
+msgid ""
+"    To have the server choose a free port number to listen on, specify\n"
+"    a port number of 0; in this case, the server will print the port\n"
+"    number it uses."
+msgstr ""
+
+#, python-format
+msgid "listening at http://%s%s/%s (bound to %s:%d)\n"
+msgstr ""
+
+msgid "show changed files in the working directory"
+msgstr "afișează fișierele modificate în directorul de lucru"
+
+msgid ""
+"    Show status of files in the repository. If names are given, only\n"
+"    files that match are shown. Files that are clean or ignored or\n"
+"    the source of a copy/move operation, are not listed unless\n"
+"    -c/--clean, -i/--ignored, -C/--copies or -A/--all are given.\n"
+"    Unless options described with \"show only ...\" are given, the\n"
+"    options -mardu are used."
+msgstr ""
+
+msgid ""
+"    Option -q/--quiet hides untracked (unknown and ignored) files\n"
+"    unless explicitly requested with -u/--unknown or -i/--ignored."
+msgstr ""
+
+msgid ""
+"    NOTE: status may appear to disagree with diff if permissions have\n"
+"    changed or a merge has occurred. The standard diff format does not\n"
+"    report permission changes and diff only reports changes relative\n"
+"    to one merge parent."
+msgstr ""
+
+msgid ""
+"    If one revision is given, it is used as the base revision.\n"
+"    If two revisions are given, the differences between them are\n"
+"    shown. The --change option can also be used as a shortcut to list\n"
+"    the changed files of a revision from its first parent."
+msgstr ""
+
+msgid "    The codes used to show the status of files are::"
+msgstr "    Codurile folosite pentru a arăta starea fișierelor sunt::"
+
+msgid ""
+"      M = modified\n"
+"      A = added\n"
+"      R = removed\n"
+"      C = clean\n"
+"      ! = missing (deleted by non-hg command, but still tracked)\n"
+"      ? = not tracked\n"
+"      I = ignored\n"
+"        = origin of the previous file listed as A (added)"
+msgstr ""
+"      M = modificat\n"
+"      A = adăugat\n"
+"      R = înlăturat\n"
+"      C = curat\n"
+"      ! = lipsă (șters de o comandă exterioară, dar încă urmărit)\n"
+"      ? = neurmărit\n"
+"      I = ignorat\n"
+"        = originea fișierului precedent listat ca A (adăugat)"
+
+msgid "summarize working directory state"
+msgstr ""
+
+msgid ""
+"    This generates a brief summary of the working directory state,\n"
+"    including parents, branch, commit status, and available updates."
+msgstr ""
+
+msgid ""
+"    With the --remote option, this will check the default paths for\n"
+"    incoming and outgoing changes. This can be time-consuming."
+msgstr ""
+
+#, python-format
+msgid "parent: %d:%s "
+msgstr "părinte: %d:%s "
+
+msgid " (empty repository)"
+msgstr " (depozit vid)"
+
+#, fuzzy
+msgid " (no revision checked out)"
+msgstr " (nu există nicio revizie extrasă)"
+
+#, python-format
+msgid "branch: %s\n"
+msgstr "ramură: %s\n"
+
+#, python-format
+msgid "%d modified"
+msgstr "%d modificate"
+
+#, python-format
+msgid "%d added"
+msgstr "%d adăugate"
+
+#, python-format
+msgid "%d removed"
+msgstr "%d înlăturate"
+
+#, python-format
+msgid "%d renamed"
+msgstr "%d redenumite"
+
+#, python-format
+msgid "%d copied"
+msgstr "%d copiate"
+
+#, python-format
+msgid "%d deleted"
+msgstr "%d șterse"
+
+#, python-format
+msgid "%d unknown"
+msgstr "%d necunoscute"
+
+#, python-format
+msgid "%d ignored"
+msgstr "%d ignorate"
+
+#, python-format
+msgid "%d unresolved"
+msgstr "%d nerezolvate"
+
+#, python-format
+msgid "%d subrepos"
+msgstr "%d subdepozite"
+
+msgid " (merge)"
+msgstr " (fuziune)"
+
+msgid " (new branch)"
+msgstr " (ramură nouă)"
+
+msgid " (head closed)"
+msgstr " (capăt închis)"
+
+msgid " (clean)"
+msgstr " (curat)"
+
+msgid " (new branch head)"
+msgstr " (capăt de ramură nou)"
+
+#, python-format
+msgid "commit: %s\n"
+msgstr "depozitare: %s\n"
+
+msgid "update: (current)\n"
+msgstr "actualizare: (curent)\n"
+
+#, python-format
+msgid "update: %d new changesets (update)\n"
+msgstr "actualizare: %d seturi de modificări noi (actualizare)\n"
+
+#, python-format
+msgid "update: %d new changesets, %d branch heads (merge)\n"
+msgstr ""
+"actualizare: %d seturi de modificări noi, %d capete de ramură (fuziune)\n"
+
+msgid "1 or more incoming"
+msgstr "1 sau mai multe de primit"
+
+#, python-format
+msgid "%d outgoing"
+msgstr "%d de trimis"
+
+#, python-format
+msgid "remote: %s\n"
+msgstr "la distanță: %s\n"
+
+msgid "remote: (synced)\n"
+msgstr "la distanță: (sincronizat)\n"
+
+msgid "add one or more tags for the current or given revision"
+msgstr ""
+"adaugă una sau mai multe etichete pentru revizia curentă\n"
+"sau cea specificată"
+
+msgid "    Name a particular revision using <name>."
+msgstr ""
+
+msgid ""
+"    Tags are used to name particular revisions of the repository and are\n"
+"    very useful to compare different revisions, to go back to significant\n"
+"    earlier versions or to mark branch points as releases, etc."
+msgstr ""
+
+msgid ""
+"    If no revision is given, the parent of the working directory is\n"
+"    used, or tip if no revision is checked out."
+msgstr ""
+
+msgid ""
+"    To facilitate version control, distribution, and merging of tags,\n"
+"    they are stored as a file named \".hgtags\" which is managed\n"
+"    similarly to other project files and can be hand-edited if\n"
+"    necessary. The file '.hg/localtags' is used for local tags (not\n"
+"    shared among repositories)."
+msgstr ""
+
+msgid ""
+"    Since tag names have priority over branch names during revision\n"
+"    lookup, using an existing branch name as a tag name is discouraged."
+msgstr ""
+
+msgid "tag names must be unique"
+msgstr ""
+
+msgid "tag names cannot consist entirely of whitespace"
+msgstr ""
+
+msgid "--rev and --remove are incompatible"
+msgstr ""
+
+#, python-format
+msgid "tag '%s' does not exist"
+msgstr ""
+
+#, python-format
+msgid "tag '%s' is not a global tag"
+msgstr ""
+
+#, python-format
+msgid "tag '%s' is not a local tag"
+msgstr ""
+
+#, python-format
+msgid "tag '%s' already exists (use -f to force)"
+msgstr ""
+
+msgid "list repository tags"
+msgstr ""
+
+msgid ""
+"    This lists both regular and local tags. When the -v/--verbose\n"
+"    switch is used, a third column \"local\" is printed for local tags."
+msgstr ""
+
+msgid "show the tip revision"
+msgstr "afișează revizia vârf"
+
+msgid ""
+"    The tip revision (usually just called the tip) is the changeset\n"
+"    most recently added to the repository (and therefore the most\n"
+"    recently changed head)."
+msgstr ""
+
+msgid ""
+"    If you have just made a commit, that commit will be the tip. If\n"
+"    you have just pulled changes from another repository, the tip of\n"
+"    that repository becomes the current tip. The \"tip\" tag is special\n"
+"    and cannot be renamed or assigned to a different changeset."
+msgstr ""
+
+msgid "apply one or more changegroup files"
+msgstr ""
+
+msgid ""
+"    Apply one or more compressed changegroup files generated by the\n"
+"    bundle command."
+msgstr ""
+
+msgid ""
+"    Returns 0 on success, 1 if an update has unresolved files.\n"
+"    "
+msgstr ""
+"    Returnează 0 în caz de succes, 1 dacă o actualizare are\n"
+"    fișiere nerezolvate.\n"
+"    "
+
+msgid "update working directory (or switch revisions)"
+msgstr "actualizează directorul de lucru (sau comută între revizii)"
+
+msgid ""
+"    Update the repository's working directory to the specified\n"
+"    changeset."
+msgstr ""
+"    Actualizează directorul de lucru al depozitului la setul de\n"
+"    modificări specificat."
+
+msgid ""
+"    If no changeset is specified, attempt to update to the tip of the\n"
+"    current branch. If this changeset is a descendant of the working\n"
+"    directory's parent, update to it, otherwise abort."
+msgstr ""
+"    Dacă nu se specifică nici un set de modificări, se încearcă "
+"actualizarea\n"
+"    la vârful ramurii curente. Dacă acest set de modificări este descendent\n"
+"    al părintelui directorului de lucru, se actualizează la el, altfel se "
+"renunță."
+
+msgid ""
+"    The following rules apply when the working directory contains\n"
+"    uncommitted changes:"
+msgstr ""
+"   Când directorul de lucru conține modificări nedepozitate, se\n"
+"   aplică următoarele reguli:"
+
+msgid ""
+"    1. If neither -c/--check nor -C/--clean is specified, and if\n"
+"       the requested changeset is an ancestor or descendant of\n"
+"       the working directory's parent, the uncommitted changes\n"
+"       are merged into the requested changeset and the merged\n"
+"       result is left uncommitted. If the requested changeset is\n"
+"       not an ancestor or descendant (that is, it is on another\n"
+"       branch), the update is aborted and the uncommitted changes\n"
+"       are preserved."
+msgstr ""
+"    1. Dacă nu e specificat -c/--check sau -C/--clean, și dacă setul de\n"
+"       modificări solicitat este ascendent sau descendent al părintelui\n"
+"       directorului de lucru, modificările nedepozitate sunt fuzionate în\n"
+"       setul de modificări solicitat, iar rezultatul fuziunii este lăsat\n"
+"       nedepozitat. Dacă setul de modificări solicitat nu este un strămoș\n"
+"       sau un descendent (adică se află în altă ramură), actualizarea\n"
+"       este întreruptă, iar modificările nedepozitate sunt păstrate."
+
+msgid ""
+"    2. With the -c/--check option, the update is aborted and the\n"
+"       uncommitted changes are preserved."
+msgstr ""
+"    2. Cu opțiunea -c/--check, actualizarea este întreruptă,  iar\n"
+"       modificările nedepozitate sunt păstrate."
+
+msgid ""
+"    3. With the -C/--clean option, uncommitted changes are discarded and\n"
+"       the working directory is updated to the requested changeset."
+msgstr ""
+"    3. Cu opțiunea -C/--clean, modificările nedepozitate sunt înlăturate, "
+"iar\n"
+"       directorul de lucru este actualizat la setul de modificări solicitat."
+
+msgid ""
+"    Use null as the changeset to remove the working directory (like\n"
+"    :hg:`clone -U`)."
+msgstr ""
+"    Folosiți null ca set de modificări pentru a elimina directorul de\n"
+"    lucru (similar cu :hg:`clone -U`)."
+
+msgid ""
+"    If you want to update just one file to an older changeset, use :hg:"
+"`revert`."
+msgstr ""
+"    Dacă doriți să actualizați doar un singur fișier la un set de\n"
+"    modificări mai vechi, folosiți :hg:`revert`."
+
+msgid "cannot specify both -c/--check and -C/--clean"
+msgstr ""
+
+msgid "uncommitted local changes"
+msgstr ""
+
+msgid "verify the integrity of the repository"
+msgstr ""
+
+msgid "    Verify the integrity of the current repository."
+msgstr ""
+
+msgid ""
+"    This will perform an extensive check of the repository's\n"
+"    integrity, validating the hashes and checksums of each entry in\n"
+"    the changelog, manifest, and tracked files, as well as the\n"
+"    integrity of their crosslinks and indices."
+msgstr ""
+
+msgid "output version and copyright information"
+msgstr "afișează versiunea și informații legate de copyright"
+
+#, python-format
+msgid "Mercurial Distributed SCM (version %s)\n"
+msgstr ""
+"Mercurial - gestionar distribuit pentru controlul codului sursă\n"
+"(versiunea %s)\n"
+
+msgid ""
+"\n"
+"Copyright (C) 2005-2010 Matt Mackall <mpm@selenic.com> and others\n"
+"This is free software; see the source for copying conditions. There is NO\n"
+"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"
+msgstr ""
+"\n"
+"Copyright (C) 2005-2010 Matt Mackall <mpm@selenic.com> și alții\n"
+"Acesta este software liber; vezi sursa pentru condițiile de copiere.\n"
+"Nu există NICIO garanție; nici măcar pentru COMERCIALIZARE sau\n"
+"COMPATIBILITATE ÃŽN ANUMITE SCOPURI.\n"
+
+msgid "repository root directory or name of overlay bundle file"
+msgstr ""
+
+msgid "DIR"
+msgstr "DIR"
+
+msgid "change working directory"
+msgstr "schimbă directorul de lucru "
+
+msgid "do not prompt, assume 'yes' for any required answers"
+msgstr "nu întreba, presupune 'da' pentru orice răspuns solicitat"
+
+msgid "suppress output"
+msgstr "suprimă afișarea"
+
+msgid "enable additional output"
+msgstr "activează afișarea informațiilor suplimentare"
+
+msgid "set/override config option (use 'section.name=value')"
+msgstr ""
+"setează/suprascrie opțiunea de configurare (folosiți 'secțiune.nume=valoare')"
+
+msgid "CONFIG"
+msgstr ""
+
+msgid "enable debugging output"
+msgstr "activează afișarea informațiilor pentru depanare"
+
+msgid "start debugger"
+msgstr "pornește depanatorul (debugger)"
+
+msgid "set the charset encoding"
+msgstr "setează codificarea pentru setul de caractere"
+
+msgid "ENCODE"
+msgstr ""
+
+msgid "MODE"
+msgstr ""
+
+msgid "set the charset encoding mode"
+msgstr "setează modul de codificare pentru setul de caractere"
+
+msgid "always print a traceback on exception"
+msgstr ""
+
+msgid "time how long the command takes"
+msgstr "durata de execuție a comenzii"
+
+msgid "print command execution profile"
+msgstr "afișează profilul executării comenzii"
+
+msgid "output version information and exit"
+msgstr "afișează informații despre versiune și ieși"
+
+msgid "display help and exit"
+msgstr "afișează ajutorul și ieși"
+
+msgid "do not perform actions, just print output"
+msgstr "acțiunea nu se execută, doar se afișează mesajele"
+
+msgid "specify ssh command to use"
+msgstr "specifică comanda ssh care va fi folosită"
+
+msgid "specify hg command to run on the remote side"
+msgstr "specifică comanda hg care va fi executată pe mașina la distanță"
+
+msgid "PATTERN"
+msgstr "TIPAR"
+
+msgid "include names matching the given patterns"
+msgstr "include numele care se potrivesc cu tiparele specificate"
+
+msgid "exclude names matching the given patterns"
+msgstr "exclude numele care se potrivesc cu tiparele specificate"
+
+msgid "use text as commit message"
+msgstr "folosește textul drept mesaj de depozitare"
+
+msgid "read commit message from file"
+msgstr "citește mesajul pentru depozitare din fișier"
+
+msgid "record datecode as commit date"
+msgstr "înregistrează codul de dată ca dată a depozitării"
+
+msgid "record the specified user as committer"
+msgstr ""
+"înregistrează utilizatorul specificat ca fiind cel care a făcut depozitarea"
+
+msgid "STYLE"
+msgstr "STIL"
+
+msgid "display using template map file"
+msgstr "afișează folosind fișierul cu harta de șabloane"
+
+msgid "display with template"
+msgstr "afișează cu șablon"
+
+msgid "do not show merges"
+msgstr "nu afișa fuziunile"
+
+msgid "output diffstat-style summary of changes"
+msgstr ""
+
+msgid "treat all files as text"
+msgstr "tratează toate fișierele ca text"
+
+msgid "omit dates from diff headers"
+msgstr "omite datele din antetele diff"
+
+msgid "show which function each change is in"
+msgstr "afișează funcția în care se află fiecare modificare"
+
+msgid "produce a diff that undoes the changes"
+msgstr ""
+
+msgid "ignore white space when comparing lines"
+msgstr "ignoră spațiul alb la compararea liniilor"
+
+msgid "ignore changes in the amount of white space"
+msgstr "ignoră modificările cantității de spațiu alb"
+
+msgid "ignore changes whose lines are all blank"
+msgstr "ignoră modificările ale căror linii sunt toate vide"
+
+msgid "number of lines of context to show"
+msgstr "numărul liniilor de context care vor fi afișate"
+
+msgid "SIMILARITY"
+msgstr "ASEMÄ‚NARE"
+
+msgid "guess renamed files by similarity (0<=s<=100)"
+msgstr "ghicește fișierele redenumite după asemănare (0<=s<=100)"
+
+msgid "[OPTION]... [FILE]..."
+msgstr "[OPȚIUNE]... [FIȘIER]..."
+
+msgid "annotate the specified revision"
+msgstr "adnotează revizia specificată"
+
+msgid "follow copies/renames and list the filename (DEPRECATED)"
+msgstr ""
+"urmărește copierile/redenumirile și afișează numele\n"
+"fișierului (ÎNVECHIT)"
+
+msgid "don't follow copies and renames"
+msgstr "nu urmări copierile și redenumirile"
+
+msgid "list the author (long with -v)"
+msgstr "afișează autorul (lung cu -v)"
+
+msgid "list the filename"
+msgstr "afișează numele fișierului"
+
+msgid "list the date (short with -q)"
+msgstr "afișează data (scurt cu -q)"
+
+msgid "list the revision number (default)"
+msgstr "afișează numele reviziei (implicit)"
+
+msgid "list the changeset"
+msgstr "afișează setul de modificări"
+
+msgid "show line number at the first appearance"
+msgstr "afișează numărul liniei la prima apariție"
+
+msgid "[-r REV] [-f] [-a] [-u] [-d] [-n] [-c] [-l] FILE..."
+msgstr "[-r REV] [-f] [-a] [-u] [-d] [-n] [-c] [-l] FIȘIER..."
+
+msgid "do not pass files through decoders"
+msgstr ""
+
+msgid "PREFIX"
+msgstr "PREFIX"
+
+msgid "directory prefix for files in archive"
+msgstr ""
+
+msgid "revision to distribute"
+msgstr ""
+
+msgid "type of distribution to create"
+msgstr ""
+
+msgid "[OPTION]... DEST"
+msgstr "[OPÈšIUNE]... DEST"
+
+msgid "merge with old dirstate parent after backout"
+msgstr ""
+
+msgid "parent to choose when backing out merge"
+msgstr ""
+
+msgid "revision to backout"
+msgstr ""
+
+msgid "[OPTION]... [-r] REV"
+msgstr "[OPÈšIUNE]... [-r] REV"
+
+msgid "reset bisect state"
+msgstr ""
+
+msgid "mark changeset good"
+msgstr "marchează setul de modificări drept bun"
+
+msgid "mark changeset bad"
+msgstr "marchează setul de modificări drept rău"
+
+msgid "skip testing changeset"
+msgstr "omite testarea setului de modificări"
+
+msgid "use command to check changeset state"
+msgstr ""
+
+msgid "do not update to target"
+msgstr "nu actualiza la destinație"
+
+msgid "[-gbsr] [-U] [-c CMD] [REV]"
+msgstr "[-gbsr] [-U] [-c CMD] [REV]"
+
+msgid "set branch name even if it shadows an existing branch"
+msgstr ""
+
+msgid "reset branch name to parent branch name"
+msgstr ""
+
+msgid "[-fC] [NAME]"
+msgstr "[-fC] [NAME]"
+
+msgid "show only branches that have unmerged heads"
+msgstr "afișează doar ramurile care au capete nefuzionate"
+
+msgid "show normal and closed branches"
+msgstr "afișează ramurile normale și închise"
+
+msgid "[-ac]"
+msgstr ""
+
+msgid "run even when the destination is unrelated"
+msgstr ""
+
+msgid "a changeset intended to be added to the destination"
+msgstr ""
+
+msgid "a specific branch you would like to bundle"
+msgstr ""
+
+msgid "a base changeset assumed to be available at the destination"
+msgstr ""
+
+msgid "bundle all changesets in the repository"
+msgstr ""
+
+msgid "bundle compression type to use"
+msgstr ""
+
+msgid "[-f] [-t TYPE] [-a] [-r REV]... [--base REV]... FILE [DEST]"
+msgstr ""
+
+msgid "print output to file with formatted name"
+msgstr ""
+
+msgid "print the given revision"
+msgstr ""
+
+msgid "apply any matching decode filter"
+msgstr ""
+
+msgid "[OPTION]... FILE..."
+msgstr "[OPȚIUNE]... FIȘIER"
+
+msgid "the clone will include an empty working copy (only a repository)"
+msgstr "clona va include o copie de lucru vidă (doar un depozit)"
+
+msgid "revision, tag or branch to check out"
+msgstr "revizia, eticheta sau ramura care va fi actualizată"
+
+msgid "include the specified changeset"
+msgstr "include setul de modificări specificat"
+
+msgid "clone only the specified branch"
+msgstr "clonează doar ramura specificată"
+
+msgid "[OPTION]... SOURCE [DEST]"
+msgstr "[OPÈšIUNE]... SURSÄ‚ [DEST]"
+
+msgid "mark new/missing files as added/removed before committing"
+msgstr ""
+"marchează fișierele noi/lipsă ca adăugate/eliminate înainte de depozitare"
+
+msgid "mark a branch as closed, hiding it from the branch list"
+msgstr "marchează o ramură ca închisă, ascunzând-o din lista ramurilor"
+
+msgid "record a copy that has already occurred"
+msgstr ""
+
+msgid "forcibly copy over an existing managed file"
+msgstr ""
+
+msgid "[OPTION]... [SOURCE]... DEST"
+msgstr "[OPÈšIUNE]... [SURSÄ‚]... DEST"
+
+msgid "[INDEX] REV1 REV2"
+msgstr ""
+
+msgid "add single file mergeable changes"
+msgstr ""
+
+msgid "add single file all revs append to"
+msgstr ""
+
+msgid "add single file all revs overwrite"
+msgstr ""
+
+msgid "add new file at each rev"
+msgstr ""
+
+msgid "[OPTION]... TEXT"
+msgstr "[OPÈšIUNE]... TEXT"
+
+msgid "[COMMAND]"
+msgstr ""
+
+msgid "show the command options"
+msgstr "afișează opțiunile comenzii"
+
+msgid "[-o] CMD"
+msgstr ""
+
+msgid "use tags as labels"
+msgstr ""
+
+msgid "annotate with branch names"
+msgstr ""
+
+msgid "use dots for runs"
+msgstr ""
+
+msgid "separate elements by spaces"
+msgstr ""
+
+msgid "[OPTION]... [FILE [REV]...]"
+msgstr "[OPȚIUNE]... [FIȘIER [REV]...]"
+
+msgid "try extended date formats"
+msgstr ""
+
+msgid "[-e] DATE [RANGE]"
+msgstr ""
+
+msgid "FILE REV"
+msgstr ""
+
+msgid "[PATH]"
+msgstr ""
+
+msgid "REPO NAMESPACE [KEY OLD NEW]"
+msgstr ""
+
+msgid "revision to rebuild to"
+msgstr ""
+
+msgid "[-r REV] [REV]"
+msgstr ""
+
+msgid "revision to debug"
+msgstr ""
+
+msgid "[-r REV] FILE"
+msgstr ""
+
+msgid "REV1 [REV2]"
+msgstr ""
+
+msgid "do not display the saved mtime"
+msgstr ""
+
+msgid "[OPTION]..."
+msgstr "[OPÈšIUNE]..."
+
+msgid "revision to check"
+msgstr ""
+
+msgid "[OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]..."
+msgstr "[OPȚIUNE]... ([-c REV] | [-r REV1 [-r REV2]]) [FIȘIER]..."
+
+msgid "diff against the second parent"
+msgstr ""
+
+msgid "revisions to export"
+msgstr ""
+
+msgid "[OPTION]... [-o OUTFILESPEC] REV..."
+msgstr "[OPȚIUNE]... [-o SPECFIȘIEȘIRE] REV..."
+
+msgid "end fields with NUL"
+msgstr ""
+
+msgid "print all revisions that match"
+msgstr ""
+
+msgid "follow changeset history, or file history across copies and renames"
+msgstr ""
+"urmărește istoricul seturilor de modificări sau al fișierelor, ținând cont "
+"de copieri și redenumiri"
+
+msgid "ignore case when matching"
+msgstr "ignoră minuscule/majuscule la potrivire"
+
+msgid "print only filenames and revisions that match"
+msgstr "afișează doar numele de fișiere și reviziile care se potrivesc"
+
+msgid "print matching line numbers"
+msgstr "afișează numerele liniilor care se potrivesc"
+
+msgid "only search files changed within revision range"
+msgstr "caută doar fișierele modificate în intervalul de revizii"
+
+msgid "[OPTION]... PATTERN [FILE]..."
+msgstr "[OPȚIUNE]... TIPAR [FIȘIER]..."
+
+msgid "show only heads which are descendants of REV"
+msgstr "afișează doar capetele care sunt descendenți ai REV"
+
+msgid "show topological heads only"
+msgstr "afișează doar capetele topologice"
+
+msgid "show active branchheads only (DEPRECATED)"
+msgstr "afișează doar capetele de ramură active [ÎNVECHIT]"
+
+msgid "show normal and closed branch heads"
+msgstr " afișează capetele de ramură normale și închise"
+
+msgid "[-ac] [-r REV] [REV]..."
+msgstr "[-ac] [-r REV] [REV]..."
+
+msgid "[TOPIC]"
+msgstr "[SUBIECT]"
+
+msgid "identify the specified revision"
+msgstr "identifică revizia specificată"
+
+msgid "show local revision number"
+msgstr "afișează numărul de revizie local"
+
+msgid "show global revision id"
+msgstr "afișează id-ul global al reviziei"
+
+msgid "show branch"
+msgstr "afișează ramura"
+
+msgid "show tags"
+msgstr "afișează etichetele"
+
+msgid "[-nibt] [-r REV] [SOURCE]"
+msgstr "[-nibt] [-r REV] [SURSÄ‚]"
+
+msgid ""
+"directory strip option for patch. This has the same meaning as the "
+"corresponding patch option"
+msgstr ""
+
+msgid "PATH"
+msgstr "CALE"
+
+msgid "base path"
+msgstr "calea de bază"
+
+msgid "skip check for outstanding uncommitted changes"
+msgstr "omite verificarea pentru modificări nedepozitate în suspensie"
+
+msgid "don't commit, just update the working directory"
+msgstr "nu depozita, doar actualizează directorul de lucru"
+
+msgid "apply patch to the nodes from which it was generated"
+msgstr "aplică patch-ul nodurilor pentru care a fost generat"
+
+msgid "use any branch information in patch (implied by --exact)"
+msgstr ""
+"folosește orice informație despre ramură din patch\n"
+"(implicat de --exact)"
+
+msgid "[OPTION]... PATCH..."
+msgstr "[OPÈšIUNE]... PATCH"
+
+msgid "run even if remote repository is unrelated"
+msgstr "execută chiar dacă depozitul la distanță este neînrudit"
+
+msgid "show newest record first"
+msgstr "afișează începând cu cea mai nouă înregistrare"
+
+msgid "file to store the bundles into"
+msgstr ""
+
+msgid "a remote changeset intended to be added"
+msgstr ""
+
+msgid "a specific branch you would like to pull"
+msgstr ""
+
+msgid "[-p] [-n] [-M] [-f] [-r REV]... [--bundle FILENAME] [SOURCE]"
+msgstr "[-p] [-n] [-M] [-f] [-r REV]... [--bundle NUMEFIȘIER] [SURSĂ]"
+
+msgid "[-e CMD] [--remotecmd CMD] [DEST]"
+msgstr "[-e CMD] [--remotecmd CMD] [DEST]"
+
+msgid "search the repository as it is in REV"
+msgstr "caută depozitul așa cum este el în REV"
+
+msgid "end filenames with NUL, for use with xargs"
+msgstr "termină numele de fișiere cu NUL, pentru utilizare cu xargs"
+
+msgid "print complete paths from the filesystem root"
+msgstr "afișează căi complete de la rădăcina sistemului de fișiere"
+
+msgid "[OPTION]... [PATTERN]..."
+msgstr "[OPÈšIUNE]... [TIPAR]..."
+
+msgid "only follow the first parent of merge changesets"
+msgstr "urmărește doar primul părinte al seturilor de modificări de fuziune"
+
+msgid "show revisions matching date spec"
+msgstr "afișează reviziile care se potrivesc cu data"
+
+msgid "show copied files"
+msgstr "afișează fișierele copiate"
+
+msgid "do case-insensitive search for a given text"
+msgstr "caută textul specificat fără a diferenția între minuscule și majuscule"
+
+msgid "include revisions where files were removed"
+msgstr "include reviziile în care au fost eliminate fișiere"
+
+msgid "show only merges"
+msgstr "afișează doar fuziunile"
+
+msgid "revisions committed by user"
+msgstr "reviziile depozitate de utilizatorul"
+
+msgid "show only changesets within the given named branch (DEPRECATED)"
+msgstr ""
+"afișează doar seturile de modificări din interiorul ramurii denumite\n"
+"specificate (ÃŽNVECHIT)"
+
+msgid "show changesets within the given named branch"
+msgstr ""
+"afișează seturile de modificări din cadrul ramurii denumite specificate"
+
+msgid "do not display revision or any of its ancestors"
+msgstr "nu afișa revizia sau oricare din strămoșii ei"
+
+msgid "[OPTION]... [FILE]"
+msgstr "[OPȚIUNE]... [FIȘIER]"
+
+msgid "revision to display"
+msgstr "revizia de afișat"
+
+msgid "[-r REV]"
+msgstr "[-r REV]"
+
+msgid "force a merge with outstanding changes"
+msgstr "forțează o fuziune cu modificări în suspensie"
+
+msgid "revision to merge"
+msgstr "revizia de fuzionat"
+
+msgid "review revisions to merge (no merge is performed)"
+msgstr ""
+"treci în revistă reviziile de fuzionat (nu se execută\n"
+"nicio fuziune)"
+
+msgid "[-P] [-f] [[-r] REV]"
+msgstr "[-P] [-f] [[-r] REV]"
+
+msgid "a changeset intended to be included in the destination"
+msgstr "un set de modificări care se dorește a fi inclus în destinație"
+
+msgid "a specific branch you would like to push"
+msgstr ""
+
+msgid "[-M] [-p] [-n] [-f] [-r REV]... [DEST]"
+msgstr "[-M] [-p] [-n] [-f] [-r REV]... [DEST]"
+
+msgid "show parents of the specified revision"
+msgstr "afișează părinții reviziei specificate"
+
+msgid "[-r REV] [FILE]"
+msgstr "[-r REV] [FIȘIER]"
+
+msgid "[NAME]"
+msgstr "[NUME]"
+
+msgid "update to new branch head if changesets were pulled"
+msgstr ""
+
+msgid "run even when remote repository is unrelated"
+msgstr "execută chiar când depozitul la distanță este neînrudit"
+
+msgid "[-u] [-f] [-r REV]... [-e CMD] [--remotecmd CMD] [SOURCE]"
+msgstr "[-u] [-f] [-r REV]... [-e CMD] [--remotecmd CMD] [SURSÄ‚]"
+
+msgid "force push"
+msgstr ""
+
+msgid "allow pushing a new branch"
+msgstr ""
+
+msgid "[-f] [-r REV]... [-e CMD] [--remotecmd CMD] [DEST]"
+msgstr "[-f] [-r REV]... [-e CMD] [--remotecmd CMD] [DEST]"
+
+msgid "record delete for missing files"
+msgstr "înregistrează ștergere pentru fișierele lipsă"
+
+msgid "remove (and delete) file even if added or modified"
+msgstr "înlătură (și șterge) fișierul chiar dacă este adăugat sau modificat"
+
+msgid "record a rename that has already occurred"
+msgstr "înregistrează o redenumire care a avut deja loc"
+
+msgid "[OPTION]... SOURCE... DEST"
+msgstr "[OPÈšIUNE]... SURSÄ‚... DEST"
+
+msgid "select all unresolved files"
+msgstr "selectează toate fișierele nerezolvate"
+
+msgid "list state of files needing merge"
+msgstr "afișează starea fișierelor care au nevoie de fuziune"
+
+msgid "mark files as resolved"
+msgstr "marchează fișierul drept rezolvat"
+
+msgid "mark files as unresolved"
+msgstr "marchează fișierul drept rezolvat"
+
+msgid "hide status prefix"
+msgstr "ascunde prefixul stării"
+
+msgid "revert all changes when no arguments given"
+msgstr ""
+
+msgid "tipmost revision matching date"
+msgstr "revizia cea mai apropiată de vârf care se potrivește cu data"
+
+msgid "revert to the specified revision"
+msgstr ""
+
+msgid "do not save backup copies of files"
+msgstr "nu salva copii de siguranță ale fișierelor"
+
+msgid "[OPTION]... [-r REV] [NAME]..."
+msgstr "[OPÈšIUNE]... [-r REV] [NUME]..."
+
+msgid "name of access log file to write to"
+msgstr "numele fișierului jurnal de acces în care să se scrie"
+
+msgid "name of error log file to write to"
+msgstr "numele fișierului jurnal de eroare în care să se scrie"
+
+msgid "PORT"
+msgstr "PORT"
+
+msgid "port to listen on (default: 8000)"
+msgstr "portul pe care se va asculta (implicit: 8000)"
+
+msgid "ADDR"
+msgstr "ADRESÄ‚"
+
+msgid "address to listen on (default: all interfaces)"
+msgstr ""
+
+msgid "prefix path to serve from (default: server root)"
+msgstr ""
+
+msgid "name to show in web pages (default: working directory)"
+msgstr ""
+"numele care va fi afișat în paginile web (implicit: directorul de lucru)"
+
+msgid "name of the hgweb config file (serve more than one repository)"
+msgstr ""
+
+msgid "name of the hgweb config file (DEPRECATED)"
+msgstr ""
+
+msgid "for remote clients"
+msgstr ""
+
+msgid "web templates to use"
+msgstr ""
+
+msgid "template style to use"
+msgstr ""
+
+msgid "use IPv6 in addition to IPv4"
+msgstr ""
+
+msgid "SSL certificate file"
+msgstr ""
+
+#, fuzzy
+msgid "show untrusted configuration options"
+msgstr "afișează opțiunile de configurare 'untrusted'"
+
+msgid "[-u] [NAME]..."
+msgstr ""
+
+msgid "check for push and pull"
+msgstr ""
+
+msgid "show status of all files"
+msgstr "afișează starea tuturor fișierelor"
+
+msgid "show only modified files"
+msgstr "afișează doar fișierele modificate"
+
+msgid "show only added files"
+msgstr "afișează doar fișierele adăugate"
+
+msgid "show only removed files"
+msgstr "afișează doar fișierele înlăturate"
+
+msgid "show only deleted (but tracked) files"
+msgstr "afișează doar fișierele șterse (dar urmărite)"
+
+msgid "show only files without changes"
+msgstr "afișează doar fișierele fără modificări"
+
+msgid "show only unknown (not tracked) files"
+msgstr "afișează doar fișierele necunoscute (neurmărite)"
+
+msgid "show only ignored files"
+msgstr "afișează doar fișierele ignorate"
+
+msgid "show source of copied files"
+msgstr "afișează sursa fișierelor copiate"
+
+msgid "show difference from revision"
+msgstr "afișează diferențele față de revizie"
+
+msgid "list the changed files of a revision"
+msgstr "afișează fișierele modificate ale unei revizii"
+
+msgid "replace existing tag"
+msgstr "înlocuiește o etichetă existentă"
+
+msgid "make the tag local"
+msgstr "fă eticheta locală"
+
+msgid "revision to tag"
+msgstr ""
+
+msgid "remove a tag"
+msgstr "înlătură o etichetă"
+
+msgid "use <text> as commit message"
+msgstr "folosește <text> drept mesaj de depozitare"
+
+msgid "[-f] [-l] [-m TEXT] [-d DATE] [-u USER] [-r REV] NAME..."
+msgstr "[-f] [-l] [-m TEXT] [-d DATÄ‚] [-u UTILIZATOR] [-r REV] NUME..."
+
+msgid "[-p] [-g]"
+msgstr "[-p] [-g]"
+
+msgid "update to new branch head if changesets were unbundled"
+msgstr ""
+
+msgid "[-u] FILE..."
+msgstr "[-u] FIȘIER..."
+
+msgid "discard uncommitted changes (no backup)"
+msgstr "înlătură modificările nedepozitate (fără copie de siguranță)"
+
+msgid "check for uncommitted changes"
+msgstr "verifică dacă există modificări nedepozitate"
+
+msgid "[-c] [-C] [-d DATE] [[-r] REV]"
+msgstr "[-c] [-C] [-d DATÄ‚] [[-r] REV]"
+
+#, python-format
+msgid "cannot include %s (%s)"
+msgstr ""
+
+msgid "not found in manifest"
+msgstr "nu s-a găsit în manifest"
+
+msgid "branch name not in UTF-8!"
+msgstr ""
+
+#, python-format
+msgid "%s does not exist!\n"
+msgstr ""
+
+#, python-format
+msgid ""
+"%s: up to %d MB of RAM may be required to manage this file\n"
+"(use 'hg revert %s' to cancel the pending addition)\n"
+msgstr ""
+
+#, python-format
+msgid "%s not added: only files and symlinks supported currently\n"
+msgstr ""
+
+#, python-format
+msgid "%s already tracked!\n"
+msgstr ""
+
+#, python-format
+msgid "%s not added!\n"
+msgstr ""
+
+#, python-format
+msgid "%s still exists!\n"
+msgstr ""
+
+#, python-format
+msgid "%s not tracked!\n"
+msgstr ""
+
+#, python-format
+msgid "%s not removed!\n"
+msgstr ""
+
+#, python-format
+msgid "copy failed: %s is not a file or a symbolic link\n"
+msgstr ""
+
+#, python-format
+msgid "invalid event type in dag: %s"
+msgstr ""
+
+msgid "working directory state appears damaged!"
+msgstr ""
+
+#, python-format
+msgid "'\\n' and '\\r' disallowed in filenames: %r"
+msgstr ""
+
+#, python-format
+msgid "directory %r already in dirstate"
+msgstr ""
+
+#, python-format
+msgid "file %r in dirstate clashes with %r"
+msgstr ""
+
+#, python-format
+msgid "setting %r to other parent only allowed in merges"
+msgstr ""
+
+#, python-format
+msgid "not in dirstate: %s\n"
+msgstr ""
+
+msgid "unknown"
+msgstr ""
+
+msgid "character device"
+msgstr ""
+
+msgid "block device"
+msgstr ""
+
+msgid "fifo"
+msgstr ""
+
+msgid "socket"
+msgstr ""
+
+msgid "directory"
+msgstr ""
+
+#, python-format
+msgid "unsupported file type (type is %s)"
+msgstr ""
+
+msgid "queries"
+msgstr ""
+
+msgid "searching"
+msgstr ""
+
+msgid "already have changeset "
+msgstr ""
+
+msgid "warning: repository is unrelated\n"
+msgstr ""
+
+msgid "repository is unrelated"
+msgstr ""
+
+#, python-format
+msgid "push creates new remote branches: %s!"
+msgstr ""
+
+msgid "use 'hg push --new-branch' to create new remote branches"
+msgstr ""
+
+#, python-format
+msgid "push creates new remote heads on branch '%s'!"
+msgstr ""
+
+msgid "push creates new remote heads!"
+msgstr ""
+
+msgid "you should pull and merge or use push -f to force"
+msgstr ""
+
+msgid "did you forget to merge? use push -f to force"
+msgstr ""
+
+msgid "note: unsynced remote changes!\n"
+msgstr ""
+
+#, python-format
+msgid "abort: %s\n"
+msgstr "abandon: %s\n"
+
+#, python-format
+msgid "(%s)\n"
+msgstr ""
+
+#, python-format
+msgid "hg: parse error at %s: %s\n"
+msgstr "hg: eroare de parsare la %s: %s\n"
+
+#, python-format
+msgid "hg: parse error: %s\n"
+msgstr "hg: eroare de parsare: %s\n"
+
+msgid "entering debugger - type c to continue starting hg or h for help\n"
+msgstr ""
+
+#, python-format
+msgid ""
+"hg: command '%s' is ambiguous:\n"
+"    %s\n"
+msgstr ""
+"hg: comanda '%s' este ambiguă:\n"
+"    %s\n"
+
+#, python-format
+msgid "timed out waiting for lock held by %s"
+msgstr "timpul de așteptare pentru lacătul deținut de %s a expirat"
+
+#, python-format
+msgid "lock held by %s"
+msgstr "lacăt deținut de %s"
+
+#, python-format
+msgid "abort: %s: %s\n"
+msgstr "abandon: %s: %s\n"
+
+#, python-format
+msgid "abort: could not lock %s: %s\n"
+msgstr "abandon: nu s-a putut bloca %s: %s\n"
+
+#, python-format
+msgid "hg %s: %s\n"
+msgstr "hg %s: %s\n"
+
+#, python-format
+msgid "hg: %s\n"
+msgstr "hg: %s\n"
+
+#, python-format
+msgid "abort: %s!\n"
+msgstr "abandon: %s!\n"
+
+#, python-format
+msgid "abort: %s"
+msgstr "abandon: %s"
+
+msgid " empty string\n"
+msgstr " șir vid\n"
+
+msgid "killed!\n"
+msgstr ""
+
+#, python-format
+msgid "hg: unknown command '%s'\n"
+msgstr "hg: comandă necunoscută '%s'\n"
+
+msgid "(did you forget to compile extensions?)\n"
+msgstr "(ați uitat să compilați extensiile?)\n"
+
+msgid "(is your Python install correct?)\n"
+msgstr "(instalarea dvs. Python este corectă?)\n"
+
+#, python-format
+msgid "abort: error: %s\n"
+msgstr "abandon: eroare: %s\n"
+
+msgid "broken pipe\n"
+msgstr ""
+
+msgid "interrupted!\n"
+msgstr "întrerupt!\n"
+
+msgid ""
+"\n"
+"broken pipe\n"
+msgstr ""
+
+msgid "abort: out of memory\n"
+msgstr "abandon: memorie epuizată\n"
+
+msgid "** unknown exception encountered, details follow\n"
+msgstr ""
+
+msgid "** report bug details to http://mercurial.selenic.com/bts/\n"
+msgstr ""
+
+msgid "** or mercurial@selenic.com\n"
+msgstr ""
+
+#, python-format
+msgid "** Python %s\n"
+msgstr ""
+
+#, python-format
+msgid "** Mercurial Distributed SCM (version %s)\n"
+msgstr ""
+"** Mercurial - gestionar distribuit pentru controlul codului sursă\n"
+"(versiunea %s)\n"
+
+#, python-format
+msgid "** Extensions loaded: %s\n"
+msgstr ""
+
+#, python-format
+msgid "no definition for alias '%s'\n"
+msgstr "nu există nicio definiție pentru alias-ul '%s'\n"
+
+#, python-format
+msgid ""
+"error in definition for alias '%s': %s may only be given on the command "
+"line\n"
+msgstr ""
+
+#, python-format
+msgid "alias '%s' resolves to unknown command '%s'\n"
+msgstr "alias-ul '%s' corespunde comenzii necunoscute '%s'\n"
+
+#, python-format
+msgid "alias '%s' resolves to ambiguous command '%s'\n"
+msgstr "alias-ul '%s' corespunde comenzii ambigue '%s'\n"
+
+#, python-format
+msgid "malformed --config option: %r (use --config section.name=value)"
+msgstr ""
+
+#, python-format
+msgid "error getting current working directory: %s"
+msgstr "eroare la obținerea directorului de lucru: %s"
+
+#, python-format
+msgid "extension '%s' overrides commands: %s\n"
+msgstr ""
+
+msgid "Option --config may not be abbreviated!"
+msgstr ""
+
+msgid "Option --cwd may not be abbreviated!"
+msgstr ""
+
+msgid ""
+"Option -R has to be separated from other options (e.g. not -qR) and --"
+"repository may only be abbreviated as --repo!"
+msgstr ""
+
+#, python-format
+msgid "Time: real %.3f secs (user %.3f+%.3f sys %.3f+%.3f)\n"
+msgstr "Durată: real %.3f sec (utilizator %.3f+%.3f sistem %.3f+%.3f)\n"
+
+#, python-format
+msgid "repository '%s' is not local"
+msgstr ""
+
+msgid "warning: --repository ignored\n"
+msgstr ""
+
+msgid "invalid arguments"
+msgstr ""
+
+#, python-format
+msgid "unrecognized profiling format '%s' - Ignored\n"
+msgstr ""
+
+msgid ""
+"lsprof not available - install from http://codespeak.net/svn/user/arigo/hack/"
+"misc/lsprof/"
+msgstr ""
+
+#, python-format
+msgid "*** failed to import extension %s from %s: %s\n"
+msgstr ""
+
+#, python-format
+msgid "*** failed to import extension %s: %s\n"
+msgstr ""
+
+#, python-format
+msgid "couldn't find merge tool %s\n"
+msgstr ""
+
+#, python-format
+msgid "tool %s can't handle symlinks\n"
+msgstr ""
+
+#, python-format
+msgid "tool %s can't handle binary\n"
+msgstr ""
+
+#, python-format
+msgid "tool %s requires a GUI\n"
+msgstr ""
+
+#, python-format
+msgid ""
+" no tool found to merge %s\n"
+"keep (l)ocal or take (o)ther?"
+msgstr ""
+
+msgid "&Local"
+msgstr ""
+
+msgid "&Other"
+msgstr ""
+
+#, python-format
+msgid "merging %s and %s to %s\n"
+msgstr ""
+
+#, python-format
+msgid "merging %s\n"
+msgstr ""
+
+#, python-format
+msgid "%s.premerge not valid ('%s' is neither boolean nor %s)"
+msgstr ""
+
+#, python-format
+msgid "was merge of '%s' successful (yn)?"
+msgstr ""
+
+msgid "&No"
+msgstr ""
+
+msgid "&Yes"
+msgstr ""
+
+#, python-format
+msgid ""
+" output file %s appears unchanged\n"
+"was merge successful (yn)?"
+msgstr ""
+
+#, python-format
+msgid "merging %s failed!\n"
+msgstr ""
+
+msgid "starting revisions are not directly related"
+msgstr ""
+
+#, python-format
+msgid "Inconsistent state, %s:%s is good and bad"
+msgstr ""
+
+#, python-format
+msgid "unknown bisect kind %s"
+msgstr ""
+
+msgid "disabled extensions:"
+msgstr ""
+
+msgid "Configuration Files"
+msgstr "Fișiere de configurare"
+
+msgid "Date Formats"
+msgstr "Formate de dată"
+
+msgid "File Name Patterns"
+msgstr "Șabloane pentru nume de fișiere"
+
+msgid "Environment Variables"
+msgstr "Variabile de mediu"
+
+msgid "Specifying Single Revisions"
+msgstr "Specificarea reviziilor simple"
+
+msgid "Specifying Multiple Revisions"
+msgstr "Specificarea reviziilor multiple"
+
+msgid "Specifying Revision Sets"
+msgstr "Specificarea seturilor de revizii"
+
+msgid "Diff Formats"
+msgstr "Formate pentru diff"
+
+msgid "Template Usage"
+msgstr "Folosirea șabloanelor"
+
+msgid "URL Paths"
+msgstr "Căi URL"
+
+msgid "Using additional features"
+msgstr "Folosirea facilităților suplimentare"
+
+msgid "Configuring hgweb"
+msgstr "Configurarea hgweb"
+
+msgid "Glossary"
+msgstr "Glosar"
+
+msgid ""
+"Mercurial reads configuration data from several files, if they exist.\n"
+"Below we list the most specific file first."
+msgstr ""
+
+msgid "On Windows, these configuration files are read:"
+msgstr ""
+
+msgid ""
+"- ``<repo>\\.hg\\hgrc``\n"
+"- ``%USERPROFILE%\\.hgrc``\n"
+"- ``%USERPROFILE%\\mercurial.ini``\n"
+"- ``%HOME%\\.hgrc``\n"
+"- ``%HOME%\\mercurial.ini``\n"
+"- ``C:\\mercurial\\mercurial.ini`` (unless regkey or hgrc.d\\ or mercurial."
+"ini found)\n"
+"- ``HKEY_LOCAL_MACHINE\\SOFTWARE\\Mercurial`` (unless hgrc.d\\ or mercurial."
+"ini found)\n"
+"- ``<hg.exe-dir>\\hgrc.d\\*.rc`` (unless mercurial.ini found)\n"
+"- ``<hg.exe-dir>\\mercurial.ini``"
+msgstr ""
+
+msgid "On Unix, these files are read:"
+msgstr ""
+
+msgid ""
+"- ``<repo>/.hg/hgrc``\n"
+"- ``$HOME/.hgrc``\n"
+"- ``/etc/mercurial/hgrc``\n"
+"- ``/etc/mercurial/hgrc.d/*.rc``\n"
+"- ``<install-root>/etc/mercurial/hgrc``\n"
+"- ``<install-root>/etc/mercurial/hgrc.d/*.rc``"
+msgstr ""
+
+msgid ""
+"If there is a per-repository configuration file which is not owned by\n"
+"the active user, Mercurial will warn you that the file is skipped::"
+msgstr ""
+"Dacă există un fișier de configurare la nivelul depozitului care nu\n"
+"este proprietatea utilizatorului activ, Mercurial vă va avertiza că\n"
+"fișierul este omis::"
+
+msgid ""
+"  not trusting file <repo>/.hg/hgrc from untrusted user USER, group GROUP"
+msgstr ""
+
+msgid ""
+"If this bothers you, the warning can be silenced (the file would still\n"
+"be ignored) or trust can be established. Use one of the following\n"
+"settings, the syntax is explained below:"
+msgstr ""
+
+msgid ""
+"- ``ui.report_untrusted = False``\n"
+"- ``trusted.users = USER``\n"
+"- ``trusted.groups = GROUP``"
+msgstr ""
+
+msgid ""
+"The configuration files for Mercurial use a simple ini-file format. A\n"
+"configuration file consists of sections, led by a ``[section]`` header\n"
+"and followed by ``name = value`` entries::"
+msgstr ""
+
+msgid ""
+"  [ui]\n"
+"  username = Firstname Lastname <firstname.lastname@example.net>\n"
+"  verbose = True"
+msgstr ""
+
+msgid ""
+"The above entries will be referred to as ``ui.username`` and\n"
+"``ui.verbose``, respectively. Please see the hgrc man page for a full\n"
+"description of the possible configuration values:"
+msgstr ""
+
+msgid ""
+"- on Unix-like systems: ``man hgrc``\n"
+"- online: http://www.selenic.com/mercurial/hgrc.5.html\n"
+msgstr ""
+
+msgid "Some commands allow the user to specify a date, e.g.:"
+msgstr ""
+
+msgid ""
+"- backout, commit, import, tag: Specify the commit date.\n"
+"- log, revert, update: Select revision(s) by date."
+msgstr ""
+
+msgid "Many date formats are valid. Here are some examples:"
+msgstr ""
+
+msgid ""
+"- ``Wed Dec 6 13:18:29 2006`` (local timezone assumed)\n"
+"- ``Dec 6 13:18 -0600`` (year assumed, time offset provided)\n"
+"- ``Dec 6 13:18 UTC`` (UTC and GMT are aliases for +0000)\n"
+"- ``Dec 6`` (midnight)\n"
+"- ``13:18`` (today assumed)\n"
+"- ``3:39`` (3:39AM assumed)\n"
+"- ``3:39pm`` (15:39)\n"
+"- ``2006-12-06 13:18:29`` (ISO 8601 format)\n"
+"- ``2006-12-6 13:18``\n"
+"- ``2006-12-6``\n"
+"- ``12-6``\n"
+"- ``12/6``\n"
+"- ``12/6/6`` (Dec 6 2006)"
+msgstr ""
+"- ``Wed Dec 6 13:18:29 2006`` (se subînțelege 'ora locală')\n"
+"- ``Dec 6 13:18 -0600`` (se subînțelege anul, diferența de fus orar este "
+"furnizată)\n"
+"- ``Dec 6 13:18 UTC`` (UTC și GMT sunt alias-uri pentru +0000)\n"
+"- ``Dec 6`` (miezul nopții)\n"
+"- ``13:18`` (se subînțelege 'astăzi')\n"
+"- ``3:39`` (se subînțelege 3:39AM)\n"
+"- ``3:39pm`` (15:39)\n"
+"- ``2006-12-06 13:18:29`` (formatul ISO 8601)\n"
+"- ``2006-12-6 13:18``\n"
+"- ``2006-12-6``\n"
+"- ``12-6``\n"
+"- ``12/6``\n"
+"- ``12/6/6`` (Dec 6 2006)"
+
+msgid "Lastly, there is Mercurial's internal format:"
+msgstr ""
+
+msgid "- ``1165432709 0`` (Wed Dec 6 13:18:29 2006 UTC)"
+msgstr ""
+
+msgid ""
+"This is the internal representation format for dates. unixtime is the\n"
+"number of seconds since the epoch (1970-01-01 00:00 UTC). offset is\n"
+"the offset of the local timezone, in seconds west of UTC (negative if\n"
+"the timezone is east of UTC)."
+msgstr ""
+
+msgid "The log command also accepts date ranges:"
+msgstr ""
+
+msgid ""
+"- ``<{datetime}`` - at or before a given date/time\n"
+"- ``>{datetime}`` - on or after a given date/time\n"
+"- ``{datetime} to {datetime}`` - a date range, inclusive\n"
+"- ``-{days}`` - within a given number of days of today\n"
+msgstr ""
+
+msgid ""
+"Mercurial's default format for showing changes between two versions of\n"
+"a file is compatible with the unified format of GNU diff, which can be\n"
+"used by GNU patch and many other standard tools."
+msgstr ""
+
+msgid ""
+"While this standard format is often enough, it does not encode the\n"
+"following information:"
+msgstr ""
+
+msgid ""
+"- executable status and other permission bits\n"
+"- copy or rename information\n"
+"- changes in binary files\n"
+"- creation or deletion of empty files"
+msgstr ""
+
+msgid ""
+"Mercurial also supports the extended diff format from the git VCS\n"
+"which addresses these limitations. The git diff format is not produced\n"
+"by default because a few widespread tools still do not understand this\n"
+"format."
+msgstr ""
+
+msgid ""
+"This means that when generating diffs from a Mercurial repository\n"
+"(e.g. with :hg:`export`), you should be careful about things like file\n"
+"copies and renames or other things mentioned above, because when\n"
+"applying a standard diff to a different repository, this extra\n"
+"information is lost. Mercurial's internal operations (like push and\n"
+"pull) are not affected by this, because they use an internal binary\n"
+"format for communicating changes."
+msgstr ""
+
+msgid ""
+"To make Mercurial produce the git extended diff format, use the --git\n"
+"option available for many commands, or set 'git = True' in the [diff]\n"
+"section of your hgrc. You do not need to set this option when\n"
+"importing diffs in this format or using them in the mq extension.\n"
+msgstr ""
+
+msgid ""
+"HG\n"
+"    Path to the 'hg' executable, automatically passed when running\n"
+"    hooks, extensions or external tools. If unset or empty, this is\n"
+"    the hg executable's name if it's frozen, or an executable named\n"
+"    'hg' (with %PATHEXT% [defaulting to COM/EXE/BAT/CMD] extensions on\n"
+"    Windows) is searched."
+msgstr ""
+
+msgid ""
+"HGEDITOR\n"
+"    This is the name of the editor to run when committing. See EDITOR."
+msgstr ""
+
+msgid "    (deprecated, use .hgrc)"
+msgstr ""
+
+msgid ""
+"HGENCODING\n"
+"    This overrides the default locale setting detected by Mercurial.\n"
+"    This setting is used to convert data including usernames,\n"
+"    changeset descriptions, tag names, and branches. This setting can\n"
+"    be overridden with the --encoding command-line option."
+msgstr ""
+
+msgid ""
+"HGENCODINGMODE\n"
+"    This sets Mercurial's behavior for handling unknown characters\n"
+"    while transcoding user input. The default is \"strict\", which\n"
+"    causes Mercurial to abort if it can't map a character. Other\n"
+"    settings include \"replace\", which replaces unknown characters, and\n"
+"    \"ignore\", which drops them. This setting can be overridden with\n"
+"    the --encodingmode command-line option."
+msgstr ""
+
+msgid ""
+"HGMERGE\n"
+"    An executable to use for resolving merge conflicts. The program\n"
+"    will be executed with three arguments: local file, remote file,\n"
+"    ancestor file."
+msgstr ""
+
+msgid ""
+"HGRCPATH\n"
+"    A list of files or directories to search for hgrc files. Item\n"
+"    separator is \":\" on Unix, \";\" on Windows. If HGRCPATH is not set,\n"
+"    platform default search path is used. If empty, only the .hg/hgrc\n"
+"    from the current repository is read."
+msgstr ""
+
+msgid "    For each element in HGRCPATH:"
+msgstr ""
+
+msgid ""
+"    - if it's a directory, all files ending with .rc are added\n"
+"    - otherwise, the file itself will be added"
+msgstr ""
+
+msgid ""
+"HGPLAIN\n"
+"    When set, this disables any options in .hgrc that might change\n"
+"    Mercurial's default output. This includes encoding, defaults,\n"
+"    verbose mode, debug mode, quiet mode, tracebacks, and\n"
+"    localization. This can be useful when scripting against Mercurial\n"
+"    in the face of existing user configuration."
+msgstr ""
+
+msgid ""
+"    Equivalent options set via command line flags or environment\n"
+"    variables are not overridden."
+msgstr ""
+
+msgid ""
+"HGUSER\n"
+"    This is the string used as the author of a commit. If not set,\n"
+"    available values will be considered in this order:"
+msgstr ""
+
+msgid ""
+"    - HGUSER (deprecated)\n"
+"    - hgrc files from the HGRCPATH\n"
+"    - EMAIL\n"
+"    - interactive prompt\n"
+"    - LOGNAME (with ``@hostname`` appended)"
+msgstr ""
+
+msgid ""
+"EMAIL\n"
+"    May be used as the author of a commit; see HGUSER."
+msgstr ""
+
+msgid ""
+"LOGNAME\n"
+"    May be used as the author of a commit; see HGUSER."
+msgstr ""
+
+msgid ""
+"VISUAL\n"
+"    This is the name of the editor to use when committing. See EDITOR."
+msgstr ""
+
+msgid ""
+"EDITOR\n"
+"    Sometimes Mercurial needs to open a text file in an editor for a\n"
+"    user to modify, for example when writing commit messages. The\n"
+"    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'."
+msgstr ""
+
+msgid ""
+"PYTHONPATH\n"
+"    This is used by Python to find imported modules and may need to be\n"
+"    set appropriately if this Mercurial is not installed system-wide.\n"
+msgstr ""
+
+msgid ""
+"Mercurial has the ability to add new features through the use of\n"
+"extensions. Extensions may add new commands, add options to\n"
+"existing commands, change the default behavior of commands, or\n"
+"implement hooks."
+msgstr ""
+
+msgid ""
+"Extensions are not loaded by default for a variety of reasons:\n"
+"they can increase startup overhead; they may be meant for advanced\n"
+"usage only; they may provide potentially dangerous abilities (such\n"
+"as letting you destroy or modify history); they might not be ready\n"
+"for prime time; or they may alter some usual behaviors of stock\n"
+"Mercurial. It is thus up to the user to activate extensions as\n"
+"needed."
+msgstr ""
+
+msgid ""
+"To enable the \"foo\" extension, either shipped with Mercurial or in\n"
+"the Python search path, create an entry for it in your hgrc, like\n"
+"this::"
+msgstr ""
+
+msgid ""
+"  [extensions]\n"
+"  foo ="
+msgstr ""
+
+msgid "You may also specify the full path to an extension::"
+msgstr ""
+
+msgid ""
+"  [extensions]\n"
+"  myfeature = ~/.hgext/myfeature.py"
+msgstr ""
+
+msgid ""
+"To explicitly disable an extension enabled in an hgrc of broader\n"
+"scope, prepend its path with !::"
+msgstr ""
+
+msgid ""
+"  [extensions]\n"
+"  # disabling extension bar residing in /path/to/extension/bar.py\n"
+"  bar = !/path/to/extension/bar.py\n"
+"  # ditto, but no path was supplied for extension baz\n"
+"  baz = !\n"
+msgstr ""
+
+msgid ""
+"Ancestor\n"
+"    Any changeset that can be reached by an unbroken chain of parent\n"
+"    changesets from a given changeset. More precisely, the ancestors\n"
+"    of a changeset can be defined by two properties: a parent of a\n"
+"    changeset is an ancestor, and a parent of an ancestor is an\n"
+"    ancestor. See also: 'Descendant'."
+msgstr ""
+
+msgid ""
+"Branch\n"
+"    (Noun) A child changeset that has been created from a parent that\n"
+"    is not a head. These are known as topological branches, see\n"
+"    'Branch, topological'. If a topological branch is named, it becomes\n"
+"    a named branch. If a topological branch is not named, it becomes\n"
+"    an anonymous branch. See 'Branch, anonymous' and 'Branch, named'."
+msgstr ""
+
+msgid ""
+"    Branches may be created when changes are pulled from or pushed to\n"
+"    a remote repository, since new heads may be created by these\n"
+"    operations. Note that the term branch can also be used informally\n"
+"    to describe a development process in which certain development is\n"
+"    done independently of other development. This is sometimes done\n"
+"    explicitly with a named branch, but it can also be done locally,\n"
+"    using bookmarks or clones and anonymous branches."
+msgstr ""
+
+msgid "    Example: \"The experimental branch\"."
+msgstr ""
+
+msgid ""
+"    (Verb) The action of creating a child changeset which results in\n"
+"    its parent having more than one child."
+msgstr ""
+
+msgid "    Example: \"I'm going to branch at X\"."
+msgstr ""
+
+msgid ""
+"Branch, anonymous\n"
+"    Every time a new child changeset is created from a parent that is not\n"
+"    a head and the name of the branch is not changed, a new anonymous\n"
+"    branch is created."
+msgstr ""
+
+msgid ""
+"Branch, closed\n"
+"    A named branch whose branch heads have all been closed."
+msgstr ""
+
+msgid ""
+"Branch, default\n"
+"    The branch assigned to a changeset when no name has previously been\n"
+"    assigned."
+msgstr ""
+
+msgid ""
+"Branch head\n"
+"    See 'Head, branch'."
+msgstr ""
+
+msgid ""
+"Branch, inactive\n"
+"    If a named branch has no topological heads, it is considered to be\n"
+"    inactive. As an example, a feature branch becomes inactive when it\n"
+"    is merged into the default branch. The :hg:`branches` command\n"
+"    shows inactive branches by default, though they can be hidden with\n"
+"    :hg:`branches --active`."
+msgstr ""
+
+msgid ""
+"    NOTE: this concept is deprecated because it is too implicit.\n"
+"    Branches should now be explicitly closed using :hg:`commit\n"
+"    --close-branch` when they are no longer needed."
+msgstr ""
+
+msgid ""
+"Branch, named\n"
+"    A collection of changesets which have the same branch name. By\n"
+"    default, children of a changeset in a named branch belong to the\n"
+"    same named branch. A child can be explicitly assigned to a\n"
+"    different branch. See :hg:`help branch`, :hg:`help branches` and\n"
+"    :hg:`commit --close-branch` for more information on managing\n"
+"    branches."
+msgstr ""
+
+msgid ""
+"    Named branches can be thought of as a kind of namespace, dividing\n"
+"    the collection of changesets that comprise the repository into a\n"
+"    collection of disjoint subsets. A named branch is not necessarily\n"
+"    a topological branch. If a new named branch is created from the\n"
+"    head of another named branch, or the default branch, but no\n"
+"    further changesets are added to that previous branch, then that\n"
+"    previous branch will be a branch in name only."
+msgstr ""
+
+msgid ""
+"Branch tip\n"
+"    See 'Tip, branch'."
+msgstr ""
+
+msgid ""
+"Branch, topological\n"
+"    Every time a new child changeset is created from a parent that is\n"
+"    not a head, a new topological branch is created. If a topological\n"
+"    branch is named, it becomes a named branch. If a topological\n"
+"    branch is not named, it becomes an anonymous branch of the\n"
+"    current, possibly default, branch."
+msgstr ""
+
+msgid ""
+"Changelog\n"
+"    A record of the changesets in the order in which they were added\n"
+"    to the repository. This includes details such as changeset id,\n"
+"    author, commit message, date, and list of changed files."
+msgstr ""
+
+msgid ""
+"Changeset\n"
+"    A snapshot of the state of the repository used to record a change."
+msgstr ""
+
+msgid ""
+"Changeset, child\n"
+"    The converse of parent changeset: if P is a parent of C, then C is\n"
+"    a child of P. There is no limit to the number of children that a\n"
+"    changeset may have."
+msgstr ""
+
+msgid ""
+"Changeset id\n"
+"    A SHA-1 hash that uniquely identifies a changeset. It may be\n"
+"    represented as either a \"long\" 40 hexadecimal digit string, or a\n"
+"    \"short\" 12 hexadecimal digit string."
+msgstr ""
+
+msgid ""
+"Changeset, merge\n"
+"    A changeset with two parents. This occurs when a merge is\n"
+"    committed."
+msgstr ""
+
+msgid ""
+"Changeset, parent\n"
+"    A revision upon which a child changeset is based. Specifically, a\n"
+"    parent changeset of a changeset C is a changeset whose node\n"
+"    immediately precedes C in the DAG. Changesets have at most two\n"
+"    parents."
+msgstr ""
+
+msgid ""
+"Checkout\n"
+"    (Noun) The working directory being updated to a specific\n"
+"    revision. This use should probably be avoided where possible, as\n"
+"    changeset is much more appropriate than checkout in this context."
+msgstr ""
+
+msgid "    Example: \"I'm using checkout X.\""
+msgstr ""
+
+msgid ""
+"    (Verb) Updating the working directory to a specific changeset. See\n"
+"    :hg:`help update`."
+msgstr ""
+
+msgid "    Example: \"I'm going to check out changeset X.\""
+msgstr ""
+
+msgid ""
+"Child changeset\n"
+"    See 'Changeset, child'."
+msgstr ""
+
+msgid ""
+"Close changeset\n"
+"    See 'Changeset, close'."
+msgstr ""
+
+msgid ""
+"Closed branch\n"
+"    See 'Branch, closed'."
+msgstr ""
+
+msgid ""
+"Clone\n"
+"    (Noun) An entire or partial copy of a repository. The partial\n"
+"    clone must be in the form of a revision and its ancestors."
+msgstr ""
+
+msgid "    Example: \"Is your clone up to date?\"."
+msgstr ""
+
+msgid "    (Verb) The process of creating a clone, using :hg:`clone`."
+msgstr ""
+
+msgid "    Example: \"I'm going to clone the repository\"."
+msgstr ""
+
+msgid ""
+"Closed branch head\n"
+"    See 'Head, closed branch'."
+msgstr ""
+
+msgid ""
+"Commit\n"
+"    (Noun) A synonym for changeset."
+msgstr ""
+
+msgid "    Example: \"Is the bug fixed in your recent commit?\""
+msgstr ""
+
+msgid ""
+"    (Verb) The act of recording changes to a repository. When files\n"
+"    are committed in a working directory, Mercurial finds the\n"
+"    differences between the committed files and their parent\n"
+"    changeset, creating a new changeset in the repository."
+msgstr ""
+
+msgid "    Example: \"You should commit those changes now.\""
+msgstr ""
+
+msgid ""
+"Cset\n"
+"    A common abbreviation of the term changeset."
+msgstr ""
+
+msgid ""
+"DAG\n"
+"    The repository of changesets of a distributed version control\n"
+"    system (DVCS) can be described as a directed acyclic graph (DAG),\n"
+"    consisting of nodes and edges, where nodes correspond to\n"
+"    changesets and edges imply a parent -> child relation. This graph\n"
+"    can be visualized by graphical tools such as :hg:`glog`\n"
+"    (graphlog). In Mercurial, the DAG is limited by the requirement\n"
+"    for children to have at most two parents."
+msgstr ""
+
+msgid ""
+"Default branch\n"
+"    See 'Branch, default'."
+msgstr ""
+
+msgid ""
+"Descendant\n"
+"    Any changeset that can be reached by a chain of child changesets\n"
+"    from a given changeset. More precisely, the descendants of a\n"
+"    changeset can be defined by two properties: the child of a\n"
+"    changeset is a descendant, and the child of a descendant is a\n"
+"    descendant. See also: 'Ancestor'."
+msgstr ""
+
+msgid ""
+"Diff\n"
+"    (Noun) The difference between the contents and attributes of files\n"
+"    in two changesets or a changeset and the current working\n"
+"    directory. The difference is usually represented in a standard\n"
+"    form called a \"diff\" or \"patch\". The \"git diff\" format is used\n"
+"    when the changes include copies, renames, or changes to file\n"
+"    attributes, none of which can be represented/handled by classic\n"
+"    \"diff\" and \"patch\"."
+msgstr ""
+
+msgid "    Example: \"Did you see my correction in the diff?\""
+msgstr ""
+
+msgid ""
+"    (Verb) Diffing two changesets is the action of creating a diff or\n"
+"    patch."
+msgstr ""
+
+msgid ""
+"    Example: \"If you diff with changeset X, you will see what I mean.\""
+msgstr ""
+
+msgid ""
+"Directory, working\n"
+"    The working directory represents the state of the files tracked by\n"
+"    Mercurial, that will be recorded in the next commit. The working\n"
+"    directory initially corresponds to the snapshot at an existing\n"
+"    changeset, known as the parent of the working directory. See\n"
+"    'Parent, working directory'. The state may be modified by changes\n"
+"    to the files introduced manually or by a merge. The repository\n"
+"    metadata exists in the .hg directory inside the working directory."
+msgstr ""
+
+msgid ""
+"Graph\n"
+"    See DAG and :hg:`help graphlog`."
+msgstr ""
+
+msgid ""
+"Head\n"
+"    The term 'head' may be used to refer to both a branch head or a\n"
+"    repository head, depending on the context. See 'Head, branch' and\n"
+"    'Head, repository' for specific definitions."
+msgstr ""
+
+msgid ""
+"    Heads are where development generally takes place and are the\n"
+"    usual targets for update and merge operations."
+msgstr ""
+
+msgid ""
+"Head, branch\n"
+"    A changeset with no descendants on the same named branch."
+msgstr ""
+
+msgid ""
+"Head, closed branch\n"
+"    A changeset that marks a head as no longer interesting. The closed\n"
+"    head is no longer listed by :hg:`heads`. A branch is considered\n"
+"    closed when all its heads are closed and consequently is not\n"
+"    listed by :hg:`branches`."
+msgstr ""
+
+msgid ""
+"Head, repository\n"
+"    A topological head which has not been closed."
+msgstr ""
+
+msgid ""
+"Head, topological\n"
+"    A changeset with no children in the repository."
+msgstr ""
+
+msgid ""
+"History, immutable\n"
+"    Once committed, changesets cannot be altered.  Extensions which\n"
+"    appear to change history actually create new changesets that\n"
+"    replace existing ones, and then destroy the old changesets. Doing\n"
+"    so in public repositories can result in old changesets being\n"
+"    reintroduced to the repository."
+msgstr ""
+
+msgid ""
+"History, rewriting\n"
+"    The changesets in a repository are immutable. However, extensions\n"
+"    to Mercurial can be used to alter the repository, usually in such\n"
+"    a way as to preserve changeset contents."
+msgstr ""
+
+msgid ""
+"Immutable history\n"
+"    See 'History, immutable'."
+msgstr ""
+
+msgid ""
+"Merge changeset\n"
+"    See 'Changeset, merge'."
+msgstr ""
+
+msgid ""
+"Manifest\n"
+"    Each changeset has a manifest, which is the list of files that are\n"
+"    tracked by the changeset."
+msgstr ""
+
+msgid ""
+"Merge\n"
+"    Used to bring together divergent branches of work. When you update\n"
+"    to a changeset and then merge another changeset, you bring the\n"
+"    history of the latter changeset into your working directory. Once\n"
+"    conflicts are resolved (and marked), this merge may be committed\n"
+"    as a merge changeset, bringing two branches together in the DAG."
+msgstr ""
+
+msgid ""
+"Named branch\n"
+"    See 'Branch, named'."
+msgstr ""
+
+msgid ""
+"Null changeset\n"
+"    The empty changeset. It is the parent state of newly-initialized\n"
+"    repositories and repositories with no checked out revision. It is\n"
+"    thus the parent of root changesets and the effective ancestor when\n"
+"    merging unrelated changesets. Can be specified by the alias 'null'\n"
+"    or by the changeset ID '000000000000'."
+msgstr ""
+
+msgid ""
+"Parent\n"
+"    See 'Changeset, parent'."
+msgstr ""
+
+msgid ""
+"Parent changeset\n"
+"    See 'Changeset, parent'."
+msgstr ""
+
+msgid ""
+"Parent, working directory\n"
+"    The working directory parent reflects a virtual revision which is\n"
+"    the child of the changeset (or two changesets with an uncommitted\n"
+"    merge) shown by :hg:`parents`. This is changed with\n"
+"    :hg:`update`. Other commands to see the working directory parent\n"
+"    are :hg:`summary` and :hg:`id`. Can be specified by the alias \".\"."
+msgstr ""
+
+msgid ""
+"Patch\n"
+"    (Noun) The product of a diff operation."
+msgstr ""
+
+msgid "    Example: \"I've sent you my patch.\""
+msgstr ""
+
+msgid ""
+"    (Verb) The process of using a patch file to transform one\n"
+"    changeset into another."
+msgstr ""
+
+msgid "    Example: \"You will need to patch that revision.\""
+msgstr ""
+
+msgid ""
+"Pull\n"
+"    An operation in which changesets in a remote repository which are\n"
+"    not in the local repository are brought into the local\n"
+"    repository. Note that this operation without special arguments\n"
+"    only updates the repository, it does not update the files in the\n"
+"    working directory. See :hg:`help pull`."
+msgstr ""
+
+msgid ""
+"Push\n"
+"    An operation in which changesets in a local repository which are\n"
+"    not in a remote repository are sent to the remote repository. Note\n"
+"    that this operation only adds changesets which have been committed\n"
+"    locally to the remote repository. Uncommitted changes are not\n"
+"    sent. See :hg:`help push`."
+msgstr ""
+
+msgid ""
+"Repository\n"
+"    The metadata describing all recorded states of a collection of\n"
+"    files. Each recorded state is represented by a changeset. A\n"
+"    repository is usually (but not always) found in the ``.hg``\n"
+"    subdirectory of a working directory. Any recorded state can be\n"
+"    recreated by \"updating\" a working directory to a specific\n"
+"    changeset."
+msgstr ""
+
+msgid ""
+"Repository head\n"
+"    See 'Head, repository'."
+msgstr ""
+
+msgid ""
+"Revision\n"
+"    A state of the repository at some point in time. Earlier revisions\n"
+"    can be updated to by using :hg:`update`.  See also 'Revision\n"
+"    number'; See also 'Changeset'."
+msgstr ""
+
+msgid ""
+"Revision number\n"
+"    This integer uniquely identifies a changeset in a specific\n"
+"    repository. It represents the order in which changesets were added\n"
+"    to a repository, starting with revision number 0. Note that the\n"
+"    revision number may be different in each clone of a repository. To\n"
+"    identify changesets uniquely between different clones, see\n"
+"    'Changeset id'."
+msgstr ""
+
+msgid ""
+"Revlog\n"
+"    History storage mechanism used by Mercurial. It is a form of delta\n"
+"    encoding, with occasional full revision of data followed by delta\n"
+"    of each successive revision. It includes data and an index\n"
+"    pointing to the data."
+msgstr ""
+
+msgid ""
+"Rewriting history\n"
+"    See 'History, rewriting'."
+msgstr ""
+
+msgid ""
+"Root\n"
+"    A changeset that has only the null changeset as its parent. Most\n"
+"    repositories have only a single root changeset."
+msgstr ""
+
+msgid ""
+"Tip\n"
+"    The changeset with the highest revision number. It is the changeset\n"
+"    most recently added in a repository."
+msgstr ""
+
+msgid ""
+"Tip, branch\n"
+"    The head of a given branch with the highest revision number. When\n"
+"    a branch name is used as a revision identifier, it refers to the\n"
+"    branch tip. See also 'Branch, head'. Note that because revision\n"
+"    numbers may be different in different repository clones, the\n"
+"    branch tip may be different in different cloned repositories."
+msgstr ""
+
+msgid ""
+"Update\n"
+"    (Noun) Another synonym of changeset."
+msgstr ""
+
+msgid "    Example: \"I've pushed an update\"."
+msgstr ""
+
+msgid ""
+"    (Verb) This term is usually used to describe updating the state of\n"
+"    the working directory to that of a specific changeset. See\n"
+"    :hg:`help update`."
+msgstr ""
+
+msgid "    Example: \"You should update\"."
+msgstr ""
+
+msgid ""
+"Working directory\n"
+"    See 'Directory, working'."
+msgstr ""
+
+msgid ""
+"Working directory parent\n"
+"    See 'Parent, working directory'.\n"
+msgstr ""
+
+msgid ""
+"Mercurial's internal web server, hgweb, can serve either a single\n"
+"repository, or a collection of them. In the latter case, a special\n"
+"configuration file can be used to specify the repository paths to use\n"
+"and global web configuration options."
+msgstr ""
+
+msgid ""
+"This file uses the same syntax as hgrc configuration files, but only\n"
+"the following sections are recognized:"
+msgstr ""
+
+msgid ""
+"  - web\n"
+"  - paths\n"
+"  - collections"
+msgstr ""
+
+msgid ""
+"The ``web`` section can specify all the settings described in the web\n"
+"section of the hgrc documentation."
+msgstr ""
+
+msgid ""
+"The ``paths`` section provides mappings of physical repository\n"
+"paths to virtual ones. For instance::"
+msgstr ""
+
+msgid ""
+"  [paths]\n"
+"  projects/a = /foo/bar\n"
+"  projects/b = /baz/quux\n"
+"  web/root = /real/root/*\n"
+"  / = /real/root2/*\n"
+"  virtual/root2 = /real/root2/**"
+msgstr ""
+
+msgid ""
+"- The first two entries make two repositories in different directories\n"
+"  appear under the same directory in the web interface\n"
+"- The third entry maps every Mercurial repository found in '/real/root'\n"
+"  into 'web/root'. This format is preferred over the [collections] one,\n"
+"  since using absolute paths as configuration keys is not supported on "
+"every\n"
+"  platform (especially on Windows).\n"
+"- The fourth entry is a special case mapping all repositories in\n"
+"  '/real/root2' in the root of the virtual directory.\n"
+"- The fifth entry recursively finds all repositories under the real\n"
+"  root, and maps their relative paths under the virtual root."
+msgstr ""
+
+msgid ""
+"The ``collections`` section provides mappings of trees of physical\n"
+"repositories paths to virtual ones, though the paths syntax is generally\n"
+"preferred. For instance::"
+msgstr ""
+
+msgid ""
+"  [collections]\n"
+"  /foo = /foo"
+msgstr ""
+
+msgid ""
+"Here, the left side will be stripped off all repositories found in the\n"
+"right side. Thus ``/foo/bar`` and ``foo/quux/baz`` will be listed as\n"
+"``bar`` and ``quux/baz`` respectively.\n"
+msgstr ""
+
+msgid ""
+"When Mercurial accepts more than one revision, they may be specified\n"
+"individually, or provided as a topologically continuous range,\n"
+"separated by the \":\" character."
+msgstr ""
+
+msgid ""
+"The syntax of range notation is [BEGIN]:[END], where BEGIN and END are\n"
+"revision identifiers. Both BEGIN and END are optional. If BEGIN is not\n"
+"specified, it defaults to revision number 0. If END is not specified,\n"
+"it defaults to the tip. The range \":\" thus means \"all revisions\"."
+msgstr ""
+
+msgid "If BEGIN is greater than END, revisions are treated in reverse order."
+msgstr ""
+
+msgid ""
+"A range acts as a closed interval. This means that a range of 3:5\n"
+"gives 3, 4 and 5. Similarly, a range of 9:6 gives 9, 8, 7, and 6.\n"
+msgstr ""
+
+msgid ""
+"Mercurial accepts several notations for identifying one or more files\n"
+"at a time."
+msgstr ""
+
+msgid ""
+"By default, Mercurial treats filenames as shell-style extended glob\n"
+"patterns."
+msgstr ""
+
+msgid "Alternate pattern notations must be specified explicitly."
+msgstr ""
+
+msgid ""
+"To use a plain path name without any pattern matching, start it with\n"
+"``path:``. These path names must completely match starting at the\n"
+"current repository root."
+msgstr ""
+
+msgid ""
+"To use an extended glob, start a name with ``glob:``. Globs are rooted\n"
+"at the current directory; a glob such as ``*.c`` will only match files\n"
+"in the current directory ending with ``.c``."
+msgstr ""
+
+msgid ""
+"The supported glob syntax extensions are ``**`` to match any string\n"
+"across path separators and ``{a,b}`` to mean \"a or b\"."
+msgstr ""
+
+msgid ""
+"To use a Perl/Python regular expression, start a name with ``re:``.\n"
+"Regexp pattern matching is anchored at the root of the repository."
+msgstr ""
+
+msgid "Plain examples::"
+msgstr ""
+
+msgid ""
+"  path:foo/bar   a name bar in a directory named foo in the root\n"
+"                 of the repository\n"
+"  path:path:name a file or directory named \"path:name\""
+msgstr ""
+
+msgid "Glob examples::"
+msgstr ""
+
+msgid ""
+"  glob:*.c       any name ending in \".c\" in the current directory\n"
+"  *.c            any name ending in \".c\" in the current directory\n"
+"  **.c           any name ending in \".c\" in any subdirectory of the\n"
+"                 current directory including itself.\n"
+"  foo/*.c        any name ending in \".c\" in the directory foo\n"
+"  foo/**.c       any name ending in \".c\" in any subdirectory of foo\n"
+"                 including itself."
+msgstr ""
+
+msgid "Regexp examples::"
+msgstr ""
+
+msgid ""
+"  re:.*\\.c$      any name ending in \".c\", anywhere in the repository\n"
+msgstr ""
+
+msgid "Mercurial supports several ways to specify individual revisions."
+msgstr ""
+
+msgid ""
+"A plain integer is treated as a revision number. Negative integers are\n"
+"treated as sequential offsets from the tip, with -1 denoting the tip,\n"
+"-2 denoting the revision prior to the tip, and so forth."
+msgstr ""
+
+msgid ""
+"A 40-digit hexadecimal string is treated as a unique revision\n"
+"identifier."
+msgstr ""
+
+msgid ""
+"A hexadecimal string less than 40 characters long is treated as a\n"
+"unique revision identifier and is referred to as a short-form\n"
+"identifier. A short-form identifier is only valid if it is the prefix\n"
+"of exactly one full-length identifier."
+msgstr ""
+
+msgid ""
+"Any other string is treated as a tag or branch name. A tag name is a\n"
+"symbolic name associated with a revision identifier. A branch name\n"
+"denotes the tipmost revision of that branch. Tag and branch names must\n"
+"not contain the \":\" character."
+msgstr ""
+
+msgid ""
+"The reserved name \"tip\" is a special tag that always identifies the\n"
+"most recent revision."
+msgstr ""
+
+msgid ""
+"The reserved name \"null\" indicates the null revision. This is the\n"
+"revision of an empty repository, and the parent of revision 0."
+msgstr ""
+
+msgid ""
+"The reserved name \".\" indicates the working directory parent. If no\n"
+"working directory is checked out, it is equivalent to null. If an\n"
+"uncommitted merge is in progress, \".\" is the revision of the first\n"
+"parent.\n"
+msgstr ""
+
+msgid ""
+"Mercurial supports a functional language for selecting a set of\n"
+"revisions."
+msgstr ""
+
+msgid ""
+"The language supports a number of predicates which are joined by infix\n"
+"operators. Parenthesis can be used for grouping."
+msgstr ""
+
+msgid ""
+"Identifiers such as branch names must be quoted with single or double\n"
+"quotes if they contain characters outside of\n"
+"``[._a-zA-Z0-9\\x80-\\xff]`` or if they match one of the predefined\n"
+"predicates. Special characters can be used in quoted identifiers by\n"
+"escaping them, e.g., ``\\n`` is interpreted as a newline."
+msgstr ""
+
+msgid "There is a single prefix operator:"
+msgstr ""
+
+msgid ""
+"``not x``\n"
+"  Changesets not in x. Short form is ``! x``."
+msgstr ""
+
+msgid "These are the supported infix operators:"
+msgstr ""
+
+msgid ""
+"``x::y``\n"
+"  A DAG range, meaning all changesets that are descendants of x and\n"
+"  ancestors of y, including x and y themselves. If the first endpoint\n"
+"  is left out, this is equivalent to ``ancestors(y)``, if the second\n"
+"  is left out it is equivalent to ``descendants(x)``."
+msgstr ""
+
+msgid "  An alternative syntax is ``x..y``."
+msgstr ""
+
+msgid ""
+"``x:y``\n"
+"  All changesets with revision numbers between x and y, both\n"
+"  inclusive. Either endpoint can be left out, they default to 0 and\n"
+"  tip."
+msgstr ""
+
+msgid ""
+"``x and y``\n"
+"  The intersection of changesets in x and y. Short form is ``x & y``."
+msgstr ""
+
+msgid ""
+"``x or y``\n"
+"  The union of changesets in x and y. There are two alternative short\n"
+"  forms: ``x | y`` and ``x + y``."
+msgstr ""
+
+msgid ""
+"``x - y``\n"
+"  Changesets in x but not in y."
+msgstr ""
+
+msgid "The following predicates are supported:"
+msgstr ""
+
+msgid ""
+"``adds(pattern)``\n"
+"  Changesets that add a file matching pattern."
+msgstr ""
+
+msgid ""
+"``all()``\n"
+"  All changesets, the same as ``0:tip``."
+msgstr ""
+
+msgid ""
+"``ancestor(single, single)``\n"
+"  Greatest common ancestor of the two changesets."
+msgstr ""
+
+msgid ""
+"``ancestors(set)``\n"
+"  Changesets that are ancestors of a changeset in set."
+msgstr ""
+
+msgid ""
+"``author(string)``\n"
+"  Alias for ``user(string)``."
+msgstr ""
+
+msgid ""
+"``branch(set)``\n"
+"  All changesets belonging to the branches of changesets in set."
+msgstr ""
+
+msgid ""
+"``children(set)``\n"
+"  Child changesets of changesets in set."
+msgstr ""
+
+msgid ""
+"``closed()``\n"
+"  Changeset is closed."
+msgstr ""
+
+msgid ""
+"``contains(pattern)``\n"
+"  Revision contains pattern."
+msgstr ""
+
+msgid ""
+"``date(interval)``\n"
+"  Changesets within the interval, see :hg:`help dates`."
+msgstr ""
+
+msgid ""
+"``descendants(set)``\n"
+"  Changesets which are descendants of changesets in set."
+msgstr ""
+
+msgid ""
+"``file(pattern)``\n"
+"  Changesets affecting files matched by pattern."
+msgstr ""
+
+msgid ""
+"``follow()``\n"
+"  An alias for ``::.`` (ancestors of the working copy's first parent)."
+msgstr ""
+
+msgid ""
+"``grep(regex)``\n"
+"  Like ``keyword(string)`` but accepts a regex."
+msgstr ""
+
+msgid ""
+"``head()``\n"
+"  Changeset is a head."
+msgstr ""
+
+msgid ""
+"``heads(set)``\n"
+"  Members of set with no children in set."
+msgstr ""
+
+msgid ""
+"``keyword(string)``\n"
+"  Search commit message, user name, and names of changed files for\n"
+"  string."
+msgstr ""
+
+msgid ""
+"``limit(set, n)``\n"
+"  First n members of set."
+msgstr ""
+
+msgid ""
+"``max(set)``\n"
+"  Changeset with highest revision number in set."
+msgstr ""
+
+msgid ""
+"``min(set)``\n"
+"  Changeset with lowest revision number in set."
+msgstr ""
+
+msgid ""
+"``merge()``\n"
+"  Changeset is a merge changeset."
+msgstr ""
+
+msgid ""
+"``modifies(pattern)``\n"
+"  Changesets modifying files matched by pattern."
+msgstr ""
+
+msgid ""
+"``outgoing([path])``\n"
+"  Changesets not found in the specified destination repository, or the\n"
+"  default push location."
+msgstr ""
+"``outgoing([cale])``\n"
+"  Nu s-au găsit seturi de modificări în depozitul destinație specificat\n"
+"  sau în amplasarea implicită pentru `push`."
+
+msgid ""
+"``p1(set)``\n"
+"  First parent of changesets in set."
+msgstr ""
+
+msgid ""
+"``p2(set)``\n"
+"  Second parent of changesets in set."
+msgstr ""
+
+msgid ""
+"``parents(set)``\n"
+"  The set of all parents for all changesets in set."
+msgstr ""
+
+msgid ""
+"``present(set)``\n"
+"  An empty set, if any revision in set isn't found; otherwise,\n"
+"  all revisions in set."
+msgstr ""
+
+msgid ""
+"``removes(pattern)``\n"
+"  Changesets which remove files matching pattern."
+msgstr ""
+
+msgid ""
+"``reverse(set)``\n"
+"  Reverse order of set."
+msgstr ""
+
+msgid ""
+"``roots(set)``\n"
+"  Changesets with no parent changeset in set."
+msgstr ""
+
+msgid ""
+"``sort(set[, [-]key...])``\n"
+"  Sort set by keys. The default sort order is ascending, specify a key\n"
+"  as ``-key`` to sort in descending order."
+msgstr ""
+
+msgid "  The keys can be:"
+msgstr ""
+
+msgid ""
+"  - ``rev`` for the revision number,\n"
+"  - ``branch`` for the branch name,\n"
+"  - ``desc`` for the commit message (description),\n"
+"  - ``user`` for user name (``author`` can be used as an alias),\n"
+"  - ``date`` for the commit date"
+msgstr ""
+
+msgid ""
+"``tagged()``\n"
+"  Changeset is tagged."
+msgstr ""
+
+msgid ""
+"``user(string)``\n"
+"  User name is string."
+msgstr ""
+
+msgid "Command line equivalents for :hg:`log`::"
+msgstr ""
+
+msgid ""
+"  -f    ->  ::.\n"
+"  -d x  ->  date(x)\n"
+"  -k x  ->  keyword(x)\n"
+"  -m    ->  merge()\n"
+"  -u x  ->  user(x)\n"
+"  -b x  ->  branch(x)\n"
+"  -P x  ->  !::x\n"
+"  -l x  ->  limit(expr, x)"
+msgstr ""
+
+msgid "Some sample queries::"
+msgstr ""
+
+msgid ""
+"  hg log -r 'branch(default)'\n"
+"  hg log -r 'branch(default) and 1.5:: and not merge()'\n"
+"  hg log -r '1.3::1.5 and keyword(bug) and file(\"hgext/*\")'\n"
+"  hg log -r 'sort(date(\"May 2008\"), user)'\n"
+"  hg log -r '(keyword(bug) or keyword(issue)) and not ancestors(tagged())'\n"
+msgstr ""
+
+msgid ""
+"Mercurial allows you to customize output of commands through\n"
+"templates. You can either pass in a template from the command\n"
+"line, via the --template option, or select an existing\n"
+"template-style (--style)."
+msgstr ""
+
+msgid ""
+"You can customize output for any \"log-like\" command: log,\n"
+"outgoing, incoming, tip, parents, heads and glog."
+msgstr ""
+
+msgid ""
+"Four styles are packaged with Mercurial: default (the style used\n"
+"when no explicit preference is passed), compact, changelog,\n"
+"and xml.\n"
+"Usage::"
+msgstr ""
+
+msgid "    $ hg log -r1 --style changelog"
+msgstr ""
+
+msgid ""
+"A template is a piece of text, with markup to invoke variable\n"
+"expansion::"
+msgstr ""
+
+msgid ""
+"    $ hg log -r1 --template \"{node}\\n\"\n"
+"    b56ce7b07c52de7d5fd79fb89701ea538af65746"
+msgstr ""
+
+msgid ""
+"Strings in curly braces are called keywords. The availability of\n"
+"keywords depends on the exact context of the templater. These\n"
+"keywords are usually available for templating a log-like command:"
+msgstr ""
+
+msgid ":author: String. The unmodified author of the changeset."
+msgstr ""
+
+msgid ""
+":branches: String. The name of the branch on which the changeset was\n"
+"    committed. Will be empty if the branch name was default."
+msgstr ""
+
+msgid ":children: List of strings. The children of the changeset."
+msgstr ""
+
+msgid ":date: Date information. The date when the changeset was committed."
+msgstr ""
+
+msgid ":desc: String. The text of the changeset description."
+msgstr ""
+
+msgid ""
+":diffstat: String. Statistics of changes with the following format:\n"
+"    \"modified files: +added/-removed lines\""
+msgstr ""
+
+msgid ""
+":files: List of strings. All files modified, added, or removed by this\n"
+"    changeset."
+msgstr ""
+
+msgid ":file_adds: List of strings. Files added by this changeset."
+msgstr ""
+
+msgid ""
+":file_copies: List of strings. Files copied in this changeset with\n"
+"    their sources."
+msgstr ""
+
+msgid ""
+":file_copies_switch: List of strings. Like \"file_copies\" but displayed\n"
+"    only if the --copied switch is set."
+msgstr ""
+
+msgid ":file_mods: List of strings. Files modified by this changeset."
+msgstr ""
+
+msgid ":file_dels: List of strings. Files removed by this changeset."
+msgstr ""
+
+msgid ""
+":node: String. The changeset identification hash, as a 40 hexadecimal\n"
+"    digit string."
+msgstr ""
+
+msgid ":parents: List of strings. The parents of the changeset."
+msgstr ""
+
+msgid ":rev: Integer. The repository-local changeset revision number."
+msgstr ""
+
+msgid ":tags: List of strings. Any tags associated with the changeset."
+msgstr ""
+
+msgid ""
+":latesttag: String. Most recent global tag in the ancestors of this\n"
+"    changeset."
+msgstr ""
+
+msgid ":latesttagdistance: Integer. Longest path to the latest tag."
+msgstr ""
+
+msgid ""
+"The \"date\" keyword does not produce human-readable output. If you\n"
+"want to use a date in your output, you can use a filter to process\n"
+"it. Filters are functions which return a string based on the input\n"
+"variable. Be sure to use the stringify filter first when you're\n"
+"applying a string-input filter to a list-like input variable.\n"
+"You can also use a chain of filters to get the desired output::"
+msgstr ""
+
+msgid ""
+"   $ hg tip --template \"{date|isodate}\\n\"\n"
+"   2008-08-21 18:22 +0000"
+msgstr ""
+
+msgid "List of filters:"
+msgstr ""
+
+msgid ""
+":addbreaks: Any text. Add an XHTML \"<br />\" tag before the end of\n"
+"    every line except the last."
+msgstr ""
+
+msgid ""
+":age: Date. Returns a human-readable date/time difference between the\n"
+"    given date/time and the current date/time."
+msgstr ""
+
+msgid ""
+":basename: Any text. Treats the text as a path, and returns the last\n"
+"    component of the path after splitting by the path separator\n"
+"    (ignoring trailing separators). For example, \"foo/bar/baz\" becomes\n"
+"    \"baz\" and \"foo/bar//\" becomes \"bar\"."
+msgstr ""
+
+msgid ""
+":stripdir: Treat the text as path and strip a directory level, if\n"
+"    possible. For example, \"foo\" and \"foo/bar\" becomes \"foo\"."
+msgstr ""
+
+msgid ""
+":date: Date. Returns a date in a Unix date format, including the\n"
+"    timezone: \"Mon Sep 04 15:13:13 2006 0700\"."
+msgstr ""
+
+msgid ""
+":domain: Any text. Finds the first string that looks like an email\n"
+"    address, and extracts just the domain component. Example: ``User\n"
+"    <user@example.com>`` becomes ``example.com``."
+msgstr ""
+
+msgid ""
+":email: Any text. Extracts the first string that looks like an email\n"
+"    address. Example: ``User <user@example.com>`` becomes\n"
+"    ``user@example.com``."
+msgstr ""
+
+msgid ""
+":escape: Any text. Replaces the special XML/XHTML characters \"&\", \"<\"\n"
+"    and \">\" with XML entities."
+msgstr ""
+
+msgid ":fill68: Any text. Wraps the text to fit in 68 columns."
+msgstr ""
+
+msgid ":fill76: Any text. Wraps the text to fit in 76 columns."
+msgstr ""
+
+msgid ":firstline: Any text. Returns the first line of text."
+msgstr ""
+
+msgid ":nonempty: Any text. Returns '(none)' if the string is empty."
+msgstr ""
+
+msgid ""
+":hgdate: Date. Returns the date as a pair of numbers: \"1157407993\n"
+"    25200\" (Unix timestamp, timezone offset)."
+msgstr ""
+
+msgid ""
+":isodate: Date. Returns the date in ISO 8601 format: \"2009-08-18 13:00\n"
+"    +0200\"."
+msgstr ""
+
+msgid ""
+":isodatesec: Date. Returns the date in ISO 8601 format, including\n"
+"    seconds: \"2009-08-18 13:00:13 +0200\". See also the rfc3339date\n"
+"    filter."
+msgstr ""
+
+msgid ":localdate: Date. Converts a date to local date."
+msgstr ""
+
+msgid ""
+":obfuscate: Any text. Returns the input text rendered as a sequence of\n"
+"    XML entities."
+msgstr ""
+
+msgid ":person: Any text. Returns the text before an email address."
+msgstr ""
+
+msgid ""
+":rfc822date: Date. Returns a date using the same format used in email\n"
+"    headers: \"Tue, 18 Aug 2009 13:00:13 +0200\"."
+msgstr ""
+
+msgid ""
+":rfc3339date: Date. Returns a date using the Internet date format\n"
+"    specified in RFC 3339: \"2009-08-18T13:00:13+02:00\"."
+msgstr ""
+
+msgid ""
+":short: Changeset hash. Returns the short form of a changeset hash,\n"
+"    i.e. a 12 hexadecimal digit string."
+msgstr ""
+
+msgid ":shortdate: Date. Returns a date like \"2006-09-18\"."
+msgstr ""
+
+msgid ""
+":stringify: Any type. Turns the value into text by converting values into\n"
+"    text and concatenating them."
+msgstr ""
+
+msgid ":strip: Any text. Strips all leading and trailing whitespace."
+msgstr ""
+
+msgid ""
+":tabindent: Any text. Returns the text, with every line except the\n"
+"     first starting with a tab character."
+msgstr ""
+
+msgid ""
+":urlescape: Any text. Escapes all \"special\" characters. For example,\n"
+"    \"foo bar\" becomes \"foo%20bar\"."
+msgstr ""
+
+msgid ":user: Any text. Returns the user portion of an email address.\n"
+msgstr ""
+":user: Orice text. Returnează porțiunea utilizator a unei adrese de e-mail.\n"
+
+msgid "Valid URLs are of the form::"
+msgstr ""
+
+msgid ""
+"  local/filesystem/path[#revision]\n"
+"  file://local/filesystem/path[#revision]\n"
+"  http://[user[:pass]@]host[:port]/[path][#revision]\n"
+"  https://[user[:pass]@]host[:port]/[path][#revision]\n"
+"  ssh://[user[:pass]@]host[:port]/[path][#revision]"
+msgstr ""
+
+msgid ""
+"Paths in the local filesystem can either point to Mercurial\n"
+"repositories or to bundle files (as created by :hg:`bundle` or :hg:`\n"
+"incoming --bundle`)."
+msgstr ""
+
+msgid ""
+"An optional identifier after # indicates a particular branch, tag, or\n"
+"changeset to use from the remote repository. See also :hg:`help\n"
+"revisions`."
+msgstr ""
+
+msgid ""
+"Some features, such as pushing to http:// and https:// URLs are only\n"
+"possible if the feature is explicitly enabled on the remote Mercurial\n"
+"server."
+msgstr ""
+
+msgid "Some notes about using SSH with Mercurial:"
+msgstr ""
+
+msgid ""
+"- SSH requires an accessible shell account on the destination machine\n"
+"  and a copy of hg in the remote path or specified with as remotecmd.\n"
+"- path is relative to the remote user's home directory by default. Use\n"
+"  an extra slash at the start of a path to specify an absolute path::"
+msgstr ""
+
+msgid "    ssh://example.com//tmp/repository"
+msgstr ""
+
+msgid ""
+"- Mercurial doesn't use its own compression via SSH; the right thing\n"
+"  to do is to configure it in your ~/.ssh/config, e.g.::"
+msgstr ""
+
+msgid ""
+"    Host *.mylocalnetwork.example.com\n"
+"      Compression no\n"
+"    Host *\n"
+"      Compression yes"
+msgstr ""
+
+msgid ""
+"  Alternatively specify \"ssh -C\" as your ssh command in your hgrc or\n"
+"  with the --ssh command line option."
+msgstr ""
+
+msgid ""
+"These URLs can all be stored in your hgrc with path aliases under the\n"
+"[paths] section like so::"
+msgstr ""
+
+msgid ""
+"  [paths]\n"
+"  alias1 = URL1\n"
+"  alias2 = URL2\n"
+"  ..."
+msgstr ""
+
+msgid ""
+"You can then use the alias for any command that uses a URL (for\n"
+"example :hg:`pull alias1` will be treated as :hg:`pull URL1`)."
+msgstr ""
+
+msgid ""
+"Two path aliases are special because they are used as defaults when\n"
+"you do not provide the URL to a command:"
+msgstr ""
+
+msgid ""
+"default:\n"
+"  When you create a repository with hg clone, the clone command saves\n"
+"  the location of the source repository as the new repository's\n"
+"  'default' path. This is then used when you omit path from push- and\n"
+"  pull-like commands (including incoming and outgoing)."
+msgstr ""
+
+msgid ""
+"default-push:\n"
+"  The push command will look for a path named 'default-push', and\n"
+"  prefer it over 'default' if both are defined.\n"
+msgstr ""
+
+msgid "remote branch lookup not supported"
+msgstr ""
+
+msgid "dirstate branch not accessible"
+msgstr ""
+
+#, python-format
+msgid "unknown branch '%s'"
+msgstr ""
+
+msgid "can only share local repositories"
+msgstr ""
+
+msgid "destination already exists"
+msgstr ""
+
+msgid "updating working directory\n"
+msgstr "se actualizează directorul de lucru\n"
+
+#, python-format
+msgid "destination directory: %s\n"
+msgstr ""
+
+#, python-format
+msgid "destination '%s' already exists"
+msgstr ""
+
+#, python-format
+msgid "destination '%s' is not empty"
+msgstr ""
+
+msgid ""
+"src repository does not support revision lookup and so doesn't support clone "
+"by revision"
+msgstr ""
+
+msgid "clone from remote to remote not supported"
+msgstr ""
+
+#, python-format
+msgid "updating to branch %s\n"
+msgstr "se actualizează la ramura %s\n"
+
+#, python-format
+msgid ""
+"%d files updated, %d files merged, %d files removed, %d files unresolved\n"
+msgstr ""
+"%d fișiere actualizate, %d fișiere fuzionate, %d fișiere înlăturate, %d "
+"fișiere nerezolvate\n"
+
+msgid "use 'hg resolve' to retry unresolved file merges\n"
+msgstr ""
+
+msgid ""
+"use 'hg resolve' to retry unresolved file merges or 'hg update -C' to "
+"abandon\n"
+msgstr ""
+
+msgid "(branch merge, don't forget to commit)\n"
+msgstr ""
+
+#, python-format
+msgid "error reading %s/.hg/hgrc: %s\n"
+msgstr ""
+
+msgid "SSL support is unavailable"
+msgstr ""
+
+msgid "IPv6 is not available on this system"
+msgstr ""
+
+#, python-format
+msgid "cannot start server at '%s:%d': %s"
+msgstr ""
+
+#, python-format
+msgid "calling hook %s: %s\n"
+msgstr ""
+
+#, python-format
+msgid "%s hook is invalid (\"%s\" not in a module)"
+msgstr ""
+
+msgid "exception from first failed import attempt:\n"
+msgstr ""
+
+msgid "exception from second failed import attempt:\n"
+msgstr ""
+
+#, python-format
+msgid "%s hook is invalid (import of \"%s\" failed)"
+msgstr ""
+
+#, python-format
+msgid "%s hook is invalid (\"%s\" is not defined)"
+msgstr ""
+
+#, python-format
+msgid "%s hook is invalid (\"%s\" is not callable)"
+msgstr ""
+
+#, python-format
+msgid "error: %s hook failed: %s\n"
+msgstr ""
+
+#, python-format
+msgid "error: %s hook raised an exception: %s\n"
+msgstr ""
+
+#, python-format
+msgid "%s hook failed"
+msgstr ""
+
+#, python-format
+msgid "warning: %s hook failed\n"
+msgstr ""
+
+#, python-format
+msgid "running hook %s: %s\n"
+msgstr ""
+
+#, python-format
+msgid "%s hook %s"
+msgstr ""
+
+#, python-format
+msgid "warning: %s hook %s\n"
+msgstr ""
+
+msgid "connection ended unexpectedly"
+msgstr ""
+
+#, python-format
+msgid "unsupported URL component: \"%s\""
+msgstr ""
+
+msgid "operation not supported over http"
+msgstr ""
+
+msgid "authorization failed"
+msgstr ""
+
+msgid "http error, possibly caused by proxy setting"
+msgstr ""
+
+#, python-format
+msgid "real URL is %s\n"
+msgstr ""
+
+#, python-format
+msgid ""
+"'%s' does not appear to be an hg repository:\n"
+"---%%<--- (%s)\n"
+"%s\n"
+"---%%<---\n"
+msgstr ""
+
+#, python-format
+msgid "'%s' sent a broken Content-Type header (%s)"
+msgstr ""
+
+#, python-format
+msgid "'%s' uses newer protocol %s"
+msgstr ""
+
+#, python-format
+msgid "push failed: %s"
+msgstr ""
+
+msgid "Python support for SSL and HTTPS is not installed"
+msgstr ""
+
+msgid "cannot create new http repository"
+msgstr ""
+
+#, python-format
+msgid "ignoring invalid syntax '%s'"
+msgstr ""
+
+#, python-format
+msgid "skipping unreadable ignore file '%s': %s\n"
+msgstr "se omite fișierul ilizibil cu ignorări: '%s': %s\n"
+
+#, python-format
+msgid "repository %s not found"
+msgstr "depozitul %s nu a fost găsit"
+
+#, python-format
+msgid "repository %s already exists"
+msgstr "depozitul %s există deja"
+
+#, python-format
+msgid "requirement '%s' not supported"
+msgstr ""
+
+#, python-format
+msgid ".hg/sharedpath points to nonexistent directory %s"
+msgstr ""
+
+#, python-format
+msgid "%r cannot be used in a tag name"
+msgstr ""
+
+#, python-format
+msgid "warning: tag %s conflicts with existing branch name\n"
+msgstr ""
+
+msgid "working copy of .hgtags is changed (please commit .hgtags manually)"
+msgstr ""
+
+#, python-format
+msgid "working directory has unknown parent '%s'!"
+msgstr ""
+
+#, python-format
+msgid "unknown revision '%s'"
+msgstr ""
+
+msgid "abandoned transaction found - run hg recover"
+msgstr ""
+
+msgid "rolling back interrupted transaction\n"
+msgstr ""
+
+msgid "no interrupted transaction available\n"
+msgstr ""
+
+#, python-format
+msgid "rolling back to revision %s (undo %s: %s)\n"
+msgstr ""
+
+#, python-format
+msgid "rolling back to revision %s (undo %s)\n"
+msgstr ""
+
+msgid "rolling back unknown transaction\n"
+msgstr ""
+
+#, python-format
+msgid "Named branch could not be reset, current branch still is: %s\n"
+msgstr ""
+
+msgid "no rollback information available\n"
+msgstr ""
+
+#, python-format
+msgid "waiting for lock on %s held by %r\n"
+msgstr ""
+
+#, python-format
+msgid "repository %s"
+msgstr "depozitul %s"
+
+#, python-format
+msgid "working directory of %s"
+msgstr "directorul de lucrul al %s"
+
+msgid "cannot partially commit a merge (do not specify files or patterns)"
+msgstr ""
+
+msgid "can't commit subrepos without .hgsub"
+msgstr ""
+
+msgid "file not found!"
+msgstr ""
+
+msgid "no match under directory!"
+msgstr ""
+
+msgid "file not tracked!"
+msgstr ""
+
+msgid "unresolved merge conflicts (see hg resolve)"
+msgstr ""
+
+#, python-format
+msgid "committing subrepository %s\n"
+msgstr ""
+
+#, python-format
+msgid "note: commit message saved in %s\n"
+msgstr ""
+
+#, python-format
+msgid "trouble committing %s!\n"
+msgstr ""
+
+msgid "requesting all changes\n"
+msgstr "se solicită toate modificările\n"
+
+msgid ""
+"Partial pull cannot be done because other repository doesn't support "
+"changegroupsubset."
+msgstr ""
+
+#, python-format
+msgid "%d changesets found\n"
+msgstr ""
+
+msgid "bundling changes"
+msgstr ""
+
+msgid "chunks"
+msgstr ""
+
+msgid "bundling manifests"
+msgstr ""
+
+#, python-format
+msgid "empty or missing revlog for %s"
+msgstr ""
+
+msgid "bundling files"
+msgstr ""
+
+msgid "adding changesets\n"
+msgstr "se adaugă seturile de modificări\n"
+
+msgid "changesets"
+msgstr ""
+
+msgid "received changelog group is empty"
+msgstr ""
+
+msgid "adding manifests\n"
+msgstr "se adaugă manifestele\n"
+
+msgid "manifests"
+msgstr ""
+
+msgid "adding file changes\n"
+msgstr "se adaugă modificările fișierelor\n"
+
+msgid "received file revlog group is empty"
+msgstr ""
+
+#, python-format
+msgid "missing file data for %s:%s - run hg verify"
+msgstr ""
+
+#, python-format
+msgid " (%+d heads)"
+msgstr "(%+d capete)"
+
+#, python-format
+msgid "added %d changesets with %d changes to %d files%s\n"
+msgstr ""
+"au fost adăugate %d seturi de modificări, conținând %d modificări în %d "
+"fișiere%s\n"
+
+msgid "Unexpected response from remote server:"
+msgstr ""
+
+msgid "operation forbidden by server"
+msgstr ""
+
+msgid "locking the remote repository failed"
+msgstr ""
+
+msgid "the server sent an unknown error code"
+msgstr ""
+
+msgid "streaming all changes\n"
+msgstr ""
+
+#, python-format
+msgid "%d files to transfer, %s of data\n"
+msgstr ""
+
+#, python-format
+msgid "transferred %s in %.1f seconds (%s/sec)\n"
+msgstr ""
+
+msgid "no [smtp]host in hgrc - cannot send mail"
+msgstr ""
+
+#, python-format
+msgid "sending mail: smtp host %s, port %s\n"
+msgstr ""
+
+msgid "can't use TLS: Python SSL support not installed"
+msgstr ""
+
+msgid "(using tls)\n"
+msgstr ""
+
+#, python-format
+msgid "(authenticating to mail server as %s)\n"
+msgstr ""
+
+#, python-format
+msgid "sending mail: %s\n"
+msgstr ""
+
+msgid "smtp specified as email transport, but no smtp host configured"
+msgstr ""
+
+#, python-format
+msgid "%r specified as email transport, but not in PATH"
+msgstr ""
+
+#, python-format
+msgid "ignoring invalid sendcharset: %s\n"
+msgstr ""
+
+#, python-format
+msgid "invalid email address: %s"
+msgstr ""
+
+#, python-format
+msgid "invalid local address: %s"
+msgstr ""
+
+#, python-format
+msgid "failed to remove %s from manifest"
+msgstr ""
+
+#, python-format
+msgid "diff context lines count must be an integer, not %r"
+msgstr ""
+
+#, python-format
+msgid ""
+"untracked file in working directory differs from file in requested revision: "
+"'%s'"
+msgstr ""
+
+#, python-format
+msgid "case-folding collision between %s and %s"
+msgstr ""
+
+#, python-format
+msgid ""
+" conflicting flags for %s\n"
+"(n)one, e(x)ec or sym(l)ink?"
+msgstr ""
+
+msgid "&None"
+msgstr ""
+
+msgid "E&xec"
+msgstr ""
+
+msgid "Sym&link"
+msgstr ""
+
+msgid "resolving manifests\n"
+msgstr "se determină manifestele\n"
+
+#, python-format
+msgid ""
+" local changed %s which remote deleted\n"
+"use (c)hanged version or (d)elete?"
+msgstr ""
+
+msgid "&Changed"
+msgstr ""
+
+msgid "&Delete"
+msgstr ""
+
+#, python-format
+msgid ""
+"remote changed %s which local deleted\n"
+"use (c)hanged version or leave (d)eleted?"
+msgstr ""
+
+msgid "&Deleted"
+msgstr ""
+
+msgid "updating"
+msgstr "se actualizează"
+
+#, python-format
+msgid "update failed to remove %s: %s!\n"
+msgstr ""
+
+#, python-format
+msgid "getting %s\n"
+msgstr "se obține %s\n"
+
+#, python-format
+msgid "getting %s to %s\n"
+msgstr "se obține %s în %s\n"
+
+#, python-format
+msgid "warning: detected divergent renames of %s to:\n"
+msgstr ""
+
+#, python-format
+msgid "branch %s not found"
+msgstr ""
+
+msgid "merging with a working directory ancestor has no effect"
+msgstr ""
+
+msgid "nothing to merge (use 'hg update' or check 'hg heads')"
+msgstr ""
+
+msgid "outstanding uncommitted changes (use 'hg status' to list changes)"
+msgstr ""
+"modificări nedepozitate în suspensie (folosiți 'hg status' pentru a afișa "
+"modificările)"
+
+msgid ""
+"crosses branches (use 'hg merge' to merge or use 'hg update -C' to discard "
+"changes)"
+msgstr ""
+
+msgid "crosses branches (use 'hg merge' or use 'hg update -c')"
+msgstr ""
+
+#, python-format
+msgid "cannot create %s: destination already exists"
+msgstr ""
+
+#, python-format
+msgid "cannot create %s: unable to create destination directory"
+msgstr ""
+
+#, python-format
+msgid "unable to find '%s' for patching\n"
+msgstr ""
+
+#, python-format
+msgid "patching file %s\n"
+msgstr ""
+
+#, python-format
+msgid "%d out of %d hunks FAILED -- saving rejects to file %s\n"
+msgstr ""
+
+#, python-format
+msgid "bad hunk #%d %s (%d %d %d %d)"
+msgstr ""
+
+#, python-format
+msgid "file %s already exists\n"
+msgstr ""
+
+#, python-format
+msgid "Hunk #%d succeeded at %d with fuzz %d (offset %d lines).\n"
+msgstr ""
+
+#, python-format
+msgid "Hunk #%d succeeded at %d (offset %d lines).\n"
+msgstr ""
+
+#, python-format
+msgid "Hunk #%d FAILED at %d\n"
+msgstr ""
+
+#, python-format
+msgid "bad hunk #%d"
+msgstr ""
+
+#, python-format
+msgid "bad hunk #%d old text line %d"
+msgstr ""
+
+msgid "could not extract binary patch"
+msgstr ""
+
+#, python-format
+msgid "binary patch is %d bytes, not %d"
+msgstr ""
+
+#, python-format
+msgid "unable to strip away %d of %d dirs from %s"
+msgstr ""
+
+msgid "undefined source and destination files"
+msgstr ""
+
+#, python-format
+msgid "malformed patch %s %s"
+msgstr ""
+
+#, python-format
+msgid "unsupported parser state: %s"
+msgstr ""
+
+#, python-format
+msgid "patch command failed: %s"
+msgstr ""
+
+#, python-format
+msgid "Unsupported line endings type: %s"
+msgstr ""
+
+msgid ""
+"internal patcher failed\n"
+"please report details to http://mercurial.selenic.com/bts/\n"
+"or mercurial@selenic.com\n"
+msgstr ""
+
+#, python-format
+msgid " %d files changed, %d insertions(+), %d deletions(-)\n"
+msgstr ""
+
+#, python-format
+msgid "exited with status %d"
+msgstr ""
+
+#, python-format
+msgid "killed by signal %d"
+msgstr ""
+
+#, python-format
+msgid "saved backup bundle to %s\n"
+msgstr ""
+
+msgid "adding branch\n"
+msgstr "se adaugă ramura\n"
+
+#, python-format
+msgid "strip failed, full bundle stored in '%s'\n"
+msgstr ""
+
+#, python-format
+msgid "strip failed, partial bundle stored in '%s'\n"
+msgstr ""
+
+#, python-format
+msgid "cannot %s; remote repository does not support the %r capability"
+msgstr ""
+
+#, python-format
+msgid "unknown compression type %r"
+msgstr ""
+
+msgid "index entry flags need RevlogNG"
+msgstr ""
+
+#, python-format
+msgid "index %s unknown flags %#04x for format v0"
+msgstr ""
+
+#, python-format
+msgid "index %s unknown flags %#04x for revlogng"
+msgstr ""
+
+#, python-format
+msgid "index %s unknown format %d"
+msgstr ""
+
+#, python-format
+msgid "index %s is corrupted"
+msgstr ""
+
+msgid "no node"
+msgstr ""
+
+msgid "ambiguous identifier"
+msgstr ""
+
+msgid "no match found"
+msgstr ""
+
+#, python-format
+msgid "incompatible revision flag %x"
+msgstr ""
+
+#, python-format
+msgid "%s not found in the transaction"
+msgstr "%s nu a fost găsit în tranzacție"
+
+msgid "unknown base"
+msgstr ""
+
+msgid "consistency error adding group"
+msgstr "eroare de consistență la adăugarea grupului"
+
+msgid "unterminated string"
+msgstr ""
+
+msgid "syntax error"
+msgstr ""
+
+msgid "missing argument"
+msgstr ""
+
+#, python-format
+msgid "can't use %s here"
+msgstr ""
+
+msgid "can't use a list in this context"
+msgstr ""
+
+#, python-format
+msgid "not a function: %s"
+msgstr ""
+
+msgid "limit wants two arguments"
+msgstr ""
+
+msgid "limit wants a number"
+msgstr ""
+
+msgid "limit expects a number"
+msgstr ""
+
+msgid "ancestor wants two arguments"
+msgstr ""
+
+msgid "ancestor arguments must be single revisions"
+msgstr ""
+
+msgid "follow takes no arguments"
+msgstr ""
+
+msgid "date wants a string"
+msgstr ""
+
+msgid "keyword wants a string"
+msgstr ""
+
+msgid "grep wants a string"
+msgstr ""
+
+msgid "author wants a string"
+msgstr ""
+
+msgid "file wants a pattern"
+msgstr ""
+
+msgid "contains wants a pattern"
+msgstr ""
+
+msgid "modifies wants a pattern"
+msgstr ""
+
+msgid "adds wants a pattern"
+msgstr ""
+
+msgid "removes wants a pattern"
+msgstr ""
+
+msgid "merge takes no arguments"
+msgstr ""
+
+msgid "closed takes no arguments"
+msgstr ""
+
+msgid "head takes no arguments"
+msgstr ""
+
+msgid "sort wants one or two arguments"
+msgstr ""
+
+msgid "sort spec must be a string"
+msgstr ""
+
+#, python-format
+msgid "unknown sort key %r"
+msgstr ""
+
+msgid "all takes no arguments"
+msgstr ""
+
+msgid "outgoing wants a repository path"
+msgstr ""
+
+msgid "tagged takes no arguments"
+msgstr ""
+
+msgid "can't negate that"
+msgstr ""
+
+msgid "not a symbol"
+msgstr ""
+
+msgid "empty query"
+msgstr ""
+
+msgid "searching for exact renames"
+msgstr ""
+
+msgid "searching for similar files"
+msgstr ""
+
+#, python-format
+msgid "%s looks like a binary file."
+msgstr ""
+
+msgid "can only specify two labels."
+msgstr ""
+
+msgid "warning: conflicts during merge.\n"
+msgstr ""
+
+#, python-format
+msgid "couldn't parse location %s"
+msgstr ""
+
+msgid "could not create remote repo"
+msgstr ""
+
+msgid "no suitable response from remote hg"
+msgstr "niciun răspuns potrivit de la hg-ul la distanță"
+
+msgid "remote: "
+msgstr "la distanță: "
+
+msgid "unexpected response:"
+msgstr ""
+
+#, python-format
+msgid "push refused: %s"
+msgstr ""
+
+#, python-format
+msgid "'%s' does not appear to be an hg repository"
+msgstr ""
+
+msgid "cannot lock static-http repository"
+msgstr ""
+
+msgid "cannot create new static-http repository"
+msgstr ""
+
+#, python-format
+msgid "invalid entry in fncache, line %s"
+msgstr ""
+
+#, python-format
+msgid "subrepo spec file %s not found"
+msgstr ""
+
+msgid "missing ] in subrepo source"
+msgstr ""
+
+#, python-format
+msgid "bad subrepository pattern in %s: %s"
+msgstr ""
+
+#, python-format
+msgid ""
+" subrepository sources for %s differ\n"
+"use (l)ocal source (%s) or (r)emote source (%s)?"
+msgstr ""
+
+msgid "&Remote"
+msgstr ""
+
+#, python-format
+msgid ""
+" local changed subrepository %s which remote removed\n"
+"use (c)hanged version or (d)elete?"
+msgstr ""
+
+#, python-format
+msgid ""
+" remote changed subrepository %s which local removed\n"
+"use (c)hanged version or (d)elete?"
+msgstr ""
+
+#, python-format
+msgid "unknown subrepo type %s"
+msgstr ""
+
+#, python-format
+msgid "removing subrepo %s\n"
+msgstr ""
+
+#, python-format
+msgid "pulling subrepo %s from %s\n"
+msgstr ""
+
+#, python-format
+msgid "pushing subrepo %s to %s\n"
+msgstr ""
+
+msgid "cannot commit svn externals"
+msgstr ""
+
+#, python-format
+msgid "not removing repo %s because it has changes.\n"
+msgstr ""
+
+#, python-format
+msgid "%s, line %s: %s\n"
+msgstr ""
+
+msgid "cannot parse entry"
+msgstr ""
+
+#, python-format
+msgid "node '%s' is not well formed"
+msgstr ""
+
+msgid "unmatched quotes"
+msgstr ""
+
+#, python-format
+msgid "error expanding '%s%%%s'"
+msgstr ""
+
+#, python-format
+msgid "unknown filter '%s'"
+msgstr ""
+
+#, python-format
+msgid "style not found: %s"
+msgstr ""
+
+#, python-format
+msgid "template file %s: %s"
+msgstr ""
+
+msgid "cannot use transaction when it is already committed/aborted"
+msgstr "nu se poate folosi o tranzacție când este deja depozitată/abandonată"
+
+#, python-format
+msgid "failed to truncate %s\n"
+msgstr ""
+
+msgid "transaction abort!\n"
+msgstr "tranzacție abandonată!\n"
+
+msgid "rollback completed\n"
+msgstr ""
+
+msgid "rollback failed - please run hg recover\n"
+msgstr ""
+
+#, python-format
+msgid "Not trusting file %s from untrusted user %s, group %s\n"
+msgstr ""
+
+#, python-format
+msgid "Ignored: %s\n"
+msgstr ""
+
+#, python-format
+msgid "ignoring untrusted configuration option %s.%s = %s\n"
+msgstr ""
+
+#, python-format
+msgid "%s.%s not a boolean ('%s')"
+msgstr ""
+
+msgid "enter a commit username:"
+msgstr ""
+
+#, python-format
+msgid "No username found, using '%s' instead\n"
+msgstr ""
+
+msgid "no username supplied (see \"hg help config\")"
+msgstr ""
+
+#, python-format
+msgid "username %s contains a newline\n"
+msgstr ""
+
+#, python-format
+msgid "(deprecated '%%' in path %s=%s from %s)\n"
+msgstr ""
+
+msgid "response expected"
+msgstr ""
+
+msgid "unrecognized response\n"
+msgstr ""
+
+msgid "password: "
+msgstr ""
+
+msgid "edit failed"
+msgstr ""
+
+msgid "http authorization required"
+msgstr ""
+
+msgid "http authorization required\n"
+msgstr ""
+
+#, python-format
+msgid "realm: %s\n"
+msgstr ""
+
+#, python-format
+msgid "user: %s\n"
+msgstr "utilizator: %s\n"
+
+msgid "user:"
+msgstr "utilizator:"
+
+#, python-format
+msgid "http auth: user %s, password %s\n"
+msgstr ""
+
+#, python-format
+msgid "ignoring invalid [auth] key '%s'\n"
+msgstr ""
+
+msgid "certificate checking requires Python 2.6"
+msgstr "verificarea certificatului necesită Python 2.6"
+
+msgid "server identity verification succeeded\n"
+msgstr ""
+
+#, python-format
+msgid "command '%s' failed: %s"
+msgstr ""
+
+#, python-format
+msgid "path contains illegal component: %s"
+msgstr ""
+
+#, python-format
+msgid "path %r is inside repo %r"
+msgstr ""
+
+#, python-format
+msgid "path %r traverses symbolic link %r"
+msgstr ""
+
+msgid "Hardlinks not supported"
+msgstr ""
+
+#, python-format
+msgid "could not symlink to %r: %s"
+msgstr ""
+
+#, python-format
+msgid "invalid date: %r "
+msgstr ""
+
+#, python-format
+msgid "date exceeds 32 bits: %d"
+msgstr ""
+
+#, python-format
+msgid "impossible time zone offset: %d"
+msgstr ""
+
+#, python-format
+msgid "invalid day spec: %s"
+msgstr ""
+
+#, python-format
+msgid "%.0f GB"
+msgstr ""
+
+#, python-format
+msgid "%.1f GB"
+msgstr ""
+
+#, python-format
+msgid "%.2f GB"
+msgstr ""
+
+#, python-format
+msgid "%.0f MB"
+msgstr ""
+
+#, python-format
+msgid "%.1f MB"
+msgstr ""
+
+#, python-format
+msgid "%.2f MB"
+msgstr ""
+
+#, python-format
+msgid "%.0f KB"
+msgstr ""
+
+#, python-format
+msgid "%.1f KB"
+msgstr ""
+
+#, python-format
+msgid "%.2f KB"
+msgstr ""
+
+#, python-format
+msgid "%.0f bytes"
+msgstr ""
+
+msgid "cannot verify bundle or remote repos"
+msgstr ""
+
+msgid "interrupted"
+msgstr ""
+
+#, python-format
+msgid "empty or missing %s"
+msgstr ""
+
+#, python-format
+msgid "data length off by %d bytes"
+msgstr ""
+
+#, python-format
+msgid "index contains %d extra bytes"
+msgstr ""
+
+#, python-format
+msgid "warning: `%s' uses revlog format 1"
+msgstr ""
+
+#, python-format
+msgid "warning: `%s' uses revlog format 0"
+msgstr ""
+
+#, python-format
+msgid "rev %d points to nonexistent changeset %d"
+msgstr ""
+
+#, python-format
+msgid "rev %d points to unexpected changeset %d"
+msgstr ""
+
+#, python-format
+msgid " (expected %s)"
+msgstr ""
+
+#, python-format
+msgid "unknown parent 1 %s of %s"
+msgstr ""
+
+#, python-format
+msgid "unknown parent 2 %s of %s"
+msgstr ""
+
+#, python-format
+msgid "checking parents of %s"
+msgstr "se verifică părinții lui %s"
+
+#, python-format
+msgid "duplicate revision %d (%d)"
+msgstr ""
+
+msgid "abandoned transaction found - run hg recover\n"
+msgstr ""
+
+#, python-format
+msgid "repository uses revlog format %d\n"
+msgstr ""
+
+msgid "checking changesets\n"
+msgstr "se verifică seturile de modificări\n"
+
+#, python-format
+msgid "unpacking changeset %s"
+msgstr ""
+
+msgid "checking manifests\n"
+msgstr "se verifică manifestele\n"
+
+#, python-format
+msgid "%s not in changesets"
+msgstr ""
+
+msgid "file without name in manifest"
+msgstr ""
+
+#, python-format
+msgid "reading manifest delta %s"
+msgstr ""
+
+msgid "crosschecking files in changesets and manifests\n"
+msgstr ""
+"se verifică încrucișat fișierele din seturile de modificări și manifeste\n"
+
+msgid "crosschecking"
+msgstr "se verifică încrucișat"
+
+#, python-format
+msgid "changeset refers to unknown manifest %s"
+msgstr ""
+
+msgid "in changeset but not in manifest"
+msgstr ""
+
+msgid "in manifest but not in changeset"
+msgstr ""
+
+msgid "checking files\n"
+msgstr "se verifică fișierele\n"
+
+#, python-format
+msgid "cannot decode filename '%s'"
+msgstr ""
+
+msgid "checking"
+msgstr "se verifică"
+
+#, python-format
+msgid "broken revlog! (%s)"
+msgstr ""
+
+msgid "missing revlog!"
+msgstr ""
+
+#, python-format
+msgid "%s not in manifests"
+msgstr ""
+
+#, python-format
+msgid "unpacked size is %s, %s expected"
+msgstr ""
+
+#, python-format
+msgid "unpacking %s"
+msgstr ""
+
+#, python-format
+msgid "warning: copy source of '%s' not in parents of %s"
+msgstr ""
+
+#, python-format
+msgid "empty or missing copy source revlog %s:%s"
+msgstr ""
+
+#, python-format
+msgid "warning: %s@%s: copy source revision is nullid %s:%s\n"
+msgstr ""
+
+#, python-format
+msgid "checking rename of %s"
+msgstr "se verifică redenumirea lui %s"
+
+#, python-format
+msgid "%s in manifests not found"
+msgstr ""
+
+#, python-format
+msgid "warning: orphan revlog '%s'"
+msgstr ""
+
+#, python-format
+msgid "%d files, %d changesets, %d total revisions\n"
+msgstr "%d fișiere, %d seturi de modificări, %d revizii totale\n"
+
+#, python-format
+msgid "%d warnings encountered!\n"
+msgstr ""
+
+#, python-format
+msgid "%d integrity errors encountered!\n"
+msgstr ""
+
+#, python-format
+msgid "(first damaged changeset appears to be %d)\n"
+msgstr ""
+
+msgid "user name not available - set USERNAME environment variable"
+msgstr ""
+
+msgid "look up remote revision"
+msgstr "se caută revizia"
+
+msgid "look up remote changes"
+msgstr "se caută modificări la distanță"
+
+msgid "push failed:"
+msgstr ""
+
+msgid "push failed (unexpected response):"
+msgstr ""
+
+#~ msgid ""
+#~ "    If no commit message is specified, the configured editor is\n"
+#~ "    started to prompt you for a message."
+#~ msgstr ""
+#~ "    Dacă nu specificați nici un mesaj pentru depozitare, se va\n"
+#~ "    lansa editorul menționat în configurație pentru a scrie un mesaj."
+
+#~ msgid "Checking extensions...\n"
+#~ msgstr "Se verifică extensiile...\n"
+
+#~ msgid "unmark files as resolved"
+#~ msgstr "de-marchează fișierul drept rezolvat"
--- a/mercurial/archival.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/archival.py	Wed Sep 22 18:29:41 2010 -0500
@@ -12,7 +12,7 @@
 import cStringIO, os, stat, tarfile, time, zipfile
 import zlib, gzip
 
-def tidyprefix(dest, prefix, suffixes):
+def tidyprefix(dest, kind, prefix):
     '''choose prefix to use for names in archive.  make sure prefix is
     safe for consumers.'''
 
@@ -23,7 +23,7 @@
             raise ValueError('dest must be string if no prefix')
         prefix = os.path.basename(dest)
         lower = prefix.lower()
-        for sfx in suffixes:
+        for sfx in exts.get(kind, []):
             if lower.endswith(sfx):
                 prefix = prefix[:-len(sfx)]
                 break
@@ -35,6 +35,20 @@
         raise util.Abort(_('archive prefix contains illegal components'))
     return prefix
 
+exts = {
+    'tar': ['.tar'],
+    'tbz2': ['.tbz2', '.tar.bz2'],
+    'tgz': ['.tgz', '.tar.gz'],
+    'zip': ['.zip'],
+    }
+
+def guesskind(dest):
+    for kind, extensions in exts.iteritems():
+        if util.any(dest.endswith(ext) for ext in extensions):
+            return kind
+    return None
+
+
 class tarit(object):
     '''write archive to tar file or stream.  can write uncompressed,
     or compress with gzip or bzip2.'''
@@ -66,9 +80,7 @@
             if fname:
                 self.fileobj.write(fname + '\000')
 
-    def __init__(self, dest, prefix, mtime, kind=''):
-        self.prefix = tidyprefix(dest, prefix, ['.tar', '.tar.bz2', '.tar.gz',
-                                                '.tgz', '.tbz2'])
+    def __init__(self, dest, mtime, kind=''):
         self.mtime = mtime
 
         def taropen(name, mode, fileobj=None):
@@ -90,7 +102,7 @@
             self.z = taropen(name='', mode='w|', fileobj=dest)
 
     def addfile(self, name, mode, islink, data):
-        i = tarfile.TarInfo(self.prefix + name)
+        i = tarfile.TarInfo(name)
         i.mtime = self.mtime
         i.size = len(data)
         if islink:
@@ -129,8 +141,7 @@
     '''write archive to zip file or stream.  can write uncompressed,
     or compressed with deflate.'''
 
-    def __init__(self, dest, prefix, mtime, compress=True):
-        self.prefix = tidyprefix(dest, prefix, ('.zip',))
+    def __init__(self, dest, mtime, compress=True):
         if not isinstance(dest, str):
             try:
                 dest.tell()
@@ -149,7 +160,7 @@
         self.date_time = time.gmtime(mtime)[:6]
 
     def addfile(self, name, mode, islink, data):
-        i = zipfile.ZipInfo(self.prefix + name, self.date_time)
+        i = zipfile.ZipInfo(name, self.date_time)
         i.compress_type = self.z.compression
         # unzip will not honor unix file modes unless file creator is
         # set to unix (id 3).
@@ -167,9 +178,7 @@
 class fileit(object):
     '''write archive as files in directory.'''
 
-    def __init__(self, name, prefix, mtime):
-        if prefix:
-            raise util.Abort(_('cannot give prefix when archiving to files'))
+    def __init__(self, name, mtime):
         self.basedir = name
         self.opener = util.opener(self.basedir)
 
@@ -189,14 +198,14 @@
 archivers = {
     'files': fileit,
     'tar': tarit,
-    'tbz2': lambda name, prefix, mtime: tarit(name, prefix, mtime, 'bz2'),
-    'tgz': lambda name, prefix, mtime: tarit(name, prefix, mtime, 'gz'),
-    'uzip': lambda name, prefix, mtime: zipit(name, prefix, mtime, False),
+    'tbz2': lambda name, mtime: tarit(name, mtime, 'bz2'),
+    'tgz': lambda name, mtime: tarit(name, mtime, 'gz'),
+    'uzip': lambda name, mtime: zipit(name, mtime, False),
     'zip': zipit,
     }
 
 def archive(repo, dest, node, kind, decode=True, matchfn=None,
-            prefix=None, mtime=None):
+            prefix=None, mtime=None, subrepos=False):
     '''create archive of repo as it was at node.
 
     dest can be name of directory, name of archive file, or file
@@ -211,24 +220,30 @@
 
     prefix is name of path to put before every archive member.'''
 
+    if kind == 'files':
+        if prefix:
+            raise util.Abort(_('cannot give prefix when archiving to files'))
+    else:
+        prefix = tidyprefix(dest, kind, prefix)
+
     def write(name, mode, islink, getdata):
         if matchfn and not matchfn(name):
             return
         data = getdata()
         if decode:
             data = repo.wwritedata(name, data)
-        archiver.addfile(name, mode, islink, data)
+        archiver.addfile(prefix + name, mode, islink, data)
 
     if kind not in archivers:
         raise util.Abort(_("unknown archive type '%s'") % kind)
 
     ctx = repo[node]
-    archiver = archivers[kind](dest, prefix, mtime or ctx.date()[0])
+    archiver = archivers[kind](dest, mtime or ctx.date()[0])
 
     if repo.ui.configbool("ui", "archivemeta", True):
         def metadata():
             base = 'repo: %s\nnode: %s\nbranch: %s\n' % (
-                hex(repo.changelog.node(0)), hex(node), ctx.branch())
+                repo[0].hex(), hex(node), ctx.branch())
 
             tags = ''.join('tag: %s\n' % t for t in ctx.tags()
                            if repo.tagtype(t) == 'global')
@@ -248,4 +263,10 @@
     for f in ctx:
         ff = ctx.flags(f)
         write(f, 'x' in ff and 0755 or 0644, 'l' in ff, ctx[f].data)
+
+    if subrepos:
+        for subpath in ctx.substate:
+            sub = ctx.sub(subpath)
+            sub.archive(archiver, prefix)
+
     archiver.done()
--- a/mercurial/bundlerepo.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/bundlerepo.py	Wed Sep 22 18:29:41 2010 -0500
@@ -13,16 +13,16 @@
 
 from node import nullid
 from i18n import _
-import os, struct, bz2, zlib, tempfile, shutil
+import os, struct, tempfile, shutil
 import changegroup, util, mdiff
 import localrepo, changelog, manifest, filelog, revlog, error
 
 class bundlerevlog(revlog.revlog):
-    def __init__(self, opener, indexfile, bundlefile,
+    def __init__(self, opener, indexfile, bundle,
                  linkmapper=None):
         # How it works:
         # to retrieve a revision, we need to know the offset of
-        # the revision in the bundlefile (an opened file).
+        # the revision in the bundle (an unbundle object).
         #
         # We store this offset in the index (start), to differentiate a
         # rev in the bundle and from a rev in the revlog, we check
@@ -30,11 +30,14 @@
         # (it is bigger since we store the node to which the delta is)
         #
         revlog.revlog.__init__(self, opener, indexfile)
-        self.bundlefile = bundlefile
+        self.bundle = bundle
         self.basemap = {}
         def chunkpositer():
-            for chunk in changegroup.chunkiter(bundlefile):
-                pos = bundlefile.tell()
+            while 1:
+                chunk = bundle.chunk()
+                if not chunk:
+                    break
+                pos = bundle.tell()
                 yield chunk, pos - len(chunk)
         n = len(self)
         prev = None
@@ -68,7 +71,7 @@
             prev = node
             n += 1
 
-    def bundle(self, rev):
+    def inbundle(self, rev):
         """is rev from the bundle"""
         if rev < 0:
             return False
@@ -79,19 +82,19 @@
         # Warning: in case of bundle, the diff is against bundlebase,
         # not against rev - 1
         # XXX: could use some caching
-        if not self.bundle(rev):
+        if not self.inbundle(rev):
             return revlog.revlog._chunk(self, rev)
-        self.bundlefile.seek(self.start(rev))
-        return self.bundlefile.read(self.length(rev))
+        self.bundle.seek(self.start(rev))
+        return self.bundle.read(self.length(rev))
 
     def revdiff(self, rev1, rev2):
         """return or calculate a delta between two revisions"""
-        if self.bundle(rev1) and self.bundle(rev2):
+        if self.inbundle(rev1) and self.inbundle(rev2):
             # hot path for bundle
             revb = self.rev(self.bundlebase(rev2))
             if revb == rev1:
                 return self._chunk(rev2)
-        elif not self.bundle(rev1) and not self.bundle(rev2):
+        elif not self.inbundle(rev1) and not self.inbundle(rev2):
             return revlog.revlog.revdiff(self, rev1, rev2)
 
         return mdiff.textdiff(self.revision(self.node(rev1)),
@@ -107,7 +110,7 @@
         iter_node = node
         rev = self.rev(iter_node)
         # reconstruct the revision if it is from a changegroup
-        while self.bundle(rev):
+        while self.inbundle(rev):
             if self._cache and self._cache[0] == iter_node:
                 text = self._cache[2]
                 break
@@ -139,20 +142,20 @@
         raise NotImplementedError
 
 class bundlechangelog(bundlerevlog, changelog.changelog):
-    def __init__(self, opener, bundlefile):
+    def __init__(self, opener, bundle):
         changelog.changelog.__init__(self, opener)
-        bundlerevlog.__init__(self, opener, self.indexfile, bundlefile)
+        bundlerevlog.__init__(self, opener, self.indexfile, bundle)
 
 class bundlemanifest(bundlerevlog, manifest.manifest):
-    def __init__(self, opener, bundlefile, linkmapper):
+    def __init__(self, opener, bundle, linkmapper):
         manifest.manifest.__init__(self, opener)
-        bundlerevlog.__init__(self, opener, self.indexfile, bundlefile,
+        bundlerevlog.__init__(self, opener, self.indexfile, bundle,
                               linkmapper)
 
 class bundlefilelog(bundlerevlog, filelog.filelog):
-    def __init__(self, opener, path, bundlefile, linkmapper):
+    def __init__(self, opener, path, bundle, linkmapper):
         filelog.filelog.__init__(self, opener, path)
-        bundlerevlog.__init__(self, opener, self.indexfile, bundlefile,
+        bundlerevlog.__init__(self, opener, self.indexfile, bundle,
                               linkmapper)
 
 class bundlerepository(localrepo.localrepository):
@@ -171,58 +174,41 @@
             self._url = 'bundle:' + bundlename
 
         self.tempfile = None
-        self.bundlefile = open(bundlename, "rb")
-        header = self.bundlefile.read(6)
-        if not header.startswith("HG"):
-            raise util.Abort(_("%s: not a Mercurial bundle file") % bundlename)
-        elif not header.startswith("HG10"):
-            raise util.Abort(_("%s: unknown bundle version") % bundlename)
-        elif (header == "HG10BZ") or (header == "HG10GZ"):
+        f = open(bundlename, "rb")
+        self.bundle = changegroup.readbundle(f, bundlename)
+        if self.bundle.compressed():
             fdtemp, temp = tempfile.mkstemp(prefix="hg-bundle-",
                                             suffix=".hg10un", dir=self.path)
             self.tempfile = temp
             fptemp = os.fdopen(fdtemp, 'wb')
-            def generator(f):
-                if header == "HG10BZ":
-                    zd = bz2.BZ2Decompressor()
-                    zd.decompress("BZ")
-                elif header == "HG10GZ":
-                    zd = zlib.decompressobj()
-                for chunk in f:
-                    yield zd.decompress(chunk)
-            gen = generator(util.filechunkiter(self.bundlefile, 4096))
 
             try:
                 fptemp.write("HG10UN")
-                for chunk in gen:
+                while 1:
+                    chunk = self.bundle.read(2**18)
+                    if not chunk:
+                        break
                     fptemp.write(chunk)
             finally:
                 fptemp.close()
-                self.bundlefile.close()
 
-            self.bundlefile = open(self.tempfile, "rb")
-            # seek right after the header
-            self.bundlefile.seek(6)
-        elif header == "HG10UN":
-            # nothing to do
-            pass
-        else:
-            raise util.Abort(_("%s: unknown bundle compression type")
-                             % bundlename)
+            f = open(self.tempfile, "rb")
+            self.bundle = changegroup.readbundle(f, bundlename)
+
         # dict with the mapping 'filename' -> position in the bundle
         self.bundlefilespos = {}
 
     @util.propertycache
     def changelog(self):
-        c = bundlechangelog(self.sopener, self.bundlefile)
-        self.manstart = self.bundlefile.tell()
+        c = bundlechangelog(self.sopener, self.bundle)
+        self.manstart = self.bundle.tell()
         return c
 
     @util.propertycache
     def manifest(self):
-        self.bundlefile.seek(self.manstart)
-        m = bundlemanifest(self.sopener, self.bundlefile, self.changelog.rev)
-        self.filestart = self.bundlefile.tell()
+        self.bundle.seek(self.manstart)
+        m = bundlemanifest(self.sopener, self.bundle, self.changelog.rev)
+        self.filestart = self.bundle.tell()
         return m
 
     @util.propertycache
@@ -240,33 +226,32 @@
 
     def file(self, f):
         if not self.bundlefilespos:
-            self.bundlefile.seek(self.filestart)
+            self.bundle.seek(self.filestart)
             while 1:
-                chunk = changegroup.getchunk(self.bundlefile)
+                chunk = self.bundle.chunk()
                 if not chunk:
                     break
-                self.bundlefilespos[chunk] = self.bundlefile.tell()
-                for c in changegroup.chunkiter(self.bundlefile):
-                    pass
+                self.bundlefilespos[chunk] = self.bundle.tell()
+                while 1:
+                    c = self.bundle.chunk()
+                    if not c:
+                        break
 
         if f[0] == '/':
             f = f[1:]
         if f in self.bundlefilespos:
-            self.bundlefile.seek(self.bundlefilespos[f])
-            return bundlefilelog(self.sopener, f, self.bundlefile,
+            self.bundle.seek(self.bundlefilespos[f])
+            return bundlefilelog(self.sopener, f, self.bundle,
                                  self.changelog.rev)
         else:
             return filelog.filelog(self.sopener, f)
 
     def close(self):
         """Close assigned bundle file immediately."""
-        self.bundlefile.close()
+        self.bundle.close()
 
     def __del__(self):
-        bundlefile = getattr(self, 'bundlefile', None)
-        if bundlefile and not bundlefile.closed:
-            bundlefile.close()
-        tempfile = getattr(self, 'tempfile', None)
+        del self.bundle
         if tempfile is not None:
             os.unlink(tempfile)
         if self._tempparent:
--- a/mercurial/changegroup.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/changegroup.py	Wed Sep 22 18:29:41 2010 -0500
@@ -24,17 +24,6 @@
                           % (len(d), l - 4))
     return d
 
-def chunkiter(source, progress=None):
-    """iterate through the chunks in source, yielding a sequence of chunks
-    (strings)"""
-    while 1:
-        c = getchunk(source)
-        if not c:
-            break
-        elif progress is not None:
-            progress()
-        yield c
-
 def chunkheader(length):
     """return a changegroup chunk header (string)"""
     return struct.pack(">l", length + 4)
@@ -61,8 +50,7 @@
     # We want to gather manifests needed and filelogs affected.
     def collect(node):
         c = cl.read(node)
-        for fn in c[3]:
-            files.setdefault(fn, fn)
+        files.update(c[3])
         mmfs.setdefault(c[0], node)
     return collect
 
@@ -95,15 +83,18 @@
         # parse the changegroup data, otherwise we will block
         # in case of sshrepo because we don't know the end of the stream
 
-        # an empty chunkiter is the end of the changegroup
-        # a changegroup has at least 2 chunkiters (changelog and manifest).
-        # after that, an empty chunkiter is the end of the changegroup
+        # an empty chunkgroup is the end of the changegroup
+        # a changegroup has at least 2 chunkgroups (changelog and manifest).
+        # after that, an empty chunkgroup is the end of the changegroup
         empty = False
         count = 0
         while not empty or count <= 2:
             empty = True
             count += 1
-            for chunk in chunkiter(cg):
+            while 1:
+                chunk = getchunk(cg)
+                if not chunk:
+                    break
                 empty = False
                 fh.write(z.compress(chunkheader(len(chunk))))
                 pos = 0
@@ -121,34 +112,93 @@
         if cleanup is not None:
             os.unlink(cleanup)
 
-def unbundle(header, fh):
-    if header == 'HG10UN':
+def decompressor(fh, alg):
+    if alg == 'UN':
         return fh
-    elif not header.startswith('HG'):
-        # old client with uncompressed bundle
-        def generator(f):
-            yield header
-            for chunk in f:
-                yield chunk
-    elif header == 'HG10GZ':
+    elif alg == 'GZ':
         def generator(f):
             zd = zlib.decompressobj()
             for chunk in f:
                 yield zd.decompress(chunk)
-    elif header == 'HG10BZ':
+    elif alg == 'BZ':
         def generator(f):
             zd = bz2.BZ2Decompressor()
             zd.decompress("BZ")
             for chunk in util.filechunkiter(f, 4096):
                 yield zd.decompress(chunk)
+    else:
+        raise util.Abort("unknown bundle compression '%s'" % alg)
     return util.chunkbuffer(generator(fh))
 
+class unbundle10(object):
+    def __init__(self, fh, alg):
+        self._stream = decompressor(fh, alg)
+        self._type = alg
+        self.callback = None
+    def compressed(self):
+        return self._type != 'UN'
+    def read(self, l):
+        return self._stream.read(l)
+    def seek(self, pos):
+        return self._stream.seek(pos)
+    def tell(self):
+        return self._stream.tell()
+    def close(self):
+        return self._stream.close()
+
+    def chunklength(self):
+        d = self.read(4)
+        if not d:
+            return 0
+        l = max(0, struct.unpack(">l", d)[0] - 4)
+        if l and self.callback:
+            self.callback()
+        return l
+
+    def chunk(self):
+        """return the next chunk from changegroup 'source' as a string"""
+        l = self.chunklength()
+        d = self.read(l)
+        if len(d) < l:
+            raise util.Abort(_("premature EOF reading chunk"
+                               " (got %d bytes, expected %d)")
+                             % (len(d), l))
+        return d
+
+    def parsechunk(self):
+        l = self.chunklength()
+        if not l:
+            return {}
+        h = self.read(80)
+        node, p1, p2, cs = struct.unpack("20s20s20s20s", h)
+        data = self.read(l - 80)
+        return dict(node=node, p1=p1, p2=p2, cs=cs, data=data)
+
+class headerlessfixup(object):
+    def __init__(self, fh, h):
+        self._h = h
+        self._fh = fh
+    def read(self, n):
+        if self._h:
+            d, self._h = self._h[:n], self._h[n:]
+            if len(d) < n:
+                d += self._fh.read(n - len(d))
+            return d
+        return self._fh.read(n)
+
 def readbundle(fh, fname):
     header = fh.read(6)
-    if not header.startswith('HG'):
-        raise util.Abort(_('%s: not a Mercurial bundle file') % fname)
-    if not header.startswith('HG10'):
-        raise util.Abort(_('%s: unknown bundle version') % fname)
-    elif header not in bundletypes:
-        raise util.Abort(_('%s: unknown bundle compression type') % fname)
-    return unbundle(header, fh)
+
+    if not fname:
+        fname = "stream"
+        if not header.startswith('HG') and header.startswith('\0'):
+            fh = headerlessfixup(fh, header)
+            header = "HG10UN"
+
+    magic, version, alg = header[0:2], header[2:4], header[4:6]
+
+    if magic != 'HG':
+        raise util.Abort(_('%s: not a Mercurial bundle') % fname)
+    if version != '10':
+        raise util.Abort(_('%s: unknown bundle version %s') % (fname, version))
+    return unbundle10(fh, alg)
--- a/mercurial/cmdutil.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/cmdutil.py	Wed Sep 22 18:29:41 2010 -0500
@@ -9,8 +9,8 @@
 from i18n import _
 import os, sys, errno, re, glob, tempfile
 import util, templater, patch, error, encoding, templatekw
-import match as _match
-import similar, revset
+import match as matchmod
+import similar, revset, subrepo
 
 revrangesep = ':'
 
@@ -247,7 +247,7 @@
         return list(pats)
     ret = []
     for p in pats:
-        kind, name = _match._patsplit(p, None)
+        kind, name = matchmod._patsplit(p, None)
         if kind is None:
             try:
                 globbed = glob.glob(name)
@@ -262,18 +262,19 @@
 def match(repo, pats=[], opts={}, globbed=False, default='relpath'):
     if not globbed and default == 'relpath':
         pats = expandpats(pats or [])
-    m = _match.match(repo.root, repo.getcwd(), pats,
-                    opts.get('include'), opts.get('exclude'), default)
+    m = matchmod.match(repo.root, repo.getcwd(), pats,
+                       opts.get('include'), opts.get('exclude'), default,
+                       auditor=repo.auditor)
     def badfn(f, msg):
         repo.ui.warn("%s: %s\n" % (m.rel(f), msg))
     m.bad = badfn
     return m
 
 def matchall(repo):
-    return _match.always(repo.root, repo.getcwd())
+    return matchmod.always(repo.root, repo.getcwd())
 
 def matchfiles(repo, files):
-    return _match.exact(repo.root, repo.getcwd(), files)
+    return matchmod.exact(repo.root, repo.getcwd(), files)
 
 def addremove(repo, pats=[], opts={}, dry_run=None, similarity=None):
     if dry_run is None:
@@ -297,7 +298,7 @@
             unknown.append(abs)
             if repo.ui.verbose or not exact:
                 repo.ui.status(_('adding %s\n') % ((pats and rel) or abs))
-        elif repo.dirstate[abs] != 'r' and (not good or not util.lexists(target)
+        elif repo.dirstate[abs] != 'r' and (not good or not os.path.lexists(target)
             or (os.path.isdir(target) and not os.path.islink(target))):
             deleted.append(abs)
             if repo.ui.verbose or not exact:
@@ -328,6 +329,49 @@
         finally:
             wlock.release()
 
+def updatedir(ui, repo, patches, similarity=0):
+    '''Update dirstate after patch application according to metadata'''
+    if not patches:
+        return
+    copies = []
+    removes = set()
+    cfiles = patches.keys()
+    cwd = repo.getcwd()
+    if cwd:
+        cfiles = [util.pathto(repo.root, cwd, f) for f in patches.keys()]
+    for f in patches:
+        gp = patches[f]
+        if not gp:
+            continue
+        if gp.op == 'RENAME':
+            copies.append((gp.oldpath, gp.path))
+            removes.add(gp.oldpath)
+        elif gp.op == 'COPY':
+            copies.append((gp.oldpath, gp.path))
+        elif gp.op == 'DELETE':
+            removes.add(gp.path)
+
+    wctx = repo[None]
+    for src, dst in copies:
+        wctx.copy(src, dst)
+    if (not similarity) and removes:
+        wctx.remove(sorted(removes), True)
+
+    for f in patches:
+        gp = patches[f]
+        if gp and gp.mode:
+            islink, isexec = gp.mode
+            dst = repo.wjoin(gp.path)
+            # patch won't create empty files
+            if gp.op == 'ADD' and not os.path.lexists(dst):
+                flags = (isexec and 'x' or '') + (islink and 'l' or '')
+                repo.wwrite(gp.path, '', flags)
+            util.set_flags(dst, islink, isexec)
+    addremove(repo, cfiles, similarity=similarity)
+    files = patches.keys()
+    files.extend([r for r in removes if r not in files])
+    return sorted(files)
+
 def copy(ui, repo, pats, opts, rename=False):
     # called with the repo lock held
     #
@@ -464,7 +508,7 @@
     # srcs: list of (hgsep, hgsep, ossep, bool)
     # return: function that takes hgsep and returns ossep
     def targetpathafterfn(pat, dest, srcs):
-        if _match.patkind(pat):
+        if matchmod.patkind(pat):
             # a mercurial pattern
             res = lambda p: os.path.join(dest,
                                          os.path.basename(util.localpath(p)))
@@ -477,7 +521,7 @@
                     score = 0
                     for s in srcs:
                         t = os.path.join(dest, util.localpath(s[0])[striplen:])
-                        if os.path.exists(t):
+                        if os.path.lexists(t):
                             score += 1
                     return score
 
@@ -512,7 +556,7 @@
     dest = pats.pop()
     destdirexists = os.path.isdir(dest) and not os.path.islink(dest)
     if not destdirexists:
-        if len(pats) > 1 or _match.patkind(pats[0]):
+        if len(pats) > 1 or matchmod.patkind(pats[0]):
             raise util.Abort(_('with multiple sources, destination must be an '
                                'existing directory'))
         if util.endswithsep(dest):
@@ -638,7 +682,7 @@
         fp.write("# HG changeset patch\n")
         fp.write("# User %s\n" % ctx.user())
         fp.write("# Date %d %d\n" % ctx.date())
-        if branch and (branch != 'default'):
+        if branch and branch != 'default':
             fp.write("# Branch %s\n" % branch)
         fp.write("# Node ID %s\n" % hex(node))
         fp.write("# Parent  %s\n" % hex(prev))
@@ -654,7 +698,8 @@
         single(rev, seqno + 1, fp)
 
 def diffordiffstat(ui, repo, diffopts, node1, node2, match,
-                   changes=None, stat=False, fp=None):
+                   changes=None, stat=False, fp=None, prefix='',
+                   listsubrepos=False):
     '''show diff or diffstat.'''
     if fp is None:
         write = ui.write
@@ -667,16 +712,27 @@
         width = 80
         if not ui.plain():
             width = util.termwidth()
-        chunks = patch.diff(repo, node1, node2, match, changes, diffopts)
+        chunks = patch.diff(repo, node1, node2, match, changes, diffopts,
+                            prefix=prefix)
         for chunk, label in patch.diffstatui(util.iterlines(chunks),
                                              width=width,
                                              git=diffopts.git):
             write(chunk, label=label)
     else:
         for chunk, label in patch.diffui(repo, node1, node2, match,
-                                         changes, diffopts):
+                                         changes, diffopts, prefix=prefix):
             write(chunk, label=label)
 
+    if listsubrepos:
+        ctx1 = repo[node1]
+        ctx2 = repo[node2]
+        for subpath, sub in subrepo.itersubrepos(ctx1, ctx2):
+            if node2 is not None:
+                node2 = ctx2.substate[subpath][1]
+            submatch = matchmod.narrowmatcher(subpath, match)
+            sub.diff(diffopts, node2, submatch, changes=changes,
+                     stat=stat, fp=fp, prefix=prefix)
+
 class changeset_printer(object):
     '''show changeset information when templating not requested.'''
 
@@ -1052,36 +1108,53 @@
     fncache = {}
     change = util.cachefunc(repo.changectx)
 
+    # First step is to fill wanted, the set of revisions that we want to yield.
+    # When it does not induce extra cost, we also fill fncache for revisions in
+    # wanted: a cache of filenames that were changed (ctx.files()) and that
+    # match the file filtering conditions.
+
     if not slowpath and not match.files():
         # No files, no patterns.  Display all revs.
         wanted = set(revs)
     copies = []
 
     if not slowpath:
-        # Only files, no patterns.  Check the history of each file.
-        def filerevgen(filelog, node):
+        # We only have to read through the filelog to find wanted revisions
+
+        minrev, maxrev = min(revs), max(revs)
+        def filerevgen(filelog, last):
+            """
+            Only files, no patterns.  Check the history of each file.
+
+            Examines filelog entries within minrev, maxrev linkrev range
+            Returns an iterator yielding (linkrev, parentlinkrevs, copied)
+            tuples in backwards order
+            """
             cl_count = len(repo)
-            if node is None:
-                last = len(filelog) - 1
-            else:
-                last = filelog.rev(node)
-            for i, window in increasing_windows(last, nullrev):
-                revs = []
-                for j in xrange(i - window, i + 1):
-                    n = filelog.node(j)
-                    revs.append((filelog.linkrev(j),
-                                 follow and filelog.renamed(n)))
-                for rev in reversed(revs):
-                    # only yield rev for which we have the changelog, it can
-                    # happen while doing "hg log" during a pull or commit
-                    if rev[0] < cl_count:
-                        yield rev
+            revs = []
+            for j in xrange(0, last + 1):
+                linkrev = filelog.linkrev(j)
+                if linkrev < minrev:
+                    continue
+                # only yield rev for which we have the changelog, it can
+                # happen while doing "hg log" during a pull or commit
+                if linkrev > maxrev or linkrev >= cl_count:
+                    break
+
+                parentlinkrevs = []
+                for p in filelog.parentrevs(j):
+                    if p != nullrev:
+                        parentlinkrevs.append(filelog.linkrev(p))
+                n = filelog.node(j)
+                revs.append((linkrev, parentlinkrevs,
+                             follow and filelog.renamed(n)))
+
+            return reversed(revs)
         def iterfiles():
             for filename in match.files():
                 yield filename, None
             for filename_node in copies:
                 yield filename_node
-        minrev, maxrev = min(revs), max(revs)
         for file_, node in iterfiles():
             filelog = repo.file(file_)
             if not len(filelog):
@@ -1095,31 +1168,43 @@
                     break
                 else:
                     continue
-            for rev, copied in filerevgen(filelog, node):
-                if rev <= maxrev:
-                    if rev < minrev:
-                        break
-                    fncache.setdefault(rev, [])
-                    fncache[rev].append(file_)
-                    wanted.add(rev)
-                    if copied:
-                        copies.append(copied)
+
+            if node is None:
+                last = len(filelog) - 1
+            else:
+                last = filelog.rev(node)
+
+
+            # keep track of all ancestors of the file
+            ancestors = set([filelog.linkrev(last)])
+
+            # iterate from latest to oldest revision
+            for rev, flparentlinkrevs, copied in filerevgen(filelog, last):
+                if rev not in ancestors:
+                    continue
+                # XXX insert 1327 fix here
+                if flparentlinkrevs:
+                    ancestors.update(flparentlinkrevs)
+
+                fncache.setdefault(rev, []).append(file_)
+                wanted.add(rev)
+                if copied:
+                    copies.append(copied)
     if slowpath:
+        # We have to read the changelog to match filenames against
+        # changed files
+
         if follow:
             raise util.Abort(_('can only follow copies/renames for explicit '
                                'filenames'))
 
         # The slow path checks files modified in every changeset.
-        def changerevgen():
-            for i, window in increasing_windows(len(repo) - 1, nullrev):
-                for j in xrange(i - window, i + 1):
-                    yield change(j)
-
-        for ctx in changerevgen():
+        for i in sorted(revs):
+            ctx = change(i)
             matches = filter(match, ctx.files())
             if matches:
-                fncache[ctx.rev()] = matches
-                wanted.add(ctx.rev())
+                fncache[i] = matches
+                wanted.add(i)
 
     class followfilter(object):
         def __init__(self, onlyfirst=False):
@@ -1168,6 +1253,8 @@
             if ff.match(x):
                 wanted.discard(x)
 
+    # Now that wanted is correctly initialized, we can iterate over the
+    # revision range, yielding only revisions in wanted.
     def iterate():
         if follow and not match.files():
             ff = followfilter(onlyfirst=opts.get('follow_first'))
@@ -1178,7 +1265,6 @@
                 return rev in wanted
 
         for i, window in increasing_windows(0, len(revs)):
-            change = util.cachefunc(repo.changectx)
             nrevs = [rev for rev in revs[i:i + window] if want(rev)]
             for rev in sorted(nrevs):
                 fns = fncache.get(rev)
@@ -1194,6 +1280,35 @@
                 yield change(rev)
     return iterate()
 
+def add(ui, repo, match, dryrun, listsubrepos, prefix):
+    join = lambda f: os.path.join(prefix, f)
+    bad = []
+    oldbad = match.bad
+    match.bad = lambda x, y: bad.append(x) or oldbad(x, y)
+    names = []
+    wctx = repo[None]
+    for f in repo.walk(match):
+        exact = match.exact(f)
+        if exact or f not in repo.dirstate:
+            names.append(f)
+            if ui.verbose or not exact:
+                ui.status(_('adding %s\n') % match.rel(join(f)))
+
+    if listsubrepos:
+        for subpath in wctx.substate:
+            sub = wctx.sub(subpath)
+            try:
+                submatch = matchmod.narrowmatcher(subpath, match)
+                bad.extend(sub.add(ui, submatch, dryrun, prefix))
+            except error.LookupError:
+                ui.status(_("skipping missing subrepository: %s\n")
+                               % join(subpath))
+
+    if not dryrun:
+        rejected = wctx.add(names, prefix)
+        bad.extend(f for f in rejected if f in match.files())
+    return bad
+
 def commit(ui, repo, commitfunc, pats, opts):
     '''commit the specified files or all outstanding changes'''
     date = opts.get('date')
--- a/mercurial/commands.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/commands.py	Wed Sep 22 18:29:41 2010 -0500
@@ -9,7 +9,7 @@
 from lock import release
 from i18n import _, gettext
 import os, re, sys, difflib, time, tempfile
-import hg, util, revlog, bundlerepo, extensions, copies, error
+import hg, util, revlog, extensions, copies, error
 import patch, help, mdiff, url, encoding, templatekw, discovery
 import archival, changegroup, cmdutil, sshserver, hbisect, hgweb, hgweb.server
 import merge as mergemod
@@ -46,21 +46,10 @@
     Returns 0 if all files are successfully added.
     """
 
-    bad = []
-    names = []
     m = cmdutil.match(repo, pats, opts)
-    oldbad = m.bad
-    m.bad = lambda x, y: bad.append(x) or oldbad(x, y)
-
-    for f in repo.walk(m):
-        exact = m.exact(f)
-        if exact or f not in repo.dirstate:
-            names.append(f)
-            if ui.verbose or not exact:
-                ui.status(_('adding %s\n') % m.rel(f))
-    if not opts.get('dry_run'):
-        bad += [f for f in repo[None].add(names) if f in m.files()]
-    return bad and 1 or 0
+    rejected = cmdutil.add(ui, repo, m, opts.get('dry_run'),
+                           opts.get('subrepos'), prefix="")
+    return rejected and 1 or 0
 
 def addremove(ui, repo, *pats, **opts):
     """add all new files, delete all missing files
@@ -83,7 +72,7 @@
     Returns 0 if all files are successfully added.
     """
     try:
-        sim = float(opts.get('similarity') or 0)
+        sim = float(opts.get('similarity') or 100)
     except ValueError:
         raise util.Abort(_('similarity must be a number'))
     if sim < 0 or sim > 100:
@@ -197,20 +186,7 @@
     if os.path.realpath(dest) == repo.root:
         raise util.Abort(_('repository root cannot be destination'))
 
-    def guess_type():
-        exttypes = {
-            'tar': ['.tar'],
-            'tbz2': ['.tbz2', '.tar.bz2'],
-            'tgz': ['.tgz', '.tar.gz'],
-            'zip': ['.zip'],
-        }
-
-        for type, extensions in exttypes.items():
-            if util.any(dest.endswith(ext) for ext in extensions):
-                return type
-        return None
-
-    kind = opts.get('type') or guess_type() or 'files'
+    kind = opts.get('type') or archival.guesskind(dest) or 'files'
     prefix = opts.get('prefix')
 
     if dest == '-':
@@ -223,7 +199,7 @@
     prefix = cmdutil.make_filename(repo, prefix, node)
     matchfn = cmdutil.match(repo, [], opts)
     archival.archive(repo, dest, node, kind, not opts.get('no_decode'),
-                     matchfn, prefix)
+                     matchfn, prefix, subrepos=opts.get('subrepos'))
 
 def backout(ui, repo, node=None, rev=None, **opts):
     '''reverse effect of earlier changeset
@@ -348,6 +324,15 @@
             else:
                 ui.write(_("The first bad revision is:\n"))
             displayer.show(repo[nodes[0]])
+            parents = repo[nodes[0]].parents()
+            if len(parents) > 1:
+                side = good and state['bad'] or state['good']
+                num = len(set(i.node() for i in parents) & set(side))
+                if num == 1:
+                    common = parents[0].ancestor(parents[1])
+                    ui.write(_('Not all ancestors of this changeset have been'
+                               ' checked.\nTo check the other ancestors, start'
+                               ' from the common ancestor, %s.\n' % common))
         else:
             # multiple possible revisions
             if good:
@@ -423,14 +408,19 @@
         return
 
     # update state
-    node = repo.lookup(rev or '.')
+
+    if rev:
+        nodes = [repo.lookup(i) for i in cmdutil.revrange(repo, [rev])]
+    else:
+        nodes = [repo.lookup('.')]
+
     if good or bad or skip:
         if good:
-            state['good'].append(node)
+            state['good'] += nodes
         elif bad:
-            state['bad'].append(node)
+            state['bad'] += nodes
         elif skip:
-            state['skip'].append(node)
+            state['skip'] += nodes
         hbisect.save_state(repo, state)
 
     if not check_state(state):
@@ -525,16 +515,22 @@
             else:
                 hn = repo.lookup(node)
                 if isactive:
+                    label = 'branches.active'
                     notice = ''
                 elif hn not in repo.branchheads(tag, closed=False):
                     if not closed:
                         continue
+                    label = 'branches.closed'
                     notice = _(' (closed)')
                 else:
+                    label = 'branches.inactive'
                     notice = _(' (inactive)')
+                if tag == repo.dirstate.branch():
+                    label = 'branches.current'
                 rev = str(node).rjust(31 - encoding.colwidth(encodedtag))
-                data = encodedtag, rev, hexfunc(hn), notice
-                ui.write("%s %s:%s%s\n" % data)
+                rev = ui.label('%s:%s' % (rev, hexfunc(hn)), 'log.changeset')
+                encodedtag = ui.label(encodedtag, label)
+                ui.write("%s %s%s\n" % (encodedtag, rev, notice))
 
 def bundle(ui, repo, fname, dest=None, **opts):
     """create a changegroup file
@@ -905,7 +901,7 @@
         # we don't want to fail in merges during buildup
         os.environ['HGMERGE'] = 'internal:local'
 
-    def writefile(fname, text, fmode="w"):
+    def writefile(fname, text, fmode="wb"):
         f = open(fname, fmode)
         try:
             f.write(text)
@@ -940,7 +936,7 @@
                 merge(ui, repo, node=p2)
 
             if mergeable_file:
-                f = open("mf", "r+")
+                f = open("mf", "rb+")
                 try:
                     lines = f.read().split("\n")
                     lines[id * linesperrev] += " r%i" % id
@@ -950,7 +946,7 @@
                     f.close()
 
             if appended_file:
-                writefile("af", "r%i\n" % id, "a")
+                writefile("af", "r%i\n" % id, "ab")
 
             if overwritten_file:
                 writefile("of", "r%i\n" % id)
@@ -1221,9 +1217,15 @@
         ui.write(line)
         ui.write("\n")
 
-def debugdata(ui, file_, rev):
+def debugdata(ui, repo, file_, rev):
     """dump the contents of a data file revision"""
-    r = revlog.revlog(util.opener(os.getcwd(), audit=False), file_[:-2] + ".i")
+    r = None
+    if repo:
+        filelog = repo.file(file_)
+        if len(filelog):
+            r = filelog
+    if not r:
+        r = revlog.revlog(util.opener(os.getcwd(), audit=False), file_[:-2] + ".i")
     try:
         ui.write(r.revision(r.lookup(rev)))
     except KeyError:
@@ -1241,9 +1243,15 @@
         m = util.matchdate(range)
         ui.write("match: %s\n" % m(d[0]))
 
-def debugindex(ui, file_):
+def debugindex(ui, repo, file_):
     """dump the contents of an index file"""
-    r = revlog.revlog(util.opener(os.getcwd(), audit=False), file_)
+    r = None
+    if repo:
+        filelog = repo.file(file_)
+        if len(filelog):
+            r = filelog
+    if not r:
+        r = revlog.revlog(util.opener(os.getcwd(), audit=False), file_)
     ui.write("   rev    offset  length   base linkrev"
              " nodeid       p1           p2\n")
     for i in r:
@@ -1256,9 +1264,15 @@
                 i, r.start(i), r.length(i), r.base(i), r.linkrev(i),
             short(node), short(pp[0]), short(pp[1])))
 
-def debugindexdot(ui, file_):
+def debugindexdot(ui, repo, file_):
     """dump an index DAG as a graphviz dot file"""
-    r = revlog.revlog(util.opener(os.getcwd(), audit=False), file_)
+    r = None
+    if repo:
+        filelog = repo.file(file_)
+        if len(filelog):
+            r = filelog
+    if not r:
+        r = revlog.revlog(util.opener(os.getcwd(), audit=False), file_)
     ui.write("digraph G {\n")
     for i in r:
         node = r.node(i)
@@ -1293,9 +1307,10 @@
         problems += 1
 
     # compiled modules
-    ui.status(_("Checking extensions...\n"))
+    ui.status(_("Checking installed modules (%s)...\n")
+              % os.path.dirname(__file__))
     try:
-        import bdiff, mpatch, base85
+        import bdiff, mpatch, base85, osutil
     except Exception, inst:
         ui.write(" %s\n" % inst)
         ui.write(_(" One or more extensions could not be found"))
@@ -1369,7 +1384,7 @@
     # check username
     ui.status(_("Checking username...\n"))
     try:
-        user = ui.username()
+        ui.username()
     except util.Abort, e:
         ui.write(" %s\n" % e)
         ui.write(_(" (specify a username in your configuration file)\n"))
@@ -1459,7 +1474,8 @@
 
     diffopts = patch.diffopts(ui, opts)
     m = cmdutil.match(repo, pats, opts)
-    cmdutil.diffordiffstat(ui, repo, diffopts, node1, node2, m, stat=stat)
+    cmdutil.diffordiffstat(ui, repo, diffopts, node1, node2, m, stat=stat,
+                           listsubrepos=opts.get('subrepos'))
 
 def export(ui, repo, *changesets, **opts):
     """dump the header and diffs for one or more changesets
@@ -1478,11 +1494,11 @@
     given using a format string. The formatting rules are as follows:
 
     :``%%``: literal "%" character
-    :``%H``: changeset hash (40 bytes of hexadecimal)
+    :``%H``: changeset hash (40 hexadecimal digits)
     :``%N``: number of patches being generated
     :``%R``: changeset revision number
     :``%b``: basename of the exporting repository
-    :``%h``: short-form changeset hash (12 bytes of hexadecimal)
+    :``%h``: short-form changeset hash (12 hexadecimal digits)
     :``%n``: zero-padded sequence number, starting at 1
     :``%r``: zero-padded changeset revision number
 
@@ -1874,7 +1890,10 @@
         if not doc:
             doc = _("(no help text available)")
         if hasattr(entry[0], 'definition'):  # aliased command
-            doc = _('alias for: hg %s\n\n%s') % (entry[0].definition, doc)
+            if entry[0].definition.startswith('!'):  # shell alias
+                doc = _('shell alias for::\n\n    %s') % entry[0].definition[1:]
+            else:
+                doc = _('alias for: hg %s\n\n%s') % (entry[0].definition, doc)
         if ui.quiet:
             doc = doc.splitlines()[0]
         keep = ui.verbose and ['verbose'] or []
@@ -2270,8 +2289,8 @@
                 patch.patch(tmpname, ui, strip=strip, cwd=repo.root,
                             files=files, eolmode=None)
             finally:
-                files = patch.updatedir(ui, repo, files,
-                                        similarity=sim / 100.0)
+                files = cmdutil.updatedir(ui, repo, files,
+                                          similarity=sim / 100.0)
             if not opts.get('no_commit'):
                 if opts.get('exact'):
                     m = None
@@ -2338,66 +2357,16 @@
 
     Returns 0 if there are incoming changes, 1 otherwise.
     """
-    limit = cmdutil.loglimit(opts)
-    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))
-    revs, checkout = hg.addbranchrevs(repo, other, branches, opts.get('rev'))
-    if revs:
-        revs = [other.lookup(rev) for rev in revs]
-
-    tmp = discovery.findcommonincoming(repo, other, heads=revs,
-                                       force=opts.get('force'))
-    common, incoming, rheads = tmp
-    if not incoming:
-        try:
-            os.unlink(opts["bundle"])
-        except:
-            pass
-        ui.status(_("no changes found\n"))
-        return 1
-
-    cleanup = None
-    try:
-        fname = opts["bundle"]
-        if fname or not other.local():
-            # create a bundle (uncompressed if other repo is not local)
-
-            if revs is None and other.capable('changegroupsubset'):
-                revs = rheads
-
-            if revs is None:
-                cg = other.changegroup(incoming, "incoming")
-            else:
-                cg = other.changegroupsubset(incoming, revs, 'incoming')
-            bundletype = other.local() and "HG10BZ" or "HG10UN"
-            fname = cleanup = changegroup.writebundle(cg, fname, bundletype)
-            # keep written bundle?
-            if opts["bundle"]:
-                cleanup = None
-            if not other.local():
-                # use the created uncompressed bundlerepo
-                other = bundlerepo.bundlerepository(ui, repo.root, fname)
-
-        o = other.changelog.nodesbetween(incoming, revs)[0]
-        if opts.get('newest_first'):
-            o.reverse()
-        displayer = cmdutil.show_changeset(ui, other, opts)
-        count = 0
-        for n in o:
-            if limit is not None and count >= limit:
-                break
-            parents = [p for p in other.changelog.parents(n) if p != nullid]
-            if opts.get('no_merges') and len(parents) == 2:
-                continue
-            count += 1
-            displayer.show(other[n])
-        displayer.close()
-    finally:
-        if hasattr(other, 'close'):
-            other.close()
-        if cleanup:
-            os.unlink(cleanup)
+    if opts.get('bundle') and opts.get('subrepos'):
+        raise util.Abort(_('cannot combine --bundle and --subrepos'))
+
+    ret = hg.incoming(ui, repo, source, opts)
+    if opts.get('subrepos'):
+        ctx = repo[None]
+        for subpath in sorted(ctx.substate):
+            sub = ctx.sub(subpath)
+            ret = min(ret, sub.incoming(ui, source, opts))
+    return ret
 
 def init(ui, dest=".", **opts):
     """create a new repository in the given directory
@@ -2653,33 +2622,13 @@
 
     Returns 0 if there are outgoing changes, 1 otherwise.
     """
-    limit = cmdutil.loglimit(opts)
-    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'))
-    if revs:
-        revs = [repo.lookup(rev) for rev in revs]
-
-    other = hg.repository(hg.remoteui(repo, opts), dest)
-    ui.status(_('comparing with %s\n') % url.hidepassword(dest))
-    o = discovery.findoutgoing(repo, other, force=opts.get('force'))
-    if not o:
-        ui.status(_("no changes found\n"))
-        return 1
-    o = repo.changelog.nodesbetween(o, revs)[0]
-    if opts.get('newest_first'):
-        o.reverse()
-    displayer = cmdutil.show_changeset(ui, repo, opts)
-    count = 0
-    for n in o:
-        if limit is not None and count >= limit:
-            break
-        parents = [p for p in repo.changelog.parents(n) if p != nullid]
-        if opts.get('no_merges') and len(parents) == 2:
-            continue
-        count += 1
-        displayer.show(repo[n])
-    displayer.close()
+    ret = hg.outgoing(ui, repo, dest, opts)
+    if opts.get('subrepos'):
+        ctx = repo[None]
+        for subpath in sorted(ctx.substate):
+            sub = ctx.sub(subpath)
+            ret = min(ret, sub.outgoing(ui, dest, opts))
+    return ret
 
 def parents(ui, repo, file_=None, **opts):
     """show the parents of the working directory or revision
@@ -3041,6 +2990,8 @@
 
                 # replace filemerge's .orig file with our resolve file
                 util.rename(a + ".resolve", a + ".orig")
+
+    ms.commit()
     return ret
 
 def revert(ui, repo, *pats, **opts):
@@ -3082,8 +3033,8 @@
     Returns 0 on success.
     """
 
-    if opts["date"]:
-        if opts["rev"]:
+    if opts.get("date"):
+        if opts.get("rev"):
             raise util.Abort(_("you can't specify a revision and a date"))
         opts["rev"] = cmdutil.finddate(ui, repo, opts["date"])
 
@@ -3175,7 +3126,8 @@
             target = repo.wjoin(abs)
             def handle(xlist, dobackup):
                 xlist[0].append(abs)
-                if dobackup and not opts.get('no_backup') and util.lexists(target):
+                if (dobackup and not opts.get('no_backup') and
+                    os.path.lexists(target)):
                     bakname = "%s.orig" % rel
                     ui.note(_('saving current version of %s as %s\n') %
                             (rel, bakname))
@@ -3340,7 +3292,7 @@
 
     # this way we can check if something was given in the command-line
     if opts.get('port'):
-        opts['port'] = int(opts.get('port'))
+        opts['port'] = util.getport(opts.get('port'))
 
     baseui = repo and repo.baseui or ui
     optlist = ("name templates style address port prefix ipv6"
@@ -3462,7 +3414,8 @@
         show = ui.quiet and states[:4] or states[:5]
 
     stat = repo.status(node1, node2, cmdutil.match(repo, pats, opts),
-                       'ignored' in show, 'clean' in show, 'unknown' in show)
+                       'ignored' in show, 'clean' in show, 'unknown' in show,
+                       opts.get('subrepos'))
     changestates = zip(states, 'MAR!?IC', stat)
 
     if (opts.get('all') or opts.get('copies')) and not opts.get('no_status'):
@@ -3975,8 +3928,14 @@
      _('guess renamed files by similarity (0<=s<=100)'), _('SIMILARITY'))
 ]
 
+subrepoopts = [
+    ('S', 'subrepos', None,
+     _('recurse into subrepositories'))
+]
+
 table = {
-    "^add": (add, walkopts + dryrunopts, _('[OPTION]... [FILE]...')),
+    "^add": (add, walkopts + subrepoopts + dryrunopts,
+             _('[OPTION]... [FILE]...')),
     "addremove":
         (addremove, similarityopts + walkopts + dryrunopts,
          _('[OPTION]... [FILE]...')),
@@ -4006,7 +3965,7 @@
            _('revision to distribute'), _('REV')),
           ('t', 'type', '',
            _('type of distribution to create'), _('TYPE')),
-         ] + walkopts,
+         ] + subrepoopts + walkopts,
          _('[OPTION]... DEST')),
     "backout":
         (backout,
@@ -4161,7 +4120,7 @@
            _('revision'), _('REV')),
           ('c', 'change', '',
            _('change made by revision'), _('REV'))
-         ] + diffopts + diffopts2 + walkopts,
+         ] + diffopts + diffopts2 + walkopts + subrepoopts,
          _('[OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...')),
     "^export":
         (export,
@@ -4243,7 +4202,7 @@
            _('a remote changeset intended to be added'), _('REV')),
           ('b', 'branch', [],
            _('a specific branch you would like to pull'), _('BRANCH')),
-         ] + logopts + remoteopts,
+         ] + logopts + remoteopts + subrepoopts,
          _('[-p] [-n] [-M] [-f] [-r REV]...'
            ' [--bundle FILENAME] [SOURCE]')),
     "^init":
@@ -4310,7 +4269,7 @@
           ('n', 'newest-first', None, _('show newest record first')),
           ('b', 'branch', [],
            _('a specific branch you would like to push'), _('BRANCH')),
-         ] + logopts + remoteopts,
+         ] + logopts + remoteopts + subrepoopts,
          _('[-M] [-p] [-n] [-f] [-r REV]... [DEST]')),
     "parents":
         (parents,
@@ -4438,7 +4397,7 @@
            _('show difference from revision'), _('REV')),
           ('', 'change', '',
            _('list the changed files of a revision'), _('REV')),
-         ] + walkopts,
+         ] + walkopts + subrepoopts,
          _('[OPTION]... [FILE]...')),
     "tag":
         (tag,
@@ -4478,7 +4437,7 @@
     "version": (version_, []),
 }
 
-norepo = ("clone init version help debugcommands debugcomplete debugdata"
-          " debugindex debugindexdot debugdate debuginstall debugfsinfo"
-          " debugpushkey")
-optionalrepo = ("identify paths serve showconfig debugancestor debugdag")
+norepo = ("clone init version help debugcommands debugcomplete"
+          " debugdate debuginstall debugfsinfo debugpushkey")
+optionalrepo = ("identify paths serve showconfig debugancestor debugdag"
+                " debugdata debugindex debugindexdot")
--- a/mercurial/context.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/context.py	Wed Sep 22 18:29:41 2010 -0500
@@ -75,7 +75,7 @@
 
     @propertycache
     def substate(self):
-        return subrepo.state(self)
+        return subrepo.state(self, self._repo.ui)
 
     def __contains__(self, key):
         return key in self._manifest
@@ -352,12 +352,12 @@
     def size(self):
         return self._filelog.size(self._filerev)
 
-    def cmp(self, text):
-        """compare text with stored file revision
+    def cmp(self, fctx):
+        """compare with other file context
 
-        returns True if text is different than what is stored.
+        returns True if different than fctx.
         """
-        return self._filelog.cmp(self._filenode, text)
+        return self._filelog.cmp(self._filenode, fctx.data())
 
     def renamed(self):
         """check if file was actually renamed in this changeset revision
@@ -769,7 +769,8 @@
                 self.modified() or self.added() or self.removed() or
                 (missing and self.deleted()))
 
-    def add(self, list):
+    def add(self, list, prefix=""):
+        join = lambda f: os.path.join(prefix, f)
         wlock = self._repo.wlock()
         ui, ds = self._repo.ui, self._repo.dirstate
         try:
@@ -779,7 +780,7 @@
                 try:
                     st = os.lstat(p)
                 except:
-                    ui.warn(_("%s does not exist!\n") % f)
+                    ui.warn(_("%s does not exist!\n") % join(f))
                     rejected.append(f)
                     continue
                 if st.st_size > 10000000:
@@ -787,13 +788,13 @@
                               "to manage this file\n"
                               "(use 'hg revert %s' to cancel the "
                               "pending addition)\n")
-                              % (f, 3 * st.st_size // 1000000, f))
+                              % (f, 3 * st.st_size // 1000000, join(f)))
                 if not (stat.S_ISREG(st.st_mode) or stat.S_ISLNK(st.st_mode)):
                     ui.warn(_("%s not added: only files and symlinks "
-                              "supported currently\n") % f)
+                              "supported currently\n") % join(f))
                     rejected.append(p)
                 elif ds[f] in 'amn':
-                    ui.warn(_("%s already tracked!\n") % f)
+                    ui.warn(_("%s already tracked!\n") % join(f))
                 elif ds[f] == 'r':
                     ds.normallookup(f)
                 else:
@@ -935,12 +936,14 @@
                 raise
             return (t, tz)
 
-    def cmp(self, text):
-        """compare text with disk content
+    def cmp(self, fctx):
+        """compare with other file context
 
-        returns True if text is different than what is on disk.
+        returns True if different than fctx.
         """
-        return self._repo.wread(self._path) != text
+        # fctx should be a filectx (not a wfctx)
+        # invert comparison to reuse the same code path
+        return fctx.cmp(self)
 
 class memctx(object):
     """Use memctx to perform in-memory commits via localrepo.commitctx().
--- a/mercurial/demandimport.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/demandimport.py	Wed Sep 22 18:29:41 2010 -0500
@@ -29,29 +29,35 @@
 
 class _demandmod(object):
     """module demand-loader and proxy"""
-    def __init__(self, name, globals, locals):
+    def __init__(self, name, globals, locals, level):
         if '.' in name:
             head, rest = name.split('.', 1)
             after = [rest]
         else:
             head = name
             after = []
-        object.__setattr__(self, "_data", (head, globals, locals, after))
+        object.__setattr__(self, "_data", (head, globals, locals, after, level))
         object.__setattr__(self, "_module", None)
     def _extend(self, name):
         """add to the list of submodules to load"""
         self._data[3].append(name)
     def _load(self):
         if not self._module:
-            head, globals, locals, after = self._data
-            mod = _origimport(head, globals, locals)
+            head, globals, locals, after, level = self._data
+            if level is not None:
+                mod = _origimport(head, globals, locals, level)
+            else:
+                mod = _origimport(head, globals, locals)
             # load submodules
             def subload(mod, p):
                 h, t = p, None
                 if '.' in p:
                     h, t = p.split('.', 1)
                 if not hasattr(mod, h):
-                    setattr(mod, h, _demandmod(p, mod.__dict__, mod.__dict__))
+                    # TODO: should we adjust the level here?
+                    submod = _demandmod(p, mod.__dict__, mod.__dict__,
+                                        level=level)
+                    setattr(mod, h, submod)
                 elif t:
                     subload(getattr(mod, h), t)
 
@@ -91,28 +97,36 @@
             base, rest = name.split('.', 1)
             # email.__init__ loading email.mime
             if globals and globals.get('__name__', None) == base:
-                return _origimport(name, globals, locals, fromlist)
+                if level is not None:
+                    return _origimport(name, globals, locals, fromlist, level)
+                else:
+                    return _origimport(name, globals, locals, fromlist)
             # if a is already demand-loaded, add b to its submodule list
             if base in locals:
                 if isinstance(locals[base], _demandmod):
                     locals[base]._extend(rest)
                 return locals[base]
-        return _demandmod(name, globals, locals)
+        return _demandmod(name, globals, locals, level=level)
     else:
+        # from a import b,c,d
         if level is not None:
-            # from . import b,c,d or from .a import b,c,d
-            return _origimport(name, globals, locals, fromlist, level)
-        # from a import b,c,d
-        mod = _origimport(name, globals, locals)
+            mod = _origimport(name, globals, locals, level=level)
+        else:
+            mod = _origimport(name, globals, locals)
         # recurse down the module chain
         for comp in name.split('.')[1:]:
             if not hasattr(mod, comp):
-                setattr(mod, comp, _demandmod(comp, mod.__dict__, mod.__dict__))
+                # TODO: should we adjust the level here?
+                submod = _demandmod(comp, mod.__dict__, mod.__dict__,
+                                    level=level)
+                setattr(mod, comp, submod)
             mod = getattr(mod, comp)
         for x in fromlist:
             # set requested submodules for demand load
             if not(hasattr(mod, x)):
-                setattr(mod, x, _demandmod(x, mod.__dict__, locals))
+                # TODO: should we adjust the level here?
+                submod = _demandmod(x, mod.__dict__, locals, level=level)
+                setattr(mod, x, submod)
         return mod
 
 ignore = [
--- a/mercurial/dirstate.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/dirstate.py	Wed Sep 22 18:29:41 2010 -0500
@@ -497,14 +497,25 @@
         elif match.files() and not match.anypats(): # match.match, no patterns
             skipstep3 = True
 
-        files = set(match.files())
+        files = sorted(match.files())
+        subrepos.sort()
+        i, j = 0, 0
+        while i < len(files) and j < len(subrepos):
+            subpath = subrepos[j] + "/"
+            if not files[i].startswith(subpath):
+                i += 1
+                continue
+            while files and files[i].startswith(subpath):
+                del files[i]
+            j += 1
+
         if not files or '.' in files:
             files = ['']
         results = dict.fromkeys(subrepos)
         results['.hg'] = None
 
         # step 1: find all explicit files
-        for ff in sorted(files):
+        for ff in files:
             nf = normalize(normpath(ff), False)
             if nf in results:
                 continue
--- a/mercurial/discovery.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/discovery.py	Wed Sep 22 18:29:41 2010 -0500
@@ -35,7 +35,9 @@
     exist on the remote side and that no child of a node of base exists
     in both remote and repo.
     Furthermore base will be updated to include the nodes that exists
-    in repo and remote but no children exists in repo and remote.
+    in repo and remote but no children exists in both repo and remote.
+    In other words, base is the set of heads of the DAG resulting from
+    the intersection of the nodes from repo and remote.
     If a list of heads is specified, return only nodes which are heads
     or ancestors of these heads.
 
@@ -172,18 +174,17 @@
 
     return base.keys(), list(fetch), heads
 
-def findoutgoing(repo, remote, base=None, heads=None, force=False):
+def findoutgoing(repo, remote, base=None, remoteheads=None, force=False):
     """Return list of nodes that are roots of subsets not in remote
 
     If base dict is specified, assume that these nodes and their parents
     exist on the remote side.
-    If a list of heads is specified, return only nodes which are heads
-    or ancestors of these heads, and return a second element which
-    contains all remote heads which get new children.
+    If remotehead is specified, assume it is the list of the heads from
+    the remote repository.
     """
     if base is None:
         base = {}
-        findincoming(repo, remote, base, heads, force=force)
+        findincoming(repo, remote, base, remoteheads, force=force)
 
     repo.ui.debug("common changesets up to "
                   + " ".join(map(short, base.keys())) + "\n")
@@ -203,22 +204,12 @@
     # find every node whose parents have been pruned
     subset = []
     # find every remote head that will get new children
-    updated_heads = set()
     for n in remain:
         p1, p2 = repo.changelog.parents(n)
         if p1 not in remain and p2 not in remain:
             subset.append(n)
-        if heads:
-            if p1 in heads:
-                updated_heads.add(p1)
-            if p2 in heads:
-                updated_heads.add(p2)
 
-    # this is the set of all roots we have to push
-    if heads:
-        return subset, list(updated_heads)
-    else:
-        return subset
+    return subset
 
 def prepush(repo, remote, force, revs, newbranch):
     '''Analyze the local and remote repositories and determine which
@@ -235,34 +226,18 @@
     successive changegroup chunks ready to be sent over the wire and
     remoteheads is the list of remote heads.'''
     common = {}
-    remote_heads = remote.heads()
-    inc = findincoming(repo, remote, common, remote_heads, force=force)
+    remoteheads = remote.heads()
+    inc = findincoming(repo, remote, common, remoteheads, force=force)
 
     cl = repo.changelog
-    update, updated_heads = findoutgoing(repo, remote, common, remote_heads)
+    update = findoutgoing(repo, remote, common, remoteheads)
     outg, bases, heads = cl.nodesbetween(update, revs)
 
     if not bases:
         repo.ui.status(_("no changes found\n"))
         return None, 1
 
-    if not force and remote_heads != [nullid]:
-
-        def fail_multiple_heads(unsynced, branch=None):
-            if branch:
-                msg = _("abort: push creates new remote heads"
-                        " on branch '%s'!\n") % branch
-            else:
-                msg = _("abort: push creates new remote heads!\n")
-            repo.ui.warn(msg)
-            if unsynced:
-                repo.ui.status(_("(you should pull and merge or"
-                                 " use push -f to force)\n"))
-            else:
-                repo.ui.status(_("(did you forget to merge?"
-                                 " use push -f to force)\n"))
-            return None, 0
-
+    if not force and remoteheads != [nullid]:
         if remote.capable('branchmap'):
             # Check for each named branch if we're creating new remote heads.
             # To be a remote head after push, node must be either:
@@ -281,12 +256,10 @@
             newbranches = branches - set(remotemap)
             if newbranches and not newbranch: # new branch requires --new-branch
                 branchnames = ', '.join(sorted(newbranches))
-                repo.ui.warn(_("abort: push creates "
-                               "new remote branches: %s!\n")
-                             % branchnames)
-                repo.ui.status(_("(use 'hg push --new-branch' to create new "
-                                 "remote branches)\n"))
-                return None, 0
+                raise util.Abort(_("push creates new remote branches: %s!")
+                                   % branchnames,
+                                 hint=_("use 'hg push --new-branch' to create"
+                                        " new remote branches"))
             branches.difference_update(newbranches)
 
             # 3. Construct the initial oldmap and newmap dicts.
@@ -299,11 +272,11 @@
             newmap = {}
             unsynced = set()
             for branch in branches:
-                remoteheads = remotemap[branch]
-                prunedheads = [h for h in remoteheads if h in cl.nodemap]
-                oldmap[branch] = prunedheads
-                newmap[branch] = list(prunedheads)
-                if len(remoteheads) > len(prunedheads):
+                remotebrheads = remotemap[branch]
+                prunedbrheads = [h for h in remotebrheads if h in cl.nodemap]
+                oldmap[branch] = prunedbrheads
+                newmap[branch] = list(prunedbrheads)
+                if len(remotebrheads) > len(prunedbrheads):
                     unsynced.add(branch)
 
             # 4. Update newmap with outgoing changes.
@@ -311,23 +284,12 @@
             ctxgen = (repo[n] for n in outg)
             repo._updatebranchcache(newmap, ctxgen)
 
-            # 5. Check for new heads.
-            # If there are more heads after the push than before, a suitable
-            # warning, depending on unsynced status, is displayed.
-            for branch in branches:
-                if len(newmap[branch]) > len(oldmap[branch]):
-                    return fail_multiple_heads(branch in unsynced, branch)
-
-            # 6. Check for unsynced changes on involved branches.
-            if unsynced:
-                repo.ui.warn(_("note: unsynced remote changes!\n"))
-
         else:
-            # Old servers: Check for new topological heads.
-            # Code based on _updatebranchcache.
-            newheads = set(h for h in remote_heads if h in cl.nodemap)
-            oldheadcnt = len(newheads)
-            newheads.update(outg)
+            # 1-4b. old servers: Check for new topological heads.
+            # Construct {old,new}map with branch = None (topological branch).
+            # (code based on _updatebranchcache)
+            oldheads = set(h for h in remoteheads if h in cl.nodemap)
+            newheads = oldheads.union(outg)
             if len(newheads) > 1:
                 for latest in reversed(outg):
                     if latest not in newheads:
@@ -336,10 +298,31 @@
                     reachable = cl.reachable(latest, cl.node(minhrev))
                     reachable.remove(latest)
                     newheads.difference_update(reachable)
-            if len(newheads) > oldheadcnt:
-                return fail_multiple_heads(inc)
-            if inc:
-                repo.ui.warn(_("note: unsynced remote changes!\n"))
+            branches = set([None])
+            newmap = {None: newheads}
+            oldmap = {None: oldheads}
+            unsynced = inc and branches or set()
+
+        # 5. Check for new heads.
+        # If there are more heads after the push than before, a suitable
+        # warning, depending on unsynced status, is displayed.
+        for branch in branches:
+            if len(newmap[branch]) > len(oldmap[branch]):
+                if branch:
+                    msg = _("push creates new remote heads "
+                            "on branch '%s'!") % branch
+                else:
+                    msg = _("push creates new remote heads!")
+
+                if branch in unsynced:
+                    hint = _("you should pull and merge or use push -f to force")
+                else:
+                    hint = _("did you forget to merge? use push -f to force")
+                raise util.Abort(msg, hint=hint)
+
+        # 6. Check for unsynced changes on involved branches.
+        if unsynced:
+            repo.ui.warn(_("note: unsynced remote changes!\n"))
 
     if revs is None:
         # use the fast path, no race possible on push
@@ -347,4 +330,4 @@
         cg = repo._changegroup(nodes, 'push')
     else:
         cg = repo.changegroupsubset(update, revs, 'push')
-    return cg, remote_heads
+    return cg, remoteheads
--- a/mercurial/dispatch.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/dispatch.py	Wed Sep 22 18:29:41 2010 -0500
@@ -6,7 +6,7 @@
 # GNU General Public License version 2 or any later version.
 
 from i18n import _
-import os, sys, atexit, signal, pdb, socket, errno, shlex, time
+import os, sys, atexit, signal, pdb, socket, errno, shlex, time, traceback, re
 import util, commands, hg, fancyopts, extensions, hook, error
 import cmdutil, encoding
 import ui as uimod
@@ -23,6 +23,8 @@
             u.setconfig('ui', 'traceback', 'on')
     except util.Abort, inst:
         sys.stderr.write(_("abort: %s\n") % inst)
+        if inst.hint:
+            sys.stderr.write("(%s)\n" % inst.hint)
         return -1
     except error.ParseError, inst:
         if len(inst.args) > 1:
@@ -49,6 +51,8 @@
         try:
             # enter the debugger before command execution
             if '--debugger' in args:
+                ui.warn(_("entering debugger - "
+                        "type c to continue starting hg or h for help\n"))
                 pdb.set_trace()
             try:
                 return _dispatch(ui, args)
@@ -57,6 +61,7 @@
         except:
             # enter the debugger when we hit an exception
             if '--debugger' in args:
+                traceback.print_exc()
                 pdb.post_mortem(sys.exc_info()[2])
             ui.traceback()
             raise
@@ -113,6 +118,8 @@
             commands.help_(ui, 'shortlist')
     except util.Abort, inst:
         ui.warn(_("abort: %s\n") % inst)
+        if inst.hint:
+            ui.warn(_("(%s)\n") % inst.hint)
     except ImportError, inst:
         ui.warn(_("abort: %s!\n") % inst)
         m = str(inst).split()[-1]
@@ -183,6 +190,7 @@
 class cmdalias(object):
     def __init__(self, name, definition, cmdtable):
         self.name = self.cmd = name
+        self.cmdname = ''
         self.definition = definition
         self.args = []
         self.opts = []
@@ -209,10 +217,39 @@
 
             return
 
+        if self.definition.startswith('!'):
+            def fn(ui, *args):
+                env = {'HG_ARGS': ' '.join((self.name,) + args)}
+                def _checkvar(m):
+                    if int(m.groups()[0]) <= len(args):
+                        return m.group()
+                    else:
+                        return ''
+                cmd = re.sub(r'\$(\d+)', _checkvar, self.definition[1:])
+                replace = dict((str(i + 1), arg) for i, arg in enumerate(args))
+                replace['0'] = self.name
+                replace['@'] = ' '.join(args)
+                cmd = util.interpolate(r'\$', replace, cmd)
+                return util.system(cmd, environ=env)
+            self.fn = fn
+            return
+
         args = shlex.split(self.definition)
-        cmd = args.pop(0)
+        self.cmdname = cmd = args.pop(0)
         args = map(util.expandpath, args)
 
+        for invalidarg in ("--cwd", "-R", "--repository", "--repo"):
+            if _earlygetopt([invalidarg], args):
+                def fn(ui, *args):
+                    ui.warn(_("error in definition for alias '%s': %s may only "
+                              "be given on the command line\n")
+                            % (self.name, invalidarg))
+                    return 1
+
+                self.fn = fn
+                self.badalias = True
+                return
+
         try:
             tableentry = cmdutil.findcmd(cmd, cmdtable, False)[1]
             if len(tableentry) > 2:
@@ -250,9 +287,18 @@
 
     def __call__(self, ui, *args, **opts):
         if self.shadows:
-            ui.debug("alias '%s' shadows command\n" % self.name)
+            ui.debug("alias '%s' shadows command '%s'\n" %
+                     (self.name, self.cmdname))
 
-        return util.checksignature(self.fn)(ui, *args, **opts)
+        if self.definition.startswith('!'):
+            return self.fn(ui, *args, **opts)
+        else:
+            try:
+                util.checksignature(self.fn)(ui, *args, **opts)
+            except error.SignatureError:
+                args = ' '.join([self.cmdname] + self.args)
+                ui.debug("alias '%s' expands to '%s'\n" % (self.name, args))
+                raise
 
 def addaliases(ui, cmdtable):
     # aliases are processed after extensions have been loaded, so they
@@ -489,6 +535,8 @@
     elif rpath:
         ui.warn(_("warning: --repository ignored\n"))
 
+    msg = ' '.join(' ' in a and repr(a) or a for a in fullargs)
+    ui.log("command", msg + "\n")
     d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
     return runcommand(lui, repo, cmd, fullargs, ui, options, d,
                       cmdpats, cmdoptions)
--- a/mercurial/encoding.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/encoding.py	Wed Sep 22 18:29:41 2010 -0500
@@ -6,7 +6,7 @@
 # GNU General Public License version 2 or any later version.
 
 import error
-import sys, unicodedata, locale, os
+import unicodedata, locale, os
 
 def _getpreferredencoding():
     '''
--- a/mercurial/error.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/error.py	Wed Sep 22 18:29:41 2010 -0500
@@ -32,6 +32,9 @@
 
 class Abort(Exception):
     """Raised if a command needs to print an error and exit."""
+    def __init__(self, *args, **kw):
+        Exception.__init__(self, *args)
+        self.hint = kw.get('hint')
 
 class ConfigError(Abort):
     'Exception raised when parsing config files'
--- a/mercurial/filemerge.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/filemerge.py	Wed Sep 22 18:29:41 2010 -0500
@@ -135,7 +135,7 @@
         except IOError:
             return False
 
-    if not fco.cmp(fcd.data()): # files identical?
+    if not fco.cmp(fcd): # files identical?
         return None
 
     ui = repo.ui
@@ -219,8 +219,8 @@
         if "$output" in args:
             out, a = a, back # read input from backup, write to original
         replace = dict(local=a, base=b, other=c, output=out)
-        args = re.sub("\$(local|base|other|output)",
-            lambda x: '"%s"' % util.localpath(replace[x.group()[1:]]), args)
+        args = util.interpolate(r'\$', replace, args,
+                                lambda s: '"%s"' % util.localpath(s))
         r = util.system(toolpath + ' ' + args, cwd=repo.root, environ=env)
 
     if not r and (_toolbool(ui, tool, "checkconflicts") or
--- a/mercurial/help/glossary.txt	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/help/glossary.txt	Wed Sep 22 18:29:41 2010 -0500
@@ -16,7 +16,7 @@
     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
+    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.
 
@@ -94,8 +94,8 @@
 
 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.
+    represented as either a "long" 40 hexadecimal digit string, or a
+    "short" 12 hexadecimal digit string.
 
 Changeset, merge
     A changeset with two parents. This occurs when a merge is
--- a/mercurial/help/revsets.txt	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/help/revsets.txt	Wed Sep 22 18:29:41 2010 -0500
@@ -58,8 +58,7 @@
   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.
+  All changesets belonging to the branches of changesets in set.
 
 ``children(set)``
   Child changesets of changesets in set.
@@ -74,10 +73,10 @@
   Changesets within the interval, see :hg:`help dates`.
 
 ``descendants(set)``
-  Changesets which are decendants of changesets in set.
+  Changesets which are descendants of changesets in set.
 
 ``file(pattern)``
-  Changesets which manually affected files matching pattern.
+  Changesets affecting files matched by pattern.
 
 ``follow()``
   An alias for ``::.`` (ancestors of the working copy's first parent).
@@ -101,14 +100,18 @@
 ``max(set)``
   Changeset with highest revision number in set.
 
+``min(set)``
+  Changeset with lowest revision number in set.
+
 ``merge()``
   Changeset is a merge changeset.
 
 ``modifies(pattern)``
-  Changesets which modify files matching pattern.
+  Changesets modifying files matched by pattern.
 
 ``outgoing([path])``
-  Changesets missing in path.
+  Changesets not found in the specified destination repository, or the
+  default push location.
 
 ``p1(set)``
   First parent of changesets in set.
@@ -119,6 +122,10 @@
 ``parents(set)``
   The set of all parents for all changesets in set.
 
+``present(set)``
+  An empty set, if any revision in set isn't found; otherwise,
+  all revisions in set.
+
 ``removes(pattern)``
   Changesets which remove files matching pattern.
 
--- a/mercurial/help/templates.txt	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/help/templates.txt	Wed Sep 22 18:29:41 2010 -0500
@@ -28,6 +28,8 @@
 :branches: String. The name of the branch on which the changeset was
     committed. Will be empty if the branch name was default.
 
+:children: List of strings. The children of the changeset.
+
 :date: Date information. The date when the changeset was committed.
 
 :desc: String. The text of the changeset description.
@@ -50,8 +52,8 @@
 
 :file_dels: List of strings. Files removed by this changeset.
 
-:node: String. The changeset identification hash, as a 40-character
-    hexadecimal string.
+:node: String. The changeset identification hash, as a 40 hexadecimal
+    digit string.
 
 :parents: List of strings. The parents of the changeset.
 
@@ -104,6 +106,9 @@
 :escape: Any text. Replaces the special XML/XHTML characters "&", "<"
     and ">" with XML entities.
 
+:hex: Any text. Convert a binary Mercurial node identifier into
+    its long hexadecimal representation.
+
 :fill68: Any text. Wraps the text to fit in 68 columns.
 
 :fill76: Any text. Wraps the text to fit in 76 columns.
@@ -136,7 +141,7 @@
     specified in RFC 3339: "2009-08-18T13:00:13+02:00".
 
 :short: Changeset hash. Returns the short form of a changeset hash,
-    i.e. a 12-byte hexadecimal string.
+    i.e. a 12 hexadecimal digit string.
 
 :shortdate: Date. Returns a date like "2006-09-18".
 
--- a/mercurial/hg.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/hg.py	Wed Sep 22 18:29:41 2010 -0500
@@ -8,8 +8,10 @@
 
 from i18n import _
 from lock import release
+from node import hex, nullid, nullrev, short
 import localrepo, bundlerepo, httprepo, sshrepo, statichttprepo
 import lock, util, extensions, error, encoding, node
+import cmdutil, discovery, url, changegroup
 import merge as mergemod
 import verify as verifymod
 import errno, os, shutil
@@ -311,7 +313,8 @@
             # we need to re-init the repo after manually copying the data
             # into it
             dest_repo = repository(ui, dest)
-            src_repo.hook('outgoing', source='clone', node='0'*40)
+            src_repo.hook('outgoing', source='clone',
+                          node=node.hex(node.nullid))
         else:
             try:
                 dest_repo = repository(ui, dest, create=True)
@@ -400,11 +403,102 @@
     _showstats(repo, stats)
     if stats[3]:
         repo.ui.status(_("use 'hg resolve' to retry unresolved file merges "
-                         "or 'hg update -C' to abandon\n"))
+                         "or 'hg update -C .' to abandon\n"))
     elif remind:
         repo.ui.status(_("(branch merge, don't forget to commit)\n"))
     return stats[3] > 0
 
+def incoming(ui, repo, source, opts):
+    limit = cmdutil.loglimit(opts)
+    source, branches = parseurl(ui.expandpath(source), opts.get('branch'))
+    other = repository(remoteui(repo, opts), source)
+    ui.status(_('comparing with %s\n') % url.hidepassword(source))
+    revs, checkout = addbranchrevs(repo, other, branches, opts.get('rev'))
+    if revs:
+        revs = [other.lookup(rev) for rev in revs]
+
+    tmp = discovery.findcommonincoming(repo, other, heads=revs,
+                                       force=opts.get('force'))
+    common, incoming, rheads = tmp
+    if not incoming:
+        try:
+            os.unlink(opts["bundle"])
+        except:
+            pass
+        ui.status(_("no changes found\n"))
+        return 1
+
+    cleanup = None
+    try:
+        fname = opts["bundle"]
+        if fname or not other.local():
+            # create a bundle (uncompressed if other repo is not local)
+
+            if revs is None and other.capable('changegroupsubset'):
+                revs = rheads
+
+            if revs is None:
+                cg = other.changegroup(incoming, "incoming")
+            else:
+                cg = other.changegroupsubset(incoming, revs, 'incoming')
+            bundletype = other.local() and "HG10BZ" or "HG10UN"
+            fname = cleanup = changegroup.writebundle(cg, fname, bundletype)
+            # keep written bundle?
+            if opts["bundle"]:
+                cleanup = None
+            if not other.local():
+                # use the created uncompressed bundlerepo
+                other = bundlerepo.bundlerepository(ui, repo.root, fname)
+
+        o = other.changelog.nodesbetween(incoming, revs)[0]
+        if opts.get('newest_first'):
+            o.reverse()
+        displayer = cmdutil.show_changeset(ui, other, opts)
+        count = 0
+        for n in o:
+            if limit is not None and count >= limit:
+                break
+            parents = [p for p in other.changelog.parents(n) if p != nullid]
+            if opts.get('no_merges') and len(parents) == 2:
+                continue
+            count += 1
+            displayer.show(other[n])
+        displayer.close()
+    finally:
+        if hasattr(other, 'close'):
+            other.close()
+        if cleanup:
+            os.unlink(cleanup)
+
+def outgoing(ui, repo, dest, opts):
+    limit = cmdutil.loglimit(opts)
+    dest = ui.expandpath(dest or 'default-push', dest or 'default')
+    dest, branches = parseurl(dest, opts.get('branch'))
+    revs, checkout = addbranchrevs(repo, repo, branches, opts.get('rev'))
+    if revs:
+        revs = [repo.lookup(rev) for rev in revs]
+
+    other = repository(remoteui(repo, opts), dest)
+    ui.status(_('comparing with %s\n') % url.hidepassword(dest))
+    o = discovery.findoutgoing(repo, other, force=opts.get('force'))
+    if not o:
+        ui.status(_("no changes found\n"))
+        return 1
+    o = repo.changelog.nodesbetween(o, revs)[0]
+    if opts.get('newest_first'):
+        o.reverse()
+    displayer = cmdutil.show_changeset(ui, repo, opts)
+    count = 0
+    for n in o:
+        if limit is not None and count >= limit:
+            break
+        parents = [p for p in repo.changelog.parents(n) if p != nullid]
+        if opts.get('no_merges') and len(parents) == 2:
+            continue
+        count += 1
+        displayer.show(repo[n])
+    displayer.close()
+
 def revert(repo, node, choose):
     """revert changes to revision in node without updating dirstate"""
     return mergemod.update(repo, node, False, True, choose)[3] > 0
--- a/mercurial/hgweb/common.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/hgweb/common.py	Wed Sep 22 18:29:41 2010 -0500
@@ -9,6 +9,7 @@
 import errno, mimetypes, os
 
 HTTP_OK = 200
+HTTP_NOT_MODIFIED = 304
 HTTP_BAD_REQUEST = 400
 HTTP_UNAUTHORIZED = 401
 HTTP_FORBIDDEN = 403
@@ -152,3 +153,9 @@
     return (config("web", "contact") or
             config("ui", "username") or
             os.environ.get("EMAIL") or "")
+
+def caching(web, req):
+    tag = str(web.mtime)
+    if req.env.get('HTTP_IF_NONE_MATCH') == tag:
+        raise ErrorResponse(HTTP_NOT_MODIFIED)
+    req.headers.append(('ETag', tag))
--- a/mercurial/hgweb/hgweb_mod.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/hgweb/hgweb_mod.py	Wed Sep 22 18:29:41 2010 -0500
@@ -8,7 +8,7 @@
 
 import os
 from mercurial import ui, hg, hook, error, encoding, templater
-from common import get_mtime, ErrorResponse, permhooks
+from common import get_mtime, ErrorResponse, permhooks, caching
 from common import HTTP_OK, HTTP_BAD_REQUEST, HTTP_NOT_FOUND, HTTP_SERVER_ERROR
 from request import wsgirequest
 import webcommands, protocol, webutil
@@ -112,24 +112,18 @@
         # and the clients always use the old URL structure
 
         cmd = req.form.get('cmd', [''])[0]
-        if cmd and cmd in protocol.__all__:
+        if protocol.iscmd(cmd):
             if query:
                 raise ErrorResponse(HTTP_NOT_FOUND)
-            try:
-                if cmd in perms:
-                    try:
-                        self.check_perm(req, perms[cmd])
-                    except ErrorResponse, inst:
-                        if cmd == 'unbundle':
-                            req.drain()
-                        raise
-                method = getattr(protocol, cmd)
-                return method(self.repo, req)
-            except ErrorResponse, inst:
-                req.respond(inst, protocol.HGTYPE)
-                if not inst.message:
-                    return []
-                return '0\n%s\n' % inst.message,
+            if cmd in perms:
+                try:
+                    self.check_perm(req, perms[cmd])
+                except ErrorResponse, inst:
+                    if cmd == 'unbundle':
+                        req.drain()
+                    req.respond(inst, protocol.HGTYPE)
+                    return '0\n%s\n' % inst.message
+            return protocol.call(self.repo, req, cmd)
 
         # translate user-visible url structure to internal structure
 
@@ -184,6 +178,7 @@
                 req.form['cmd'] = [tmpl.cache['default']]
                 cmd = req.form['cmd'][0]
 
+            caching(self, req) # sets ETag header or raises NOT_MODIFIED
             if cmd not in webcommands.__all__:
                 msg = 'no such method: %s' % cmd
                 raise ErrorResponse(HTTP_BAD_REQUEST, msg)
--- a/mercurial/hgweb/protocol.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/hgweb/protocol.py	Wed Sep 22 18:29:41 2010 -0500
@@ -5,221 +5,64 @@
 # This software may be used and distributed according to the terms of the
 # GNU General Public License version 2 or any later version.
 
-import cStringIO, zlib, tempfile, errno, os, sys, urllib, copy
-from mercurial import util, streamclone, pushkey
-from mercurial.node import bin, hex
-from mercurial import changegroup as changegroupmod
-from common import ErrorResponse, HTTP_OK, HTTP_NOT_FOUND, HTTP_SERVER_ERROR
-
-# __all__ is populated with the allowed commands. Be sure to add to it if
-# you're adding a new command, or the new command won't work.
-
-__all__ = [
-   'lookup', 'heads', 'branches', 'between', 'changegroup',
-   'changegroupsubset', 'capabilities', 'unbundle', 'stream_out',
-   'branchmap', 'pushkey', 'listkeys'
-]
+import cStringIO, zlib, sys, urllib
+from mercurial import util, wireproto
+from common import HTTP_OK
 
 HGTYPE = 'application/mercurial-0.1'
-basecaps = 'lookup changegroupsubset branchmap pushkey'.split()
-
-def lookup(repo, req):
-    try:
-        r = hex(repo.lookup(req.form['key'][0]))
-        success = 1
-    except Exception, inst:
-        r = str(inst)
-        success = 0
-    resp = "%s %s\n" % (success, r)
-    req.respond(HTTP_OK, HGTYPE, length=len(resp))
-    yield resp
-
-def heads(repo, req):
-    resp = " ".join(map(hex, repo.heads())) + "\n"
-    req.respond(HTTP_OK, HGTYPE, length=len(resp))
-    yield resp
-
-def branchmap(repo, req):
-    branches = repo.branchmap()
-    heads = []
-    for branch, nodes in branches.iteritems():
-        branchname = urllib.quote(branch)
-        branchnodes = [hex(node) for node in nodes]
-        heads.append('%s %s' % (branchname, ' '.join(branchnodes)))
-    resp = '\n'.join(heads)
-    req.respond(HTTP_OK, HGTYPE, length=len(resp))
-    yield resp
-
-def branches(repo, req):
-    nodes = []
-    if 'nodes' in req.form:
-        nodes = map(bin, req.form['nodes'][0].split(" "))
-    resp = cStringIO.StringIO()
-    for b in repo.branches(nodes):
-        resp.write(" ".join(map(hex, b)) + "\n")
-    resp = resp.getvalue()
-    req.respond(HTTP_OK, HGTYPE, length=len(resp))
-    yield resp
-
-def between(repo, req):
-    pairs = [map(bin, p.split("-"))
-             for p in req.form['pairs'][0].split(" ")]
-    resp = ''.join(" ".join(map(hex, b)) + "\n" for b in repo.between(pairs))
-    req.respond(HTTP_OK, HGTYPE, length=len(resp))
-    yield resp
-
-def changegroup(repo, req):
-    req.respond(HTTP_OK, HGTYPE)
-    nodes = []
-
-    if 'roots' in req.form:
-        nodes = map(bin, req.form['roots'][0].split(" "))
-
-    z = zlib.compressobj()
-    f = repo.changegroup(nodes, 'serve')
-    while 1:
-        chunk = f.read(4096)
-        if not chunk:
-            break
-        yield z.compress(chunk)
-
-    yield z.flush()
-
-def changegroupsubset(repo, req):
-    req.respond(HTTP_OK, HGTYPE)
-    bases = []
-    heads = []
-
-    if 'bases' in req.form:
-        bases = [bin(x) for x in req.form['bases'][0].split(' ')]
-    if 'heads' in req.form:
-        heads = [bin(x) for x in req.form['heads'][0].split(' ')]
-
-    z = zlib.compressobj()
-    f = repo.changegroupsubset(bases, heads, 'serve')
-    while 1:
-        chunk = f.read(4096)
-        if not chunk:
-            break
-        yield z.compress(chunk)
-
-    yield z.flush()
-
-def capabilities(repo, req):
-    caps = copy.copy(basecaps)
-    if streamclone.allowed(repo.ui):
-        caps.append('stream=%d' % repo.changelog.version)
-    if changegroupmod.bundlepriority:
-        caps.append('unbundle=%s' % ','.join(changegroupmod.bundlepriority))
-    rsp = ' '.join(caps)
-    req.respond(HTTP_OK, HGTYPE, length=len(rsp))
-    yield rsp
-
-def unbundle(repo, req):
-
-    proto = req.env.get('wsgi.url_scheme') or 'http'
-    their_heads = req.form['heads'][0].split(' ')
 
-    def check_heads():
-        heads = map(hex, repo.heads())
-        return their_heads == [hex('force')] or their_heads == heads
-
-    # fail early if possible
-    if not check_heads():
-        req.drain()
-        raise ErrorResponse(HTTP_OK, 'unsynced changes')
-
-    # do not lock repo until all changegroup data is
-    # streamed. save to temporary file.
-
-    fd, tempname = tempfile.mkstemp(prefix='hg-unbundle-')
-    fp = os.fdopen(fd, 'wb+')
-    try:
-        length = int(req.env['CONTENT_LENGTH'])
-        for s in util.filechunkiter(req, limit=length):
+class webproto(object):
+    def __init__(self, req):
+        self.req = req
+        self.response = ''
+    def getargs(self, args):
+        data = {}
+        keys = args.split()
+        for k in keys:
+            if k == '*':
+                star = {}
+                for key in self.req.form.keys():
+                    if key not in keys:
+                        star[key] = self.req.form[key][0]
+                data['*'] = star
+            else:
+                data[k] = self.req.form[k][0]
+        return [data[k] for k in keys]
+    def getfile(self, fp):
+        length = int(self.req.env['CONTENT_LENGTH'])
+        for s in util.filechunkiter(self.req, limit=length):
             fp.write(s)
-
-        try:
-            lock = repo.lock()
-            try:
-                if not check_heads():
-                    raise ErrorResponse(HTTP_OK, 'unsynced changes')
-
-                fp.seek(0)
-                header = fp.read(6)
-                if header.startswith('HG') and not header.startswith('HG10'):
-                    raise ValueError('unknown bundle version')
-                elif header not in changegroupmod.bundletypes:
-                    raise ValueError('unknown bundle compression type')
-                gen = changegroupmod.unbundle(header, fp)
-
-                # send addchangegroup output to client
-
-                oldio = sys.stdout, sys.stderr
-                sys.stderr = sys.stdout = cStringIO.StringIO()
+    def redirect(self):
+        self.oldio = sys.stdout, sys.stderr
+        sys.stderr = sys.stdout = cStringIO.StringIO()
+    def groupchunks(self, cg):
+        z = zlib.compressobj()
+        while 1:
+            chunk = cg.read(4096)
+            if not chunk:
+                break
+            yield z.compress(chunk)
+        yield z.flush()
+    def _client(self):
+        return 'remote:%s:%s:%s' % (
+            self.req.env.get('wsgi.url_scheme') or 'http',
+            urllib.quote(self.req.env.get('REMOTE_HOST', '')),
+            urllib.quote(self.req.env.get('REMOTE_USER', '')))
 
-                try:
-                    url = 'remote:%s:%s:%s' % (
-                          proto,
-                          urllib.quote(req.env.get('REMOTE_HOST', '')),
-                          urllib.quote(req.env.get('REMOTE_USER', '')))
-                    try:
-                        ret = repo.addchangegroup(gen, 'serve', url, lock=lock)
-                    except util.Abort, inst:
-                        sys.stdout.write("abort: %s\n" % inst)
-                        ret = 0
-                finally:
-                    val = sys.stdout.getvalue()
-                    sys.stdout, sys.stderr = oldio
-                req.respond(HTTP_OK, HGTYPE)
-                return '%d\n%s' % (ret, val),
-            finally:
-                lock.release()
-        except ValueError, inst:
-            raise ErrorResponse(HTTP_OK, inst)
-        except (OSError, IOError), inst:
-            error = getattr(inst, 'strerror', 'Unknown error')
-            if not isinstance(error, str):
-                error = 'Error: %s' % str(error)
-            if inst.errno == errno.ENOENT:
-                code = HTTP_NOT_FOUND
-            else:
-                code = HTTP_SERVER_ERROR
-            filename = getattr(inst, 'filename', '')
-            # Don't send our filesystem layout to the client
-            if filename and filename.startswith(repo.root):
-                filename = filename[len(repo.root)+1:]
-                text = '%s: %s' % (error, filename)
-            else:
-                text = error.replace(repo.root + os.path.sep, '')
-            raise ErrorResponse(code, text)
-    finally:
-        fp.close()
-        os.unlink(tempname)
+def iscmd(cmd):
+    return cmd in wireproto.commands
 
-def stream_out(repo, req):
-    req.respond(HTTP_OK, HGTYPE)
-    try:
-        for chunk in streamclone.stream_out(repo):
-            yield chunk
-    except streamclone.StreamException, inst:
-        yield str(inst)
-
-def pushkey(repo, req):
-    namespace = req.form['namespace'][0]
-    key = req.form['key'][0]
-    old = req.form['old'][0]
-    new = req.form['new'][0]
-
-    r = repo.pushkey(namespace, key, old, new)
-    r = '%d\n' % int(r)
-    req.respond(HTTP_OK, HGTYPE, length=len(r))
-    yield r
-
-def listkeys(repo, req):
-    namespace = req.form['namespace'][0]
-    d = repo.listkeys(namespace).items()
-    t = '\n'.join(['%s\t%s' % (k.encode('string-escape'),
-                               v.encode('string-escape')) for k, v in d])
-    req.respond(HTTP_OK, HGTYPE, length=len(t))
-    yield t
+def call(repo, req, cmd):
+    p = webproto(req)
+    rsp = wireproto.dispatch(repo, p, cmd)
+    if isinstance(rsp, str):
+        req.respond(HTTP_OK, HGTYPE, length=len(rsp))
+        return [rsp]
+    elif isinstance(rsp, wireproto.streamres):
+        req.respond(HTTP_OK, HGTYPE)
+        return rsp.gen
+    elif isinstance(rsp, wireproto.pushres):
+        val = sys.stdout.getvalue()
+        sys.stdout, sys.stderr = p.oldio
+        req.respond(HTTP_OK, HGTYPE)
+        return ['%d\n%s' % (rsp.res, val)]
--- a/mercurial/hgweb/server.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/hgweb/server.py	Wed Sep 22 18:29:41 2010 -0500
@@ -269,7 +269,7 @@
     import mimetypes; mimetypes.init()
 
     address = ui.config('web', 'address', '')
-    port = int(ui.config('web', 'port', 8000))
+    port = util.getport(ui.config('web', 'port', 8000))
     try:
         return cls(ui, app, (address, port), handler)
     except socket.error, inst:
--- a/mercurial/hgweb/webcommands.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/hgweb/webcommands.py	Wed Sep 22 18:29:41 2010 -0500
@@ -116,12 +116,11 @@
     morevars['rev'] = query
 
     def changelist(**map):
-        cl = web.repo.changelog
         count = 0
         qw = query.lower().split()
 
         def revgen():
-            for i in xrange(len(cl) - 1, 0, -100):
+            for i in xrange(len(web.repo) - 1, 0, -100):
                 l = []
                 for j in xrange(max(0, i - 100), i + 1):
                     ctx = web.repo[j]
@@ -164,10 +163,10 @@
             if count >= revcount:
                 break
 
-    cl = web.repo.changelog
+    tip = web.repo['tip']
     parity = paritygen(web.stripecount)
 
-    return tmpl('search', query=query, node=hex(cl.tip()),
+    return tmpl('search', query=query, node=tip.hex(),
                 entries=changelist, archives=web.archivelist("tip"),
                 morevars=morevars, lessvars=lessvars)
 
@@ -224,8 +223,7 @@
     morevars = copy.copy(tmpl.defaults['sessionvars'])
     morevars['revcount'] = revcount * 2
 
-    cl = web.repo.changelog
-    count = len(cl)
+    count = len(web.repo)
     pos = ctx.rev()
     start = max(0, pos - revcount + 1)
     end = min(count, start + revcount)
@@ -385,7 +383,6 @@
                 latestentry=lambda **x: entries(True, 1, **x))
 
 def branches(web, req, tmpl):
-    b = web.repo.branchtags()
     tips = (web.repo[n] for t, n in web.repo.branchtags().iteritems())
     heads = web.repo.heads()
     parity = paritygen(web.stripecount)
@@ -467,19 +464,19 @@
 
         yield l
 
-    cl = web.repo.changelog
-    count = len(cl)
+    tip = web.repo['tip']
+    count = len(web.repo)
     start = max(0, count - web.maxchanges)
     end = min(count, start + web.maxchanges)
 
     return tmpl("summary",
                 desc=web.config("web", "description", "unknown"),
                 owner=get_contact(web.config) or "unknown",
-                lastchange=cl.read(cl.tip())[2],
+                lastchange=tip.date(),
                 tags=tagentries,
                 branches=branches,
                 shortlog=changelist,
-                node=hex(cl.tip()),
+                node=tip.hex(),
                 archives=web.archivelist("tip"))
 
 def filediff(web, req, tmpl):
--- a/mercurial/httprepo.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/httprepo.py	Wed Sep 22 18:29:41 2010 -0500
@@ -6,12 +6,11 @@
 # This software may be used and distributed according to the terms of the
 # GNU General Public License version 2 or any later version.
 
-from node import bin, hex, nullid
+from node import nullid
 from i18n import _
-import repo, changegroup, statichttprepo, error, url, util, pushkey
+import changegroup, statichttprepo, error, url, util, wireproto
 import os, urllib, urllib2, urlparse, zlib, httplib
 import errno, socket
-import encoding
 
 def zgenerator(f):
     zd = zlib.decompressobj()
@@ -24,7 +23,7 @@
         raise IOError(None, _('connection ended unexpectedly'))
     yield zd.flush()
 
-class httprepository(repo.repository):
+class httprepository(wireproto.wirerepository):
     def __init__(self, ui, path):
         self.path = path
         self.caps = None
@@ -56,7 +55,7 @@
     def get_caps(self):
         if self.caps is None:
             try:
-                self.caps = set(self.do_read('capabilities').split())
+                self.caps = set(self._call('capabilities').split())
             except error.RepoError:
                 self.caps = set()
             self.ui.debug('capabilities: %s\n' %
@@ -68,7 +67,7 @@
     def lock(self):
         raise util.Abort(_('operation not supported over http'))
 
-    def do_cmd(self, cmd, **args):
+    def _callstream(self, cmd, **args):
         data = args.pop('data', None)
         headers = args.pop('headers', {})
         self.ui.debug("sending %s command\n" % cmd)
@@ -132,90 +131,15 @@
 
         return resp
 
-    def do_read(self, cmd, **args):
-        fp = self.do_cmd(cmd, **args)
+    def _call(self, cmd, **args):
+        fp = self._callstream(cmd, **args)
         try:
             return fp.read()
         finally:
             # if using keepalive, allow connection to be reused
             fp.close()
 
-    def lookup(self, key):
-        self.requirecap('lookup', _('look up remote revision'))
-        d = self.do_cmd("lookup", key = key).read()
-        success, data = d[:-1].split(' ', 1)
-        if int(success):
-            return bin(data)
-        raise error.RepoError(data)
-
-    def heads(self):
-        d = self.do_read("heads")
-        try:
-            return map(bin, d[:-1].split(" "))
-        except:
-            raise error.ResponseError(_("unexpected response:"), d)
-
-    def branchmap(self):
-        d = self.do_read("branchmap")
-        try:
-            branchmap = {}
-            for branchpart in d.splitlines():
-                branchheads = branchpart.split(' ')
-                branchname = urllib.unquote(branchheads[0])
-                # Earlier servers (1.3.x) send branch names in (their) local
-                # charset. The best we can do is assume it's identical to our
-                # own local charset, in case it's not utf-8.
-                try:
-                    branchname.decode('utf-8')
-                except UnicodeDecodeError:
-                    branchname = encoding.fromlocal(branchname)
-                branchheads = [bin(x) for x in branchheads[1:]]
-                branchmap[branchname] = branchheads
-            return branchmap
-        except:
-            raise error.ResponseError(_("unexpected response:"), d)
-
-    def branches(self, nodes):
-        n = " ".join(map(hex, nodes))
-        d = self.do_read("branches", nodes=n)
-        try:
-            br = [tuple(map(bin, b.split(" "))) for b in d.splitlines()]
-            return br
-        except:
-            raise error.ResponseError(_("unexpected response:"), d)
-
-    def between(self, pairs):
-        batch = 8 # avoid giant requests
-        r = []
-        for i in xrange(0, len(pairs), batch):
-            n = " ".join(["-".join(map(hex, p)) for p in pairs[i:i + batch]])
-            d = self.do_read("between", pairs=n)
-            try:
-                r += [l and map(bin, l.split(" ")) or []
-                      for l in d.splitlines()]
-            except:
-                raise error.ResponseError(_("unexpected response:"), d)
-        return r
-
-    def changegroup(self, nodes, kind):
-        n = " ".join(map(hex, nodes))
-        f = self.do_cmd("changegroup", roots=n)
-        return util.chunkbuffer(zgenerator(f))
-
-    def changegroupsubset(self, bases, heads, source):
-        self.requirecap('changegroupsubset', _('look up remote changes'))
-        baselst = " ".join([hex(n) for n in bases])
-        headlst = " ".join([hex(n) for n in heads])
-        f = self.do_cmd("changegroupsubset", bases=baselst, heads=headlst)
-        return util.chunkbuffer(zgenerator(f))
-
-    def unbundle(self, cg, heads, source):
-        '''Send cg (a readable file-like object representing the
-        changegroup to push, typically a chunkbuffer object) to the
-        remote server as a bundle. Return an integer response code:
-        non-zero indicates a successful push (see
-        localrepository.addchangegroup()), and zero indicates either
-        error or nothing to push.'''
+    def _callpush(self, cmd, cg, **args):
         # have to stream bundle to a temp file because we do not have
         # http 1.1 chunked transfer.
 
@@ -235,56 +159,25 @@
 
         tempname = changegroup.writebundle(cg, None, type)
         fp = url.httpsendfile(tempname, "rb")
+        headers = {'Content-Type': 'application/mercurial-0.1'}
+
         try:
             try:
-                resp = self.do_read(
-                     'unbundle', data=fp,
-                     headers={'Content-Type': 'application/mercurial-0.1'},
-                     heads=' '.join(map(hex, heads)))
-                resp_code, output = resp.split('\n', 1)
-                try:
-                    ret = int(resp_code)
-                except ValueError, err:
-                    raise error.ResponseError(
-                            _('push failed (unexpected response):'), resp)
-                for l in output.splitlines(True):
-                    self.ui.status(_('remote: '), l)
-                return ret
+                r = self._call(cmd, data=fp, headers=headers, **args)
+                return r.split('\n', 1)
             except socket.error, err:
-                if err[0] in (errno.ECONNRESET, errno.EPIPE):
-                    raise util.Abort(_('push failed: %s') % err[1])
-                raise util.Abort(err[1])
+                if err.args[0] in (errno.ECONNRESET, errno.EPIPE):
+                    raise util.Abort(_('push failed: %s') % err.args[1])
+                raise util.Abort(err.args[1])
         finally:
             fp.close()
             os.unlink(tempname)
 
-    def stream_out(self):
-        return self.do_cmd('stream_out')
+    def _abort(self, exception):
+        raise exception
 
-    def pushkey(self, namespace, key, old, new):
-        if not self.capable('pushkey'):
-            return False
-        d = self.do_cmd("pushkey", data="", # force a POST
-                        namespace=namespace, key=key, old=old, new=new).read()
-        code, output = d.split('\n', 1)
-        try:
-            ret = bool(int(code))
-        except ValueError, err:
-            raise error.ResponseError(
-                _('push failed (unexpected response):'), d)
-        for l in output.splitlines(True):
-            self.ui.status(_('remote: '), l)
-        return ret
-
-    def listkeys(self, namespace):
-        if not self.capable('pushkey'):
-            return {}
-        d = self.do_cmd("listkeys", namespace=namespace).read()
-        r = {}
-        for l in d.splitlines():
-            k, v = l.split('\t')
-            r[k.decode('string-escape')] = v.decode('string-escape')
-        return r
+    def _decompress(self, stream):
+        return util.chunkbuffer(zgenerator(stream))
 
 class httpsrepository(httprepository):
     def __init__(self, ui, path):
--- a/mercurial/localrepo.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/localrepo.py	Wed Sep 22 18:29:41 2010 -0500
@@ -21,13 +21,15 @@
 
 class localrepository(repo.repository):
     capabilities = set(('lookup', 'changegroupsubset', 'branchmap', 'pushkey'))
-    supported = set('revlogv1 store fncache shared'.split())
+    supportedformats = set(('revlogv1', 'parentdelta'))
+    supported = supportedformats | set(('store', 'fncache', 'shared'))
 
     def __init__(self, baseui, path=None, create=0):
         repo.repository.__init__(self)
         self.root = os.path.realpath(util.expandpath(path))
         self.path = os.path.join(self.root, ".hg")
         self.origroot = path
+        self.auditor = util.path_auditor(self.root, self._checknested)
         self.opener = util.opener(self.path)
         self.wopener = util.opener(self.root)
         self.baseui = baseui
@@ -55,10 +57,8 @@
                         '\0\0\0\2' # represents revlogv2
                         ' dummy changelog to prevent using the old repo layout'
                     )
-                reqfile = self.opener("requires", "w")
-                for r in requirements:
-                    reqfile.write("%s\n" % r)
-                reqfile.close()
+                if self.ui.configbool('format', 'parentdelta', False):
+                    requirements.append("parentdelta")
             else:
                 raise error.RepoError(_("repository %s not found") % path)
         elif create:
@@ -90,7 +90,9 @@
         self.sopener = self.store.opener
         self.sjoin = self.store.join
         self.opener.createmode = self.store.createmode
-        self.sopener.options = {}
+        self._applyrequirements(requirements)
+        if create:
+            self._writerequirements()
 
         # These two define the set of tags for this repository.  _tags
         # maps tag name to node; _tagtypes maps tag name to 'global' or
@@ -107,6 +109,56 @@
         self._datafilters = {}
         self._transref = self._lockref = self._wlockref = None
 
+    def _applyrequirements(self, requirements):
+        self.requirements = requirements
+        self.sopener.options = {}
+        if 'parentdelta' in requirements:
+            self.sopener.options['parentdelta'] = 1
+
+    def _writerequirements(self):
+        reqfile = self.opener("requires", "w")
+        for r in self.requirements:
+            reqfile.write("%s\n" % r)
+        reqfile.close()
+
+    def _checknested(self, path):
+        """Determine if path is a legal nested repository."""
+        if not path.startswith(self.root):
+            return False
+        subpath = path[len(self.root) + 1:]
+
+        # XXX: Checking against the current working copy is wrong in
+        # the sense that it can reject things like
+        #
+        #   $ hg cat -r 10 sub/x.txt
+        #
+        # if sub/ is no longer a subrepository in the working copy
+        # parent revision.
+        #
+        # However, it can of course also allow things that would have
+        # been rejected before, such as the above cat command if sub/
+        # is a subrepository now, but was a normal directory before.
+        # The old path auditor would have rejected by mistake since it
+        # panics when it sees sub/.hg/.
+        #
+        # All in all, checking against the working copy seems sensible
+        # since we want to prevent access to nested repositories on
+        # the filesystem *now*.
+        ctx = self[None]
+        parts = util.splitpath(subpath)
+        while parts:
+            prefix = os.sep.join(parts)
+            if prefix in ctx.substate:
+                if prefix == subpath:
+                    return True
+                else:
+                    sub = ctx.sub(prefix)
+                    return sub.checknested(subpath[len(prefix) + 1:])
+            else:
+                parts.pop()
+        return False
+
+
     @propertycache
     def changelog(self):
         c = changelog.changelog(self.sopener)
@@ -333,8 +385,7 @@
 
         return partial
 
-    def branchmap(self):
-        '''returns a dictionary {branch: [branchheads]}'''
+    def updatebranchcache(self):
         tip = self.changelog.tip()
         if self._branchcache is not None and self._branchcachetip == tip:
             return self._branchcache
@@ -351,6 +402,9 @@
         # this private cache holds all heads (not just tips)
         self._branchcache = partial
 
+    def branchmap(self):
+        '''returns a dictionary {branch: [branchheads]}'''
+        self.updatebranchcache()
         return self._branchcache
 
     def branchtags(self):
@@ -478,9 +532,6 @@
     def wjoin(self, f):
         return os.path.join(self.root, f)
 
-    def rjoin(self, f):
-        return os.path.join(self.root, util.pconvert(f))
-
     def file(self, f):
         if f[0] == '/':
             f = f[1:]
@@ -510,7 +561,7 @@
     def _link(self, f):
         return os.path.islink(self.wjoin(f))
 
-    def _filter(self, filter, filename, data):
+    def _loadfilter(self, filter):
         if filter not in self.filterpats:
             l = []
             for pat, cmd in self.ui.configitems(filter):
@@ -533,6 +584,9 @@
                 l.append((mf, fn, params))
             self.filterpats[filter] = l
 
+    def _filter(self, filter, filename, data):
+        self._loadfilter(filter)
+
         for mf, fn, cmd in self.filterpats[filter]:
             if mf(filename):
                 self.ui.debug("filtering %s through %s\n" % (filename, cmd))
@@ -871,7 +925,7 @@
             # commit subs
             if subs or removedsubs:
                 state = wctx.substate.copy()
-                for s in subs:
+                for s in sorted(subs):
                     sub = wctx.sub(s)
                     self.ui.status(_('committing subrepository %s\n') %
                         subrepo.relpath(sub))
@@ -972,7 +1026,7 @@
             tr.close()
 
             if self._branchcache:
-                self.branchtags()
+                self.updatebranchcache()
             return n
         finally:
             if tr:
@@ -1007,7 +1061,8 @@
         return self[node].walk(match)
 
     def status(self, node1='.', node2=None, match=None,
-               ignored=False, clean=False, unknown=False):
+               ignored=False, clean=False, unknown=False,
+               listsubrepos=False):
         """return status of files between two nodes or node and working directory
 
         If node1 is None, use the first dirstate parent instead.
@@ -1059,16 +1114,16 @@
                 # do a full compare of any files that might have changed
                 for f in sorted(cmp):
                     if (f not in ctx1 or ctx2.flags(f) != ctx1.flags(f)
-                        or ctx1[f].cmp(ctx2[f].data())):
+                        or ctx1[f].cmp(ctx2[f])):
                         modified.append(f)
                     else:
                         fixup.append(f)
 
-                if listclean:
-                    clean += fixup
-
                 # update dirstate for files that are actually clean
                 if fixup:
+                    if listclean:
+                        clean += fixup
+
                     try:
                         # updating the dirstate is optional
                         # so we don't wait on the lock
@@ -1103,7 +1158,7 @@
                 if fn in mf1:
                     if (mf1.flags(fn) != mf2.flags(fn) or
                         (mf1[fn] != mf2[fn] and
-                         (mf2[fn] or ctx1[fn].cmp(ctx2[fn].data())))):
+                         (mf2[fn] or ctx1[fn].cmp(ctx2[fn])))):
                         modified.append(fn)
                     elif listclean:
                         clean.append(fn)
@@ -1113,6 +1168,24 @@
             removed = mf1.keys()
 
         r = modified, added, removed, deleted, unknown, ignored, clean
+
+        if listsubrepos:
+            for subpath, sub in subrepo.itersubrepos(ctx1, ctx2):
+                if working:
+                    rev2 = None
+                else:
+                    rev2 = ctx2.substate[subpath][1]
+                try:
+                    submatch = matchmod.narrowmatcher(subpath, match)
+                    s = sub.status(rev2, match=submatch, ignored=listignored,
+                                   clean=listclean, unknown=listunknown,
+                                   listsubrepos=True)
+                    for rfiles, sfiles in zip(r, s):
+                        rfiles.extend("%s/%s" % (subpath, f) for f in sfiles)
+                except error.LookupError:
+                    self.ui.status(_("skipping missing subrepository: %s\n")
+                                   % subpath)
+
         [l.sort() for l in r]
         return r
 
@@ -1223,46 +1296,34 @@
         # unbundle assumes local user cannot lock remote repo (new ssh
         # servers, http servers).
 
-        if remote.capable('unbundle'):
-            return self.push_unbundle(remote, force, revs, newbranch)
-        return self.push_addchangegroup(remote, force, revs, newbranch)
-
-    def push_addchangegroup(self, remote, force, revs, newbranch):
-        '''Push a changegroup by locking the remote and sending the
-        addchangegroup command to it. Used for local and old SSH repos.
-        Return an integer: see push().
-        '''
-        lock = remote.lock()
+        lock = None
+        unbundle = remote.capable('unbundle')
+        if not unbundle:
+            lock = remote.lock()
         try:
             ret = discovery.prepush(self, remote, force, revs, newbranch)
-            if ret[0] is not None:
-                cg, remote_heads = ret
+            if ret[0] is None:
+                # and here we return 0 for "nothing to push" or 1 for
+                # "something to push but I refuse"
+                return ret[1]
+
+            cg, remote_heads = ret
+            if unbundle:
+                # local repo finds heads on server, finds out what revs it must
+                # push.  once revs transferred, if server finds it has
+                # different heads (someone else won commit/push race), server
+                # aborts.
+                if force:
+                    remote_heads = ['force']
+                # ssh: return remote's addchangegroup()
+                # http: return remote's addchangegroup() or 0 for error
+                return remote.unbundle(cg, remote_heads, 'push')
+            else:
                 # we return an integer indicating remote head count change
                 return remote.addchangegroup(cg, 'push', self.url(), lock=lock)
-            # and here we return 0 for "nothing to push" or 1 for
-            # "something to push but I refuse"
-            return ret[1]
         finally:
-            lock.release()
-
-    def push_unbundle(self, remote, force, revs, newbranch):
-        '''Push a changegroup by unbundling it on the remote.  Used for new
-        SSH and HTTP repos. Return an integer: see push().'''
-        # local repo finds heads on server, finds out what revs it
-        # must push.  once revs transferred, if server finds it has
-        # different heads (someone else won commit/push race), server
-        # aborts.
-
-        ret = discovery.prepush(self, remote, force, revs, newbranch)
-        if ret[0] is not None:
-            cg, remote_heads = ret
-            if force:
-                remote_heads = ['force']
-            # ssh: return remote's addchangegroup()
-            # http: return remote's addchangegroup() or 0 for error
-            return remote.unbundle(cg, remote_heads, 'push')
-        # as in push_addchangegroup()
-        return ret[1]
+            if lock is not None:
+                lock.release()
 
     def changegroupinfo(self, nodes, source):
         if self.ui.verbose or source == 'bundle':
@@ -1296,8 +1357,10 @@
         # Set up some initial variables
         # Make it easy to refer to self.changelog
         cl = self.changelog
-        # msng is short for missing - compute the list of changesets in this
-        # changegroup.
+        # Compute the list of changesets in this changegroup.
+        # Some bases may turn out to be superfluous, and some heads may be
+        # too.  nodesbetween will return the minimal set of bases and heads
+        # necessary to re-create the changegroup.
         if not bases:
             bases = [nullid]
         msng_cl_lst, bases, heads = cl.nodesbetween(bases, heads)
@@ -1314,31 +1377,9 @@
         self.hook('preoutgoing', throw=True, source=source)
 
         self.changegroupinfo(msng_cl_lst, source)
-        # Some bases may turn out to be superfluous, and some heads may be
-        # too.  nodesbetween will return the minimal set of bases and heads
-        # necessary to re-create the changegroup.
 
-        # Known heads are the list of heads that it is assumed the recipient
-        # of this changegroup will know about.
-        knownheads = set()
-        # We assume that all parents of bases are known heads.
-        for n in bases:
-            knownheads.update(cl.parents(n))
-        knownheads.discard(nullid)
-        knownheads = list(knownheads)
-        if knownheads:
-            # Now that we know what heads are known, we can compute which
-            # changesets are known.  The recipient must know about all
-            # changesets required to reach the known heads from the null
-            # changeset.
-            has_cl_set, junk, junk = cl.nodesbetween(None, knownheads)
-            junk = None
-            # Transform the list into a set.
-            has_cl_set = set(has_cl_set)
-        else:
-            # If there were no known heads, the recipient cannot be assumed to
-            # know about any changesets.
-            has_cl_set = set()
+        # We assume that all ancestors of bases are known
+        commonrevs = set(cl.ancestors(*[cl.rev(n) for n in bases]))
 
         # Make it easy to refer to self.manifest
         mnfst = self.manifest
@@ -1355,19 +1396,6 @@
         def identity(x):
             return x
 
-        # If we determine that a particular file or manifest node must be a
-        # node that the recipient of the changegroup will already have, we can
-        # also assume the recipient will have all the parents.  This function
-        # prunes them from the set of missing nodes.
-        def prune_parents(revlog, hasset, msngset):
-            for r in revlog.ancestors(*[revlog.rev(n) for n in hasset]):
-                msngset.pop(revlog.node(r), None)
-
-        # Use the information collected in collect_manifests_and_files to say
-        # which changenode any manifestnode belongs to.
-        def lookup_manifest_link(mnfstnode):
-            return msng_mnfst_set[mnfstnode]
-
         # A function generating function that sets up the initial environment
         # the inner function.
         def filenode_collector(changedfiles):
@@ -1386,10 +1414,9 @@
                     deltamf = mnfst.readdelta(mnfstnode)
                     # For each line in the delta
                     for f, fnode in deltamf.iteritems():
-                        f = changedfiles.get(f, None)
                         # And if the file is in the list of files we care
                         # about.
-                        if f is not None:
+                        if f in changedfiles:
                             # Get the changenode this manifest belongs to
                             clnode = msng_mnfst_set[mnfstnode]
                             # Create the set of filenodes for the file if
@@ -1412,28 +1439,23 @@
                             ndset.setdefault(fnode, clnode)
             return collect_msng_filenodes
 
-        # We have a list of filenodes we think we need for a file, lets remove
-        # all those we know the recipient must have.
-        def prune_filenodes(f, filerevlog):
-            msngset = msng_filenode_set[f]
+        # If we determine that a particular file or manifest node must be a
+        # node that the recipient of the changegroup will already have, we can
+        # also assume the recipient will have all the parents.  This function
+        # prunes them from the set of missing nodes.
+        def prune(revlog, missingnodes):
             hasset = set()
             # If a 'missing' filenode thinks it belongs to a changenode we
             # assume the recipient must have, then the recipient must have
             # that filenode.
-            for n in msngset:
-                clnode = cl.node(filerevlog.linkrev(filerevlog.rev(n)))
-                if clnode in has_cl_set:
+            for n in missingnodes:
+                clrev = revlog.linkrev(revlog.rev(n))
+                if clrev in commonrevs:
                     hasset.add(n)
-            prune_parents(filerevlog, hasset, msngset)
-
-        # A function generator function that sets up the a context for the
-        # inner function.
-        def lookup_filenode_link_func(fname):
-            msngset = msng_filenode_set[fname]
-            # Lookup the changenode the filenode belongs to.
-            def lookup_filenode_link(fnode):
-                return msngset[fnode]
-            return lookup_filenode_link
+            for n in hasset:
+                missingnodes.pop(n, None)
+            for r in revlog.ancestors(*[revlog.rev(n) for n in hasset]):
+                missingnodes.pop(revlog.node(r), None)
 
         # Add the nodes that were explicitly requested.
         def add_extra_nodes(name, nodes):
@@ -1448,45 +1470,30 @@
         # logically divide up the task, generate the group.
         def gengroup():
             # The set of changed files starts empty.
-            changedfiles = {}
+            changedfiles = set()
             collect = changegroup.collector(cl, msng_mnfst_set, changedfiles)
 
             # Create a changenode group generator that will call our functions
             # back to lookup the owning changenode and collect information.
             group = cl.group(msng_cl_lst, identity, collect)
-            cnt = 0
-            for chnk in group:
+            for cnt, chnk in enumerate(group):
                 yield chnk
                 self.ui.progress(_('bundling changes'), cnt, unit=_('chunks'))
-                cnt += 1
             self.ui.progress(_('bundling changes'), None)
 
-
-            # Figure out which manifest nodes (of the ones we think might be
-            # part of the changegroup) the recipient must know about and
-            # remove them from the changegroup.
-            has_mnfst_set = set()
-            for n in msng_mnfst_set:
-                # If a 'missing' manifest thinks it belongs to a changenode
-                # the recipient is assumed to have, obviously the recipient
-                # must have that manifest.
-                linknode = cl.node(mnfst.linkrev(mnfst.rev(n)))
-                if linknode in has_cl_set:
-                    has_mnfst_set.add(n)
-            prune_parents(mnfst, has_mnfst_set, msng_mnfst_set)
+            prune(mnfst, msng_mnfst_set)
             add_extra_nodes(1, msng_mnfst_set)
             msng_mnfst_lst = msng_mnfst_set.keys()
             # Sort the manifestnodes by revision number.
             msng_mnfst_lst.sort(key=mnfst.rev)
             # Create a generator for the manifestnodes that calls our lookup
             # and data collection functions back.
-            group = mnfst.group(msng_mnfst_lst, lookup_manifest_link,
+            group = mnfst.group(msng_mnfst_lst,
+                                lambda mnode: msng_mnfst_set[mnode],
                                 filenode_collector(changedfiles))
-            cnt = 0
-            for chnk in group:
+            for cnt, chnk in enumerate(group):
                 yield chnk
                 self.ui.progress(_('bundling manifests'), cnt, unit=_('chunks'))
-                cnt += 1
             self.ui.progress(_('bundling manifests'), None)
 
             # These are no longer needed, dereference and toss the memory for
@@ -1499,7 +1506,7 @@
                     if isinstance(fname, int):
                         continue
                     msng_filenode_set.setdefault(fname, {})
-                    changedfiles[fname] = 1
+                    changedfiles.add(fname)
             # Go through all our files in order sorted by name.
             cnt = 0
             for fname in sorted(changedfiles):
@@ -1508,32 +1515,27 @@
                     raise util.Abort(_("empty or missing revlog for %s") % fname)
                 # Toss out the filenodes that the recipient isn't really
                 # missing.
-                if fname in msng_filenode_set:
-                    prune_filenodes(fname, filerevlog)
-                    add_extra_nodes(fname, msng_filenode_set[fname])
-                    msng_filenode_lst = msng_filenode_set[fname].keys()
-                else:
-                    msng_filenode_lst = []
+                missingfnodes = msng_filenode_set.pop(fname, {})
+                prune(filerevlog, missingfnodes)
+                add_extra_nodes(fname, missingfnodes)
                 # If any filenodes are left, generate the group for them,
                 # otherwise don't bother.
-                if len(msng_filenode_lst) > 0:
+                if missingfnodes:
                     yield changegroup.chunkheader(len(fname))
                     yield fname
-                    # Sort the filenodes by their revision #
-                    msng_filenode_lst.sort(key=filerevlog.rev)
+                    # Sort the filenodes by their revision # (topological order)
+                    nodeiter = list(missingfnodes)
+                    nodeiter.sort(key=filerevlog.rev)
                     # Create a group generator and only pass in a changenode
                     # lookup function as we need to collect no information
                     # from filenodes.
-                    group = filerevlog.group(msng_filenode_lst,
-                                             lookup_filenode_link_func(fname))
+                    group = filerevlog.group(nodeiter,
+                                             lambda fnode: missingfnodes[fnode])
                     for chnk in group:
                         self.ui.progress(
                             _('bundling files'), cnt, item=fname, unit=_('chunks'))
                         cnt += 1
                         yield chnk
-                if fname in msng_filenode_set:
-                    # Don't need this anymore, toss it to free memory.
-                    del msng_filenode_set[fname]
             # Signal that no more groups are left.
             yield changegroup.closechunk()
             self.ui.progress(_('bundling files'), None)
@@ -1541,7 +1543,7 @@
             if msng_cl_lst:
                 self.hook('outgoing', node=hex(msng_cl_lst[0]), source=source)
 
-        return util.chunkbuffer(gengroup())
+        return changegroup.unbundle10(util.chunkbuffer(gengroup()), 'UN')
 
     def changegroup(self, basenodes, source):
         # to avoid a race we use changegroupsubset() (issue1320)
@@ -1571,31 +1573,28 @@
                 if log.linkrev(r) in revset:
                     yield log.node(r)
 
-        def lookuprevlink_func(revlog):
-            def lookuprevlink(n):
+        def lookuplinkrev_func(revlog):
+            def lookuplinkrev(n):
                 return cl.node(revlog.linkrev(revlog.rev(n)))
-            return lookuprevlink
+            return lookuplinkrev
 
         def gengroup():
             '''yield a sequence of changegroup chunks (strings)'''
             # construct a list of all changed files
-            changedfiles = {}
+            changedfiles = set()
             mmfs = {}
             collect = changegroup.collector(cl, mmfs, changedfiles)
 
-            cnt = 0
-            for chnk in cl.group(nodes, identity, collect):
+            for cnt, chnk in enumerate(cl.group(nodes, identity, collect)):
                 self.ui.progress(_('bundling changes'), cnt, unit=_('chunks'))
-                cnt += 1
                 yield chnk
             self.ui.progress(_('bundling changes'), None)
 
             mnfst = self.manifest
             nodeiter = gennodelst(mnfst)
-            cnt = 0
-            for chnk in mnfst.group(nodeiter, lookuprevlink_func(mnfst)):
+            for cnt, chnk in enumerate(mnfst.group(nodeiter,
+                                                   lookuplinkrev_func(mnfst))):
                 self.ui.progress(_('bundling manifests'), cnt, unit=_('chunks'))
-                cnt += 1
                 yield chnk
             self.ui.progress(_('bundling manifests'), None)
 
@@ -1609,7 +1608,7 @@
                 if nodeiter:
                     yield changegroup.chunkheader(len(fname))
                     yield fname
-                    lookup = lookuprevlink_func(filerevlog)
+                    lookup = lookuplinkrev_func(filerevlog)
                     for chnk in filerevlog.group(nodeiter, lookup):
                         self.ui.progress(
                             _('bundling files'), cnt, item=fname, unit=_('chunks'))
@@ -1622,7 +1621,7 @@
             if nodes:
                 self.hook('outgoing', node=hex(nodes[0]), source=source)
 
-        return util.chunkbuffer(gengroup())
+        return changegroup.unbundle10(util.chunkbuffer(gengroup()), 'UN')
 
     def addchangegroup(self, source, srctype, url, emptyok=False, lock=None):
         """Add the changegroup returned by source.read() to this repo.
@@ -1672,8 +1671,10 @@
                                      total=self.total)
                     self.count += 1
             pr = prog()
-            chunkiter = changegroup.chunkiter(source, progress=pr)
-            if cl.addgroup(chunkiter, csmap, trp) is None and not emptyok:
+            source.callback = pr
+
+            if (cl.addgroup(source, csmap, trp) is None
+                and not emptyok):
                 raise util.Abort(_("received changelog group is empty"))
             clend = len(cl)
             changesets = clend - clstart
@@ -1687,12 +1688,11 @@
             pr.step = _('manifests')
             pr.count = 1
             pr.total = changesets # manifests <= changesets
-            chunkiter = changegroup.chunkiter(source, progress=pr)
             # no need to check for empty manifest group here:
             # if the result of the merge of 1 and 2 is the same in 3 and 4,
             # no new manifest will be created and the manifest group will
             # be empty during the pull
-            self.manifest.addgroup(chunkiter, revmap, trp)
+            self.manifest.addgroup(source, revmap, trp)
             self.ui.progress(_('manifests'), None)
 
             needfiles = {}
@@ -1710,16 +1710,17 @@
             pr.step = 'files'
             pr.count = 1
             pr.total = efiles
+            source.callback = None
+
             while 1:
-                f = changegroup.getchunk(source)
+                f = source.chunk()
                 if not f:
                     break
                 self.ui.debug("adding %s revisions\n" % f)
                 pr()
                 fl = self.file(f)
                 o = len(fl)
-                chunkiter = changegroup.chunkiter(source)
-                if fl.addgroup(chunkiter, revmap, trp) is None:
+                if fl.addgroup(source, revmap, trp) is None:
                     raise util.Abort(_("received file revlog group is empty"))
                 revisions += len(fl) - o
                 files += 1
@@ -1770,7 +1771,7 @@
         if changesets > 0:
             # forcefully update the on-disk branch cache
             self.ui.debug("updating the branch cache\n")
-            self.branchtags()
+            self.updatebranchcache()
             self.hook("changegroup", node=hex(cl.node(clstart)),
                       source=srctype, url=url)
 
@@ -1785,7 +1786,7 @@
             return newheads - oldheads + 1
 
 
-    def stream_in(self, remote):
+    def stream_in(self, remote, requirements):
         fp = remote.stream_out()
         l = fp.readline()
         try:
@@ -1830,6 +1831,13 @@
         self.ui.status(_('transferred %s in %.1f seconds (%s/sec)\n') %
                        (util.bytecount(total_bytes), elapsed,
                         util.bytecount(total_bytes / elapsed)))
+
+        # new requirements = old non-format requirements + new format-related
+        # requirements from the streamed-in repository
+        requirements.update(set(self.requirements) - self.supportedformats)
+        self._applyrequirements(requirements)
+        self._writerequirements()
+
         self.invalidate()
         return len(self.heads()) + 1
 
@@ -1848,8 +1856,17 @@
         # and format flags on "stream" capability, and use
         # uncompressed only if compatible.
 
-        if stream and not heads and remote.capable('stream'):
-            return self.stream_in(remote)
+        if stream and not heads:
+            # 'stream' means remote revlog format is revlogv1 only
+            if remote.capable('stream'):
+                return self.stream_in(remote, set(('revlogv1',)))
+            # otherwise, 'streamreqs' contains the remote revlog format
+            streamreqs = remote.capable('streamreqs')
+            if streamreqs:
+                streamreqs = set(streamreqs.split(','))
+                # if we support it, stream in and adjust our requirements
+                if not streamreqs - self.supportedformats:
+                    return self.stream_in(remote, streamreqs)
         return self.pull(remote, heads)
 
     def pushkey(self, namespace, key, old, new):
--- a/mercurial/mail.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/mail.py	Wed Sep 22 18:29:41 2010 -0500
@@ -37,7 +37,7 @@
     mailhost = ui.config('smtp', 'host')
     if not mailhost:
         raise util.Abort(_('smtp.host not configured - cannot send mail'))
-    mailport = int(ui.config('smtp', 'port', 25))
+    mailport = util.getport(ui.config('smtp', 'port', 25))
     ui.note(_('sending mail: smtp host %s, port %s\n') %
             (mailhost, mailport))
     s.connect(host=mailhost, port=mailport)
--- a/mercurial/manifest.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/manifest.py	Wed Sep 22 18:29:41 2010 -0500
@@ -36,7 +36,7 @@
 
     def readdelta(self, node):
         r = self.rev(node)
-        return self.parse(mdiff.patchtext(self.revdiff(r - 1, r)))
+        return self.parse(mdiff.patchtext(self.revdiff(self.deltaparent(r), r)))
 
     def read(self, node):
         if node == revlog.nullid:
@@ -84,7 +84,7 @@
                 hi = start
         end = advance(lo, '\0')
         found = m[lo:end]
-        if cmp(s, found) == 0:
+        if s == found:
             # we know that after the null there are 40 bytes of sha1
             end = advance(end + 40, '\n')
             return (lo, end + 1)
@@ -186,11 +186,7 @@
             if dstart != None:
                 delta.append([dstart, dend, "".join(dline)])
             # apply the delta to the addlist, and get a delta for addrevision
-            cachedelta = addlistdelta(addlist, delta)
-
-            # the delta is only valid if we've been processing the tip revision
-            if p1 != self.tip():
-                cachedelta = None
+            cachedelta = (self.rev(p1), addlistdelta(addlist, delta))
             arraytext = addlist
             text = buffer(arraytext)
 
--- a/mercurial/match.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/match.py	Wed Sep 22 18:29:41 2010 -0500
@@ -11,7 +11,7 @@
 
 class match(object):
     def __init__(self, root, cwd, patterns, include=[], exclude=[],
-                 default='glob', exact=False):
+                 default='glob', exact=False, auditor=None):
         """build an object to match a set of file patterns
 
         arguments:
@@ -39,14 +39,16 @@
         self._anypats = bool(include or exclude)
 
         if include:
-            im = _buildmatch(_normalize(include, 'glob', root, cwd), '(?:/|$)')
+            im = _buildmatch(_normalize(include, 'glob', root, cwd, auditor),
+                             '(?:/|$)')
         if exclude:
-            em = _buildmatch(_normalize(exclude, 'glob', root, cwd), '(?:/|$)')
+            em = _buildmatch(_normalize(exclude, 'glob', root, cwd, auditor),
+                             '(?:/|$)')
         if exact:
             self._files = patterns
             pm = self.exact
         elif patterns:
-            pats = _normalize(patterns, default, root, cwd)
+            pats = _normalize(patterns, default, root, cwd, auditor)
             self._files = _roots(pats)
             self._anypats = self._anypats or _anypats(pats)
             pm = _buildmatch(pats, '$')
@@ -108,6 +110,49 @@
     def __init__(self, root, cwd):
         match.__init__(self, root, cwd, [])
 
+class narrowmatcher(match):
+    """Adapt a matcher to work on a subdirectory only.
+
+    The paths are remapped to remove/insert the path as needed:
+
+    >>> m1 = match('root', '', ['a.txt', 'sub/b.txt'])
+    >>> m2 = narrowmatcher('sub', m1)
+    >>> bool(m2('a.txt'))
+    False
+    >>> bool(m2('b.txt'))
+    True
+    >>> bool(m2.matchfn('a.txt'))
+    False
+    >>> bool(m2.matchfn('b.txt'))
+    True
+    >>> m2.files()
+    ['b.txt']
+    >>> m2.exact('b.txt')
+    True
+    >>> m2.rel('b.txt')
+    'b.txt'
+    >>> def bad(f, msg):
+    ...     print "%s: %s" % (f, msg)
+    >>> m1.bad = bad
+    >>> m2.bad('x.txt', 'No such file')
+    sub/x.txt: No such file
+    """
+
+    def __init__(self, path, matcher):
+        self._root = matcher._root
+        self._cwd = matcher._cwd
+        self._path = path
+        self._matcher = matcher
+
+        self._files = [f[len(path) + 1:] for f in matcher._files
+                       if f.startswith(path + "/")]
+        self._anypats = matcher._anypats
+        self.matchfn = lambda fn: matcher.matchfn(self._path + "/" + fn)
+        self._fmap = set(self._files)
+
+    def bad(self, f, msg):
+        self._matcher.bad(self._path + "/" + f, msg)
+
 def patkind(pat):
     return _patsplit(pat, None)[0]
 
@@ -218,11 +263,11 @@
                 raise util.Abort(_("invalid pattern (%s): %s") % (k, p))
         raise util.Abort(_("invalid pattern"))
 
-def _normalize(names, default, root, cwd):
+def _normalize(names, default, root, cwd, auditor):
     pats = []
     for kind, name in [_patsplit(p, default) for p in names]:
         if kind in ('glob', 'relpath'):
-            name = util.canonpath(root, cwd, name)
+            name = util.canonpath(root, cwd, name, auditor)
         elif kind in ('relglob', 'path'):
             name = util.normpath(name)
 
--- a/mercurial/mdiff.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/mdiff.py	Wed Sep 22 18:29:41 2010 -0500
@@ -260,6 +260,9 @@
     return "".join(t)
 
 def patch(a, bin):
+    if len(a) == 0:
+        # skip over trivial delta header
+        return buffer(bin, 12)
     return mpatch.patches(a, [bin])
 
 # similar to difflib.SequenceMatcher.get_matching_blocks
--- a/mercurial/merge.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/merge.py	Wed Sep 22 18:29:41 2010 -0500
@@ -14,12 +14,14 @@
     '''track 3-way merge state of individual files'''
     def __init__(self, repo):
         self._repo = repo
+        self._dirty = False
         self._read()
     def reset(self, node=None):
         self._state = {}
         if node:
             self._local = node
         shutil.rmtree(self._repo.join("merge"), True)
+        self._dirty = False
     def _read(self):
         self._state = {}
         try:
@@ -33,17 +35,20 @@
         except IOError, err:
             if err.errno != errno.ENOENT:
                 raise
-    def _write(self):
-        f = self._repo.opener("merge/state", "w")
-        f.write(hex(self._local) + "\n")
-        for d, v in self._state.iteritems():
-            f.write("\0".join([d] + v) + "\n")
+        self._dirty = False
+    def commit(self):
+        if self._dirty:
+            f = self._repo.opener("merge/state", "w")
+            f.write(hex(self._local) + "\n")
+            for d, v in self._state.iteritems():
+                f.write("\0".join([d] + v) + "\n")
+            self._dirty = False
     def add(self, fcl, fco, fca, fd, flags):
         hash = util.sha1(fcl.path()).hexdigest()
         self._repo.opener("merge/" + hash, "w").write(fcl.data())
         self._state[fd] = ['u', hash, fcl.path(), fca.path(),
                            hex(fca.filenode()), fco.path(), flags]
-        self._write()
+        self._dirty = True
     def __contains__(self, dfile):
         return dfile in self._state
     def __getitem__(self, dfile):
@@ -55,7 +60,7 @@
             yield f
     def mark(self, dfile, state):
         self._state[dfile][0] = state
-        self._write()
+        self._dirty = True
     def resolve(self, dfile, wctx, octx):
         if self[dfile] == 'r':
             return 0
@@ -73,7 +78,7 @@
 def _checkunknown(wctx, mctx):
     "check for collisions between unknown files and files in mctx"
     for f in wctx.unknown():
-        if f in mctx and mctx[f].cmp(wctx[f].data()):
+        if f in mctx and mctx[f].cmp(wctx[f]):
             raise util.Abort(_("untracked file in working directory differs"
                                " from file in requested revision: '%s'") % f)
 
@@ -117,7 +122,7 @@
 
 def manifestmerge(repo, p1, p2, pa, overwrite, partial):
     """
-    Merge p1 and p2 with ancestor ma and generate merge action list
+    Merge p1 and p2 with ancestor pa and generate merge action list
 
     overwrite = whether we clobber working files
     partial = function to filter file lists
@@ -282,7 +287,7 @@
 
     # remove renamed files after safely stored
     for f in moves:
-        if util.lexists(repo.wjoin(f)):
+        if os.path.lexists(repo.wjoin(f)):
             repo.ui.debug("removing %s\n" % f)
             os.unlink(repo.wjoin(f))
 
@@ -320,7 +325,7 @@
                 else:
                     merged += 1
             util.set_flags(repo.wjoin(fd), 'l' in flags, 'x' in flags)
-            if f != fd and move and util.lexists(repo.wjoin(f)):
+            if f != fd and move and os.path.lexists(repo.wjoin(f)):
                 repo.ui.debug("removing %s\n" % f)
                 os.unlink(repo.wjoin(f))
         elif m == "g": # get
@@ -352,6 +357,7 @@
         elif m == "e": # exec
             flags = a[2]
             util.set_flags(repo.wjoin(f), 'l' in flags, 'x' in flags)
+    ms.commit()
     u.progress(_('updating'), None, total=numupdates, unit='files')
 
     return updated, merged, removed, unresolved
@@ -433,7 +439,7 @@
     the parent rev to the target rev (linear, on the same named
     branch, or on another named branch).
 
-    This logic is tested by test-update-branches.
+    This logic is tested by test-update-branches.t.
 
     -c  -C  dirty  rev  |  linear   same  cross
      n   n    n     n   |    ok     (1)     x
--- a/mercurial/patch.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/patch.py	Wed Sep 22 18:29:41 2010 -0500
@@ -11,7 +11,7 @@
 
 from i18n import _
 from node import hex, nullid, short
-import base85, cmdutil, mdiff, util, diffhelpers, copies, encoding
+import base85, mdiff, util, diffhelpers, copies, encoding
 
 gitre = re.compile('diff --git a/(.*) b/(.*)')
 
@@ -444,8 +444,8 @@
 
     def writelines(self, fname, lines):
         # Ensure supplied data ends in fname, being a regular file or
-        # a symlink. updatedir() will -too magically- take care of
-        # setting it to the proper type afterwards.
+        # a symlink. cmdutil.updatedir will -too magically- take care
+        # of setting it to the proper type afterwards.
         islink = os.path.islink(fname)
         if islink:
             fp = cStringIO.StringIO()
@@ -918,7 +918,7 @@
     nulla = afile_orig == "/dev/null"
     nullb = bfile_orig == "/dev/null"
     abase, afile = pathstrip(afile_orig, strip)
-    gooda = not nulla and util.lexists(afile)
+    gooda = not nulla and os.path.lexists(afile)
     bbase, bfile = pathstrip(bfile_orig, strip)
     if afile == bfile:
         goodb = gooda
@@ -927,8 +927,8 @@
     createfunc = hunk.createfile
     missing = not goodb and not gooda and not createfunc()
 
-    # some diff programs apparently produce create patches where the
-    # afile is not /dev/null, but afile starts with bfile
+    # some diff programs apparently produce patches where the afile is
+    # not /dev/null, but afile starts with bfile
     abasedir = afile[:afile.rfind('/') + 1]
     bbasedir = bfile[:bfile.rfind('/') + 1]
     if missing and abasedir == bbasedir and afile.startswith(bfile):
@@ -1129,8 +1129,8 @@
     read in binary mode. Otherwise, line endings are ignored when
     patching then normalized according to 'eolmode'.
 
-    Callers probably want to call 'updatedir' after this to apply
-    certain categories of changes not done by this function.
+    Callers probably want to call 'cmdutil.updatedir' after this to
+    apply certain categories of changes not done by this function.
     """
     return _applydiff(
         ui, fp, patchfile, copyfile,
@@ -1196,49 +1196,6 @@
         return -1
     return err
 
-def updatedir(ui, repo, patches, similarity=0):
-    '''Update dirstate after patch application according to metadata'''
-    if not patches:
-        return
-    copies = []
-    removes = set()
-    cfiles = patches.keys()
-    cwd = repo.getcwd()
-    if cwd:
-        cfiles = [util.pathto(repo.root, cwd, f) for f in patches.keys()]
-    for f in patches:
-        gp = patches[f]
-        if not gp:
-            continue
-        if gp.op == 'RENAME':
-            copies.append((gp.oldpath, gp.path))
-            removes.add(gp.oldpath)
-        elif gp.op == 'COPY':
-            copies.append((gp.oldpath, gp.path))
-        elif gp.op == 'DELETE':
-            removes.add(gp.path)
-
-    wctx = repo[None]
-    for src, dst in copies:
-        wctx.copy(src, dst)
-    if (not similarity) and removes:
-        wctx.remove(sorted(removes), True)
-
-    for f in patches:
-        gp = patches[f]
-        if gp and gp.mode:
-            islink, isexec = gp.mode
-            dst = repo.wjoin(gp.path)
-            # patch won't create empty files
-            if gp.op == 'ADD' and not os.path.lexists(dst):
-                flags = (isexec and 'x' or '') + (islink and 'l' or '')
-                repo.wwrite(gp.path, '', flags)
-            util.set_flags(dst, islink, isexec)
-    cmdutil.addremove(repo, cfiles, similarity=similarity)
-    files = patches.keys()
-    files.extend([r for r in removes if r not in files])
-    return sorted(files)
-
 def externalpatch(patcher, args, patchname, ui, strip, cwd, files):
     """use <patcher> to apply <patchname> to the working directory.
     returns whether patch was applied with fuzz factor."""
@@ -1352,7 +1309,7 @@
     '''print base85-encoded binary diff'''
     def gitindex(text):
         if not text:
-            return '0' * 40
+            return hex(nullid)
         l = len(text)
         s = util.sha1('blob %d\0' % l)
         s.update(text)
@@ -1404,7 +1361,7 @@
         context=get('unified', getter=ui.config))
 
 def diff(repo, node1=None, node2=None, match=None, changes=None, opts=None,
-         losedatafn=None):
+         losedatafn=None, prefix=''):
     '''yields diff of changes to files between two nodes, or node and
     working directory.
 
@@ -1418,6 +1375,9 @@
     called with the name of current file being diffed as 'fn'. If set
     to None, patches will always be upgraded to git format when
     necessary.
+
+    prefix is a filename prefix that is prepended to all filenames on
+    display (used for subrepos).
     '''
 
     if opts is None:
@@ -1462,7 +1422,7 @@
         copy = copies.copies(repo, ctx1, ctx2, repo[nullid])[0]
 
     difffn = lambda opts, losedata: trydiff(repo, revs, ctx1, ctx2,
-                 modified, added, removed, copy, getfilectx, opts, losedata)
+                 modified, added, removed, copy, getfilectx, opts, losedata, prefix)
     if opts.upgrade and not opts.git:
         try:
             def losedata(fn):
@@ -1518,7 +1478,10 @@
         header.append('new mode %s\n' % nmode)
 
 def trydiff(repo, revs, ctx1, ctx2, modified, added, removed,
-            copy, getfilectx, opts, losedatafn):
+            copy, getfilectx, opts, losedatafn, prefix):
+
+    def join(f):
+        return os.path.join(prefix, f)
 
     date1 = util.datestr(ctx1.date())
     man1 = ctx1.manifest()
@@ -1557,8 +1520,8 @@
                             gone.add(a)
                         else:
                             op = 'copy'
-                        header.append('%s from %s\n' % (op, a))
-                        header.append('%s to %s\n' % (op, f))
+                        header.append('%s from %s\n' % (op, join(a)))
+                        header.append('%s to %s\n' % (op, join(f)))
                         to = getfilectx(a, ctx1).data()
                     else:
                         losedatafn(f)
@@ -1600,7 +1563,7 @@
                 elif binary or nflag != oflag:
                     losedatafn(f)
             if opts.git:
-                header.insert(0, mdiff.diffline(revs, a, b, opts))
+                header.insert(0, mdiff.diffline(revs, join(a), join(b), opts))
 
         if dodiff:
             if dodiff == 'binary':
@@ -1609,7 +1572,7 @@
                 text = mdiff.unidiff(to, date1,
                                     # ctx2 date may be dynamic
                                     tn, util.datestr(ctx2.date()),
-                                    a, b, revs, opts=opts)
+                                    join(a), join(b), revs, opts=opts)
             if header and (text or len(header) > 1):
                 yield ''.join(header)
             if text:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/py3kcompat.py	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,72 @@
+# py3kcompat.py - compatibility definitions for running hg in py3k
+#
+# Copyright 2010 Renato Cunha <renatoc@gmail.com>
+#
+# This software may be used and distributed according to the terms of the
+# GNU General Public License version 2 or any later version.
+
+import os, builtins
+
+from numbers import Number
+
+def bytesformatter(format, args):
+    '''Custom implementation of a formatter for bytestrings.
+
+    This function currently relias on the string formatter to do the
+    formatting and always returns bytes objects.
+
+    >>> bytesformatter(20, 10)
+    0
+    >>> bytesformatter('unicode %s, %s!', ('string', 'foo'))
+    b'unicode string, foo!'
+    >>> bytesformatter(b'test %s', 'me')
+    b'test me'
+    >>> bytesformatter('test %s', 'me')
+    b'test me'
+    >>> bytesformatter(b'test %s', b'me')
+    b'test me'
+    >>> bytesformatter('test %s', b'me')
+    b'test me'
+    >>> bytesformatter('test %d: %s', (1, b'result'))
+    b'test 1: result'
+    '''
+    # The current implementation just converts from bytes to unicode, do
+    # what's needed and then convert the results back to bytes.
+    # Another alternative is to use the Python C API implementation.
+    if isinstance(format, Number):
+        # If the fixer erroneously passes a number remainder operation to
+        # bytesformatter, we just return the correct operation
+        return format % args
+    if isinstance(format, bytes):
+        format = format.decode('utf-8', 'surrogateescape')
+    if isinstance(args, bytes):
+        args = args.decode('utf-8', 'surrogateescape')
+    if isinstance(args, tuple):
+        newargs = []
+        for arg in args:
+            if isinstance(arg, bytes):
+                arg = arg.decode('utf-8', 'surrogateescape')
+            newargs.append(arg)
+        args = tuple(newargs)
+    ret = format % args
+    return ret.encode('utf-8', 'surrogateescape')
+builtins.bytesformatter = bytesformatter
+
+# Create bytes equivalents for os.environ values
+for key in list(os.environ.keys()):
+    # UTF-8 is fine for us
+    bkey = key.encode('utf-8', 'surrogateescape')
+    bvalue = os.environ[key].encode('utf-8', 'surrogateescape')
+    os.environ[bkey] = bvalue
+
+origord = builtins.ord
+def fakeord(char):
+    if isinstance(char, int):
+        return char
+    return origord(char)
+builtins.ord = fakeord
+
+if __name__ == '__main__':
+    import doctest
+    doctest.testmod()
+
--- a/mercurial/repair.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/repair.py	Wed Sep 22 18:29:41 2010 -0500
@@ -11,14 +11,18 @@
 from i18n import _
 import os
 
-def _bundle(repo, bases, heads, node, suffix, extranodes=None):
+def _bundle(repo, bases, heads, node, suffix, extranodes=None, compress=True):
     """create a bundle with the specified revisions as a backup"""
     cg = repo.changegroupsubset(bases, heads, 'strip', extranodes)
     backupdir = repo.join("strip-backup")
     if not os.path.isdir(backupdir):
         os.mkdir(backupdir)
     name = os.path.join(backupdir, "%s-%s.hg" % (short(node), suffix))
-    return changegroup.writebundle(cg, name, "HG10BZ")
+    if compress:
+        bundletype = "HG10BZ"
+    else:
+        bundletype = "HG10UN"
+    return changegroup.writebundle(cg, name, bundletype)
 
 def _collectfiles(repo, striprev):
     """find out the filelogs affected by the strip"""
@@ -31,7 +35,7 @@
 
 def _collectextranodes(repo, files, link):
     """return the nodes that have to be saved before the strip"""
-    def collectone(revlog):
+    def collectone(cl, revlog):
         extra = []
         startrev = count = len(revlog)
         # find the truncation point of the revlog
@@ -53,12 +57,12 @@
 
     extranodes = {}
     cl = repo.changelog
-    extra = collectone(repo.manifest)
+    extra = collectone(cl, repo.manifest)
     if extra:
         extranodes[1] = extra
     for fname in files:
         f = repo.file(fname)
-        extra = collectone(f)
+        extra = collectone(cl, f)
         if extra:
             extranodes[fname] = extra
 
@@ -69,6 +73,8 @@
     # TODO delete the undo files, and handle undo of merge sets
     striprev = cl.rev(node)
 
+    keeppartialbundle = backup == 'strip'
+
     # Some revisions with rev > striprev may not be descendants of striprev.
     # We have to find these revisions and put them in a bundle, so that
     # we can restore them after the truncations.
@@ -110,8 +116,9 @@
         backupfile = _bundle(repo, [node], cl.heads(), node, 'backup')
         repo.ui.status(_("saved backup bundle to %s\n") % backupfile)
     if saveheads or extranodes:
+        # do not compress partial bundle if we remove it from disk later
         chgrpfile = _bundle(repo, savebases, saveheads, node, 'temp',
-                            extranodes)
+                            extranodes=extranodes, compress=keeppartialbundle)
 
     mfst = repo.manifest
 
@@ -146,7 +153,7 @@
             if not repo.ui.verbose:
                 repo.ui.popbuffer()
             f.close()
-            if backup != "strip":
+            if not keeppartialbundle:
                 os.unlink(chgrpfile)
     except:
         if backupfile:
--- a/mercurial/repo.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/repo.py	Wed Sep 22 18:29:41 2010 -0500
@@ -35,10 +35,3 @@
 
     def cancopy(self):
         return self.local()
-
-    def rjoin(self, path):
-        url = self.url()
-        if url.endswith('/'):
-            return url + path
-        else:
-            return url + '/' + path
--- a/mercurial/revlog.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/revlog.py	Wed Sep 22 18:29:41 2010 -0500
@@ -23,13 +23,20 @@
 _decompress = zlib.decompress
 _sha = util.sha1
 
-# revlog flags
+# revlog header flags
 REVLOGV0 = 0
 REVLOGNG = 1
 REVLOGNGINLINEDATA = (1 << 16)
+REVLOGSHALLOW = (1 << 17)
 REVLOG_DEFAULT_FLAGS = REVLOGNGINLINEDATA
 REVLOG_DEFAULT_FORMAT = REVLOGNG
 REVLOG_DEFAULT_VERSION = REVLOG_DEFAULT_FORMAT | REVLOG_DEFAULT_FLAGS
+REVLOGNG_FLAGS = REVLOGNGINLINEDATA | REVLOGSHALLOW
+
+# revlog index flags
+REVIDX_PARENTDELTA  = 1
+REVIDX_PUNCHED_FLAG = 2
+REVIDX_KNOWN_FLAGS = REVIDX_PUNCHED_FLAG | REVIDX_PARENTDELTA
 
 # amount of data read unconditionally, should be >= 4
 # when not inline: threshold for using lazy index
@@ -131,7 +138,7 @@
         self.dataf = dataf
         self.s = struct.calcsize(indexformatng)
         self.datasize = size
-        self.l = size / self.s
+        self.l = size // self.s
         self.index = [None] * self.l
         self.map = {nullid: nullrev}
         self.allmap = 0
@@ -176,8 +183,8 @@
                 # limit blocksize so that we don't get too much data.
                 blocksize = max(self.datasize - blockstart, 0)
             data = self.dataf.read(blocksize)
-        lend = len(data) / self.s
-        i = blockstart / self.s
+        lend = len(data) // self.s
+        i = blockstart // self.s
         off = 0
         # lazyindex supports __delitem__
         if lend > len(self.index) - i:
@@ -420,7 +427,7 @@
     remove data, and can use some simple techniques to avoid the need
     for locking while reading.
     """
-    def __init__(self, opener, indexfile):
+    def __init__(self, opener, indexfile, shallowroot=None):
         """
         create a revlog object
 
@@ -434,12 +441,19 @@
         self._chunkcache = (0, '')
         self.nodemap = {nullid: nullrev}
         self.index = []
+        self._shallowroot = shallowroot
+        self._parentdelta = 0
 
         v = REVLOG_DEFAULT_VERSION
         if hasattr(opener, 'options') and 'defversion' in opener.options:
             v = opener.options['defversion']
             if v & REVLOGNG:
                 v |= REVLOGNGINLINEDATA
+            if v & REVLOGNG and 'parentdelta' in opener.options:
+                self._parentdelta = 1
+
+        if shallowroot:
+            v |= REVLOGSHALLOW
 
         i = ''
         try:
@@ -456,12 +470,13 @@
 
         self.version = v
         self._inline = v & REVLOGNGINLINEDATA
+        self._shallow = v & REVLOGSHALLOW
         flags = v & ~0xFFFF
         fmt = v & 0xFFFF
         if fmt == REVLOGV0 and flags:
             raise RevlogError(_("index %s unknown flags %#04x for format v0")
                               % (self.indexfile, flags >> 16))
-        elif fmt == REVLOGNG and flags & ~REVLOGNGINLINEDATA:
+        elif fmt == REVLOGNG and flags & ~REVLOGNG_FLAGS:
             raise RevlogError(_("index %s unknown flags %#04x for revlogng")
                               % (self.indexfile, flags >> 16))
         elif fmt > REVLOGNG:
@@ -533,8 +548,9 @@
         return self.index[rev][1]
     def base(self, rev):
         return self.index[rev][3]
-
-    def size(self, rev):
+    def flags(self, rev):
+        return self.index[rev][0] & 0xFFFF
+    def rawsize(self, rev):
         """return the length of the uncompressed text for a given revision"""
         l = self.index[rev][2]
         if l >= 0:
@@ -542,6 +558,7 @@
 
         t = self.revision(self.node(rev))
         return len(t)
+    size = rawsize
 
     def reachable(self, node, stop=None):
         """return the set of all nodes ancestral to a given node, including
@@ -999,9 +1016,16 @@
     def _chunkclear(self):
         self._chunkcache = (0, '')
 
+    def deltaparent(self, rev):
+        """return previous revision or parentrev according to flags"""
+        if self.flags(rev) & REVIDX_PARENTDELTA:
+            return self.parentrevs(rev)[0]
+        else:
+            return rev - 1
+
     def revdiff(self, rev1, rev2):
         """return or calculate a delta between two revisions"""
-        if rev1 + 1 == rev2 and self.base(rev1) == self.base(rev2):
+        if self.base(rev2) != rev2 and self.deltaparent(rev2) == rev1:
             return self._chunk(rev2)
 
         return mdiff.textdiff(self.revision(self.node(rev1)),
@@ -1009,10 +1033,13 @@
 
     def revision(self, node):
         """return an uncompressed revision of a given node"""
+        cachedrev = None
         if node == nullid:
             return ""
-        if self._cache and self._cache[0] == node:
-            return self._cache[2]
+        if self._cache:
+            if self._cache[0] == node:
+                return self._cache[2]
+            cachedrev = self._cache[1]
 
         # look up what we need to read
         text = None
@@ -1020,27 +1047,42 @@
         base = self.base(rev)
 
         # check rev flags
-        if self.index[rev][0] & 0xFFFF:
+        if self.flags(rev) & ~REVIDX_KNOWN_FLAGS:
             raise RevlogError(_('incompatible revision flag %x') %
-                              (self.index[rev][0] & 0xFFFF))
+                              (self.flags(rev) & ~REVIDX_KNOWN_FLAGS))
 
-        # do we have useful data cached?
-        if self._cache and self._cache[1] >= base and self._cache[1] < rev:
-            base = self._cache[1]
+        # build delta chain
+        self._loadindex(base, rev + 1)
+        chain = []
+        index = self.index # for performance
+        iterrev = rev
+        e = index[iterrev]
+        while iterrev != base and iterrev != cachedrev:
+            chain.append(iterrev)
+            if e[0] & REVIDX_PARENTDELTA:
+                iterrev = e[5]
+            else:
+                iterrev -= 1
+            e = index[iterrev]
+        chain.reverse()
+        base = iterrev
+
+        if iterrev == cachedrev:
+            # cache hit
             text = self._cache[2]
 
         # drop cache to save memory
         self._cache = None
 
-        self._loadindex(base, rev + 1)
         self._chunkraw(base, rev)
         if text is None:
             text = self._chunk(base)
 
-        bins = [self._chunk(r) for r in xrange(base + 1, rev + 1)]
+        bins = [self._chunk(r) for r in chain]
         text = mdiff.patches(text, bins)
         p1, p2 = self.parents(node)
-        if node != hash(text, p1, p2):
+        if (node != hash(text, p1, p2) and
+            not (self.flags(rev) & REVIDX_PUNCHED_FLAG)):
             raise RevlogError(_("integrity check failed on %s:%d")
                               % (self.indexfile, rev))
 
@@ -1086,52 +1128,72 @@
         tr.replace(self.indexfile, trindex * self._io.size)
         self._chunkclear()
 
-    def addrevision(self, text, transaction, link, p1, p2, d=None):
+    def addrevision(self, text, transaction, link, p1, p2, cachedelta=None):
         """add a revision to the log
 
         text - the revision data to add
         transaction - the transaction object used for rollback
         link - the linkrev data to add
         p1, p2 - the parent nodeids of the revision
-        d - an optional precomputed delta
+        cachedelta - an optional precomputed delta
         """
+        node = hash(text, p1, p2)
+        if (node in self.nodemap and
+            (not self.flags(self.rev(node)) & REVIDX_PUNCHED_FLAG)):
+            return node
+
         dfh = None
         if not self._inline:
             dfh = self.opener(self.datafile, "a")
         ifh = self.opener(self.indexfile, "a+")
         try:
-            return self._addrevision(text, transaction, link, p1, p2, d, ifh, dfh)
+            return self._addrevision(node, text, transaction, link, p1, p2,
+                                     cachedelta, ifh, dfh)
         finally:
             if dfh:
                 dfh.close()
             ifh.close()
 
-    def _addrevision(self, text, transaction, link, p1, p2, d, ifh, dfh):
-        node = hash(text, p1, p2)
-        if node in self.nodemap:
-            return node
-
+    def _addrevision(self, node, text, transaction, link, p1, p2,
+                     cachedelta, ifh, dfh):
         curr = len(self)
         prev = curr - 1
-        base = self.base(prev)
+        base = curr
         offset = self.end(prev)
+        flags = 0
+        d = None
 
-        if curr:
-            if not d:
-                ptext = self.revision(self.node(prev))
+        if self._parentdelta:
+            deltarev, deltanode = self.rev(p1), p1
+            flags = REVIDX_PARENTDELTA
+        else:
+            deltarev, deltanode = prev, self.node(prev)
+
+        # should we try to build a delta?
+        if deltarev != nullrev:
+            # can we use the cached delta?
+            if cachedelta:
+                cacherev, d = cachedelta
+                if cacherev != deltarev:
+                    d = None
+            if d is None:
+                ptext = self.revision(deltanode)
                 d = mdiff.textdiff(ptext, text)
             data = compress(d)
             l = len(data[1]) + len(data[0])
+            base = self.base(deltarev)
             dist = l + offset - self.start(base)
 
         # full versions are inserted when the needed deltas
         # become comparable to the uncompressed text
-        if not curr or dist > len(text) * 2:
+        # or the base revision is punched
+        if (d is None or dist > len(text) * 2 or
+            (self.flags(base) & REVIDX_PUNCHED_FLAG)):
             data = compress(text)
             l = len(data[1]) + len(data[0])
             base = curr
 
-        e = (offset_type(offset, 0), l, len(text),
+        e = (offset_type(offset, flags), l, len(text),
              base, link, self.rev(p1), self.rev(p2), node)
         self.index.insert(-1, e)
         self.nodemap[node] = curr
@@ -1157,15 +1219,19 @@
             self._cache = (node, curr, text)
         return node
 
-    def group(self, nodelist, lookup, infocollect=None):
+    def group(self, nodelist, lookup, infocollect=None, fullrev=False):
         """Calculate a delta group, yielding a sequence of changegroup chunks
         (strings).
 
         Given a list of changeset revs, return a set of deltas and
-        metadata corresponding to nodes. the first delta is
-        parent(nodes[0]) -> nodes[0] the receiver is guaranteed to
-        have this parent as it has all history before these
-        changesets. parent is parent[0]
+        metadata corresponding to nodes. The first delta is
+        first parent(nodelist[0]) -> nodelist[0], the receiver is
+        guaranteed to have this parent as it has all history before
+        these changesets. In the case firstparent is nullrev the
+        changegroup starts with a full revision.
+        fullrev forces the insertion of the full revision, necessary
+        in the case of shallow clones where the first parent might
+        not exist at the reciever.
         """
 
         revs = [self.rev(n) for n in nodelist]
@@ -1178,6 +1244,8 @@
         # add the parent of the first rev
         p = self.parentrevs(revs[0])[0]
         revs.insert(0, p)
+        if p == nullrev:
+            fullrev = True
 
         # build deltas
         for d in xrange(len(revs) - 1):
@@ -1189,25 +1257,19 @@
 
             p = self.parents(nb)
             meta = nb + p[0] + p[1] + lookup(nb)
-            if a == -1:
+            if fullrev:
                 d = self.revision(nb)
                 meta += mdiff.trivialdiffheader(len(d))
+                fullrev = False
             else:
                 d = self.revdiff(a, b)
             yield changegroup.chunkheader(len(meta) + len(d))
             yield meta
-            if len(d) > 2**20:
-                pos = 0
-                while pos < len(d):
-                    pos2 = pos + 2 ** 18
-                    yield d[pos:pos2]
-                    pos = pos2
-            else:
-                yield d
+            yield d
 
         yield changegroup.closechunk()
 
-    def addgroup(self, revs, linkmapper, transaction):
+    def addgroup(self, bundle, linkmapper, transaction):
         """
         add a delta group
 
@@ -1239,19 +1301,40 @@
         try:
             # loop through our set of deltas
             chain = None
-            for chunk in revs:
-                node, p1, p2, cs = struct.unpack("20s20s20s20s", chunk[:80])
+            while 1:
+                chunkdata = bundle.parsechunk()
+                if not chunkdata:
+                    break
+                node = chunkdata['node']
+                p1 = chunkdata['p1']
+                p2 = chunkdata['p2']
+                cs = chunkdata['cs']
+                delta = chunkdata['data']
+
                 link = linkmapper(cs)
-                if node in self.nodemap:
+                if (node in self.nodemap and
+                    (not self.flags(self.rev(node)) & REVIDX_PUNCHED_FLAG)):
                     # this can happen if two branches make the same change
                     chain = node
                     continue
-                delta = buffer(chunk, 80)
-                del chunk
 
                 for p in (p1, p2):
                     if not p in self.nodemap:
-                        raise LookupError(p, self.indexfile, _('unknown parent'))
+                        if self._shallow:
+                            # add null entries for missing parents
+                            if base == nullrev:
+                                base = len(self)
+                            e = (offset_type(end, REVIDX_PUNCHED_FLAG),
+                                 0, 0, base, nullrev, nullrev, nullrev, p)
+                            self.index.insert(-1, e)
+                            self.nodemap[p] = r
+                            entry = self._io.packentry(e, self.node,
+                                                       self.version, r)
+                            ifh.write(entry)
+                            t, r = r, r + 1
+                        else:
+                            raise LookupError(p, self.indexfile,
+                                              _('unknown parent'))
 
                 if not chain:
                     # retrieve the parent revision of the delta chain
@@ -1276,14 +1359,10 @@
                         dfh.flush()
                     ifh.flush()
                     text = self.revision(chain)
-                    if len(text) == 0:
-                        # skip over trivial delta header
-                        text = buffer(delta, 12)
-                    else:
-                        text = mdiff.patches(text, [delta])
+                    text = mdiff.patch(text, delta)
                     del delta
-                    chk = self._addrevision(text, transaction, link, p1, p2, None,
-                                            ifh, dfh)
+                    chk = self._addrevision(node, text, transaction, link,
+                                            p1, p2, None, ifh, dfh)
                     if not dfh and not self._inline:
                         # addrevision switched from inline to conventional
                         # reopen the index
--- a/mercurial/revset.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/revset.py	Wed Sep 22 18:29:41 2010 -0500
@@ -7,7 +7,7 @@
 
 import re
 import parser, util, error, discovery
-import match as _match
+import match as matchmod
 from i18n import _
 
 elements = {
@@ -195,6 +195,14 @@
             return [m]
     return []
 
+def minrev(repo, subset, x):
+    s = getset(repo, subset, x)
+    if s:
+        m = min(s)
+        if m in subset:
+            return [m]
+    return []
+
 def limit(repo, subset, x):
     l = getargs(x, 2, 2, _("limit wants two arguments"))
     try:
@@ -287,7 +295,7 @@
 
 def hasfile(repo, subset, x):
     pat = getstring(x, _("file wants a pattern"))
-    m = _match.match(repo.root, repo.getcwd(), [pat])
+    m = matchmod.match(repo.root, repo.getcwd(), [pat])
     s = []
     for r in subset:
         for f in repo[r].files():
@@ -298,7 +306,7 @@
 
 def contains(repo, subset, x):
     pat = getstring(x, _("contains wants a pattern"))
-    m = _match.match(repo.root, repo.getcwd(), [pat])
+    m = matchmod.match(repo.root, repo.getcwd(), [pat])
     s = []
     if m.files() == [pat]:
         for r in subset:
@@ -314,7 +322,7 @@
     return s
 
 def checkstatus(repo, subset, pat, field):
-    m = _match.match(repo.root, repo.getcwd(), [pat])
+    m = matchmod.match(repo.root, repo.getcwd(), [pat])
     s = []
     fast = (m.files() == [pat])
     for r in subset:
@@ -373,6 +381,12 @@
     l.reverse()
     return l
 
+def present(repo, subset, x):
+    try:
+        return getset(repo, subset, x)
+    except error.RepoLookupError:
+        return []
+
 def sort(repo, subset, x):
     l = getargs(x, 1, 2, _("sort wants one or two arguments"))
     keys = "rev"
@@ -469,12 +483,14 @@
     "keyword": keyword,
     "limit": limit,
     "max": maxrev,
+    "min": minrev,
     "merge": merge,
     "modifies": modifies,
     "outgoing": outgoing,
     "p1": p1,
     "p2": p2,
     "parents": parents,
+    "present": present,
     "removes": removes,
     "reverse": reverse,
     "roots": roots,
@@ -546,9 +562,9 @@
     elif op == 'func':
         f = getstring(x[1], _("not a symbol"))
         wa, ta = optimize(x[2], small)
-        if f in "grep date user author keyword branch file":
+        if f in "grep date user author keyword branch file outgoing":
             w = 10 # slow
-        elif f in "modifies adds removes outgoing":
+        elif f in "modifies adds removes":
             w = 30 # slower
         elif f == "contains":
             w = 100 # very slow
--- a/mercurial/sshrepo.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/sshrepo.py	Wed Sep 22 18:29:41 2010 -0500
@@ -5,10 +5,9 @@
 # This software may be used and distributed according to the terms of the
 # GNU General Public License version 2 or any later version.
 
-from node import bin, hex
 from i18n import _
-import repo, util, error, encoding
-import re, urllib
+import util, error, wireproto
+import re
 
 class remotelock(object):
     def __init__(self, repo):
@@ -20,14 +19,14 @@
         if self.repo:
             self.release()
 
-class sshrepository(repo.repository):
+class sshrepository(wireproto.wirerepository):
     def __init__(self, ui, path, create=0):
         self._url = path
         self.ui = ui
 
         m = re.match(r'^ssh://(([^@]+)@)?([^:/]+)(:(\d+))?(/(.*))?$', path)
         if not m:
-            self.abort(error.RepoError(_("couldn't parse location %s") % path))
+            self._abort(error.RepoError(_("couldn't parse location %s") % path))
 
         self.user = m.group(2)
         self.host = m.group(3)
@@ -46,7 +45,7 @@
             ui.note(_('running %s\n') % cmd)
             res = util.system(cmd)
             if res != 0:
-                self.abort(error.RepoError(_("could not create remote repo")))
+                self._abort(error.RepoError(_("could not create remote repo")))
 
         self.validate_repo(ui, sshcmd, args, remotecmd)
 
@@ -65,8 +64,8 @@
         self.pipeo, self.pipei, self.pipee = util.popen3(cmd)
 
         # skip any noise generated by remote shell
-        self.do_cmd("hello")
-        r = self.do_cmd("between", pairs=("%s-%s" % ("0"*40, "0"*40)))
+        self._callstream("hello")
+        r = self._callstream("between", pairs=("%s-%s" % ("0"*40, "0"*40)))
         lines = ["", "dummy"]
         max_noise = 500
         while lines[-1] and max_noise:
@@ -79,7 +78,7 @@
             lines.append(l)
             max_noise -= 1
         else:
-            self.abort(error.RepoError(_("no suitable response from remote hg")))
+            self._abort(error.RepoError(_("no suitable response from remote hg")))
 
         self.capabilities = set()
         for l in reversed(lines):
@@ -97,7 +96,7 @@
                 break
             self.ui.status(_("remote: "), l)
 
-    def abort(self, exception):
+    def _abort(self, exception):
         self.cleanup()
         raise exception
 
@@ -114,7 +113,7 @@
 
     __del__ = cleanup
 
-    def do_cmd(self, cmd, **args):
+    def _callstream(self, cmd, **args):
         self.ui.debug("sending %s command\n" % cmd)
         self.pipeo.write("%s\n" % cmd)
         for k, v in sorted(args.iteritems()):
@@ -124,17 +123,35 @@
 
         return self.pipei
 
-    def call(self, cmd, **args):
-        self.do_cmd(cmd, **args)
+    def _call(self, cmd, **args):
+        self._callstream(cmd, **args)
         return self._recv()
 
+    def _callpush(self, cmd, fp, **args):
+        r = self._call(cmd, **args)
+        if r:
+            return '', r
+        while 1:
+            d = fp.read(4096)
+            if not d:
+                break
+            self._send(d)
+        self._send("", flush=True)
+        r = self._recv()
+        if r:
+            return '', r
+        return self._recv(), ''
+
+    def _decompress(self, stream):
+        return stream
+
     def _recv(self):
         l = self.pipei.readline()
         self.readerr()
         try:
             l = int(l)
         except:
-            self.abort(error.ResponseError(_("unexpected response:"), l))
+            self._abort(error.ResponseError(_("unexpected response:"), l))
         return self.pipei.read(l)
 
     def _send(self, data, flush=False):
@@ -146,112 +163,19 @@
         self.readerr()
 
     def lock(self):
-        self.call("lock")
+        self._call("lock")
         return remotelock(self)
 
     def unlock(self):
-        self.call("unlock")
-
-    def lookup(self, key):
-        self.requirecap('lookup', _('look up remote revision'))
-        d = self.call("lookup", key=key)
-        success, data = d[:-1].split(" ", 1)
-        if int(success):
-            return bin(data)
-        else:
-            self.abort(error.RepoError(data))
-
-    def heads(self):
-        d = self.call("heads")
-        try:
-            return map(bin, d[:-1].split(" "))
-        except:
-            self.abort(error.ResponseError(_("unexpected response:"), d))
-
-    def branchmap(self):
-        d = self.call("branchmap")
-        try:
-            branchmap = {}
-            for branchpart in d.splitlines():
-                branchheads = branchpart.split(' ')
-                branchname = urllib.unquote(branchheads[0])
-                # Earlier servers (1.3.x) send branch names in (their) local
-                # charset. The best we can do is assume it's identical to our
-                # own local charset, in case it's not utf-8.
-                try:
-                    branchname.decode('utf-8')
-                except UnicodeDecodeError:
-                    branchname = encoding.fromlocal(branchname)
-                branchheads = [bin(x) for x in branchheads[1:]]
-                branchmap[branchname] = branchheads
-            return branchmap
-        except:
-            raise error.ResponseError(_("unexpected response:"), d)
-
-    def branches(self, nodes):
-        n = " ".join(map(hex, nodes))
-        d = self.call("branches", nodes=n)
-        try:
-            br = [tuple(map(bin, b.split(" "))) for b in d.splitlines()]
-            return br
-        except:
-            self.abort(error.ResponseError(_("unexpected response:"), d))
-
-    def between(self, pairs):
-        n = " ".join(["-".join(map(hex, p)) for p in pairs])
-        d = self.call("between", pairs=n)
-        try:
-            p = [l and map(bin, l.split(" ")) or [] for l in d.splitlines()]
-            return p
-        except:
-            self.abort(error.ResponseError(_("unexpected response:"), d))
-
-    def changegroup(self, nodes, kind):
-        n = " ".join(map(hex, nodes))
-        return self.do_cmd("changegroup", roots=n)
-
-    def changegroupsubset(self, bases, heads, kind):
-        self.requirecap('changegroupsubset', _('look up remote changes'))
-        bases = " ".join(map(hex, bases))
-        heads = " ".join(map(hex, heads))
-        return self.do_cmd("changegroupsubset", bases=bases, heads=heads)
-
-    def unbundle(self, cg, heads, source):
-        '''Send cg (a readable file-like object representing the
-        changegroup to push, typically a chunkbuffer object) to the
-        remote server as a bundle. Return an integer indicating the
-        result of the push (see localrepository.addchangegroup()).'''
-        d = self.call("unbundle", heads=' '.join(map(hex, heads)))
-        if d:
-            # remote may send "unsynced changes"
-            self.abort(error.RepoError(_("push refused: %s") % d))
-
-        while 1:
-            d = cg.read(4096)
-            if not d:
-                break
-            self._send(d)
-
-        self._send("", flush=True)
-
-        r = self._recv()
-        if r:
-            # remote may send "unsynced changes"
-            self.abort(error.RepoError(_("push failed: %s") % r))
-
-        r = self._recv()
-        try:
-            return int(r)
-        except:
-            self.abort(error.ResponseError(_("unexpected response:"), r))
+        self._call("unlock")
 
     def addchangegroup(self, cg, source, url):
         '''Send a changegroup to the remote server.  Return an integer
         similar to unbundle(). DEPRECATED, since it requires locking the
         remote.'''
-        d = self.call("addchangegroup")
+        d = self._call("addchangegroup")
         if d:
-            self.abort(error.RepoError(_("push refused: %s") % d))
+            self._abort(error.RepoError(_("push refused: %s") % d))
         while 1:
             d = cg.read(4096)
             if not d:
@@ -268,26 +192,6 @@
         try:
             return int(r)
         except:
-            self.abort(error.ResponseError(_("unexpected response:"), r))
-
-    def stream_out(self):
-        return self.do_cmd('stream_out')
-
-    def pushkey(self, namespace, key, old, new):
-        if not self.capable('pushkey'):
-            return False
-        d = self.call("pushkey",
-                      namespace=namespace, key=key, old=old, new=new)
-        return bool(int(d))
-
-    def listkeys(self, namespace):
-        if not self.capable('pushkey'):
-            return {}
-        d = self.call("listkeys", namespace=namespace)
-        r = {}
-        for l in d.splitlines():
-            k, v = l.split('\t')
-            r[k.decode('string-escape')] = v.decode('string-escape')
-        return r
+            self._abort(error.ResponseError(_("unexpected response:"), r))
 
 instance = sshrepository
--- a/mercurial/sshserver.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/sshserver.py	Wed Sep 22 18:29:41 2010 -0500
@@ -6,15 +6,10 @@
 # This software may be used and distributed according to the terms of the
 # GNU General Public License version 2 or any later version.
 
-from i18n import _
-from node import bin, hex
-import streamclone, util, hook, pushkey
-import os, sys, tempfile, urllib, copy
+import util, hook, wireproto, changegroup
+import os, sys
 
 class sshserver(object):
-
-    caps = 'unbundle lookup changegroupsubset branchmap pushkey'.split()
-
     def __init__(self, ui, repo):
         self.ui = ui
         self.repo = repo
@@ -29,17 +24,61 @@
         util.set_binary(self.fin)
         util.set_binary(self.fout)
 
-    def getarg(self):
-        argline = self.fin.readline()[:-1]
-        arg, l = argline.split()
-        val = self.fin.read(int(l))
-        return arg, val
+    def getargs(self, args):
+        data = {}
+        keys = args.split()
+        count = len(keys)
+        for n in xrange(len(keys)):
+            argline = self.fin.readline()[:-1]
+            arg, l = argline.split()
+            val = self.fin.read(int(l))
+            if arg not in keys:
+                raise util.Abort("unexpected parameter %r" % arg)
+            if arg == '*':
+                star = {}
+                for n in xrange(int(l)):
+                    arg, l = argline.split()
+                    val = self.fin.read(int(l))
+                    star[arg] = val
+                data['*'] = star
+            else:
+                data[arg] = val
+        return [data[k] for k in keys]
 
-    def respond(self, v):
+    def getarg(self, name):
+        return self.getargs(name)[0]
+
+    def getfile(self, fpout):
+        self.sendresponse('')
+        count = int(self.fin.readline())
+        while count:
+            fpout.write(self.fin.read(count))
+            count = int(self.fin.readline())
+
+    def redirect(self):
+        pass
+
+    def groupchunks(self, changegroup):
+        while True:
+            d = changegroup.read(4096)
+            if not d:
+                break
+            yield d
+
+    def sendresponse(self, v):
         self.fout.write("%d\n" % len(v))
         self.fout.write(v)
         self.fout.flush()
 
+    def sendstream(self, source):
+        for chunk in source.gen:
+            self.fout.write(chunk)
+        self.fout.flush()
+
+    def sendpushresponse(self, rsp):
+        self.sendresponse('')
+        self.sendresponse(str(rsp.res))
+
     def serve_forever(self):
         try:
             while self.serve_one():
@@ -49,57 +88,31 @@
                 self.lock.release()
         sys.exit(0)
 
+    handlers = {
+        str: sendresponse,
+        wireproto.streamres: sendstream,
+        wireproto.pushres: sendpushresponse,
+    }
+
     def serve_one(self):
         cmd = self.fin.readline()[:-1]
-        if cmd:
+        if cmd and cmd in wireproto.commands:
+            rsp = wireproto.dispatch(self.repo, self, cmd)
+            self.handlers[rsp.__class__](self, rsp)
+        elif cmd:
             impl = getattr(self, 'do_' + cmd, None)
             if impl:
-                impl()
-            else: self.respond("")
+                r = impl()
+                if r is not None:
+                    self.sendresponse(r)
+            else: self.sendresponse("")
         return cmd != ''
 
-    def do_lookup(self):
-        arg, key = self.getarg()
-        assert arg == 'key'
-        try:
-            r = hex(self.repo.lookup(key))
-            success = 1
-        except Exception, inst:
-            r = str(inst)
-            success = 0
-        self.respond("%s %s\n" % (success, r))
-
-    def do_branchmap(self):
-        branchmap = self.repo.branchmap()
-        heads = []
-        for branch, nodes in branchmap.iteritems():
-            branchname = urllib.quote(branch)
-            branchnodes = [hex(node) for node in nodes]
-            heads.append('%s %s' % (branchname, ' '.join(branchnodes)))
-        self.respond('\n'.join(heads))
-
-    def do_heads(self):
-        h = self.repo.heads()
-        self.respond(" ".join(map(hex, h)) + "\n")
-
-    def do_hello(self):
-        '''the hello command returns a set of lines describing various
-        interesting things about the server, in an RFC822-like format.
-        Currently the only one defined is "capabilities", which
-        consists of a line in the form:
-
-        capabilities: space separated list of tokens
-        '''
-        caps = copy.copy(self.caps)
-        if streamclone.allowed(self.repo.ui):
-            caps.append('stream=%d' % self.repo.changelog.version)
-        self.respond("capabilities: %s\n" % (' '.join(caps),))
-
     def do_lock(self):
         '''DEPRECATED - allowing remote client to lock repo is not safe'''
 
         self.lock = self.repo.lock()
-        self.respond("")
+        return ""
 
     def do_unlock(self):
         '''DEPRECATED'''
@@ -107,136 +120,21 @@
         if self.lock:
             self.lock.release()
         self.lock = None
-        self.respond("")
-
-    def do_branches(self):
-        arg, nodes = self.getarg()
-        nodes = map(bin, nodes.split(" "))
-        r = []
-        for b in self.repo.branches(nodes):
-            r.append(" ".join(map(hex, b)) + "\n")
-        self.respond("".join(r))
-
-    def do_between(self):
-        arg, pairs = self.getarg()
-        pairs = [map(bin, p.split("-")) for p in pairs.split(" ")]
-        r = []
-        for b in self.repo.between(pairs):
-            r.append(" ".join(map(hex, b)) + "\n")
-        self.respond("".join(r))
-
-    def do_changegroup(self):
-        nodes = []
-        arg, roots = self.getarg()
-        nodes = map(bin, roots.split(" "))
-
-        cg = self.repo.changegroup(nodes, 'serve')
-        while True:
-            d = cg.read(4096)
-            if not d:
-                break
-            self.fout.write(d)
-
-        self.fout.flush()
-
-    def do_changegroupsubset(self):
-        argmap = dict([self.getarg(), self.getarg()])
-        bases = [bin(n) for n in argmap['bases'].split(' ')]
-        heads = [bin(n) for n in argmap['heads'].split(' ')]
-
-        cg = self.repo.changegroupsubset(bases, heads, 'serve')
-        while True:
-            d = cg.read(4096)
-            if not d:
-                break
-            self.fout.write(d)
-
-        self.fout.flush()
+        return ""
 
     def do_addchangegroup(self):
         '''DEPRECATED'''
 
         if not self.lock:
-            self.respond("not locked")
-            return
-
-        self.respond("")
-        r = self.repo.addchangegroup(self.fin, 'serve', self.client_url(),
-                                     lock=self.lock)
-        self.respond(str(r))
-
-    def client_url(self):
-        client = os.environ.get('SSH_CLIENT', '').split(' ', 1)[0]
-        return 'remote:ssh:' + client
-
-    def do_unbundle(self):
-        their_heads = self.getarg()[1].split()
-
-        def check_heads():
-            heads = map(hex, self.repo.heads())
-            return their_heads == [hex('force')] or their_heads == heads
-
-        # fail early if possible
-        if not check_heads():
-            self.respond(_('unsynced changes'))
+            self.sendresponse("not locked")
             return
 
-        self.respond('')
-
-        # write bundle data to temporary file because it can be big
-        fd, tempname = tempfile.mkstemp(prefix='hg-unbundle-')
-        fp = os.fdopen(fd, 'wb+')
-        try:
-            count = int(self.fin.readline())
-            while count:
-                fp.write(self.fin.read(count))
-                count = int(self.fin.readline())
-
-            was_locked = self.lock is not None
-            if not was_locked:
-                self.lock = self.repo.lock()
-            try:
-                if not check_heads():
-                    # someone else committed/pushed/unbundled while we
-                    # were transferring data
-                    self.respond(_('unsynced changes'))
-                    return
-                self.respond('')
-
-                # push can proceed
+        self.sendresponse("")
+        cg = changegroup.unbundle10(self.fin, "UN")
+        r = self.repo.addchangegroup(cg, 'serve', self._client(),
+                                     lock=self.lock)
+        return str(r)
 
-                fp.seek(0)
-                r = self.repo.addchangegroup(fp, 'serve', self.client_url(),
-                                             lock=self.lock)
-                self.respond(str(r))
-            finally:
-                if not was_locked:
-                    self.lock.release()
-                    self.lock = None
-        finally:
-            fp.close()
-            os.unlink(tempname)
-
-    def do_stream_out(self):
-        try:
-            for chunk in streamclone.stream_out(self.repo):
-                self.fout.write(chunk)
-            self.fout.flush()
-        except streamclone.StreamException, inst:
-            self.fout.write(str(inst))
-            self.fout.flush()
-
-    def do_pushkey(self):
-        arg, key = self.getarg()
-        arg, namespace = self.getarg()
-        arg, new = self.getarg()
-        arg, old = self.getarg()
-        r = pushkey.push(self.repo, namespace, key, old, new)
-        self.respond('%s\n' % int(r))
-
-    def do_listkeys(self):
-        arg, namespace = self.getarg()
-        d = pushkey.list(self.repo, namespace).items()
-        t = '\n'.join(['%s\t%s' % (k.encode('string-escape'),
-                                   v.encode('string-escape')) for k, v in d])
-        self.respond(t)
+    def _client(self):
+        client = os.environ.get('SSH_CLIENT', '').split(' ', 1)[0]
+        return 'remote:ssh:' + client
--- a/mercurial/statichttprepo.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/statichttprepo.py	Wed Sep 22 18:29:41 2010 -0500
@@ -129,6 +129,7 @@
         self._branchcachetip = None
         self.encodepats = None
         self.decodepats = None
+        self.capabilities.remove("pushkey")
 
     def url(self):
         return self._url
--- a/mercurial/store.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/store.py	Wed Sep 22 18:29:41 2010 -0500
@@ -22,7 +22,7 @@
             .replace(".d/", ".d.hg/"))
 
 def decodedir(path):
-    if not path.startswith('data/'):
+    if not path.startswith('data/') or ".hg/" not in path:
         return path
     return (path
             .replace(".d.hg/", ".d/")
@@ -163,7 +163,7 @@
         mode = None
     return mode
 
-_data = 'data 00manifest.d 00manifest.i 00changelog.d  00changelog.i'
+_data = 'data 00manifest.d 00manifest.i 00changelog.d 00changelog.i'
 
 class basicstore(object):
     '''base class for local repository stores'''
--- a/mercurial/streamclone.py	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-# streamclone.py - streaming clone server support for mercurial
-#
-# Copyright 2006 Vadim Gelfer <vadim.gelfer@gmail.com>
-#
-# This software may be used and distributed according to the terms of the
-# GNU General Public License version 2 or any later version.
-
-import util, error
-
-from mercurial import store
-
-class StreamException(Exception):
-    def __init__(self, code):
-        Exception.__init__(self)
-        self.code = code
-    def __str__(self):
-        return '%i\n' % self.code
-
-# if server supports streaming clone, it advertises "stream"
-# capability with value that is version+flags of repo it is serving.
-# client only streams if it can read that repo format.
-
-# stream file format is simple.
-#
-# server writes out line that says how many files, how many total
-# bytes.  separator is ascii space, byte counts are strings.
-#
-# then for each file:
-#
-#   server writes out line that says filename, how many bytes in
-#   file.  separator is ascii nul, byte count is string.
-#
-#   server writes out raw file data.
-
-def allowed(ui):
-    return ui.configbool('server', 'uncompressed', True, untrusted=True)
-
-def stream_out(repo):
-    '''stream out all metadata files in repository.
-    writes to file-like object, must support write() and optional flush().'''
-
-    if not allowed(repo.ui):
-        raise StreamException(1)
-
-    entries = []
-    total_bytes = 0
-    try:
-        # get consistent snapshot of repo, lock during scan
-        lock = repo.lock()
-        try:
-            repo.ui.debug('scanning\n')
-            for name, ename, size in repo.store.walk():
-                entries.append((name, size))
-                total_bytes += size
-        finally:
-            lock.release()
-    except error.LockError:
-        raise StreamException(2)
-
-    yield '0\n'
-    repo.ui.debug('%d files, %d bytes to transfer\n' %
-                  (len(entries), total_bytes))
-    yield '%d %d\n' % (len(entries), total_bytes)
-    for name, size in entries:
-        repo.ui.debug('sending %s (%d bytes)\n' % (name, size))
-        # partially encode name over the wire for backwards compat
-        yield '%s\0%d\n' % (store.encodedir(name), size)
-        for chunk in util.filechunkiter(repo.sopener(name), limit=size):
-            yield chunk
--- a/mercurial/subrepo.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/subrepo.py	Wed Sep 22 18:29:41 2010 -0500
@@ -7,12 +7,12 @@
 
 import errno, os, re, xml.dom.minidom, shutil, urlparse, posixpath
 from i18n import _
-import config, util, node, error
+import config, util, node, error, cmdutil
 hg = None
 
 nullstate = ('', '', 'empty')
 
-def state(ctx):
+def state(ctx, ui):
     """return a state dict, mapping subrepo paths configured in .hgsub
     to tuple: (source from .hgsub, revision from .hgsubstate, kind
     (key in types dict))
@@ -27,6 +27,9 @@
     if '.hgsub' in ctx:
         read('.hgsub')
 
+    for path, src in ui.configitems('subpaths'):
+        p.set('subpaths', path, src, ui.configsource('subpaths', path))
+
     rev = {}
     if '.hgsubstate' in ctx:
         try:
@@ -45,6 +48,21 @@
                 raise util.Abort(_('missing ] in subrepo source'))
             kind, src = src.split(']', 1)
             kind = kind[1:]
+
+        for pattern, repl in p.items('subpaths'):
+            # Turn r'C:\foo\bar' into r'C:\\foo\\bar' since re.sub
+            # does a string decode.
+            repl = repl.encode('string-escape')
+            # However, we still want to allow back references to go
+            # through unharmed, so we turn r'\\1' into r'\1'. Again,
+            # extra escapes are needed because re.sub string decodes.
+            repl = re.sub(r'\\\\([0-9]+)', r'\\\1', repl)
+            try:
+                src = re.sub(pattern, repl, src, 1)
+            except re.error, e:
+                raise util.Abort(_("bad subrepository pattern in %s: %s")
+                                 % (p.source('subpaths', pattern), e))
+
         state[path] = (src.strip(), rev.get(path, ''), kind)
 
     return state
@@ -166,6 +184,16 @@
         return repo.ui.config('paths', 'default-push', repo.root)
     return repo.ui.config('paths', 'default', repo.root)
 
+def itersubrepos(ctx1, ctx2):
+    """find subrepos in ctx1 or ctx2"""
+    # Create a (subpath, ctx) mapping where we prefer subpaths from
+    # ctx1. The subpaths from ctx2 are important when the .hgsub file
+    # has been modified (in ctx2) but not yet committed (in ctx1).
+    subpaths = dict.fromkeys(ctx2.substate, ctx2)
+    subpaths.update(dict.fromkeys(ctx1.substate, ctx1))
+    for subpath, ctx in sorted(subpaths.iteritems()):
+        yield subpath, ctx.sub(subpath)
+
 def subrepo(ctx, path):
     """return instance of the right subrepo class for subrepo in path"""
     # subrepo inherently violates our import layering rules
@@ -182,22 +210,88 @@
         raise util.Abort(_('unknown subrepo type %s') % state[2])
     return types[state[2]](ctx, path, state[:2])
 
-# subrepo classes need to implement the following methods:
-# __init__(self, ctx, path, state)
-# dirty(self): returns true if the dirstate of the subrepo
-#   does not match current stored state
-# commit(self, text, user, date): commit the current changes
-#   to the subrepo with the given log message. Use given
-#   user and date if possible. Return the new state of the subrepo.
-# remove(self): remove the subrepo (should verify the dirstate
-#   is not dirty first)
-# get(self, state): run whatever commands are needed to put the
-#   subrepo into this state
-# merge(self, state): merge currently-saved state with the new state.
-# push(self, force): perform whatever action is analogous to 'hg push'
-#   This may be a no-op on some systems.
+# subrepo classes need to implement the following abstract class:
+
+class abstractsubrepo(object):
+
+    def dirty(self):
+        """returns true if the dirstate of the subrepo does not match
+        current stored state
+        """
+        raise NotImplementedError
+
+    def checknested(path):
+        """check if path is a subrepository within this repository"""
+        return False
+
+    def commit(self, text, user, date):
+        """commit the current changes to the subrepo with the given
+        log message. Use given user and date if possible. Return the
+        new state of the subrepo.
+        """
+        raise NotImplementedError
+
+    def remove(self):
+        """remove the subrepo
+
+        (should verify the dirstate is not dirty first)
+        """
+        raise NotImplementedError
+
+    def get(self, state):
+        """run whatever commands are needed to put the subrepo into
+        this state
+        """
+        raise NotImplementedError
+
+    def merge(self, state):
+        """merge currently-saved state with the new state."""
+        raise NotImplementedError
+
+    def push(self, force):
+        """perform whatever action is analogous to 'hg push'
 
-class hgsubrepo(object):
+        This may be a no-op on some systems.
+        """
+        raise NotImplementedError
+
+    def add(self, ui, match, dryrun, prefix):
+        return []
+
+    def status(self, rev2, **opts):
+        return [], [], [], [], [], [], []
+
+    def diff(self, diffopts, node2, match, prefix, **opts):
+        pass
+
+    def outgoing(self, ui, dest, opts):
+        return 1
+
+    def incoming(self, ui, source, opts):
+        return 1
+
+    def files(self):
+        """return filename iterator"""
+        raise NotImplementedError
+
+    def filedata(self, name):
+        """return file data"""
+        raise NotImplementedError
+
+    def fileflags(self, name):
+        """return file flags"""
+        return ''
+
+    def archive(self, archiver, prefix):
+        for name in self.files():
+            flags = self.fileflags(name)
+            mode = 'x' in flags and 0755 or 0644
+            symlink = 'l' in flags
+            archiver.addfile(os.path.join(prefix, self._path, name),
+                             mode, symlink, self.filedata(name))
+
+
+class hgsubrepo(abstractsubrepo):
     def __init__(self, ctx, path, state):
         self._path = path
         self._state = state
@@ -226,6 +320,45 @@
                 addpathconfig('default-push', defpushpath)
             fp.close()
 
+    def add(self, ui, match, dryrun, prefix):
+        return cmdutil.add(ui, self._repo, match, dryrun, True,
+                           os.path.join(prefix, self._path))
+
+    def status(self, rev2, **opts):
+        try:
+            rev1 = self._state[1]
+            ctx1 = self._repo[rev1]
+            ctx2 = self._repo[rev2]
+            return self._repo.status(ctx1, ctx2, **opts)
+        except error.RepoLookupError, inst:
+            self._repo.ui.warn(_("warning: %s in %s\n")
+                               % (inst, relpath(self)))
+            return [], [], [], [], [], [], []
+
+    def diff(self, diffopts, node2, match, prefix, **opts):
+        try:
+            node1 = node.bin(self._state[1])
+            # We currently expect node2 to come from substate and be
+            # in hex format
+            if node2 is not None:
+                node2 = node.bin(node2)
+            cmdutil.diffordiffstat(self._repo.ui, self._repo, diffopts,
+                                   node1, node2, match,
+                                   prefix=os.path.join(prefix, self._path),
+                                   listsubrepos=True, **opts)
+        except error.RepoLookupError, inst:
+            self._repo.ui.warn(_("warning: %s in %s\n")
+                               % (inst, relpath(self)))
+
+    def archive(self, archiver, prefix):
+        abstractsubrepo.archive(self, archiver, prefix)
+
+        rev = self._state[1]
+        ctx = self._repo[rev]
+        for subpath in ctx.substate:
+            s = subrepo(ctx, subpath)
+            s.archive(archiver, os.path.join(prefix, self._path))
+
     def dirty(self):
         r = self._state[1]
         if r == '':
@@ -235,6 +368,9 @@
             return True
         return w.dirty() # working directory changed
 
+    def checknested(self, path):
+        return self._repo._checknested(self._repo.wjoin(path))
+
     def commit(self, text, user, date):
         self._repo.ui.debug("committing subrepo %s\n" % relpath(self))
         n = self._repo.commit(text, user, date)
@@ -294,15 +430,36 @@
         other = hg.repository(self._repo.ui, dsturl)
         return self._repo.push(other, force)
 
-class svnsubrepo(object):
+    def outgoing(self, ui, dest, opts):
+        return hg.outgoing(ui, self._repo, _abssource(self._repo, True), opts)
+
+    def incoming(self, ui, source, opts):
+        return hg.incoming(ui, self._repo, _abssource(self._repo, False), opts)
+
+    def files(self):
+        rev = self._state[1]
+        ctx = self._repo[rev]
+        return ctx.manifest()
+
+    def filedata(self, name):
+        rev = self._state[1]
+        return self._repo[rev][name].data()
+
+    def fileflags(self, name):
+        rev = self._state[1]
+        ctx = self._repo[rev]
+        return ctx.flags(name)
+
+
+class svnsubrepo(abstractsubrepo):
     def __init__(self, ctx, path, state):
         self._path = path
         self._state = state
         self._ctx = ctx
         self._ui = ctx._repo.ui
 
-    def _svncommand(self, commands):
-        path = os.path.join(self._ctx._repo.origroot, self._path)
+    def _svncommand(self, commands, filename=''):
+        path = os.path.join(self._ctx._repo.origroot, self._path, filename)
         cmd = ['svn'] + commands + [path]
         cmd = [util.shellquote(arg) for arg in cmd]
         cmd = util.quotecommand(' '.join(cmd))
@@ -365,7 +522,7 @@
             raise util.Abort(_('cannot commit svn externals'))
         commitinfo = self._svncommand(['commit', '-m', text])
         self._ui.status(commitinfo)
-        newrev = re.search('Committed revision ([\d]+).', commitinfo)
+        newrev = re.search('Committed revision ([0-9]+).', commitinfo)
         if not newrev:
             raise util.Abort(commitinfo.splitlines()[-1])
         newrev = newrev.groups()[0]
@@ -382,7 +539,7 @@
 
     def get(self, state):
         status = self._svncommand(['checkout', state[0], '--revision', state[1]])
-        if not re.search('Checked out revision [\d]+.', status):
+        if not re.search('Checked out revision [0-9]+.', status):
             raise util.Abort(status.splitlines()[-1])
         self._ui.status(status)
 
@@ -396,6 +553,15 @@
         # push is a no-op for SVN
         return True
 
+    def files(self):
+        output = self._svncommand(['list'])
+        # This works because svn forbids \n in filenames.
+        return output.splitlines()
+
+    def filedata(self, name):
+        return self._svncommand(['cat'], name)
+
+
 types = {
     'hg': hgsubrepo,
     'svn': svnsubrepo,
--- a/mercurial/templatefilters.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/templatefilters.py	Wed Sep 22 18:29:41 2010 -0500
@@ -6,7 +6,7 @@
 # GNU General Public License version 2 or any later version.
 
 import cgi, re, os, time, urllib
-import util, encoding
+import encoding, node, util
 
 def stringify(thing):
     '''turn nested template iterator into string.'''
@@ -216,6 +216,7 @@
     "person": person,
     "rfc822date": lambda x: util.datestr(x, "%a, %d %b %Y %H:%M:%S %1%2"),
     "rfc3339date": lambda x: util.datestr(x, "%Y-%m-%dT%H:%M:%S%1:%2"),
+    "hex": node.hex,
     "short": lambda x: x[:12],
     "shortdate": util.shortdate,
     "stringify": stringify,
--- a/mercurial/templatekw.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/templatekw.py	Wed Sep 22 18:29:41 2010 -0500
@@ -151,6 +151,11 @@
         branch = encoding.tolocal(branch)
         return showlist('branch', [branch], plural='branches', **args)
 
+def showchildren(**args):
+    ctx = args['ctx']
+    childrevs = ['%d:%s' % (cctx, cctx) for cctx in ctx.children()]
+    return showlist('children', childrevs, **args)
+
 def showdate(repo, ctx, templ, **args):
     return ctx.date()
 
@@ -245,6 +250,7 @@
 keywords = {
     'author': showauthor,
     'branches': showbranches,
+    'children': showchildren,
     'date': showdate,
     'desc': showdescription,
     'diffstat': showdiffstat,
--- a/mercurial/transaction.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/transaction.py	Wed Sep 22 18:29:41 2010 -0500
@@ -115,7 +115,7 @@
     def release(self):
         if self.count > 0:
             self.usages -= 1
-        # of the transaction scopes are left without being closed, fail
+        # if the transaction scopes are left without being closed, fail
         if self.count > 0 and self.usages == 0:
             self._abort()
 
--- a/mercurial/ui.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/ui.py	Wed Sep 22 18:29:41 2010 -0500
@@ -9,9 +9,6 @@
 import errno, getpass, os, socket, sys, tempfile, traceback
 import config, util, error
 
-_booleans = {'1': True, 'yes': True, 'true': True, 'on': True,
-             '0': False, 'no': False, 'false': False, 'off': False}
-
 class ui(object):
     def __init__(self, src=None):
         self._buffers = []
@@ -149,10 +146,11 @@
             return default
         if isinstance(v, bool):
             return v
-        if v.lower() not in _booleans:
+        b = util.parsebool(v)
+        if b is None:
             raise error.ConfigError(_("%s.%s not a boolean ('%s')")
                                     % (section, name, v))
-        return _booleans[v.lower()]
+        return b
 
     def configlist(self, section, name, default=None, untrusted=False):
         """Return a list of comma/space separated strings"""
@@ -220,7 +218,7 @@
         def _configlist(s):
             s = s.rstrip(' ,')
             if not s:
-                return None
+                return []
             parser, parts, offset = _parse_plain, [''], 0
             while parser:
                 parser, parts, offset = parser(parts, s, offset)
@@ -593,6 +591,15 @@
         else:
             self.debug('%s:%s %s%s\n' % (topic, item, pos, unit))
 
+    def log(self, service, message):
+        '''hook for logging facility extensions
+
+        service should be a readily-identifiable subsystem, which will
+        allow filtering.
+        message should be a newline-terminated string to log.
+        '''
+        pass
+
     def label(self, msg, label):
         '''style msg based on supplied label
 
--- a/mercurial/url.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/url.py	Wed Sep 22 18:29:41 2010 -0500
@@ -8,6 +8,7 @@
 # GNU General Public License version 2 or any later version.
 
 import urllib, urllib2, urlparse, httplib, os, re, socket, cStringIO
+import __builtin__
 from i18n import _
 import keepalive, util
 
@@ -250,9 +251,25 @@
 
         return urllib2.ProxyHandler.proxy_open(self, req, proxy, type_)
 
-class httpsendfile(file):
+class httpsendfile(object):
+    """This is a wrapper around the objects returned by python's "open".
+
+    Its purpose is to send file-like objects via HTTP and, to do so, it
+    defines a __len__ attribute to feed the Content-Length header.
+    """
+
+    def __init__(self, *args, **kwargs):
+        # We can't just "self._data = open(*args, **kwargs)" here because there
+        # is an "open" function defined in this module that shadows the global
+        # one
+        self._data = __builtin__.open(*args, **kwargs)
+        self.read = self._data.read
+        self.seek = self._data.seek
+        self.close = self._data.close
+        self.write = self._data.write
+
     def __len__(self):
-        return os.fstat(self.fileno()).st_size
+        return os.fstat(self._data.fileno()).st_size
 
 def _gen_sendfile(connection):
     def _sendfile(self, data):
--- a/mercurial/util.h	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/util.h	Wed Sep 22 18:29:41 2010 -0500
@@ -12,6 +12,48 @@
 
 #define IS_PY3K
 #define PyInt_FromLong PyLong_FromLong
+#define PyInt_AsLong PyLong_AsLong
+
+/*
+ Mapping of some of the python < 2.x PyString* functions to py3k's PyUnicode.
+
+ The commented names below represent those that are present in the PyBytes
+ definitions for python < 2.6 (below in this file) that don't have a direct
+ implementation.
+*/
+
+#define PyStringObject PyUnicodeObject
+#define PyString_Type PyUnicode_Type
+
+#define PyString_Check PyUnicode_Check
+#define PyString_CheckExact PyUnicode_CheckExact
+#define PyString_CHECK_INTERNED PyUnicode_CHECK_INTERNED
+#define PyString_AS_STRING PyUnicode_AsLatin1String
+#define PyString_GET_SIZE PyUnicode_GET_SIZE
+
+#define PyString_FromStringAndSize PyUnicode_FromStringAndSize
+#define PyString_FromString PyUnicode_FromString
+#define PyString_FromFormatV PyUnicode_FromFormatV
+#define PyString_FromFormat PyUnicode_FromFormat
+/* #define PyString_Size PyUnicode_GET_SIZE */
+/* #define PyString_AsString */
+/* #define PyString_Repr */
+#define PyString_Concat PyUnicode_Concat
+#define PyString_ConcatAndDel PyUnicode_AppendAndDel
+#define _PyString_Resize PyUnicode_Resize
+/* #define _PyString_Eq */
+#define PyString_Format PyUnicode_Format
+/* #define _PyString_FormatLong */
+/* #define PyString_DecodeEscape */
+#define _PyString_Join PyUnicode_Join
+#define PyString_Decode PyUnicode_Decode
+#define PyString_Encode PyUnicode_Encode
+#define PyString_AsEncodedObject PyUnicode_AsEncodedObject
+#define PyString_AsEncodedString PyUnicode_AsEncodedString
+#define PyString_AsDecodedObject PyUnicode_AsDecodedObject
+#define PyString_AsDecodedString PyUnicode_AsDecodedUnicode
+/* #define PyString_AsStringAndSize */
+#define _PyString_InsertThousandsGrouping _PyUnicode_InsertThousandsGrouping
 
 #endif /* PY_MAJOR_VERSION */
 
--- a/mercurial/util.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/util.py	Wed Sep 22 18:29:41 2010 -0500
@@ -17,7 +17,7 @@
 import error, osutil, encoding
 import errno, re, shutil, sys, tempfile, traceback
 import os, stat, time, calendar, textwrap, unicodedata, signal
-import imp
+import imp, socket
 
 # Python compatibility
 
@@ -38,9 +38,15 @@
 
 import __builtin__
 
-def fakebuffer(sliceable, offset=0):
-    return sliceable[offset:]
-if not hasattr(__builtin__, 'buffer'):
+if sys.version_info[0] < 3:
+    def fakebuffer(sliceable, offset=0):
+        return sliceable[offset:]
+else:
+    def fakebuffer(sliceable, offset=0):
+        return memoryview(sliceable)[offset:]
+try:
+    buffer
+except NameError:
     __builtin__.buffer = fakebuffer
 
 import subprocess
@@ -286,7 +292,7 @@
     b.reverse()
     return os.sep.join((['..'] * len(a)) + b) or '.'
 
-def canonpath(root, cwd, myname):
+def canonpath(root, cwd, myname, auditor=None):
     """return the canonical path of myname, given cwd and root"""
     if endswithsep(root):
         rootsep = root
@@ -296,10 +302,11 @@
     if not os.path.isabs(name):
         name = os.path.join(root, cwd, name)
     name = os.path.normpath(name)
-    audit_path = path_auditor(root)
+    if auditor is None:
+        auditor = path_auditor(root)
     if name != rootsep and name.startswith(rootsep):
         name = name[len(rootsep):]
-        audit_path(name)
+        auditor(name)
         return pconvert(name)
     elif name == root:
         return ''
@@ -323,7 +330,7 @@
                     return ''
                 rel.reverse()
                 name = os.path.join(*rel)
-                audit_path(name)
+                auditor(name)
                 return pconvert(name)
             dirname, basename = os.path.split(name)
             rel.append(basename)
@@ -425,15 +432,6 @@
 
     return check
 
-# os.path.lexists is not available on python2.3
-def lexists(filename):
-    "test whether a file with this name exists. does not follow symlinks"
-    try:
-        os.lstat(filename)
-    except:
-        return False
-    return True
-
 def unlink(f):
     """unlink and remove the directory if it is empty"""
     os.unlink(f)
@@ -494,12 +492,15 @@
     - starts at the root of a windows drive
     - contains ".."
     - traverses a symlink (e.g. a/symlink_here/b)
-    - inside a nested repository'''
+    - inside a nested repository (a callback can be used to approve
+      some nested repositories, e.g., subrepositories)
+    '''
 
-    def __init__(self, root):
+    def __init__(self, root, callback=None):
         self.audited = set()
         self.auditeddir = set()
         self.root = root
+        self.callback = callback
 
     def __call__(self, path):
         if path in self.audited:
@@ -532,8 +533,9 @@
                                 (path, prefix))
                 elif (stat.S_ISDIR(st.st_mode) and
                       os.path.isdir(os.path.join(curpath, '.hg'))):
-                    raise Abort(_('path %r is inside repo %r') %
-                                (path, prefix))
+                    if not self.callback or not self.callback(curpath):
+                        raise Abort(_('path %r is inside repo %r') %
+                                    (path, prefix))
         parts.pop()
         prefixes = []
         while parts:
@@ -838,9 +840,9 @@
     def __init__(self, base, audit=True):
         self.base = base
         if audit:
-            self.audit_path = path_auditor(base)
+            self.auditor = path_auditor(base)
         else:
-            self.audit_path = always
+            self.auditor = always
         self.createmode = None
 
     @propertycache
@@ -853,7 +855,7 @@
         os.chmod(name, self.createmode & 0666)
 
     def __call__(self, path, mode="r", text=False, atomictemp=False):
-        self.audit_path(path)
+        self.auditor(path)
         f = os.path.join(self.base, path)
 
         if not text and "b" not in mode:
@@ -878,7 +880,7 @@
         return fp
 
     def symlink(self, src, dst):
-        self.audit_path(dst)
+        self.auditor(dst)
         linkname = os.path.join(self.base, dst)
         try:
             os.unlink(linkname)
@@ -908,7 +910,17 @@
     def __init__(self, in_iter):
         """in_iter is the iterator that's iterating over the input chunks.
         targetsize is how big a buffer to try to maintain."""
-        self.iter = iter(in_iter)
+        def splitbig(chunks):
+            for chunk in chunks:
+                if len(chunk) > 2**20:
+                    pos = 0
+                    while pos < len(chunk):
+                        end = pos + 2 ** 18
+                        yield chunk[pos:end]
+                        pos = end
+                else:
+                    yield chunk
+        self.iter = splitbig(in_iter)
         self._queue = []
 
     def read(self, l):
@@ -939,7 +951,6 @@
 
         return buf
 
-
 def filechunkiter(f, size=65536, limit=None):
     """Create a generator that produces the data in the file size
     (default 65536) bytes at a time, up to optional limit (default is
@@ -1058,7 +1069,7 @@
             else:
                 break
         else:
-            raise Abort(_('invalid date: %r ') % date)
+            raise Abort(_('invalid date: %r') % date)
     # validate explicit (probably user-specified) date and
     # time zone offset. values must fit in signed 32 bits for
     # current 32-bit linux runtimes. timezones go from UTC-12
@@ -1393,3 +1404,45 @@
         except ValueError:
             pass
     return termwidth_()
+
+def interpolate(prefix, mapping, s, fn=None):
+    """Return the result of interpolating items in the mapping into string s.
+
+    prefix is a single character string, or a two character string with
+    a backslash as the first character if the prefix needs to be escaped in
+    a regular expression.
+
+    fn is an optional function that will be applied to the replacement text
+    just before replacement.
+    """
+    fn = fn or (lambda s: s)
+    r = re.compile(r'%s(%s)' % (prefix, '|'.join(mapping.keys())))
+    return r.sub(lambda x: fn(mapping[x.group()[1:]]), s)
+
+def getport(port):
+    """Return the port for a given network service.
+
+    If port is an integer, it's returned as is. If it's a string, it's
+    looked up using socket.getservbyname(). If there's no matching
+    service, util.Abort is raised.
+    """
+    try:
+        return int(port)
+    except ValueError:
+        pass
+
+    try:
+        return socket.getservbyname(port)
+    except socket.error:
+        raise Abort(_("no port number associated with service '%s'") % port)
+
+_booleans = {'1': True, 'yes': True, 'true': True, 'on': True, 'always': True,
+             '0': False, 'no': False, 'false': False, 'off': False,
+             'never': False}
+
+def parsebool(s):
+    """Parse s into a boolean.
+
+    If s is not a valid boolean, returns None.
+    """
+    return _booleans.get(s.lower(), None)
--- a/mercurial/windows.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/mercurial/windows.py	Wed Sep 22 18:29:41 2010 -0500
@@ -288,7 +288,7 @@
     '''atomically rename file src to dst, replacing dst if it exists'''
     try:
         os.rename(src, dst)
-    except OSError, err: # FIXME: check err (EEXIST ?)
+    except OSError: # FIXME: check err (EEXIST ?)
 
         # On windows, rename to existing file is not allowed, so we
         # must delete destination first. But if a file is open, unlink
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/wireproto.py	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,333 @@
+# wireproto.py - generic wire protocol support functions
+#
+# Copyright 2005-2010 Matt Mackall <mpm@selenic.com>
+#
+# This software may be used and distributed according to the terms of the
+# GNU General Public License version 2 or any later version.
+
+import urllib, tempfile, os, sys
+from i18n import _
+from node import bin, hex
+import changegroup as changegroupmod
+import repo, error, encoding, util, store
+import pushkey as pushkeymod
+
+# list of nodes encoding / decoding
+
+def decodelist(l, sep=' '):
+    return map(bin, l.split(sep))
+
+def encodelist(l, sep=' '):
+    return sep.join(map(hex, l))
+
+# client side
+
+class wirerepository(repo.repository):
+    def lookup(self, key):
+        self.requirecap('lookup', _('look up remote revision'))
+        d = self._call("lookup", key=key)
+        success, data = d[:-1].split(" ", 1)
+        if int(success):
+            return bin(data)
+        self._abort(error.RepoError(data))
+
+    def heads(self):
+        d = self._call("heads")
+        try:
+            return decodelist(d[:-1])
+        except:
+            self._abort(error.ResponseError(_("unexpected response:"), d))
+
+    def branchmap(self):
+        d = self._call("branchmap")
+        try:
+            branchmap = {}
+            for branchpart in d.splitlines():
+                branchname, branchheads = branchpart.split(' ', 1)
+                branchname = urllib.unquote(branchname)
+                # Earlier servers (1.3.x) send branch names in (their) local
+                # charset. The best we can do is assume it's identical to our
+                # own local charset, in case it's not utf-8.
+                try:
+                    branchname.decode('utf-8')
+                except UnicodeDecodeError:
+                    branchname = encoding.fromlocal(branchname)
+                branchheads = decodelist(branchheads)
+                branchmap[branchname] = branchheads
+            return branchmap
+        except TypeError:
+            self._abort(error.ResponseError(_("unexpected response:"), d))
+
+    def branches(self, nodes):
+        n = encodelist(nodes)
+        d = self._call("branches", nodes=n)
+        try:
+            br = [tuple(decodelist(b)) for b in d.splitlines()]
+            return br
+        except:
+            self._abort(error.ResponseError(_("unexpected response:"), d))
+
+    def between(self, pairs):
+        batch = 8 # avoid giant requests
+        r = []
+        for i in xrange(0, len(pairs), batch):
+            n = " ".join([encodelist(p, '-') for p in pairs[i:i + batch]])
+            d = self._call("between", pairs=n)
+            try:
+                r.extend(l and decodelist(l) or [] for l in d.splitlines())
+            except:
+                self._abort(error.ResponseError(_("unexpected response:"), d))
+        return r
+
+    def pushkey(self, namespace, key, old, new):
+        if not self.capable('pushkey'):
+            return False
+        d = self._call("pushkey",
+                      namespace=namespace, key=key, old=old, new=new)
+        return bool(int(d))
+
+    def listkeys(self, namespace):
+        if not self.capable('pushkey'):
+            return {}
+        d = self._call("listkeys", namespace=namespace)
+        r = {}
+        for l in d.splitlines():
+            k, v = l.split('\t')
+            r[k.decode('string-escape')] = v.decode('string-escape')
+        return r
+
+    def stream_out(self):
+        return self._callstream('stream_out')
+
+    def changegroup(self, nodes, kind):
+        n = encodelist(nodes)
+        f = self._callstream("changegroup", roots=n)
+        return changegroupmod.unbundle10(self._decompress(f), 'UN')
+
+    def changegroupsubset(self, bases, heads, kind):
+        self.requirecap('changegroupsubset', _('look up remote changes'))
+        bases = encodelist(bases)
+        heads = encodelist(heads)
+        f = self._callstream("changegroupsubset",
+                             bases=bases, heads=heads)
+        return changegroupmod.unbundle10(self._decompress(f), 'UN')
+
+    def unbundle(self, cg, heads, source):
+        '''Send cg (a readable file-like object representing the
+        changegroup to push, typically a chunkbuffer object) to the
+        remote server as a bundle. Return an integer indicating the
+        result of the push (see localrepository.addchangegroup()).'''
+
+        ret, output = self._callpush("unbundle", cg, heads=encodelist(heads))
+        if ret == "":
+            raise error.ResponseError(
+                _('push failed:'), output)
+        try:
+            ret = int(ret)
+        except ValueError:
+            raise error.ResponseError(
+                _('push failed (unexpected response):'), ret)
+
+        for l in output.splitlines(True):
+            self.ui.status(_('remote: '), l)
+        return ret
+
+# server side
+
+class streamres(object):
+    def __init__(self, gen):
+        self.gen = gen
+
+class pushres(object):
+    def __init__(self, res):
+        self.res = res
+
+def dispatch(repo, proto, command):
+    func, spec = commands[command]
+    args = proto.getargs(spec)
+    return func(repo, proto, *args)
+
+def between(repo, proto, pairs):
+    pairs = [decodelist(p, '-') for p in pairs.split(" ")]
+    r = []
+    for b in repo.between(pairs):
+        r.append(encodelist(b) + "\n")
+    return "".join(r)
+
+def branchmap(repo, proto):
+    branchmap = repo.branchmap()
+    heads = []
+    for branch, nodes in branchmap.iteritems():
+        branchname = urllib.quote(branch)
+        branchnodes = encodelist(nodes)
+        heads.append('%s %s' % (branchname, branchnodes))
+    return '\n'.join(heads)
+
+def branches(repo, proto, nodes):
+    nodes = decodelist(nodes)
+    r = []
+    for b in repo.branches(nodes):
+        r.append(encodelist(b) + "\n")
+    return "".join(r)
+
+def capabilities(repo, proto):
+    caps = 'lookup changegroupsubset branchmap pushkey'.split()
+    if _allowstream(repo.ui):
+        requiredformats = repo.requirements & repo.supportedformats
+        # if our local revlogs are just revlogv1, add 'stream' cap
+        if not requiredformats - set(('revlogv1',)):
+            caps.append('stream')
+        # otherwise, add 'streamreqs' detailing our local revlog format
+        else:
+            caps.append('streamreqs=%s' % ','.join(requiredformats))
+    caps.append('unbundle=%s' % ','.join(changegroupmod.bundlepriority))
+    return ' '.join(caps)
+
+def changegroup(repo, proto, roots):
+    nodes = decodelist(roots)
+    cg = repo.changegroup(nodes, 'serve')
+    return streamres(proto.groupchunks(cg))
+
+def changegroupsubset(repo, proto, bases, heads):
+    bases = decodelist(bases)
+    heads = decodelist(heads)
+    cg = repo.changegroupsubset(bases, heads, 'serve')
+    return streamres(proto.groupchunks(cg))
+
+def heads(repo, proto):
+    h = repo.heads()
+    return encodelist(h) + "\n"
+
+def hello(repo, proto):
+    '''the hello command returns a set of lines describing various
+    interesting things about the server, in an RFC822-like format.
+    Currently the only one defined is "capabilities", which
+    consists of a line in the form:
+
+    capabilities: space separated list of tokens
+    '''
+    return "capabilities: %s\n" % (capabilities(repo, proto))
+
+def listkeys(repo, proto, namespace):
+    d = pushkeymod.list(repo, namespace).items()
+    t = '\n'.join(['%s\t%s' % (k.encode('string-escape'),
+                               v.encode('string-escape')) for k, v in d])
+    return t
+
+def lookup(repo, proto, key):
+    try:
+        r = hex(repo.lookup(key))
+        success = 1
+    except Exception, inst:
+        r = str(inst)
+        success = 0
+    return "%s %s\n" % (success, r)
+
+def pushkey(repo, proto, namespace, key, old, new):
+    r = pushkeymod.push(repo, namespace, key, old, new)
+    return '%s\n' % int(r)
+
+def _allowstream(ui):
+    return ui.configbool('server', 'uncompressed', True, untrusted=True)
+
+def stream(repo, proto):
+    '''If the server supports streaming clone, it advertises the "stream"
+    capability with a value representing the version and flags of the repo
+    it is serving. Client checks to see if it understands the format.
+
+    The format is simple: the server writes out a line with the amount
+    of files, then the total amount of bytes to be transfered (separated
+    by a space). Then, for each file, the server first writes the filename
+    and filesize (separated by the null character), then the file contents.
+    '''
+
+    if not _allowstream(repo.ui):
+        return '1\n'
+
+    entries = []
+    total_bytes = 0
+    try:
+        # get consistent snapshot of repo, lock during scan
+        lock = repo.lock()
+        try:
+            repo.ui.debug('scanning\n')
+            for name, ename, size in repo.store.walk():
+                entries.append((name, size))
+                total_bytes += size
+        finally:
+            lock.release()
+    except error.LockError:
+        return '2\n' # error: 2
+
+    def streamer(repo, entries, total):
+        '''stream out all metadata files in repository.'''
+        yield '0\n' # success
+        repo.ui.debug('%d files, %d bytes to transfer\n' %
+                      (len(entries), total_bytes))
+        yield '%d %d\n' % (len(entries), total_bytes)
+        for name, size in entries:
+            repo.ui.debug('sending %s (%d bytes)\n' % (name, size))
+            # partially encode name over the wire for backwards compat
+            yield '%s\0%d\n' % (store.encodedir(name), size)
+            for chunk in util.filechunkiter(repo.sopener(name), limit=size):
+                yield chunk
+
+    return streamres(streamer(repo, entries, total_bytes))
+
+def unbundle(repo, proto, heads):
+    their_heads = decodelist(heads)
+
+    def check_heads():
+        heads = repo.heads()
+        return their_heads == ['force'] or their_heads == heads
+
+    # fail early if possible
+    if not check_heads():
+        return 'unsynced changes'
+
+    # write bundle data to temporary file because it can be big
+    fd, tempname = tempfile.mkstemp(prefix='hg-unbundle-')
+    fp = os.fdopen(fd, 'wb+')
+    r = 0
+    proto.redirect()
+    try:
+        proto.getfile(fp)
+        lock = repo.lock()
+        try:
+            if not check_heads():
+                # someone else committed/pushed/unbundled while we
+                # were transferring data
+                return 'unsynced changes'
+
+            # push can proceed
+            fp.seek(0)
+            gen = changegroupmod.readbundle(fp, None)
+
+            try:
+                r = repo.addchangegroup(gen, 'serve', proto._client(),
+                                        lock=lock)
+            except util.Abort, inst:
+                sys.stderr.write("abort: %s\n" % inst)
+        finally:
+            lock.release()
+            return pushres(r)
+
+    finally:
+        fp.close()
+        os.unlink(tempname)
+
+commands = {
+    'between': (between, 'pairs'),
+    'branchmap': (branchmap, ''),
+    'branches': (branches, 'nodes'),
+    'capabilities': (capabilities, ''),
+    'changegroup': (changegroup, 'roots'),
+    'changegroupsubset': (changegroupsubset, 'bases heads'),
+    'heads': (heads, ''),
+    'hello': (hello, ''),
+    'listkeys': (listkeys, 'namespace'),
+    'lookup': (lookup, 'key'),
+    'pushkey': (pushkey, 'namespace key old new'),
+    'stream_out': (stream, ''),
+    'unbundle': (unbundle, 'heads'),
+}
--- a/setup.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/setup.py	Wed Sep 22 18:29:41 2010 -0500
@@ -9,6 +9,17 @@
 if not hasattr(sys, 'version_info') or sys.version_info < (2, 4, 0, 'final'):
     raise SystemExit("Mercurial requires Python 2.4 or later.")
 
+if sys.version_info[0] >= 3:
+    def b(s):
+        '''A helper function to emulate 2.6+ bytes literals using string
+        literals.'''
+        return s.encode('latin1')
+else:
+    def b(s):
+        '''A helper function to emulate 2.6+ bytes literals using string
+        literals.'''
+        return s
+
 # Solaris Python packaging brain damage
 try:
     import hashlib
@@ -114,8 +125,8 @@
     # fine, we don't want to load it anyway.  Python may warn about
     # a missing __init__.py in mercurial/locale, we also ignore that.
     err = [e for e in err.splitlines()
-           if not e.startswith('Not trusting file') \
-              and not e.startswith('warning: Not importing')]
+           if not e.startswith(b('Not trusting file')) \
+              and not e.startswith(b('warning: Not importing'))]
     if err:
         return ''
     return out
@@ -275,7 +286,8 @@
     cc = new_compiler()
     if hasfunction(cc, 'inotify_add_watch'):
         inotify = Extension('hgext.inotify.linux._inotify',
-                            ['hgext/inotify/linux/_inotify.c'])
+                            ['hgext/inotify/linux/_inotify.c'],
+                            ['mercurial'])
         inotify.optional = True
         extmodules.append(inotify)
         packages.extend(['hgext.inotify', 'hgext.inotify.linux'])
--- a/tests/get-with-headers.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/tests/get-with-headers.py	Wed Sep 22 18:29:41 2010 -0500
@@ -12,18 +12,42 @@
 except ImportError:
     pass
 
-headers = [h.lower() for h in sys.argv[3:]]
-conn = httplib.HTTPConnection(sys.argv[1])
-conn.request("GET", sys.argv[2])
-response = conn.getresponse()
-print response.status, response.reason
-for h in headers:
-    if response.getheader(h, None) is not None:
-        print "%s: %s" % (h, response.getheader(h))
-print
-data = response.read()
-sys.stdout.write(data)
+twice = False
+if '--twice' in sys.argv:
+    sys.argv.remove('--twice')
+    twice = True
+
+reasons = {'Not modified': 'Not Modified'} # python 2.4
+
+tag = None
+def request(host, path, show):
+
+    global tag
+    headers = {}
+    if tag:
+        headers['If-None-Match'] = tag
 
-if 200 <= response.status <= 299:
+    conn = httplib.HTTPConnection(host)
+    conn.request("GET", path, None, headers)
+    response = conn.getresponse()
+    print response.status, reasons.get(response.reason, response.reason)
+    for h in [h.lower() for h in show]:
+        if response.getheader(h, None) is not None:
+            print "%s: %s" % (h, response.getheader(h))
+
+    print
+    data = response.read()
+    sys.stdout.write(data)
+
+    if twice and response.getheader('ETag', None):
+        tag = response.getheader('ETag')
+
+    return response.status
+
+status = request(sys.argv[1], sys.argv[2], sys.argv[3:])
+if twice:
+    status = request(sys.argv[1], sys.argv[2], sys.argv[3:])
+
+if 200 <= status <= 305:
     sys.exit(0)
 sys.exit(1)
--- a/tests/run-tests.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/tests/run-tests.py	Wed Sep 22 18:29:41 2010 -0500
@@ -52,6 +52,7 @@
 import sys
 import tempfile
 import time
+import re
 
 closefds = os.name == 'posix'
 def Popen4(cmd, bufsize=-1):
@@ -441,6 +442,123 @@
 def alarmed(signum, frame):
     raise Timeout
 
+def pytest(test, options):
+    py3kswitch = options.py3k_warnings and ' -3' or ''
+    cmd = '%s%s "%s"' % (PYTHON, py3kswitch, test)
+    vlog("# Running", cmd)
+    return run(cmd, options)
+
+def shtest(test, options):
+    cmd = '"%s"' % test
+    vlog("# Running", cmd)
+    return run(cmd, options)
+
+def battest(test, options):
+    # To reliably get the error code from batch files on WinXP,
+    # the "cmd /c call" prefix is needed. Grrr
+    cmd = 'cmd /c call "%s"' % testpath
+    vlog("# Running", cmd)
+    return run(cmd, options)
+
+def tsttest(test, options):
+    t = open(test)
+    out = []
+    script = []
+    salt = "SALT" + str(time.time())
+
+    pos = prepos = -1
+    after = {}
+    expected = {}
+    for n, l in enumerate(t):
+        if l.startswith('  $ '): # commands
+            after.setdefault(pos, []).append(l)
+            prepos = pos
+            pos = n
+            script.append('echo %s %s $?\n' % (salt, n))
+            script.append(l[4:])
+        elif l.startswith('  > '): # continuations
+            after.setdefault(prepos, []).append(l)
+            script.append(l[4:])
+        elif l.startswith('  '): # results
+            # queue up a list of expected results
+            expected.setdefault(pos, []).append(l[2:])
+        else:
+            # non-command/result - queue up for merged output
+            after.setdefault(pos, []).append(l)
+
+    script.append('echo %s %s $?\n' % (salt, n + 1))
+
+    fd, name = tempfile.mkstemp(suffix='hg-tst')
+
+    try:
+        for l in script:
+            os.write(fd, l)
+        os.close(fd)
+
+        cmd = '/bin/sh "%s"' % name
+        vlog("# Running", cmd)
+        exitcode, output = run(cmd, options)
+    finally:
+        os.remove(name)
+
+    def rematch(el, l):
+        try:
+            # ensure that the regex matches to the end of the string
+            return re.match(el + r'\Z', l)
+        except re.error:
+            # el is an invalid regex
+            return False
+
+    def globmatch(el, l):
+        # The only supported special characters are * and ?. Escaping is
+        # supported.
+        i, n = 0, len(el)
+        res = ''
+        while i < n:
+            c = el[i]
+            i += 1
+            if c == '\\' and el[i] in '*?\\':
+                res += el[i - 1:i + 1]
+                i += 1
+            elif c == '*':
+                res += '.*'
+            elif c == '?':
+                res += '.'
+            else:
+                res += re.escape(c)
+        return rematch(res, l)
+
+    pos = -1
+    postout = []
+    ret = 0
+    for n, l in enumerate(output):
+        if l.startswith(salt):
+            # add on last return code
+            ret = int(l.split()[2])
+            if ret != 0:
+                postout.append("  [%s]\n" % ret)
+            if pos in after:
+                postout += after.pop(pos)
+            pos = int(l.split()[1])
+        else:
+            el = None
+            if pos in expected and expected[pos]:
+                el = expected[pos].pop(0)
+
+            if el == l: # perfect match (fast)
+                postout.append("  " + l)
+            elif (el and
+                  (el.endswith(" (re)\n") and rematch(el[:-6] + '\n', l) or
+                   el.endswith(" (glob)\n") and globmatch(el[:-8] + '\n', l))):
+                postout.append("  " + el) # fallback regex/glob match
+            else:
+                postout.append("  " + l) # let diff deal with it
+
+    if pos in after:
+        postout += after.pop(pos)
+
+    return exitcode, postout
+
 def run(cmd, options):
     """Run command in a sub-process, capturing the output (stdout and stderr).
     Return a tuple (exitcode, output).  output is None in debug mode."""
@@ -537,15 +655,15 @@
     lctest = test.lower()
 
     if lctest.endswith('.py') or firstline == '#!/usr/bin/env python':
-        py3kswitch = options.py3k_warnings and ' -3' or ''
-        cmd = '%s%s "%s"' % (PYTHON, py3kswitch, testpath)
+        runner = pytest
     elif lctest.endswith('.bat'):
         # do not run batch scripts on non-windows
         if os.name != 'nt':
             return skip("batch script")
-        # To reliably get the error code from batch files on WinXP,
-        # the "cmd /c call" prefix is needed. Grrr
-        cmd = 'cmd /c call "%s"' % testpath
+        runner = battest
+    elif lctest.endswith('.t'):
+        runner = tsttest
+        ref = testpath
     else:
         # do not run shell scripts on windows
         if os.name == 'nt':
@@ -555,7 +673,7 @@
             return fail("does not exist")
         elif not os.access(testpath, os.X_OK):
             return skip("not executable")
-        cmd = '"%s"' % testpath
+        runner = shtest
 
     # Make a tmp subdirectory to work in
     tmpd = os.path.join(HGTMP, test)
@@ -565,8 +683,7 @@
     if options.timeout > 0:
         signal.alarm(options.timeout)
 
-    vlog("# Running", cmd)
-    ret, out = run(cmd, options)
+    ret, out = runner(testpath, options)
     vlog("# Ret was:", ret)
 
     if options.timeout > 0:
@@ -807,7 +924,10 @@
                     print "Accept this change? [n] ",
                     answer = sys.stdin.readline().strip()
                     if answer.lower() in "y yes".split():
-                        rename(test + ".err", test + ".out")
+                        if test.endswith(".t"):
+                            rename(test + ".err", test)
+                        else:
+                            rename(test + ".err", test + ".out")
                         tested += 1
                         fails.pop()
                         continue
@@ -944,7 +1064,7 @@
     for test in args:
         if (test.startswith("test-") and '~' not in test and
             ('.' not in test or test.endswith('.py') or
-             test.endswith('.bat'))):
+             test.endswith('.bat') or test.endswith('.t'))):
             tests.append(test)
     if not tests:
         print "# Ran 0 tests, 0 skipped, 0 failed."
--- a/tests/test-1102	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-#!/bin/sh
-
-rm -rf a
-hg init a
-cd a
-echo a > a
-hg ci -Am0
-hg tag t1 # 1
-hg tag --remove t1 # 2
-
-hg co 1
-hg tag -r0 t1
-hg tags
-
-
-
--- a/tests/test-1102.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-adding a
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-tip                                3:a49829c4fc11
-t1                                 0:f7b1eb17ad24
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-1102.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,16 @@
+  $ rm -rf a
+  $ hg init a
+  $ cd a
+  $ echo a > a
+  $ hg ci -Am0
+  adding a
+  $ hg tag t1 # 1
+  $ hg tag --remove t1 # 2
+
+  $ hg co 1
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg tag -r0 t1
+  $ hg tags
+  tip                                3:a49829c4fc11
+  t1                                 0:f7b1eb17ad24
+
--- a/tests/test-586	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-#!/bin/sh
-# a test for issue586
-
-hg init a
-cd a
-echo a > a
-hg ci -Ama
-
-hg init ../b
-cd ../b
-echo b > b
-hg ci -Amb
-
-hg pull -f ../a
-hg merge
-hg rm -f a
-hg ci -Amc
-
-hg st -A
-cd ..
-
-# a test for issue 1433, related to issue586
-echo % create test repos
-hg init repoa
-touch repoa/a
-hg -R repoa ci -Am adda
-
-hg init repob
-touch repob/b
-hg -R repob ci -Am addb
-
-hg init repoc
-cd repoc
-hg pull ../repoa
-hg update
-mkdir tst
-hg mv * tst
-hg ci -m "import a in tst"
-hg pull -f ../repob
-echo % merge both repos
-hg merge
-mkdir src
-echo % move b content
-hg mv b src
-hg ci -m "import b in src"
-hg manifest
-
-
-
--- a/tests/test-586.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-adding a
-adding b
-pulling from ../a
-searching for changes
-warning: repository is unrelated
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files (+1 heads)
-(run 'hg heads' to see heads, 'hg merge' to merge)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-C b
-% create test repos
-adding a
-adding b
-pulling from ../repoa
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-(run 'hg update' to get a working copy)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-pulling from ../repob
-searching for changes
-warning: repository is unrelated
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files (+1 heads)
-(run 'hg heads' to see heads, 'hg merge' to merge)
-% merge both repos
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-% move b content
-src/b
-tst/a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-586.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,87 @@
+a test for issue586
+
+  $ hg init a
+  $ cd a
+  $ echo a > a
+  $ hg ci -Ama
+  adding a
+
+  $ hg init ../b
+  $ cd ../b
+  $ echo b > b
+  $ hg ci -Amb
+  adding b
+
+  $ hg pull -f ../a
+  pulling from ../a
+  searching for changes
+  warning: repository is unrelated
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files (+1 heads)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+  $ hg merge
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg rm -f a
+  $ hg ci -Amc
+
+  $ hg st -A
+  C b
+  $ cd ..
+
+a test for issue 1433, related to issue586
+
+create test repos
+
+  $ hg init repoa
+  $ touch repoa/a
+  $ hg -R repoa ci -Am adda
+  adding a
+
+  $ hg init repob
+  $ touch repob/b
+  $ hg -R repob ci -Am addb
+  adding b
+
+  $ hg init repoc
+  $ cd repoc
+  $ hg pull ../repoa
+  pulling from ../repoa
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  (run 'hg update' to get a working copy)
+  $ hg update
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ mkdir tst
+  $ hg mv * tst
+  $ hg ci -m "import a in tst"
+  $ hg pull -f ../repob
+  pulling from ../repob
+  searching for changes
+  warning: repository is unrelated
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files (+1 heads)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+
+merge both repos
+
+  $ hg merge
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ mkdir src
+
+move b content
+
+  $ hg mv b src
+  $ hg ci -m "import b in src"
+  $ hg manifest
+  src/b
+  tst/a
+
--- a/tests/test-abort-checkin	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-#!/bin/sh
-
-cat > abortcommit.py <<EOF
-from mercurial import util
-
-def hook(**args):
-    raise util.Abort("no commits allowed")
-
-def reposetup(ui, repo):
-    repo.ui.setconfig("hooks", "pretxncommit.nocommits", hook)
-EOF
-abspath=`pwd`/abortcommit.py
-
-echo "[extensions]" >> $HGRCPATH
-echo "mq=" >> $HGRCPATH
-echo "abortcommit = $abspath" >> $HGRCPATH
-
-hg init foo
-cd foo
-echo foo > foo
-hg add foo
-
-# mq may keep a reference to the repository so __del__ will not be called
-# and .hg/journal.dirstate will not be deleted:
-hg ci -m foo
-hg ci -m foo
-
-exit 0
--- a/tests/test-abort-checkin.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-error: pretxncommit.nocommits hook failed: no commits allowed
-transaction abort!
-rollback completed
-abort: no commits allowed
-error: pretxncommit.nocommits hook failed: no commits allowed
-transaction abort!
-rollback completed
-abort: no commits allowed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-abort-checkin.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,33 @@
+  $ cat > abortcommit.py <<EOF
+  > from mercurial import util
+  > def hook(**args):
+  >     raise util.Abort("no commits allowed")
+  > def reposetup(ui, repo):
+  >     repo.ui.setconfig("hooks", "pretxncommit.nocommits", hook)
+  > EOF
+  $ abspath=`pwd`/abortcommit.py
+
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "mq=" >> $HGRCPATH
+  $ echo "abortcommit = $abspath" >> $HGRCPATH
+
+  $ hg init foo
+  $ cd foo
+  $ echo foo > foo
+  $ hg add foo
+
+mq may keep a reference to the repository so __del__ will not be
+called and .hg/journal.dirstate will not be deleted:
+
+  $ hg ci -m foo
+  error: pretxncommit.nocommits hook failed: no commits allowed
+  transaction abort!
+  rollback completed
+  abort: no commits allowed
+  [255]
+  $ hg ci -m foo
+  error: pretxncommit.nocommits hook failed: no commits allowed
+  transaction abort!
+  rollback completed
+  abort: no commits allowed
+  [255]
--- a/tests/test-acl	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,176 +0,0 @@
-#!/bin/sh
-
-do_push()
-{
-    user=$1
-    shift
-
-    echo "Pushing as user $user"
-    echo 'hgrc = """'
-    sed -e 1,2d b/.hg/hgrc | grep -v fakegroups.py
-    echo '"""'
-    if test -f acl.config; then
-	echo 'acl.config = """'
-	cat acl.config
-	echo '"""'
-    fi
-    # On AIX /etc/profile sets LOGNAME read-only. So
-    #  LOGNAME=$user hg --cws a --debug push ../b
-    # fails with "This variable is read only."
-    # Use env to work around this.
-    env LOGNAME=$user hg --cwd a --debug push ../b
-    hg --cwd b rollback
-    hg --cwd b --quiet tip
-    echo
-}
-
-init_config()
-{
-cat > fakegroups.py <<EOF
-from hgext import acl
-def fakegetusers(ui, group):
-    try:
-        return acl._getusersorig(ui, group)
-    except:
-        return ["fred", "betty"]
-acl._getusersorig = acl._getusers
-acl._getusers = fakegetusers
-EOF
-
-rm -f acl.config
-cat > $config <<EOF
-[hooks]
-pretxnchangegroup.acl = python:hgext.acl.hook
-[acl]
-sources = push
-[extensions]
-f=`pwd`/fakegroups.py
-EOF
-}
-
-hg init a
-cd a
-mkdir foo foo/Bar quux
-echo 'in foo' > foo/file.txt
-echo 'in foo/Bar' > foo/Bar/file.txt
-echo 'in quux' > quux/file.py
-hg add -q
-hg ci -m 'add files' -d '1000000 0'
-echo >> foo/file.txt
-hg ci -m 'change foo/file' -d '1000001 0'
-echo >> foo/Bar/file.txt
-hg ci -m 'change foo/Bar/file' -d '1000002 0'
-echo >> quux/file.py
-hg ci -m 'change quux/file' -d '1000003 0'
-hg tip --quiet
-
-cd ..
-hg clone -r 0 a b
-
-echo '[extensions]' >> $HGRCPATH
-echo 'acl =' >> $HGRCPATH
-
-config=b/.hg/hgrc
-
-echo
-
-echo 'Extension disabled for lack of a hook'
-do_push fred
-
-echo '[hooks]' >> $config
-echo 'pretxnchangegroup.acl = python:hgext.acl.hook' >> $config
-
-echo 'Extension disabled for lack of acl.sources'
-do_push fred
-
-echo 'No [acl.allow]/[acl.deny]'
-echo '[acl]' >> $config
-echo 'sources = push' >> $config
-do_push fred
-
-echo 'Empty [acl.allow]'
-echo '[acl.allow]' >> $config
-do_push fred
-
-echo 'fred is allowed inside foo/'
-echo 'foo/** = fred' >> $config
-do_push fred
-
-echo 'Empty [acl.deny]'
-echo '[acl.deny]' >> $config
-do_push barney
-
-echo 'fred is allowed inside foo/, but not foo/bar/ (case matters)'
-echo 'foo/bar/** = fred' >> $config
-do_push fred
-
-echo 'fred is allowed inside foo/, but not foo/Bar/'
-echo 'foo/Bar/** = fred' >> $config
-do_push fred
-
-echo 'barney is not mentioned => not allowed anywhere'
-do_push barney
-
-echo 'barney is allowed everywhere'
-echo '[acl.allow]' >> $config
-echo '** = barney' >> $config
-do_push barney
-
-echo 'wilma can change files with a .txt extension'
-echo '**/*.txt = wilma' >> $config
-do_push wilma
-
-echo 'file specified by acl.config does not exist'
-echo '[acl]' >> $config
-echo 'config = ../acl.config' >> $config
-do_push barney
-
-echo 'betty is allowed inside foo/ by a acl.config file'
-echo '[acl.allow]' >> acl.config
-echo 'foo/** = betty' >> acl.config
-do_push betty
-
-echo 'acl.config can set only [acl.allow]/[acl.deny]'
-echo '[hooks]' >> acl.config
-echo 'changegroup.acl = false' >> acl.config
-do_push barney
-
-# asterisk
-
-init_config
-
-echo 'asterisk test'
-echo '[acl.allow]' >> $config
-echo "** = fred" >> $config
-echo "fred is always allowed"
-do_push fred
-
-echo '[acl.deny]' >> $config
-echo "foo/Bar/** = *" >> $config
-echo "no one is allowed inside foo/Bar/"
-do_push fred
-
-# Groups
-
-init_config
-
-echo 'OS-level groups'
-echo '[acl.allow]' >> $config
-echo "** = @group1" >> $config
-echo "@group1 is always allowed"
-do_push fred
-
-echo '[acl.deny]' >> $config
-echo "foo/Bar/** = @group1" >> $config
-echo "@group is allowed inside anything but foo/Bar/"
-do_push fred
-
-echo 'Invalid group'
-# Disable the fakegroups trick to get real failures
-grep -v fakegroups $config > config.tmp
-mv config.tmp $config
-echo '[acl.allow]' >> $config
-echo "** = @unlikelytoexist" >> $config
-do_push fred 2>&1 | grep unlikelytoexist
-
-true
--- a/tests/test-acl.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1564 +0,0 @@
-3:911600dab2ae
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 3 changes to 3 files
-updating to branch default
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-
-Extension disabled for lack of a hook
-Pushing as user fred
-hgrc = """
-"""
-pushing to ../b
-searching for changes
-common changesets up to 6675d58eff77
-3 changesets found
-list of changesets:
-ef1ea85a6374b77d6da9dcda9541f498f2d17df7
-f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
-911600dab2ae7a9baff75958b84fe606851ce955
-adding changesets
-bundling changes: 0 chunks
-bundling changes: 1 chunks
-bundling changes: 2 chunks
-bundling changes: 3 chunks
-bundling changes: 4 chunks
-bundling changes: 5 chunks
-bundling changes: 6 chunks
-bundling changes: 7 chunks
-bundling changes: 8 chunks
-bundling changes: 9 chunks
-bundling manifests: 0 chunks
-bundling manifests: 1 chunks
-bundling manifests: 2 chunks
-bundling manifests: 3 chunks
-bundling manifests: 4 chunks
-bundling manifests: 5 chunks
-bundling manifests: 6 chunks
-bundling manifests: 7 chunks
-bundling manifests: 8 chunks
-bundling manifests: 9 chunks
-bundling files: foo/Bar/file.txt 0 chunks
-bundling files: foo/Bar/file.txt 1 chunks
-bundling files: foo/Bar/file.txt 2 chunks
-bundling files: foo/Bar/file.txt 3 chunks
-bundling files: foo/file.txt 4 chunks
-bundling files: foo/file.txt 5 chunks
-bundling files: foo/file.txt 6 chunks
-bundling files: foo/file.txt 7 chunks
-bundling files: quux/file.py 8 chunks
-bundling files: quux/file.py 9 chunks
-bundling files: quux/file.py 10 chunks
-bundling files: quux/file.py 11 chunks
-changesets: 1 chunks
-add changeset ef1ea85a6374
-changesets: 2 chunks
-add changeset f9cafe1212c8
-changesets: 3 chunks
-add changeset 911600dab2ae
-adding manifests
-manifests: 1/3 chunks (33.33%)
-manifests: 2/3 chunks (66.67%)
-manifests: 3/3 chunks (100.00%)
-adding file changes
-adding foo/Bar/file.txt revisions
-files: 1/3 chunks (33.33%)
-adding foo/file.txt revisions
-files: 2/3 chunks (66.67%)
-adding quux/file.py revisions
-files: 3/3 chunks (100.00%)
-added 3 changesets with 3 changes to 3 files
-updating the branch cache
-rolling back to revision 0 (undo push)
-0:6675d58eff77
-
-Extension disabled for lack of acl.sources
-Pushing as user fred
-hgrc = """
-[hooks]
-pretxnchangegroup.acl = python:hgext.acl.hook
-"""
-pushing to ../b
-searching for changes
-common changesets up to 6675d58eff77
-invalidating branch cache (tip differs)
-3 changesets found
-list of changesets:
-ef1ea85a6374b77d6da9dcda9541f498f2d17df7
-f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
-911600dab2ae7a9baff75958b84fe606851ce955
-adding changesets
-bundling changes: 0 chunks
-bundling changes: 1 chunks
-bundling changes: 2 chunks
-bundling changes: 3 chunks
-bundling changes: 4 chunks
-bundling changes: 5 chunks
-bundling changes: 6 chunks
-bundling changes: 7 chunks
-bundling changes: 8 chunks
-bundling changes: 9 chunks
-bundling manifests: 0 chunks
-bundling manifests: 1 chunks
-bundling manifests: 2 chunks
-bundling manifests: 3 chunks
-bundling manifests: 4 chunks
-bundling manifests: 5 chunks
-bundling manifests: 6 chunks
-bundling manifests: 7 chunks
-bundling manifests: 8 chunks
-bundling manifests: 9 chunks
-bundling files: foo/Bar/file.txt 0 chunks
-bundling files: foo/Bar/file.txt 1 chunks
-bundling files: foo/Bar/file.txt 2 chunks
-bundling files: foo/Bar/file.txt 3 chunks
-bundling files: foo/file.txt 4 chunks
-bundling files: foo/file.txt 5 chunks
-bundling files: foo/file.txt 6 chunks
-bundling files: foo/file.txt 7 chunks
-bundling files: quux/file.py 8 chunks
-bundling files: quux/file.py 9 chunks
-bundling files: quux/file.py 10 chunks
-bundling files: quux/file.py 11 chunks
-changesets: 1 chunks
-add changeset ef1ea85a6374
-changesets: 2 chunks
-add changeset f9cafe1212c8
-changesets: 3 chunks
-add changeset 911600dab2ae
-adding manifests
-manifests: 1/3 chunks (33.33%)
-manifests: 2/3 chunks (66.67%)
-manifests: 3/3 chunks (100.00%)
-adding file changes
-adding foo/Bar/file.txt revisions
-files: 1/3 chunks (33.33%)
-adding foo/file.txt revisions
-files: 2/3 chunks (66.67%)
-adding quux/file.py revisions
-files: 3/3 chunks (100.00%)
-added 3 changesets with 3 changes to 3 files
-calling hook pretxnchangegroup.acl: hgext.acl.hook
-acl: changes have source "push" - skipping
-updating the branch cache
-rolling back to revision 0 (undo push)
-0:6675d58eff77
-
-No [acl.allow]/[acl.deny]
-Pushing as user fred
-hgrc = """
-[hooks]
-pretxnchangegroup.acl = python:hgext.acl.hook
-[acl]
-sources = push
-"""
-pushing to ../b
-searching for changes
-common changesets up to 6675d58eff77
-invalidating branch cache (tip differs)
-3 changesets found
-list of changesets:
-ef1ea85a6374b77d6da9dcda9541f498f2d17df7
-f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
-911600dab2ae7a9baff75958b84fe606851ce955
-adding changesets
-bundling changes: 0 chunks
-bundling changes: 1 chunks
-bundling changes: 2 chunks
-bundling changes: 3 chunks
-bundling changes: 4 chunks
-bundling changes: 5 chunks
-bundling changes: 6 chunks
-bundling changes: 7 chunks
-bundling changes: 8 chunks
-bundling changes: 9 chunks
-bundling manifests: 0 chunks
-bundling manifests: 1 chunks
-bundling manifests: 2 chunks
-bundling manifests: 3 chunks
-bundling manifests: 4 chunks
-bundling manifests: 5 chunks
-bundling manifests: 6 chunks
-bundling manifests: 7 chunks
-bundling manifests: 8 chunks
-bundling manifests: 9 chunks
-bundling files: foo/Bar/file.txt 0 chunks
-bundling files: foo/Bar/file.txt 1 chunks
-bundling files: foo/Bar/file.txt 2 chunks
-bundling files: foo/Bar/file.txt 3 chunks
-bundling files: foo/file.txt 4 chunks
-bundling files: foo/file.txt 5 chunks
-bundling files: foo/file.txt 6 chunks
-bundling files: foo/file.txt 7 chunks
-bundling files: quux/file.py 8 chunks
-bundling files: quux/file.py 9 chunks
-bundling files: quux/file.py 10 chunks
-bundling files: quux/file.py 11 chunks
-changesets: 1 chunks
-add changeset ef1ea85a6374
-changesets: 2 chunks
-add changeset f9cafe1212c8
-changesets: 3 chunks
-add changeset 911600dab2ae
-adding manifests
-manifests: 1/3 chunks (33.33%)
-manifests: 2/3 chunks (66.67%)
-manifests: 3/3 chunks (100.00%)
-adding file changes
-adding foo/Bar/file.txt revisions
-files: 1/3 chunks (33.33%)
-adding foo/file.txt revisions
-files: 2/3 chunks (66.67%)
-adding quux/file.py revisions
-files: 3/3 chunks (100.00%)
-added 3 changesets with 3 changes to 3 files
-calling hook pretxnchangegroup.acl: hgext.acl.hook
-acl: acl.allow.branches not enabled
-acl: acl.deny.branches not enabled
-acl: acl.allow not enabled
-acl: acl.deny not enabled
-acl: branch access granted: "ef1ea85a6374" on branch "default"
-acl: allowing changeset ef1ea85a6374
-acl: branch access granted: "f9cafe1212c8" on branch "default"
-acl: allowing changeset f9cafe1212c8
-acl: branch access granted: "911600dab2ae" on branch "default"
-acl: allowing changeset 911600dab2ae
-updating the branch cache
-rolling back to revision 0 (undo push)
-0:6675d58eff77
-
-Empty [acl.allow]
-Pushing as user fred
-hgrc = """
-[hooks]
-pretxnchangegroup.acl = python:hgext.acl.hook
-[acl]
-sources = push
-[acl.allow]
-"""
-pushing to ../b
-searching for changes
-common changesets up to 6675d58eff77
-invalidating branch cache (tip differs)
-3 changesets found
-list of changesets:
-ef1ea85a6374b77d6da9dcda9541f498f2d17df7
-f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
-911600dab2ae7a9baff75958b84fe606851ce955
-adding changesets
-bundling changes: 0 chunks
-bundling changes: 1 chunks
-bundling changes: 2 chunks
-bundling changes: 3 chunks
-bundling changes: 4 chunks
-bundling changes: 5 chunks
-bundling changes: 6 chunks
-bundling changes: 7 chunks
-bundling changes: 8 chunks
-bundling changes: 9 chunks
-bundling manifests: 0 chunks
-bundling manifests: 1 chunks
-bundling manifests: 2 chunks
-bundling manifests: 3 chunks
-bundling manifests: 4 chunks
-bundling manifests: 5 chunks
-bundling manifests: 6 chunks
-bundling manifests: 7 chunks
-bundling manifests: 8 chunks
-bundling manifests: 9 chunks
-bundling files: foo/Bar/file.txt 0 chunks
-bundling files: foo/Bar/file.txt 1 chunks
-bundling files: foo/Bar/file.txt 2 chunks
-bundling files: foo/Bar/file.txt 3 chunks
-bundling files: foo/file.txt 4 chunks
-bundling files: foo/file.txt 5 chunks
-bundling files: foo/file.txt 6 chunks
-bundling files: foo/file.txt 7 chunks
-bundling files: quux/file.py 8 chunks
-bundling files: quux/file.py 9 chunks
-bundling files: quux/file.py 10 chunks
-bundling files: quux/file.py 11 chunks
-changesets: 1 chunks
-add changeset ef1ea85a6374
-changesets: 2 chunks
-add changeset f9cafe1212c8
-changesets: 3 chunks
-add changeset 911600dab2ae
-adding manifests
-manifests: 1/3 chunks (33.33%)
-manifests: 2/3 chunks (66.67%)
-manifests: 3/3 chunks (100.00%)
-adding file changes
-adding foo/Bar/file.txt revisions
-files: 1/3 chunks (33.33%)
-adding foo/file.txt revisions
-files: 2/3 chunks (66.67%)
-adding quux/file.py revisions
-files: 3/3 chunks (100.00%)
-added 3 changesets with 3 changes to 3 files
-calling hook pretxnchangegroup.acl: hgext.acl.hook
-acl: acl.allow.branches not enabled
-acl: acl.deny.branches not enabled
-acl: acl.allow enabled, 0 entries for user fred
-acl: acl.deny not enabled
-acl: branch access granted: "ef1ea85a6374" on branch "default"
-acl: user fred not allowed on foo/file.txt
-error: pretxnchangegroup.acl hook failed: acl: access denied for changeset ef1ea85a6374
-transaction abort!
-rollback completed
-abort: acl: access denied for changeset ef1ea85a6374
-no rollback information available
-0:6675d58eff77
-
-fred is allowed inside foo/
-Pushing as user fred
-hgrc = """
-[hooks]
-pretxnchangegroup.acl = python:hgext.acl.hook
-[acl]
-sources = push
-[acl.allow]
-foo/** = fred
-"""
-pushing to ../b
-searching for changes
-common changesets up to 6675d58eff77
-3 changesets found
-list of changesets:
-ef1ea85a6374b77d6da9dcda9541f498f2d17df7
-f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
-911600dab2ae7a9baff75958b84fe606851ce955
-adding changesets
-bundling changes: 0 chunks
-bundling changes: 1 chunks
-bundling changes: 2 chunks
-bundling changes: 3 chunks
-bundling changes: 4 chunks
-bundling changes: 5 chunks
-bundling changes: 6 chunks
-bundling changes: 7 chunks
-bundling changes: 8 chunks
-bundling changes: 9 chunks
-bundling manifests: 0 chunks
-bundling manifests: 1 chunks
-bundling manifests: 2 chunks
-bundling manifests: 3 chunks
-bundling manifests: 4 chunks
-bundling manifests: 5 chunks
-bundling manifests: 6 chunks
-bundling manifests: 7 chunks
-bundling manifests: 8 chunks
-bundling manifests: 9 chunks
-bundling files: foo/Bar/file.txt 0 chunks
-bundling files: foo/Bar/file.txt 1 chunks
-bundling files: foo/Bar/file.txt 2 chunks
-bundling files: foo/Bar/file.txt 3 chunks
-bundling files: foo/file.txt 4 chunks
-bundling files: foo/file.txt 5 chunks
-bundling files: foo/file.txt 6 chunks
-bundling files: foo/file.txt 7 chunks
-bundling files: quux/file.py 8 chunks
-bundling files: quux/file.py 9 chunks
-bundling files: quux/file.py 10 chunks
-bundling files: quux/file.py 11 chunks
-changesets: 1 chunks
-add changeset ef1ea85a6374
-changesets: 2 chunks
-add changeset f9cafe1212c8
-changesets: 3 chunks
-add changeset 911600dab2ae
-adding manifests
-manifests: 1/3 chunks (33.33%)
-manifests: 2/3 chunks (66.67%)
-manifests: 3/3 chunks (100.00%)
-adding file changes
-adding foo/Bar/file.txt revisions
-files: 1/3 chunks (33.33%)
-adding foo/file.txt revisions
-files: 2/3 chunks (66.67%)
-adding quux/file.py revisions
-files: 3/3 chunks (100.00%)
-added 3 changesets with 3 changes to 3 files
-calling hook pretxnchangegroup.acl: hgext.acl.hook
-acl: acl.allow.branches not enabled
-acl: acl.deny.branches not enabled
-acl: acl.allow enabled, 1 entries for user fred
-acl: acl.deny not enabled
-acl: branch access granted: "ef1ea85a6374" on branch "default"
-acl: allowing changeset ef1ea85a6374
-acl: branch access granted: "f9cafe1212c8" on branch "default"
-acl: allowing changeset f9cafe1212c8
-acl: branch access granted: "911600dab2ae" on branch "default"
-acl: user fred not allowed on quux/file.py
-error: pretxnchangegroup.acl hook failed: acl: access denied for changeset 911600dab2ae
-transaction abort!
-rollback completed
-abort: acl: access denied for changeset 911600dab2ae
-no rollback information available
-0:6675d58eff77
-
-Empty [acl.deny]
-Pushing as user barney
-hgrc = """
-[hooks]
-pretxnchangegroup.acl = python:hgext.acl.hook
-[acl]
-sources = push
-[acl.allow]
-foo/** = fred
-[acl.deny]
-"""
-pushing to ../b
-searching for changes
-common changesets up to 6675d58eff77
-3 changesets found
-list of changesets:
-ef1ea85a6374b77d6da9dcda9541f498f2d17df7
-f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
-911600dab2ae7a9baff75958b84fe606851ce955
-adding changesets
-bundling changes: 0 chunks
-bundling changes: 1 chunks
-bundling changes: 2 chunks
-bundling changes: 3 chunks
-bundling changes: 4 chunks
-bundling changes: 5 chunks
-bundling changes: 6 chunks
-bundling changes: 7 chunks
-bundling changes: 8 chunks
-bundling changes: 9 chunks
-bundling manifests: 0 chunks
-bundling manifests: 1 chunks
-bundling manifests: 2 chunks
-bundling manifests: 3 chunks
-bundling manifests: 4 chunks
-bundling manifests: 5 chunks
-bundling manifests: 6 chunks
-bundling manifests: 7 chunks
-bundling manifests: 8 chunks
-bundling manifests: 9 chunks
-bundling files: foo/Bar/file.txt 0 chunks
-bundling files: foo/Bar/file.txt 1 chunks
-bundling files: foo/Bar/file.txt 2 chunks
-bundling files: foo/Bar/file.txt 3 chunks
-bundling files: foo/file.txt 4 chunks
-bundling files: foo/file.txt 5 chunks
-bundling files: foo/file.txt 6 chunks
-bundling files: foo/file.txt 7 chunks
-bundling files: quux/file.py 8 chunks
-bundling files: quux/file.py 9 chunks
-bundling files: quux/file.py 10 chunks
-bundling files: quux/file.py 11 chunks
-changesets: 1 chunks
-add changeset ef1ea85a6374
-changesets: 2 chunks
-add changeset f9cafe1212c8
-changesets: 3 chunks
-add changeset 911600dab2ae
-adding manifests
-manifests: 1/3 chunks (33.33%)
-manifests: 2/3 chunks (66.67%)
-manifests: 3/3 chunks (100.00%)
-adding file changes
-adding foo/Bar/file.txt revisions
-files: 1/3 chunks (33.33%)
-adding foo/file.txt revisions
-files: 2/3 chunks (66.67%)
-adding quux/file.py revisions
-files: 3/3 chunks (100.00%)
-added 3 changesets with 3 changes to 3 files
-calling hook pretxnchangegroup.acl: hgext.acl.hook
-acl: acl.allow.branches not enabled
-acl: acl.deny.branches not enabled
-acl: acl.allow enabled, 0 entries for user barney
-acl: acl.deny enabled, 0 entries for user barney
-acl: branch access granted: "ef1ea85a6374" on branch "default"
-acl: user barney not allowed on foo/file.txt
-error: pretxnchangegroup.acl hook failed: acl: access denied for changeset ef1ea85a6374
-transaction abort!
-rollback completed
-abort: acl: access denied for changeset ef1ea85a6374
-no rollback information available
-0:6675d58eff77
-
-fred is allowed inside foo/, but not foo/bar/ (case matters)
-Pushing as user fred
-hgrc = """
-[hooks]
-pretxnchangegroup.acl = python:hgext.acl.hook
-[acl]
-sources = push
-[acl.allow]
-foo/** = fred
-[acl.deny]
-foo/bar/** = fred
-"""
-pushing to ../b
-searching for changes
-common changesets up to 6675d58eff77
-3 changesets found
-list of changesets:
-ef1ea85a6374b77d6da9dcda9541f498f2d17df7
-f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
-911600dab2ae7a9baff75958b84fe606851ce955
-adding changesets
-bundling changes: 0 chunks
-bundling changes: 1 chunks
-bundling changes: 2 chunks
-bundling changes: 3 chunks
-bundling changes: 4 chunks
-bundling changes: 5 chunks
-bundling changes: 6 chunks
-bundling changes: 7 chunks
-bundling changes: 8 chunks
-bundling changes: 9 chunks
-bundling manifests: 0 chunks
-bundling manifests: 1 chunks
-bundling manifests: 2 chunks
-bundling manifests: 3 chunks
-bundling manifests: 4 chunks
-bundling manifests: 5 chunks
-bundling manifests: 6 chunks
-bundling manifests: 7 chunks
-bundling manifests: 8 chunks
-bundling manifests: 9 chunks
-bundling files: foo/Bar/file.txt 0 chunks
-bundling files: foo/Bar/file.txt 1 chunks
-bundling files: foo/Bar/file.txt 2 chunks
-bundling files: foo/Bar/file.txt 3 chunks
-bundling files: foo/file.txt 4 chunks
-bundling files: foo/file.txt 5 chunks
-bundling files: foo/file.txt 6 chunks
-bundling files: foo/file.txt 7 chunks
-bundling files: quux/file.py 8 chunks
-bundling files: quux/file.py 9 chunks
-bundling files: quux/file.py 10 chunks
-bundling files: quux/file.py 11 chunks
-changesets: 1 chunks
-add changeset ef1ea85a6374
-changesets: 2 chunks
-add changeset f9cafe1212c8
-changesets: 3 chunks
-add changeset 911600dab2ae
-adding manifests
-manifests: 1/3 chunks (33.33%)
-manifests: 2/3 chunks (66.67%)
-manifests: 3/3 chunks (100.00%)
-adding file changes
-adding foo/Bar/file.txt revisions
-files: 1/3 chunks (33.33%)
-adding foo/file.txt revisions
-files: 2/3 chunks (66.67%)
-adding quux/file.py revisions
-files: 3/3 chunks (100.00%)
-added 3 changesets with 3 changes to 3 files
-calling hook pretxnchangegroup.acl: hgext.acl.hook
-acl: acl.allow.branches not enabled
-acl: acl.deny.branches not enabled
-acl: acl.allow enabled, 1 entries for user fred
-acl: acl.deny enabled, 1 entries for user fred
-acl: branch access granted: "ef1ea85a6374" on branch "default"
-acl: allowing changeset ef1ea85a6374
-acl: branch access granted: "f9cafe1212c8" on branch "default"
-acl: allowing changeset f9cafe1212c8
-acl: branch access granted: "911600dab2ae" on branch "default"
-acl: user fred not allowed on quux/file.py
-error: pretxnchangegroup.acl hook failed: acl: access denied for changeset 911600dab2ae
-transaction abort!
-rollback completed
-abort: acl: access denied for changeset 911600dab2ae
-no rollback information available
-0:6675d58eff77
-
-fred is allowed inside foo/, but not foo/Bar/
-Pushing as user fred
-hgrc = """
-[hooks]
-pretxnchangegroup.acl = python:hgext.acl.hook
-[acl]
-sources = push
-[acl.allow]
-foo/** = fred
-[acl.deny]
-foo/bar/** = fred
-foo/Bar/** = fred
-"""
-pushing to ../b
-searching for changes
-common changesets up to 6675d58eff77
-3 changesets found
-list of changesets:
-ef1ea85a6374b77d6da9dcda9541f498f2d17df7
-f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
-911600dab2ae7a9baff75958b84fe606851ce955
-adding changesets
-bundling changes: 0 chunks
-bundling changes: 1 chunks
-bundling changes: 2 chunks
-bundling changes: 3 chunks
-bundling changes: 4 chunks
-bundling changes: 5 chunks
-bundling changes: 6 chunks
-bundling changes: 7 chunks
-bundling changes: 8 chunks
-bundling changes: 9 chunks
-bundling manifests: 0 chunks
-bundling manifests: 1 chunks
-bundling manifests: 2 chunks
-bundling manifests: 3 chunks
-bundling manifests: 4 chunks
-bundling manifests: 5 chunks
-bundling manifests: 6 chunks
-bundling manifests: 7 chunks
-bundling manifests: 8 chunks
-bundling manifests: 9 chunks
-bundling files: foo/Bar/file.txt 0 chunks
-bundling files: foo/Bar/file.txt 1 chunks
-bundling files: foo/Bar/file.txt 2 chunks
-bundling files: foo/Bar/file.txt 3 chunks
-bundling files: foo/file.txt 4 chunks
-bundling files: foo/file.txt 5 chunks
-bundling files: foo/file.txt 6 chunks
-bundling files: foo/file.txt 7 chunks
-bundling files: quux/file.py 8 chunks
-bundling files: quux/file.py 9 chunks
-bundling files: quux/file.py 10 chunks
-bundling files: quux/file.py 11 chunks
-changesets: 1 chunks
-add changeset ef1ea85a6374
-changesets: 2 chunks
-add changeset f9cafe1212c8
-changesets: 3 chunks
-add changeset 911600dab2ae
-adding manifests
-manifests: 1/3 chunks (33.33%)
-manifests: 2/3 chunks (66.67%)
-manifests: 3/3 chunks (100.00%)
-adding file changes
-adding foo/Bar/file.txt revisions
-files: 1/3 chunks (33.33%)
-adding foo/file.txt revisions
-files: 2/3 chunks (66.67%)
-adding quux/file.py revisions
-files: 3/3 chunks (100.00%)
-added 3 changesets with 3 changes to 3 files
-calling hook pretxnchangegroup.acl: hgext.acl.hook
-acl: acl.allow.branches not enabled
-acl: acl.deny.branches not enabled
-acl: acl.allow enabled, 1 entries for user fred
-acl: acl.deny enabled, 2 entries for user fred
-acl: branch access granted: "ef1ea85a6374" on branch "default"
-acl: allowing changeset ef1ea85a6374
-acl: branch access granted: "f9cafe1212c8" on branch "default"
-acl: user fred denied on foo/Bar/file.txt
-error: pretxnchangegroup.acl hook failed: acl: access denied for changeset f9cafe1212c8
-transaction abort!
-rollback completed
-abort: acl: access denied for changeset f9cafe1212c8
-no rollback information available
-0:6675d58eff77
-
-barney is not mentioned => not allowed anywhere
-Pushing as user barney
-hgrc = """
-[hooks]
-pretxnchangegroup.acl = python:hgext.acl.hook
-[acl]
-sources = push
-[acl.allow]
-foo/** = fred
-[acl.deny]
-foo/bar/** = fred
-foo/Bar/** = fred
-"""
-pushing to ../b
-searching for changes
-common changesets up to 6675d58eff77
-3 changesets found
-list of changesets:
-ef1ea85a6374b77d6da9dcda9541f498f2d17df7
-f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
-911600dab2ae7a9baff75958b84fe606851ce955
-adding changesets
-bundling changes: 0 chunks
-bundling changes: 1 chunks
-bundling changes: 2 chunks
-bundling changes: 3 chunks
-bundling changes: 4 chunks
-bundling changes: 5 chunks
-bundling changes: 6 chunks
-bundling changes: 7 chunks
-bundling changes: 8 chunks
-bundling changes: 9 chunks
-bundling manifests: 0 chunks
-bundling manifests: 1 chunks
-bundling manifests: 2 chunks
-bundling manifests: 3 chunks
-bundling manifests: 4 chunks
-bundling manifests: 5 chunks
-bundling manifests: 6 chunks
-bundling manifests: 7 chunks
-bundling manifests: 8 chunks
-bundling manifests: 9 chunks
-bundling files: foo/Bar/file.txt 0 chunks
-bundling files: foo/Bar/file.txt 1 chunks
-bundling files: foo/Bar/file.txt 2 chunks
-bundling files: foo/Bar/file.txt 3 chunks
-bundling files: foo/file.txt 4 chunks
-bundling files: foo/file.txt 5 chunks
-bundling files: foo/file.txt 6 chunks
-bundling files: foo/file.txt 7 chunks
-bundling files: quux/file.py 8 chunks
-bundling files: quux/file.py 9 chunks
-bundling files: quux/file.py 10 chunks
-bundling files: quux/file.py 11 chunks
-changesets: 1 chunks
-add changeset ef1ea85a6374
-changesets: 2 chunks
-add changeset f9cafe1212c8
-changesets: 3 chunks
-add changeset 911600dab2ae
-adding manifests
-manifests: 1/3 chunks (33.33%)
-manifests: 2/3 chunks (66.67%)
-manifests: 3/3 chunks (100.00%)
-adding file changes
-adding foo/Bar/file.txt revisions
-files: 1/3 chunks (33.33%)
-adding foo/file.txt revisions
-files: 2/3 chunks (66.67%)
-adding quux/file.py revisions
-files: 3/3 chunks (100.00%)
-added 3 changesets with 3 changes to 3 files
-calling hook pretxnchangegroup.acl: hgext.acl.hook
-acl: acl.allow.branches not enabled
-acl: acl.deny.branches not enabled
-acl: acl.allow enabled, 0 entries for user barney
-acl: acl.deny enabled, 0 entries for user barney
-acl: branch access granted: "ef1ea85a6374" on branch "default"
-acl: user barney not allowed on foo/file.txt
-error: pretxnchangegroup.acl hook failed: acl: access denied for changeset ef1ea85a6374
-transaction abort!
-rollback completed
-abort: acl: access denied for changeset ef1ea85a6374
-no rollback information available
-0:6675d58eff77
-
-barney is allowed everywhere
-Pushing as user barney
-hgrc = """
-[hooks]
-pretxnchangegroup.acl = python:hgext.acl.hook
-[acl]
-sources = push
-[acl.allow]
-foo/** = fred
-[acl.deny]
-foo/bar/** = fred
-foo/Bar/** = fred
-[acl.allow]
-** = barney
-"""
-pushing to ../b
-searching for changes
-common changesets up to 6675d58eff77
-3 changesets found
-list of changesets:
-ef1ea85a6374b77d6da9dcda9541f498f2d17df7
-f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
-911600dab2ae7a9baff75958b84fe606851ce955
-adding changesets
-bundling changes: 0 chunks
-bundling changes: 1 chunks
-bundling changes: 2 chunks
-bundling changes: 3 chunks
-bundling changes: 4 chunks
-bundling changes: 5 chunks
-bundling changes: 6 chunks
-bundling changes: 7 chunks
-bundling changes: 8 chunks
-bundling changes: 9 chunks
-bundling manifests: 0 chunks
-bundling manifests: 1 chunks
-bundling manifests: 2 chunks
-bundling manifests: 3 chunks
-bundling manifests: 4 chunks
-bundling manifests: 5 chunks
-bundling manifests: 6 chunks
-bundling manifests: 7 chunks
-bundling manifests: 8 chunks
-bundling manifests: 9 chunks
-bundling files: foo/Bar/file.txt 0 chunks
-bundling files: foo/Bar/file.txt 1 chunks
-bundling files: foo/Bar/file.txt 2 chunks
-bundling files: foo/Bar/file.txt 3 chunks
-bundling files: foo/file.txt 4 chunks
-bundling files: foo/file.txt 5 chunks
-bundling files: foo/file.txt 6 chunks
-bundling files: foo/file.txt 7 chunks
-bundling files: quux/file.py 8 chunks
-bundling files: quux/file.py 9 chunks
-bundling files: quux/file.py 10 chunks
-bundling files: quux/file.py 11 chunks
-changesets: 1 chunks
-add changeset ef1ea85a6374
-changesets: 2 chunks
-add changeset f9cafe1212c8
-changesets: 3 chunks
-add changeset 911600dab2ae
-adding manifests
-manifests: 1/3 chunks (33.33%)
-manifests: 2/3 chunks (66.67%)
-manifests: 3/3 chunks (100.00%)
-adding file changes
-adding foo/Bar/file.txt revisions
-files: 1/3 chunks (33.33%)
-adding foo/file.txt revisions
-files: 2/3 chunks (66.67%)
-adding quux/file.py revisions
-files: 3/3 chunks (100.00%)
-added 3 changesets with 3 changes to 3 files
-calling hook pretxnchangegroup.acl: hgext.acl.hook
-acl: acl.allow.branches not enabled
-acl: acl.deny.branches not enabled
-acl: acl.allow enabled, 1 entries for user barney
-acl: acl.deny enabled, 0 entries for user barney
-acl: branch access granted: "ef1ea85a6374" on branch "default"
-acl: allowing changeset ef1ea85a6374
-acl: branch access granted: "f9cafe1212c8" on branch "default"
-acl: allowing changeset f9cafe1212c8
-acl: branch access granted: "911600dab2ae" on branch "default"
-acl: allowing changeset 911600dab2ae
-updating the branch cache
-rolling back to revision 0 (undo push)
-0:6675d58eff77
-
-wilma can change files with a .txt extension
-Pushing as user wilma
-hgrc = """
-[hooks]
-pretxnchangegroup.acl = python:hgext.acl.hook
-[acl]
-sources = push
-[acl.allow]
-foo/** = fred
-[acl.deny]
-foo/bar/** = fred
-foo/Bar/** = fred
-[acl.allow]
-** = barney
-**/*.txt = wilma
-"""
-pushing to ../b
-searching for changes
-common changesets up to 6675d58eff77
-invalidating branch cache (tip differs)
-3 changesets found
-list of changesets:
-ef1ea85a6374b77d6da9dcda9541f498f2d17df7
-f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
-911600dab2ae7a9baff75958b84fe606851ce955
-adding changesets
-bundling changes: 0 chunks
-bundling changes: 1 chunks
-bundling changes: 2 chunks
-bundling changes: 3 chunks
-bundling changes: 4 chunks
-bundling changes: 5 chunks
-bundling changes: 6 chunks
-bundling changes: 7 chunks
-bundling changes: 8 chunks
-bundling changes: 9 chunks
-bundling manifests: 0 chunks
-bundling manifests: 1 chunks
-bundling manifests: 2 chunks
-bundling manifests: 3 chunks
-bundling manifests: 4 chunks
-bundling manifests: 5 chunks
-bundling manifests: 6 chunks
-bundling manifests: 7 chunks
-bundling manifests: 8 chunks
-bundling manifests: 9 chunks
-bundling files: foo/Bar/file.txt 0 chunks
-bundling files: foo/Bar/file.txt 1 chunks
-bundling files: foo/Bar/file.txt 2 chunks
-bundling files: foo/Bar/file.txt 3 chunks
-bundling files: foo/file.txt 4 chunks
-bundling files: foo/file.txt 5 chunks
-bundling files: foo/file.txt 6 chunks
-bundling files: foo/file.txt 7 chunks
-bundling files: quux/file.py 8 chunks
-bundling files: quux/file.py 9 chunks
-bundling files: quux/file.py 10 chunks
-bundling files: quux/file.py 11 chunks
-changesets: 1 chunks
-add changeset ef1ea85a6374
-changesets: 2 chunks
-add changeset f9cafe1212c8
-changesets: 3 chunks
-add changeset 911600dab2ae
-adding manifests
-manifests: 1/3 chunks (33.33%)
-manifests: 2/3 chunks (66.67%)
-manifests: 3/3 chunks (100.00%)
-adding file changes
-adding foo/Bar/file.txt revisions
-files: 1/3 chunks (33.33%)
-adding foo/file.txt revisions
-files: 2/3 chunks (66.67%)
-adding quux/file.py revisions
-files: 3/3 chunks (100.00%)
-added 3 changesets with 3 changes to 3 files
-calling hook pretxnchangegroup.acl: hgext.acl.hook
-acl: acl.allow.branches not enabled
-acl: acl.deny.branches not enabled
-acl: acl.allow enabled, 1 entries for user wilma
-acl: acl.deny enabled, 0 entries for user wilma
-acl: branch access granted: "ef1ea85a6374" on branch "default"
-acl: allowing changeset ef1ea85a6374
-acl: branch access granted: "f9cafe1212c8" on branch "default"
-acl: allowing changeset f9cafe1212c8
-acl: branch access granted: "911600dab2ae" on branch "default"
-acl: user wilma not allowed on quux/file.py
-error: pretxnchangegroup.acl hook failed: acl: access denied for changeset 911600dab2ae
-transaction abort!
-rollback completed
-abort: acl: access denied for changeset 911600dab2ae
-no rollback information available
-0:6675d58eff77
-
-file specified by acl.config does not exist
-Pushing as user barney
-hgrc = """
-[hooks]
-pretxnchangegroup.acl = python:hgext.acl.hook
-[acl]
-sources = push
-[acl.allow]
-foo/** = fred
-[acl.deny]
-foo/bar/** = fred
-foo/Bar/** = fred
-[acl.allow]
-** = barney
-**/*.txt = wilma
-[acl]
-config = ../acl.config
-"""
-pushing to ../b
-searching for changes
-common changesets up to 6675d58eff77
-3 changesets found
-list of changesets:
-ef1ea85a6374b77d6da9dcda9541f498f2d17df7
-f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
-911600dab2ae7a9baff75958b84fe606851ce955
-adding changesets
-bundling changes: 0 chunks
-bundling changes: 1 chunks
-bundling changes: 2 chunks
-bundling changes: 3 chunks
-bundling changes: 4 chunks
-bundling changes: 5 chunks
-bundling changes: 6 chunks
-bundling changes: 7 chunks
-bundling changes: 8 chunks
-bundling changes: 9 chunks
-bundling manifests: 0 chunks
-bundling manifests: 1 chunks
-bundling manifests: 2 chunks
-bundling manifests: 3 chunks
-bundling manifests: 4 chunks
-bundling manifests: 5 chunks
-bundling manifests: 6 chunks
-bundling manifests: 7 chunks
-bundling manifests: 8 chunks
-bundling manifests: 9 chunks
-bundling files: foo/Bar/file.txt 0 chunks
-bundling files: foo/Bar/file.txt 1 chunks
-bundling files: foo/Bar/file.txt 2 chunks
-bundling files: foo/Bar/file.txt 3 chunks
-bundling files: foo/file.txt 4 chunks
-bundling files: foo/file.txt 5 chunks
-bundling files: foo/file.txt 6 chunks
-bundling files: foo/file.txt 7 chunks
-bundling files: quux/file.py 8 chunks
-bundling files: quux/file.py 9 chunks
-bundling files: quux/file.py 10 chunks
-bundling files: quux/file.py 11 chunks
-changesets: 1 chunks
-add changeset ef1ea85a6374
-changesets: 2 chunks
-add changeset f9cafe1212c8
-changesets: 3 chunks
-add changeset 911600dab2ae
-adding manifests
-manifests: 1/3 chunks (33.33%)
-manifests: 2/3 chunks (66.67%)
-manifests: 3/3 chunks (100.00%)
-adding file changes
-adding foo/Bar/file.txt revisions
-files: 1/3 chunks (33.33%)
-adding foo/file.txt revisions
-files: 2/3 chunks (66.67%)
-adding quux/file.py revisions
-files: 3/3 chunks (100.00%)
-added 3 changesets with 3 changes to 3 files
-calling hook pretxnchangegroup.acl: hgext.acl.hook
-error: pretxnchangegroup.acl hook raised an exception: [Errno 2] No such file or directory: '../acl.config'
-transaction abort!
-rollback completed
-abort: No such file or directory: ../acl.config
-no rollback information available
-0:6675d58eff77
-
-betty is allowed inside foo/ by a acl.config file
-Pushing as user betty
-hgrc = """
-[hooks]
-pretxnchangegroup.acl = python:hgext.acl.hook
-[acl]
-sources = push
-[acl.allow]
-foo/** = fred
-[acl.deny]
-foo/bar/** = fred
-foo/Bar/** = fred
-[acl.allow]
-** = barney
-**/*.txt = wilma
-[acl]
-config = ../acl.config
-"""
-acl.config = """
-[acl.allow]
-foo/** = betty
-"""
-pushing to ../b
-searching for changes
-common changesets up to 6675d58eff77
-3 changesets found
-list of changesets:
-ef1ea85a6374b77d6da9dcda9541f498f2d17df7
-f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
-911600dab2ae7a9baff75958b84fe606851ce955
-adding changesets
-bundling changes: 0 chunks
-bundling changes: 1 chunks
-bundling changes: 2 chunks
-bundling changes: 3 chunks
-bundling changes: 4 chunks
-bundling changes: 5 chunks
-bundling changes: 6 chunks
-bundling changes: 7 chunks
-bundling changes: 8 chunks
-bundling changes: 9 chunks
-bundling manifests: 0 chunks
-bundling manifests: 1 chunks
-bundling manifests: 2 chunks
-bundling manifests: 3 chunks
-bundling manifests: 4 chunks
-bundling manifests: 5 chunks
-bundling manifests: 6 chunks
-bundling manifests: 7 chunks
-bundling manifests: 8 chunks
-bundling manifests: 9 chunks
-bundling files: foo/Bar/file.txt 0 chunks
-bundling files: foo/Bar/file.txt 1 chunks
-bundling files: foo/Bar/file.txt 2 chunks
-bundling files: foo/Bar/file.txt 3 chunks
-bundling files: foo/file.txt 4 chunks
-bundling files: foo/file.txt 5 chunks
-bundling files: foo/file.txt 6 chunks
-bundling files: foo/file.txt 7 chunks
-bundling files: quux/file.py 8 chunks
-bundling files: quux/file.py 9 chunks
-bundling files: quux/file.py 10 chunks
-bundling files: quux/file.py 11 chunks
-changesets: 1 chunks
-add changeset ef1ea85a6374
-changesets: 2 chunks
-add changeset f9cafe1212c8
-changesets: 3 chunks
-add changeset 911600dab2ae
-adding manifests
-manifests: 1/3 chunks (33.33%)
-manifests: 2/3 chunks (66.67%)
-manifests: 3/3 chunks (100.00%)
-adding file changes
-adding foo/Bar/file.txt revisions
-files: 1/3 chunks (33.33%)
-adding foo/file.txt revisions
-files: 2/3 chunks (66.67%)
-adding quux/file.py revisions
-files: 3/3 chunks (100.00%)
-added 3 changesets with 3 changes to 3 files
-calling hook pretxnchangegroup.acl: hgext.acl.hook
-acl: acl.allow.branches not enabled
-acl: acl.deny.branches not enabled
-acl: acl.allow enabled, 1 entries for user betty
-acl: acl.deny enabled, 0 entries for user betty
-acl: branch access granted: "ef1ea85a6374" on branch "default"
-acl: allowing changeset ef1ea85a6374
-acl: branch access granted: "f9cafe1212c8" on branch "default"
-acl: allowing changeset f9cafe1212c8
-acl: branch access granted: "911600dab2ae" on branch "default"
-acl: user betty not allowed on quux/file.py
-error: pretxnchangegroup.acl hook failed: acl: access denied for changeset 911600dab2ae
-transaction abort!
-rollback completed
-abort: acl: access denied for changeset 911600dab2ae
-no rollback information available
-0:6675d58eff77
-
-acl.config can set only [acl.allow]/[acl.deny]
-Pushing as user barney
-hgrc = """
-[hooks]
-pretxnchangegroup.acl = python:hgext.acl.hook
-[acl]
-sources = push
-[acl.allow]
-foo/** = fred
-[acl.deny]
-foo/bar/** = fred
-foo/Bar/** = fred
-[acl.allow]
-** = barney
-**/*.txt = wilma
-[acl]
-config = ../acl.config
-"""
-acl.config = """
-[acl.allow]
-foo/** = betty
-[hooks]
-changegroup.acl = false
-"""
-pushing to ../b
-searching for changes
-common changesets up to 6675d58eff77
-3 changesets found
-list of changesets:
-ef1ea85a6374b77d6da9dcda9541f498f2d17df7
-f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
-911600dab2ae7a9baff75958b84fe606851ce955
-adding changesets
-bundling changes: 0 chunks
-bundling changes: 1 chunks
-bundling changes: 2 chunks
-bundling changes: 3 chunks
-bundling changes: 4 chunks
-bundling changes: 5 chunks
-bundling changes: 6 chunks
-bundling changes: 7 chunks
-bundling changes: 8 chunks
-bundling changes: 9 chunks
-bundling manifests: 0 chunks
-bundling manifests: 1 chunks
-bundling manifests: 2 chunks
-bundling manifests: 3 chunks
-bundling manifests: 4 chunks
-bundling manifests: 5 chunks
-bundling manifests: 6 chunks
-bundling manifests: 7 chunks
-bundling manifests: 8 chunks
-bundling manifests: 9 chunks
-bundling files: foo/Bar/file.txt 0 chunks
-bundling files: foo/Bar/file.txt 1 chunks
-bundling files: foo/Bar/file.txt 2 chunks
-bundling files: foo/Bar/file.txt 3 chunks
-bundling files: foo/file.txt 4 chunks
-bundling files: foo/file.txt 5 chunks
-bundling files: foo/file.txt 6 chunks
-bundling files: foo/file.txt 7 chunks
-bundling files: quux/file.py 8 chunks
-bundling files: quux/file.py 9 chunks
-bundling files: quux/file.py 10 chunks
-bundling files: quux/file.py 11 chunks
-changesets: 1 chunks
-add changeset ef1ea85a6374
-changesets: 2 chunks
-add changeset f9cafe1212c8
-changesets: 3 chunks
-add changeset 911600dab2ae
-adding manifests
-manifests: 1/3 chunks (33.33%)
-manifests: 2/3 chunks (66.67%)
-manifests: 3/3 chunks (100.00%)
-adding file changes
-adding foo/Bar/file.txt revisions
-files: 1/3 chunks (33.33%)
-adding foo/file.txt revisions
-files: 2/3 chunks (66.67%)
-adding quux/file.py revisions
-files: 3/3 chunks (100.00%)
-added 3 changesets with 3 changes to 3 files
-calling hook pretxnchangegroup.acl: hgext.acl.hook
-acl: acl.allow.branches not enabled
-acl: acl.deny.branches not enabled
-acl: acl.allow enabled, 1 entries for user barney
-acl: acl.deny enabled, 0 entries for user barney
-acl: branch access granted: "ef1ea85a6374" on branch "default"
-acl: allowing changeset ef1ea85a6374
-acl: branch access granted: "f9cafe1212c8" on branch "default"
-acl: allowing changeset f9cafe1212c8
-acl: branch access granted: "911600dab2ae" on branch "default"
-acl: allowing changeset 911600dab2ae
-updating the branch cache
-rolling back to revision 0 (undo push)
-0:6675d58eff77
-
-asterisk test
-fred is always allowed
-Pushing as user fred
-hgrc = """
-[acl]
-sources = push
-[extensions]
-[acl.allow]
-** = fred
-"""
-pushing to ../b
-searching for changes
-common changesets up to 6675d58eff77
-invalidating branch cache (tip differs)
-3 changesets found
-list of changesets:
-ef1ea85a6374b77d6da9dcda9541f498f2d17df7
-f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
-911600dab2ae7a9baff75958b84fe606851ce955
-adding changesets
-bundling changes: 0 chunks
-bundling changes: 1 chunks
-bundling changes: 2 chunks
-bundling changes: 3 chunks
-bundling changes: 4 chunks
-bundling changes: 5 chunks
-bundling changes: 6 chunks
-bundling changes: 7 chunks
-bundling changes: 8 chunks
-bundling changes: 9 chunks
-bundling manifests: 0 chunks
-bundling manifests: 1 chunks
-bundling manifests: 2 chunks
-bundling manifests: 3 chunks
-bundling manifests: 4 chunks
-bundling manifests: 5 chunks
-bundling manifests: 6 chunks
-bundling manifests: 7 chunks
-bundling manifests: 8 chunks
-bundling manifests: 9 chunks
-bundling files: foo/Bar/file.txt 0 chunks
-bundling files: foo/Bar/file.txt 1 chunks
-bundling files: foo/Bar/file.txt 2 chunks
-bundling files: foo/Bar/file.txt 3 chunks
-bundling files: foo/file.txt 4 chunks
-bundling files: foo/file.txt 5 chunks
-bundling files: foo/file.txt 6 chunks
-bundling files: foo/file.txt 7 chunks
-bundling files: quux/file.py 8 chunks
-bundling files: quux/file.py 9 chunks
-bundling files: quux/file.py 10 chunks
-bundling files: quux/file.py 11 chunks
-changesets: 1 chunks
-add changeset ef1ea85a6374
-changesets: 2 chunks
-add changeset f9cafe1212c8
-changesets: 3 chunks
-add changeset 911600dab2ae
-adding manifests
-manifests: 1/3 chunks (33.33%)
-manifests: 2/3 chunks (66.67%)
-manifests: 3/3 chunks (100.00%)
-adding file changes
-adding foo/Bar/file.txt revisions
-files: 1/3 chunks (33.33%)
-adding foo/file.txt revisions
-files: 2/3 chunks (66.67%)
-adding quux/file.py revisions
-files: 3/3 chunks (100.00%)
-added 3 changesets with 3 changes to 3 files
-calling hook pretxnchangegroup.acl: hgext.acl.hook
-acl: acl.allow.branches not enabled
-acl: acl.deny.branches not enabled
-acl: acl.allow enabled, 1 entries for user fred
-acl: acl.deny not enabled
-acl: branch access granted: "ef1ea85a6374" on branch "default"
-acl: allowing changeset ef1ea85a6374
-acl: branch access granted: "f9cafe1212c8" on branch "default"
-acl: allowing changeset f9cafe1212c8
-acl: branch access granted: "911600dab2ae" on branch "default"
-acl: allowing changeset 911600dab2ae
-updating the branch cache
-rolling back to revision 0 (undo push)
-0:6675d58eff77
-
-no one is allowed inside foo/Bar/
-Pushing as user fred
-hgrc = """
-[acl]
-sources = push
-[extensions]
-[acl.allow]
-** = fred
-[acl.deny]
-foo/Bar/** = *
-"""
-pushing to ../b
-searching for changes
-common changesets up to 6675d58eff77
-invalidating branch cache (tip differs)
-3 changesets found
-list of changesets:
-ef1ea85a6374b77d6da9dcda9541f498f2d17df7
-f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
-911600dab2ae7a9baff75958b84fe606851ce955
-adding changesets
-bundling changes: 0 chunks
-bundling changes: 1 chunks
-bundling changes: 2 chunks
-bundling changes: 3 chunks
-bundling changes: 4 chunks
-bundling changes: 5 chunks
-bundling changes: 6 chunks
-bundling changes: 7 chunks
-bundling changes: 8 chunks
-bundling changes: 9 chunks
-bundling manifests: 0 chunks
-bundling manifests: 1 chunks
-bundling manifests: 2 chunks
-bundling manifests: 3 chunks
-bundling manifests: 4 chunks
-bundling manifests: 5 chunks
-bundling manifests: 6 chunks
-bundling manifests: 7 chunks
-bundling manifests: 8 chunks
-bundling manifests: 9 chunks
-bundling files: foo/Bar/file.txt 0 chunks
-bundling files: foo/Bar/file.txt 1 chunks
-bundling files: foo/Bar/file.txt 2 chunks
-bundling files: foo/Bar/file.txt 3 chunks
-bundling files: foo/file.txt 4 chunks
-bundling files: foo/file.txt 5 chunks
-bundling files: foo/file.txt 6 chunks
-bundling files: foo/file.txt 7 chunks
-bundling files: quux/file.py 8 chunks
-bundling files: quux/file.py 9 chunks
-bundling files: quux/file.py 10 chunks
-bundling files: quux/file.py 11 chunks
-changesets: 1 chunks
-add changeset ef1ea85a6374
-changesets: 2 chunks
-add changeset f9cafe1212c8
-changesets: 3 chunks
-add changeset 911600dab2ae
-adding manifests
-manifests: 1/3 chunks (33.33%)
-manifests: 2/3 chunks (66.67%)
-manifests: 3/3 chunks (100.00%)
-adding file changes
-adding foo/Bar/file.txt revisions
-files: 1/3 chunks (33.33%)
-adding foo/file.txt revisions
-files: 2/3 chunks (66.67%)
-adding quux/file.py revisions
-files: 3/3 chunks (100.00%)
-added 3 changesets with 3 changes to 3 files
-calling hook pretxnchangegroup.acl: hgext.acl.hook
-acl: acl.allow.branches not enabled
-acl: acl.deny.branches not enabled
-acl: acl.allow enabled, 1 entries for user fred
-acl: acl.deny enabled, 1 entries for user fred
-acl: branch access granted: "ef1ea85a6374" on branch "default"
-acl: allowing changeset ef1ea85a6374
-acl: branch access granted: "f9cafe1212c8" on branch "default"
-acl: user fred denied on foo/Bar/file.txt
-error: pretxnchangegroup.acl hook failed: acl: access denied for changeset f9cafe1212c8
-transaction abort!
-rollback completed
-abort: acl: access denied for changeset f9cafe1212c8
-no rollback information available
-0:6675d58eff77
-
-OS-level groups
-@group1 is always allowed
-Pushing as user fred
-hgrc = """
-[acl]
-sources = push
-[extensions]
-[acl.allow]
-** = @group1
-"""
-pushing to ../b
-searching for changes
-common changesets up to 6675d58eff77
-3 changesets found
-list of changesets:
-ef1ea85a6374b77d6da9dcda9541f498f2d17df7
-f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
-911600dab2ae7a9baff75958b84fe606851ce955
-adding changesets
-bundling changes: 0 chunks
-bundling changes: 1 chunks
-bundling changes: 2 chunks
-bundling changes: 3 chunks
-bundling changes: 4 chunks
-bundling changes: 5 chunks
-bundling changes: 6 chunks
-bundling changes: 7 chunks
-bundling changes: 8 chunks
-bundling changes: 9 chunks
-bundling manifests: 0 chunks
-bundling manifests: 1 chunks
-bundling manifests: 2 chunks
-bundling manifests: 3 chunks
-bundling manifests: 4 chunks
-bundling manifests: 5 chunks
-bundling manifests: 6 chunks
-bundling manifests: 7 chunks
-bundling manifests: 8 chunks
-bundling manifests: 9 chunks
-bundling files: foo/Bar/file.txt 0 chunks
-bundling files: foo/Bar/file.txt 1 chunks
-bundling files: foo/Bar/file.txt 2 chunks
-bundling files: foo/Bar/file.txt 3 chunks
-bundling files: foo/file.txt 4 chunks
-bundling files: foo/file.txt 5 chunks
-bundling files: foo/file.txt 6 chunks
-bundling files: foo/file.txt 7 chunks
-bundling files: quux/file.py 8 chunks
-bundling files: quux/file.py 9 chunks
-bundling files: quux/file.py 10 chunks
-bundling files: quux/file.py 11 chunks
-changesets: 1 chunks
-add changeset ef1ea85a6374
-changesets: 2 chunks
-add changeset f9cafe1212c8
-changesets: 3 chunks
-add changeset 911600dab2ae
-adding manifests
-manifests: 1/3 chunks (33.33%)
-manifests: 2/3 chunks (66.67%)
-manifests: 3/3 chunks (100.00%)
-adding file changes
-adding foo/Bar/file.txt revisions
-files: 1/3 chunks (33.33%)
-adding foo/file.txt revisions
-files: 2/3 chunks (66.67%)
-adding quux/file.py revisions
-files: 3/3 chunks (100.00%)
-added 3 changesets with 3 changes to 3 files
-calling hook pretxnchangegroup.acl: hgext.acl.hook
-acl: acl.allow.branches not enabled
-acl: acl.deny.branches not enabled
-acl: "group1" not defined in [acl.groups]
-acl: acl.allow enabled, 1 entries for user fred
-acl: acl.deny not enabled
-acl: branch access granted: "ef1ea85a6374" on branch "default"
-acl: allowing changeset ef1ea85a6374
-acl: branch access granted: "f9cafe1212c8" on branch "default"
-acl: allowing changeset f9cafe1212c8
-acl: branch access granted: "911600dab2ae" on branch "default"
-acl: allowing changeset 911600dab2ae
-updating the branch cache
-rolling back to revision 0 (undo push)
-0:6675d58eff77
-
-@group is allowed inside anything but foo/Bar/
-Pushing as user fred
-hgrc = """
-[acl]
-sources = push
-[extensions]
-[acl.allow]
-** = @group1
-[acl.deny]
-foo/Bar/** = @group1
-"""
-pushing to ../b
-searching for changes
-common changesets up to 6675d58eff77
-invalidating branch cache (tip differs)
-3 changesets found
-list of changesets:
-ef1ea85a6374b77d6da9dcda9541f498f2d17df7
-f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
-911600dab2ae7a9baff75958b84fe606851ce955
-adding changesets
-bundling changes: 0 chunks
-bundling changes: 1 chunks
-bundling changes: 2 chunks
-bundling changes: 3 chunks
-bundling changes: 4 chunks
-bundling changes: 5 chunks
-bundling changes: 6 chunks
-bundling changes: 7 chunks
-bundling changes: 8 chunks
-bundling changes: 9 chunks
-bundling manifests: 0 chunks
-bundling manifests: 1 chunks
-bundling manifests: 2 chunks
-bundling manifests: 3 chunks
-bundling manifests: 4 chunks
-bundling manifests: 5 chunks
-bundling manifests: 6 chunks
-bundling manifests: 7 chunks
-bundling manifests: 8 chunks
-bundling manifests: 9 chunks
-bundling files: foo/Bar/file.txt 0 chunks
-bundling files: foo/Bar/file.txt 1 chunks
-bundling files: foo/Bar/file.txt 2 chunks
-bundling files: foo/Bar/file.txt 3 chunks
-bundling files: foo/file.txt 4 chunks
-bundling files: foo/file.txt 5 chunks
-bundling files: foo/file.txt 6 chunks
-bundling files: foo/file.txt 7 chunks
-bundling files: quux/file.py 8 chunks
-bundling files: quux/file.py 9 chunks
-bundling files: quux/file.py 10 chunks
-bundling files: quux/file.py 11 chunks
-changesets: 1 chunks
-add changeset ef1ea85a6374
-changesets: 2 chunks
-add changeset f9cafe1212c8
-changesets: 3 chunks
-add changeset 911600dab2ae
-adding manifests
-manifests: 1/3 chunks (33.33%)
-manifests: 2/3 chunks (66.67%)
-manifests: 3/3 chunks (100.00%)
-adding file changes
-adding foo/Bar/file.txt revisions
-files: 1/3 chunks (33.33%)
-adding foo/file.txt revisions
-files: 2/3 chunks (66.67%)
-adding quux/file.py revisions
-files: 3/3 chunks (100.00%)
-added 3 changesets with 3 changes to 3 files
-calling hook pretxnchangegroup.acl: hgext.acl.hook
-acl: acl.allow.branches not enabled
-acl: acl.deny.branches not enabled
-acl: "group1" not defined in [acl.groups]
-acl: acl.allow enabled, 1 entries for user fred
-acl: "group1" not defined in [acl.groups]
-acl: acl.deny enabled, 1 entries for user fred
-acl: branch access granted: "ef1ea85a6374" on branch "default"
-acl: allowing changeset ef1ea85a6374
-acl: branch access granted: "f9cafe1212c8" on branch "default"
-acl: user fred denied on foo/Bar/file.txt
-error: pretxnchangegroup.acl hook failed: acl: access denied for changeset f9cafe1212c8
-transaction abort!
-rollback completed
-abort: acl: access denied for changeset f9cafe1212c8
-no rollback information available
-0:6675d58eff77
-
-Invalid group
-** = @unlikelytoexist
-acl: "unlikelytoexist" not defined in [acl.groups]
-error: pretxnchangegroup.acl hook failed: group 'unlikelytoexist' is undefined
-abort: group 'unlikelytoexist' is undefined
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-acl.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,1736 @@
+  > do_push()
+  > {
+  >     user=$1
+  >     shift
+  >     echo "Pushing as user $user"
+  >     echo 'hgrc = """'
+  >     sed -e 1,2d b/.hg/hgrc | grep -v fakegroups.py
+  >     echo '"""'
+  >     if test -f acl.config; then
+  >         echo 'acl.config = """'
+  >         cat acl.config
+  >         echo '"""'
+  >     fi
+  >     # On AIX /etc/profile sets LOGNAME read-only. So
+  >     #  LOGNAME=$user hg --cws a --debug push ../b
+  >     # fails with "This variable is read only."
+  >     # Use env to work around this.
+  >     env LOGNAME=$user hg --cwd a --debug push ../b
+  >     hg --cwd b rollback
+  >     hg --cwd b --quiet tip
+  >     echo
+  > }
+
+  > init_config()
+  > {
+  >     cat > fakegroups.py <<EOF
+  > from hgext import acl
+  > def fakegetusers(ui, group):
+  >     try:
+  >         return acl._getusersorig(ui, group)
+  >     except:
+  >         return ["fred", "betty"]
+  > acl._getusersorig = acl._getusers
+  > acl._getusers = fakegetusers
+  > EOF
+  >     rm -f acl.config
+  >     cat > $config <<EOF
+  > [hooks]
+  > pretxnchangegroup.acl = python:hgext.acl.hook
+  > [acl]
+  > sources = push
+  > [extensions]
+  > f=`pwd`/fakegroups.py
+  > EOF
+  > }
+
+  $ hg init a
+  $ cd a
+  $ mkdir foo foo/Bar quux
+  $ echo 'in foo' > foo/file.txt
+  $ echo 'in foo/Bar' > foo/Bar/file.txt
+  $ echo 'in quux' > quux/file.py
+  $ hg add -q
+  $ hg ci -m 'add files' -d '1000000 0'
+  $ echo >> foo/file.txt
+  $ hg ci -m 'change foo/file' -d '1000001 0'
+  $ echo >> foo/Bar/file.txt
+  $ hg ci -m 'change foo/Bar/file' -d '1000002 0'
+  $ echo >> quux/file.py
+  $ hg ci -m 'change quux/file' -d '1000003 0'
+  $ hg tip --quiet
+  3:911600dab2ae
+
+  $ cd ..
+  $ hg clone -r 0 a b
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 3 changes to 3 files
+  updating to branch default
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ echo '[extensions]' >> $HGRCPATH
+  $ echo 'acl =' >> $HGRCPATH
+
+  $ config=b/.hg/hgrc
+
+Extension disabled for lack of a hook
+
+  $ do_push fred
+  Pushing as user fred
+  hgrc = """
+  """
+  pushing to ../b
+  searching for changes
+  common changesets up to 6675d58eff77
+  3 changesets found
+  list of changesets:
+  ef1ea85a6374b77d6da9dcda9541f498f2d17df7
+  f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
+  911600dab2ae7a9baff75958b84fe606851ce955
+  adding changesets
+  bundling changes: 0 chunks
+  bundling changes: 1 chunks
+  bundling changes: 2 chunks
+  bundling changes: 3 chunks
+  bundling changes: 4 chunks
+  bundling changes: 5 chunks
+  bundling changes: 6 chunks
+  bundling changes: 7 chunks
+  bundling changes: 8 chunks
+  bundling changes: 9 chunks
+  bundling manifests: 0 chunks
+  bundling manifests: 1 chunks
+  bundling manifests: 2 chunks
+  bundling manifests: 3 chunks
+  bundling manifests: 4 chunks
+  bundling manifests: 5 chunks
+  bundling manifests: 6 chunks
+  bundling manifests: 7 chunks
+  bundling manifests: 8 chunks
+  bundling manifests: 9 chunks
+  bundling files: foo/Bar/file.txt 0 chunks
+  bundling files: foo/Bar/file.txt 1 chunks
+  bundling files: foo/Bar/file.txt 2 chunks
+  bundling files: foo/Bar/file.txt 3 chunks
+  bundling files: foo/file.txt 4 chunks
+  bundling files: foo/file.txt 5 chunks
+  bundling files: foo/file.txt 6 chunks
+  bundling files: foo/file.txt 7 chunks
+  bundling files: quux/file.py 8 chunks
+  bundling files: quux/file.py 9 chunks
+  bundling files: quux/file.py 10 chunks
+  bundling files: quux/file.py 11 chunks
+  changesets: 1 chunks
+  add changeset ef1ea85a6374
+  changesets: 2 chunks
+  add changeset f9cafe1212c8
+  changesets: 3 chunks
+  add changeset 911600dab2ae
+  adding manifests
+  manifests: 1/3 chunks (33.33%)
+  manifests: 2/3 chunks (66.67%)
+  manifests: 3/3 chunks (100.00%)
+  adding file changes
+  adding foo/Bar/file.txt revisions
+  files: 1/3 chunks (33.33%)
+  adding foo/file.txt revisions
+  files: 2/3 chunks (66.67%)
+  adding quux/file.py revisions
+  files: 3/3 chunks (100.00%)
+  added 3 changesets with 3 changes to 3 files
+  updating the branch cache
+  rolling back to revision 0 (undo push)
+  0:6675d58eff77
+  
+
+  $ echo '[hooks]' >> $config
+  $ echo 'pretxnchangegroup.acl = python:hgext.acl.hook' >> $config
+
+Extension disabled for lack of acl.sources
+
+  $ do_push fred
+  Pushing as user fred
+  hgrc = """
+  [hooks]
+  pretxnchangegroup.acl = python:hgext.acl.hook
+  """
+  pushing to ../b
+  searching for changes
+  common changesets up to 6675d58eff77
+  invalidating branch cache (tip differs)
+  3 changesets found
+  list of changesets:
+  ef1ea85a6374b77d6da9dcda9541f498f2d17df7
+  f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
+  911600dab2ae7a9baff75958b84fe606851ce955
+  adding changesets
+  bundling changes: 0 chunks
+  bundling changes: 1 chunks
+  bundling changes: 2 chunks
+  bundling changes: 3 chunks
+  bundling changes: 4 chunks
+  bundling changes: 5 chunks
+  bundling changes: 6 chunks
+  bundling changes: 7 chunks
+  bundling changes: 8 chunks
+  bundling changes: 9 chunks
+  bundling manifests: 0 chunks
+  bundling manifests: 1 chunks
+  bundling manifests: 2 chunks
+  bundling manifests: 3 chunks
+  bundling manifests: 4 chunks
+  bundling manifests: 5 chunks
+  bundling manifests: 6 chunks
+  bundling manifests: 7 chunks
+  bundling manifests: 8 chunks
+  bundling manifests: 9 chunks
+  bundling files: foo/Bar/file.txt 0 chunks
+  bundling files: foo/Bar/file.txt 1 chunks
+  bundling files: foo/Bar/file.txt 2 chunks
+  bundling files: foo/Bar/file.txt 3 chunks
+  bundling files: foo/file.txt 4 chunks
+  bundling files: foo/file.txt 5 chunks
+  bundling files: foo/file.txt 6 chunks
+  bundling files: foo/file.txt 7 chunks
+  bundling files: quux/file.py 8 chunks
+  bundling files: quux/file.py 9 chunks
+  bundling files: quux/file.py 10 chunks
+  bundling files: quux/file.py 11 chunks
+  changesets: 1 chunks
+  add changeset ef1ea85a6374
+  changesets: 2 chunks
+  add changeset f9cafe1212c8
+  changesets: 3 chunks
+  add changeset 911600dab2ae
+  adding manifests
+  manifests: 1/3 chunks (33.33%)
+  manifests: 2/3 chunks (66.67%)
+  manifests: 3/3 chunks (100.00%)
+  adding file changes
+  adding foo/Bar/file.txt revisions
+  files: 1/3 chunks (33.33%)
+  adding foo/file.txt revisions
+  files: 2/3 chunks (66.67%)
+  adding quux/file.py revisions
+  files: 3/3 chunks (100.00%)
+  added 3 changesets with 3 changes to 3 files
+  calling hook pretxnchangegroup.acl: hgext.acl.hook
+  acl: changes have source "push" - skipping
+  updating the branch cache
+  rolling back to revision 0 (undo push)
+  0:6675d58eff77
+  
+
+No [acl.allow]/[acl.deny]
+
+  $ echo '[acl]' >> $config
+  $ echo 'sources = push' >> $config
+  $ do_push fred
+  Pushing as user fred
+  hgrc = """
+  [hooks]
+  pretxnchangegroup.acl = python:hgext.acl.hook
+  [acl]
+  sources = push
+  """
+  pushing to ../b
+  searching for changes
+  common changesets up to 6675d58eff77
+  invalidating branch cache (tip differs)
+  3 changesets found
+  list of changesets:
+  ef1ea85a6374b77d6da9dcda9541f498f2d17df7
+  f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
+  911600dab2ae7a9baff75958b84fe606851ce955
+  adding changesets
+  bundling changes: 0 chunks
+  bundling changes: 1 chunks
+  bundling changes: 2 chunks
+  bundling changes: 3 chunks
+  bundling changes: 4 chunks
+  bundling changes: 5 chunks
+  bundling changes: 6 chunks
+  bundling changes: 7 chunks
+  bundling changes: 8 chunks
+  bundling changes: 9 chunks
+  bundling manifests: 0 chunks
+  bundling manifests: 1 chunks
+  bundling manifests: 2 chunks
+  bundling manifests: 3 chunks
+  bundling manifests: 4 chunks
+  bundling manifests: 5 chunks
+  bundling manifests: 6 chunks
+  bundling manifests: 7 chunks
+  bundling manifests: 8 chunks
+  bundling manifests: 9 chunks
+  bundling files: foo/Bar/file.txt 0 chunks
+  bundling files: foo/Bar/file.txt 1 chunks
+  bundling files: foo/Bar/file.txt 2 chunks
+  bundling files: foo/Bar/file.txt 3 chunks
+  bundling files: foo/file.txt 4 chunks
+  bundling files: foo/file.txt 5 chunks
+  bundling files: foo/file.txt 6 chunks
+  bundling files: foo/file.txt 7 chunks
+  bundling files: quux/file.py 8 chunks
+  bundling files: quux/file.py 9 chunks
+  bundling files: quux/file.py 10 chunks
+  bundling files: quux/file.py 11 chunks
+  changesets: 1 chunks
+  add changeset ef1ea85a6374
+  changesets: 2 chunks
+  add changeset f9cafe1212c8
+  changesets: 3 chunks
+  add changeset 911600dab2ae
+  adding manifests
+  manifests: 1/3 chunks (33.33%)
+  manifests: 2/3 chunks (66.67%)
+  manifests: 3/3 chunks (100.00%)
+  adding file changes
+  adding foo/Bar/file.txt revisions
+  files: 1/3 chunks (33.33%)
+  adding foo/file.txt revisions
+  files: 2/3 chunks (66.67%)
+  adding quux/file.py revisions
+  files: 3/3 chunks (100.00%)
+  added 3 changesets with 3 changes to 3 files
+  calling hook pretxnchangegroup.acl: hgext.acl.hook
+  acl: acl.allow.branches not enabled
+  acl: acl.deny.branches not enabled
+  acl: acl.allow not enabled
+  acl: acl.deny not enabled
+  acl: branch access granted: "ef1ea85a6374" on branch "default"
+  acl: allowing changeset ef1ea85a6374
+  acl: branch access granted: "f9cafe1212c8" on branch "default"
+  acl: allowing changeset f9cafe1212c8
+  acl: branch access granted: "911600dab2ae" on branch "default"
+  acl: allowing changeset 911600dab2ae
+  updating the branch cache
+  rolling back to revision 0 (undo push)
+  0:6675d58eff77
+  
+
+Empty [acl.allow]
+
+  $ echo '[acl.allow]' >> $config
+  $ do_push fred
+  Pushing as user fred
+  hgrc = """
+  [hooks]
+  pretxnchangegroup.acl = python:hgext.acl.hook
+  [acl]
+  sources = push
+  [acl.allow]
+  """
+  pushing to ../b
+  searching for changes
+  common changesets up to 6675d58eff77
+  invalidating branch cache (tip differs)
+  3 changesets found
+  list of changesets:
+  ef1ea85a6374b77d6da9dcda9541f498f2d17df7
+  f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
+  911600dab2ae7a9baff75958b84fe606851ce955
+  adding changesets
+  bundling changes: 0 chunks
+  bundling changes: 1 chunks
+  bundling changes: 2 chunks
+  bundling changes: 3 chunks
+  bundling changes: 4 chunks
+  bundling changes: 5 chunks
+  bundling changes: 6 chunks
+  bundling changes: 7 chunks
+  bundling changes: 8 chunks
+  bundling changes: 9 chunks
+  bundling manifests: 0 chunks
+  bundling manifests: 1 chunks
+  bundling manifests: 2 chunks
+  bundling manifests: 3 chunks
+  bundling manifests: 4 chunks
+  bundling manifests: 5 chunks
+  bundling manifests: 6 chunks
+  bundling manifests: 7 chunks
+  bundling manifests: 8 chunks
+  bundling manifests: 9 chunks
+  bundling files: foo/Bar/file.txt 0 chunks
+  bundling files: foo/Bar/file.txt 1 chunks
+  bundling files: foo/Bar/file.txt 2 chunks
+  bundling files: foo/Bar/file.txt 3 chunks
+  bundling files: foo/file.txt 4 chunks
+  bundling files: foo/file.txt 5 chunks
+  bundling files: foo/file.txt 6 chunks
+  bundling files: foo/file.txt 7 chunks
+  bundling files: quux/file.py 8 chunks
+  bundling files: quux/file.py 9 chunks
+  bundling files: quux/file.py 10 chunks
+  bundling files: quux/file.py 11 chunks
+  changesets: 1 chunks
+  add changeset ef1ea85a6374
+  changesets: 2 chunks
+  add changeset f9cafe1212c8
+  changesets: 3 chunks
+  add changeset 911600dab2ae
+  adding manifests
+  manifests: 1/3 chunks (33.33%)
+  manifests: 2/3 chunks (66.67%)
+  manifests: 3/3 chunks (100.00%)
+  adding file changes
+  adding foo/Bar/file.txt revisions
+  files: 1/3 chunks (33.33%)
+  adding foo/file.txt revisions
+  files: 2/3 chunks (66.67%)
+  adding quux/file.py revisions
+  files: 3/3 chunks (100.00%)
+  added 3 changesets with 3 changes to 3 files
+  calling hook pretxnchangegroup.acl: hgext.acl.hook
+  acl: acl.allow.branches not enabled
+  acl: acl.deny.branches not enabled
+  acl: acl.allow enabled, 0 entries for user fred
+  acl: acl.deny not enabled
+  acl: branch access granted: "ef1ea85a6374" on branch "default"
+  acl: user fred not allowed on foo/file.txt
+  error: pretxnchangegroup.acl hook failed: acl: access denied for changeset ef1ea85a6374
+  transaction abort!
+  rollback completed
+  abort: acl: access denied for changeset ef1ea85a6374
+  no rollback information available
+  0:6675d58eff77
+  
+
+fred is allowed inside foo/
+
+  $ echo 'foo/** = fred' >> $config
+  $ do_push fred
+  Pushing as user fred
+  hgrc = """
+  [hooks]
+  pretxnchangegroup.acl = python:hgext.acl.hook
+  [acl]
+  sources = push
+  [acl.allow]
+  foo/** = fred
+  """
+  pushing to ../b
+  searching for changes
+  common changesets up to 6675d58eff77
+  3 changesets found
+  list of changesets:
+  ef1ea85a6374b77d6da9dcda9541f498f2d17df7
+  f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
+  911600dab2ae7a9baff75958b84fe606851ce955
+  adding changesets
+  bundling changes: 0 chunks
+  bundling changes: 1 chunks
+  bundling changes: 2 chunks
+  bundling changes: 3 chunks
+  bundling changes: 4 chunks
+  bundling changes: 5 chunks
+  bundling changes: 6 chunks
+  bundling changes: 7 chunks
+  bundling changes: 8 chunks
+  bundling changes: 9 chunks
+  bundling manifests: 0 chunks
+  bundling manifests: 1 chunks
+  bundling manifests: 2 chunks
+  bundling manifests: 3 chunks
+  bundling manifests: 4 chunks
+  bundling manifests: 5 chunks
+  bundling manifests: 6 chunks
+  bundling manifests: 7 chunks
+  bundling manifests: 8 chunks
+  bundling manifests: 9 chunks
+  bundling files: foo/Bar/file.txt 0 chunks
+  bundling files: foo/Bar/file.txt 1 chunks
+  bundling files: foo/Bar/file.txt 2 chunks
+  bundling files: foo/Bar/file.txt 3 chunks
+  bundling files: foo/file.txt 4 chunks
+  bundling files: foo/file.txt 5 chunks
+  bundling files: foo/file.txt 6 chunks
+  bundling files: foo/file.txt 7 chunks
+  bundling files: quux/file.py 8 chunks
+  bundling files: quux/file.py 9 chunks
+  bundling files: quux/file.py 10 chunks
+  bundling files: quux/file.py 11 chunks
+  changesets: 1 chunks
+  add changeset ef1ea85a6374
+  changesets: 2 chunks
+  add changeset f9cafe1212c8
+  changesets: 3 chunks
+  add changeset 911600dab2ae
+  adding manifests
+  manifests: 1/3 chunks (33.33%)
+  manifests: 2/3 chunks (66.67%)
+  manifests: 3/3 chunks (100.00%)
+  adding file changes
+  adding foo/Bar/file.txt revisions
+  files: 1/3 chunks (33.33%)
+  adding foo/file.txt revisions
+  files: 2/3 chunks (66.67%)
+  adding quux/file.py revisions
+  files: 3/3 chunks (100.00%)
+  added 3 changesets with 3 changes to 3 files
+  calling hook pretxnchangegroup.acl: hgext.acl.hook
+  acl: acl.allow.branches not enabled
+  acl: acl.deny.branches not enabled
+  acl: acl.allow enabled, 1 entries for user fred
+  acl: acl.deny not enabled
+  acl: branch access granted: "ef1ea85a6374" on branch "default"
+  acl: allowing changeset ef1ea85a6374
+  acl: branch access granted: "f9cafe1212c8" on branch "default"
+  acl: allowing changeset f9cafe1212c8
+  acl: branch access granted: "911600dab2ae" on branch "default"
+  acl: user fred not allowed on quux/file.py
+  error: pretxnchangegroup.acl hook failed: acl: access denied for changeset 911600dab2ae
+  transaction abort!
+  rollback completed
+  abort: acl: access denied for changeset 911600dab2ae
+  no rollback information available
+  0:6675d58eff77
+  
+
+Empty [acl.deny]
+
+  $ echo '[acl.deny]' >> $config
+  $ do_push barney
+  Pushing as user barney
+  hgrc = """
+  [hooks]
+  pretxnchangegroup.acl = python:hgext.acl.hook
+  [acl]
+  sources = push
+  [acl.allow]
+  foo/** = fred
+  [acl.deny]
+  """
+  pushing to ../b
+  searching for changes
+  common changesets up to 6675d58eff77
+  3 changesets found
+  list of changesets:
+  ef1ea85a6374b77d6da9dcda9541f498f2d17df7
+  f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
+  911600dab2ae7a9baff75958b84fe606851ce955
+  adding changesets
+  bundling changes: 0 chunks
+  bundling changes: 1 chunks
+  bundling changes: 2 chunks
+  bundling changes: 3 chunks
+  bundling changes: 4 chunks
+  bundling changes: 5 chunks
+  bundling changes: 6 chunks
+  bundling changes: 7 chunks
+  bundling changes: 8 chunks
+  bundling changes: 9 chunks
+  bundling manifests: 0 chunks
+  bundling manifests: 1 chunks
+  bundling manifests: 2 chunks
+  bundling manifests: 3 chunks
+  bundling manifests: 4 chunks
+  bundling manifests: 5 chunks
+  bundling manifests: 6 chunks
+  bundling manifests: 7 chunks
+  bundling manifests: 8 chunks
+  bundling manifests: 9 chunks
+  bundling files: foo/Bar/file.txt 0 chunks
+  bundling files: foo/Bar/file.txt 1 chunks
+  bundling files: foo/Bar/file.txt 2 chunks
+  bundling files: foo/Bar/file.txt 3 chunks
+  bundling files: foo/file.txt 4 chunks
+  bundling files: foo/file.txt 5 chunks
+  bundling files: foo/file.txt 6 chunks
+  bundling files: foo/file.txt 7 chunks
+  bundling files: quux/file.py 8 chunks
+  bundling files: quux/file.py 9 chunks
+  bundling files: quux/file.py 10 chunks
+  bundling files: quux/file.py 11 chunks
+  changesets: 1 chunks
+  add changeset ef1ea85a6374
+  changesets: 2 chunks
+  add changeset f9cafe1212c8
+  changesets: 3 chunks
+  add changeset 911600dab2ae
+  adding manifests
+  manifests: 1/3 chunks (33.33%)
+  manifests: 2/3 chunks (66.67%)
+  manifests: 3/3 chunks (100.00%)
+  adding file changes
+  adding foo/Bar/file.txt revisions
+  files: 1/3 chunks (33.33%)
+  adding foo/file.txt revisions
+  files: 2/3 chunks (66.67%)
+  adding quux/file.py revisions
+  files: 3/3 chunks (100.00%)
+  added 3 changesets with 3 changes to 3 files
+  calling hook pretxnchangegroup.acl: hgext.acl.hook
+  acl: acl.allow.branches not enabled
+  acl: acl.deny.branches not enabled
+  acl: acl.allow enabled, 0 entries for user barney
+  acl: acl.deny enabled, 0 entries for user barney
+  acl: branch access granted: "ef1ea85a6374" on branch "default"
+  acl: user barney not allowed on foo/file.txt
+  error: pretxnchangegroup.acl hook failed: acl: access denied for changeset ef1ea85a6374
+  transaction abort!
+  rollback completed
+  abort: acl: access denied for changeset ef1ea85a6374
+  no rollback information available
+  0:6675d58eff77
+  
+
+fred is allowed inside foo/, but not foo/bar/ (case matters)
+
+  $ echo 'foo/bar/** = fred' >> $config
+  $ do_push fred
+  Pushing as user fred
+  hgrc = """
+  [hooks]
+  pretxnchangegroup.acl = python:hgext.acl.hook
+  [acl]
+  sources = push
+  [acl.allow]
+  foo/** = fred
+  [acl.deny]
+  foo/bar/** = fred
+  """
+  pushing to ../b
+  searching for changes
+  common changesets up to 6675d58eff77
+  3 changesets found
+  list of changesets:
+  ef1ea85a6374b77d6da9dcda9541f498f2d17df7
+  f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
+  911600dab2ae7a9baff75958b84fe606851ce955
+  adding changesets
+  bundling changes: 0 chunks
+  bundling changes: 1 chunks
+  bundling changes: 2 chunks
+  bundling changes: 3 chunks
+  bundling changes: 4 chunks
+  bundling changes: 5 chunks
+  bundling changes: 6 chunks
+  bundling changes: 7 chunks
+  bundling changes: 8 chunks
+  bundling changes: 9 chunks
+  bundling manifests: 0 chunks
+  bundling manifests: 1 chunks
+  bundling manifests: 2 chunks
+  bundling manifests: 3 chunks
+  bundling manifests: 4 chunks
+  bundling manifests: 5 chunks
+  bundling manifests: 6 chunks
+  bundling manifests: 7 chunks
+  bundling manifests: 8 chunks
+  bundling manifests: 9 chunks
+  bundling files: foo/Bar/file.txt 0 chunks
+  bundling files: foo/Bar/file.txt 1 chunks
+  bundling files: foo/Bar/file.txt 2 chunks
+  bundling files: foo/Bar/file.txt 3 chunks
+  bundling files: foo/file.txt 4 chunks
+  bundling files: foo/file.txt 5 chunks
+  bundling files: foo/file.txt 6 chunks
+  bundling files: foo/file.txt 7 chunks
+  bundling files: quux/file.py 8 chunks
+  bundling files: quux/file.py 9 chunks
+  bundling files: quux/file.py 10 chunks
+  bundling files: quux/file.py 11 chunks
+  changesets: 1 chunks
+  add changeset ef1ea85a6374
+  changesets: 2 chunks
+  add changeset f9cafe1212c8
+  changesets: 3 chunks
+  add changeset 911600dab2ae
+  adding manifests
+  manifests: 1/3 chunks (33.33%)
+  manifests: 2/3 chunks (66.67%)
+  manifests: 3/3 chunks (100.00%)
+  adding file changes
+  adding foo/Bar/file.txt revisions
+  files: 1/3 chunks (33.33%)
+  adding foo/file.txt revisions
+  files: 2/3 chunks (66.67%)
+  adding quux/file.py revisions
+  files: 3/3 chunks (100.00%)
+  added 3 changesets with 3 changes to 3 files
+  calling hook pretxnchangegroup.acl: hgext.acl.hook
+  acl: acl.allow.branches not enabled
+  acl: acl.deny.branches not enabled
+  acl: acl.allow enabled, 1 entries for user fred
+  acl: acl.deny enabled, 1 entries for user fred
+  acl: branch access granted: "ef1ea85a6374" on branch "default"
+  acl: allowing changeset ef1ea85a6374
+  acl: branch access granted: "f9cafe1212c8" on branch "default"
+  acl: allowing changeset f9cafe1212c8
+  acl: branch access granted: "911600dab2ae" on branch "default"
+  acl: user fred not allowed on quux/file.py
+  error: pretxnchangegroup.acl hook failed: acl: access denied for changeset 911600dab2ae
+  transaction abort!
+  rollback completed
+  abort: acl: access denied for changeset 911600dab2ae
+  no rollback information available
+  0:6675d58eff77
+  
+
+fred is allowed inside foo/, but not foo/Bar/
+
+  $ echo 'foo/Bar/** = fred' >> $config
+  $ do_push fred
+  Pushing as user fred
+  hgrc = """
+  [hooks]
+  pretxnchangegroup.acl = python:hgext.acl.hook
+  [acl]
+  sources = push
+  [acl.allow]
+  foo/** = fred
+  [acl.deny]
+  foo/bar/** = fred
+  foo/Bar/** = fred
+  """
+  pushing to ../b
+  searching for changes
+  common changesets up to 6675d58eff77
+  3 changesets found
+  list of changesets:
+  ef1ea85a6374b77d6da9dcda9541f498f2d17df7
+  f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
+  911600dab2ae7a9baff75958b84fe606851ce955
+  adding changesets
+  bundling changes: 0 chunks
+  bundling changes: 1 chunks
+  bundling changes: 2 chunks
+  bundling changes: 3 chunks
+  bundling changes: 4 chunks
+  bundling changes: 5 chunks
+  bundling changes: 6 chunks
+  bundling changes: 7 chunks
+  bundling changes: 8 chunks
+  bundling changes: 9 chunks
+  bundling manifests: 0 chunks
+  bundling manifests: 1 chunks
+  bundling manifests: 2 chunks
+  bundling manifests: 3 chunks
+  bundling manifests: 4 chunks
+  bundling manifests: 5 chunks
+  bundling manifests: 6 chunks
+  bundling manifests: 7 chunks
+  bundling manifests: 8 chunks
+  bundling manifests: 9 chunks
+  bundling files: foo/Bar/file.txt 0 chunks
+  bundling files: foo/Bar/file.txt 1 chunks
+  bundling files: foo/Bar/file.txt 2 chunks
+  bundling files: foo/Bar/file.txt 3 chunks
+  bundling files: foo/file.txt 4 chunks
+  bundling files: foo/file.txt 5 chunks
+  bundling files: foo/file.txt 6 chunks
+  bundling files: foo/file.txt 7 chunks
+  bundling files: quux/file.py 8 chunks
+  bundling files: quux/file.py 9 chunks
+  bundling files: quux/file.py 10 chunks
+  bundling files: quux/file.py 11 chunks
+  changesets: 1 chunks
+  add changeset ef1ea85a6374
+  changesets: 2 chunks
+  add changeset f9cafe1212c8
+  changesets: 3 chunks
+  add changeset 911600dab2ae
+  adding manifests
+  manifests: 1/3 chunks (33.33%)
+  manifests: 2/3 chunks (66.67%)
+  manifests: 3/3 chunks (100.00%)
+  adding file changes
+  adding foo/Bar/file.txt revisions
+  files: 1/3 chunks (33.33%)
+  adding foo/file.txt revisions
+  files: 2/3 chunks (66.67%)
+  adding quux/file.py revisions
+  files: 3/3 chunks (100.00%)
+  added 3 changesets with 3 changes to 3 files
+  calling hook pretxnchangegroup.acl: hgext.acl.hook
+  acl: acl.allow.branches not enabled
+  acl: acl.deny.branches not enabled
+  acl: acl.allow enabled, 1 entries for user fred
+  acl: acl.deny enabled, 2 entries for user fred
+  acl: branch access granted: "ef1ea85a6374" on branch "default"
+  acl: allowing changeset ef1ea85a6374
+  acl: branch access granted: "f9cafe1212c8" on branch "default"
+  acl: user fred denied on foo/Bar/file.txt
+  error: pretxnchangegroup.acl hook failed: acl: access denied for changeset f9cafe1212c8
+  transaction abort!
+  rollback completed
+  abort: acl: access denied for changeset f9cafe1212c8
+  no rollback information available
+  0:6675d58eff77
+  
+
+  $ echo 'barney is not mentioned => not allowed anywhere'
+  barney is not mentioned => not allowed anywhere
+  $ do_push barney
+  Pushing as user barney
+  hgrc = """
+  [hooks]
+  pretxnchangegroup.acl = python:hgext.acl.hook
+  [acl]
+  sources = push
+  [acl.allow]
+  foo/** = fred
+  [acl.deny]
+  foo/bar/** = fred
+  foo/Bar/** = fred
+  """
+  pushing to ../b
+  searching for changes
+  common changesets up to 6675d58eff77
+  3 changesets found
+  list of changesets:
+  ef1ea85a6374b77d6da9dcda9541f498f2d17df7
+  f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
+  911600dab2ae7a9baff75958b84fe606851ce955
+  adding changesets
+  bundling changes: 0 chunks
+  bundling changes: 1 chunks
+  bundling changes: 2 chunks
+  bundling changes: 3 chunks
+  bundling changes: 4 chunks
+  bundling changes: 5 chunks
+  bundling changes: 6 chunks
+  bundling changes: 7 chunks
+  bundling changes: 8 chunks
+  bundling changes: 9 chunks
+  bundling manifests: 0 chunks
+  bundling manifests: 1 chunks
+  bundling manifests: 2 chunks
+  bundling manifests: 3 chunks
+  bundling manifests: 4 chunks
+  bundling manifests: 5 chunks
+  bundling manifests: 6 chunks
+  bundling manifests: 7 chunks
+  bundling manifests: 8 chunks
+  bundling manifests: 9 chunks
+  bundling files: foo/Bar/file.txt 0 chunks
+  bundling files: foo/Bar/file.txt 1 chunks
+  bundling files: foo/Bar/file.txt 2 chunks
+  bundling files: foo/Bar/file.txt 3 chunks
+  bundling files: foo/file.txt 4 chunks
+  bundling files: foo/file.txt 5 chunks
+  bundling files: foo/file.txt 6 chunks
+  bundling files: foo/file.txt 7 chunks
+  bundling files: quux/file.py 8 chunks
+  bundling files: quux/file.py 9 chunks
+  bundling files: quux/file.py 10 chunks
+  bundling files: quux/file.py 11 chunks
+  changesets: 1 chunks
+  add changeset ef1ea85a6374
+  changesets: 2 chunks
+  add changeset f9cafe1212c8
+  changesets: 3 chunks
+  add changeset 911600dab2ae
+  adding manifests
+  manifests: 1/3 chunks (33.33%)
+  manifests: 2/3 chunks (66.67%)
+  manifests: 3/3 chunks (100.00%)
+  adding file changes
+  adding foo/Bar/file.txt revisions
+  files: 1/3 chunks (33.33%)
+  adding foo/file.txt revisions
+  files: 2/3 chunks (66.67%)
+  adding quux/file.py revisions
+  files: 3/3 chunks (100.00%)
+  added 3 changesets with 3 changes to 3 files
+  calling hook pretxnchangegroup.acl: hgext.acl.hook
+  acl: acl.allow.branches not enabled
+  acl: acl.deny.branches not enabled
+  acl: acl.allow enabled, 0 entries for user barney
+  acl: acl.deny enabled, 0 entries for user barney
+  acl: branch access granted: "ef1ea85a6374" on branch "default"
+  acl: user barney not allowed on foo/file.txt
+  error: pretxnchangegroup.acl hook failed: acl: access denied for changeset ef1ea85a6374
+  transaction abort!
+  rollback completed
+  abort: acl: access denied for changeset ef1ea85a6374
+  no rollback information available
+  0:6675d58eff77
+  
+
+barney is allowed everywhere
+
+  $ echo '[acl.allow]' >> $config
+  $ echo '** = barney' >> $config
+  $ do_push barney
+  Pushing as user barney
+  hgrc = """
+  [hooks]
+  pretxnchangegroup.acl = python:hgext.acl.hook
+  [acl]
+  sources = push
+  [acl.allow]
+  foo/** = fred
+  [acl.deny]
+  foo/bar/** = fred
+  foo/Bar/** = fred
+  [acl.allow]
+  ** = barney
+  """
+  pushing to ../b
+  searching for changes
+  common changesets up to 6675d58eff77
+  3 changesets found
+  list of changesets:
+  ef1ea85a6374b77d6da9dcda9541f498f2d17df7
+  f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
+  911600dab2ae7a9baff75958b84fe606851ce955
+  adding changesets
+  bundling changes: 0 chunks
+  bundling changes: 1 chunks
+  bundling changes: 2 chunks
+  bundling changes: 3 chunks
+  bundling changes: 4 chunks
+  bundling changes: 5 chunks
+  bundling changes: 6 chunks
+  bundling changes: 7 chunks
+  bundling changes: 8 chunks
+  bundling changes: 9 chunks
+  bundling manifests: 0 chunks
+  bundling manifests: 1 chunks
+  bundling manifests: 2 chunks
+  bundling manifests: 3 chunks
+  bundling manifests: 4 chunks
+  bundling manifests: 5 chunks
+  bundling manifests: 6 chunks
+  bundling manifests: 7 chunks
+  bundling manifests: 8 chunks
+  bundling manifests: 9 chunks
+  bundling files: foo/Bar/file.txt 0 chunks
+  bundling files: foo/Bar/file.txt 1 chunks
+  bundling files: foo/Bar/file.txt 2 chunks
+  bundling files: foo/Bar/file.txt 3 chunks
+  bundling files: foo/file.txt 4 chunks
+  bundling files: foo/file.txt 5 chunks
+  bundling files: foo/file.txt 6 chunks
+  bundling files: foo/file.txt 7 chunks
+  bundling files: quux/file.py 8 chunks
+  bundling files: quux/file.py 9 chunks
+  bundling files: quux/file.py 10 chunks
+  bundling files: quux/file.py 11 chunks
+  changesets: 1 chunks
+  add changeset ef1ea85a6374
+  changesets: 2 chunks
+  add changeset f9cafe1212c8
+  changesets: 3 chunks
+  add changeset 911600dab2ae
+  adding manifests
+  manifests: 1/3 chunks (33.33%)
+  manifests: 2/3 chunks (66.67%)
+  manifests: 3/3 chunks (100.00%)
+  adding file changes
+  adding foo/Bar/file.txt revisions
+  files: 1/3 chunks (33.33%)
+  adding foo/file.txt revisions
+  files: 2/3 chunks (66.67%)
+  adding quux/file.py revisions
+  files: 3/3 chunks (100.00%)
+  added 3 changesets with 3 changes to 3 files
+  calling hook pretxnchangegroup.acl: hgext.acl.hook
+  acl: acl.allow.branches not enabled
+  acl: acl.deny.branches not enabled
+  acl: acl.allow enabled, 1 entries for user barney
+  acl: acl.deny enabled, 0 entries for user barney
+  acl: branch access granted: "ef1ea85a6374" on branch "default"
+  acl: allowing changeset ef1ea85a6374
+  acl: branch access granted: "f9cafe1212c8" on branch "default"
+  acl: allowing changeset f9cafe1212c8
+  acl: branch access granted: "911600dab2ae" on branch "default"
+  acl: allowing changeset 911600dab2ae
+  updating the branch cache
+  rolling back to revision 0 (undo push)
+  0:6675d58eff77
+  
+
+wilma can change files with a .txt extension
+
+  $ echo '**/*.txt = wilma' >> $config
+  $ do_push wilma
+  Pushing as user wilma
+  hgrc = """
+  [hooks]
+  pretxnchangegroup.acl = python:hgext.acl.hook
+  [acl]
+  sources = push
+  [acl.allow]
+  foo/** = fred
+  [acl.deny]
+  foo/bar/** = fred
+  foo/Bar/** = fred
+  [acl.allow]
+  ** = barney
+  **/*.txt = wilma
+  """
+  pushing to ../b
+  searching for changes
+  common changesets up to 6675d58eff77
+  invalidating branch cache (tip differs)
+  3 changesets found
+  list of changesets:
+  ef1ea85a6374b77d6da9dcda9541f498f2d17df7
+  f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
+  911600dab2ae7a9baff75958b84fe606851ce955
+  adding changesets
+  bundling changes: 0 chunks
+  bundling changes: 1 chunks
+  bundling changes: 2 chunks
+  bundling changes: 3 chunks
+  bundling changes: 4 chunks
+  bundling changes: 5 chunks
+  bundling changes: 6 chunks
+  bundling changes: 7 chunks
+  bundling changes: 8 chunks
+  bundling changes: 9 chunks
+  bundling manifests: 0 chunks
+  bundling manifests: 1 chunks
+  bundling manifests: 2 chunks
+  bundling manifests: 3 chunks
+  bundling manifests: 4 chunks
+  bundling manifests: 5 chunks
+  bundling manifests: 6 chunks
+  bundling manifests: 7 chunks
+  bundling manifests: 8 chunks
+  bundling manifests: 9 chunks
+  bundling files: foo/Bar/file.txt 0 chunks
+  bundling files: foo/Bar/file.txt 1 chunks
+  bundling files: foo/Bar/file.txt 2 chunks
+  bundling files: foo/Bar/file.txt 3 chunks
+  bundling files: foo/file.txt 4 chunks
+  bundling files: foo/file.txt 5 chunks
+  bundling files: foo/file.txt 6 chunks
+  bundling files: foo/file.txt 7 chunks
+  bundling files: quux/file.py 8 chunks
+  bundling files: quux/file.py 9 chunks
+  bundling files: quux/file.py 10 chunks
+  bundling files: quux/file.py 11 chunks
+  changesets: 1 chunks
+  add changeset ef1ea85a6374
+  changesets: 2 chunks
+  add changeset f9cafe1212c8
+  changesets: 3 chunks
+  add changeset 911600dab2ae
+  adding manifests
+  manifests: 1/3 chunks (33.33%)
+  manifests: 2/3 chunks (66.67%)
+  manifests: 3/3 chunks (100.00%)
+  adding file changes
+  adding foo/Bar/file.txt revisions
+  files: 1/3 chunks (33.33%)
+  adding foo/file.txt revisions
+  files: 2/3 chunks (66.67%)
+  adding quux/file.py revisions
+  files: 3/3 chunks (100.00%)
+  added 3 changesets with 3 changes to 3 files
+  calling hook pretxnchangegroup.acl: hgext.acl.hook
+  acl: acl.allow.branches not enabled
+  acl: acl.deny.branches not enabled
+  acl: acl.allow enabled, 1 entries for user wilma
+  acl: acl.deny enabled, 0 entries for user wilma
+  acl: branch access granted: "ef1ea85a6374" on branch "default"
+  acl: allowing changeset ef1ea85a6374
+  acl: branch access granted: "f9cafe1212c8" on branch "default"
+  acl: allowing changeset f9cafe1212c8
+  acl: branch access granted: "911600dab2ae" on branch "default"
+  acl: user wilma not allowed on quux/file.py
+  error: pretxnchangegroup.acl hook failed: acl: access denied for changeset 911600dab2ae
+  transaction abort!
+  rollback completed
+  abort: acl: access denied for changeset 911600dab2ae
+  no rollback information available
+  0:6675d58eff77
+  
+
+file specified by acl.config does not exist
+
+  $ echo '[acl]' >> $config
+  $ echo 'config = ../acl.config' >> $config
+  $ do_push barney
+  Pushing as user barney
+  hgrc = """
+  [hooks]
+  pretxnchangegroup.acl = python:hgext.acl.hook
+  [acl]
+  sources = push
+  [acl.allow]
+  foo/** = fred
+  [acl.deny]
+  foo/bar/** = fred
+  foo/Bar/** = fred
+  [acl.allow]
+  ** = barney
+  **/*.txt = wilma
+  [acl]
+  config = ../acl.config
+  """
+  pushing to ../b
+  searching for changes
+  common changesets up to 6675d58eff77
+  3 changesets found
+  list of changesets:
+  ef1ea85a6374b77d6da9dcda9541f498f2d17df7
+  f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
+  911600dab2ae7a9baff75958b84fe606851ce955
+  adding changesets
+  bundling changes: 0 chunks
+  bundling changes: 1 chunks
+  bundling changes: 2 chunks
+  bundling changes: 3 chunks
+  bundling changes: 4 chunks
+  bundling changes: 5 chunks
+  bundling changes: 6 chunks
+  bundling changes: 7 chunks
+  bundling changes: 8 chunks
+  bundling changes: 9 chunks
+  bundling manifests: 0 chunks
+  bundling manifests: 1 chunks
+  bundling manifests: 2 chunks
+  bundling manifests: 3 chunks
+  bundling manifests: 4 chunks
+  bundling manifests: 5 chunks
+  bundling manifests: 6 chunks
+  bundling manifests: 7 chunks
+  bundling manifests: 8 chunks
+  bundling manifests: 9 chunks
+  bundling files: foo/Bar/file.txt 0 chunks
+  bundling files: foo/Bar/file.txt 1 chunks
+  bundling files: foo/Bar/file.txt 2 chunks
+  bundling files: foo/Bar/file.txt 3 chunks
+  bundling files: foo/file.txt 4 chunks
+  bundling files: foo/file.txt 5 chunks
+  bundling files: foo/file.txt 6 chunks
+  bundling files: foo/file.txt 7 chunks
+  bundling files: quux/file.py 8 chunks
+  bundling files: quux/file.py 9 chunks
+  bundling files: quux/file.py 10 chunks
+  bundling files: quux/file.py 11 chunks
+  changesets: 1 chunks
+  add changeset ef1ea85a6374
+  changesets: 2 chunks
+  add changeset f9cafe1212c8
+  changesets: 3 chunks
+  add changeset 911600dab2ae
+  adding manifests
+  manifests: 1/3 chunks (33.33%)
+  manifests: 2/3 chunks (66.67%)
+  manifests: 3/3 chunks (100.00%)
+  adding file changes
+  adding foo/Bar/file.txt revisions
+  files: 1/3 chunks (33.33%)
+  adding foo/file.txt revisions
+  files: 2/3 chunks (66.67%)
+  adding quux/file.py revisions
+  files: 3/3 chunks (100.00%)
+  added 3 changesets with 3 changes to 3 files
+  calling hook pretxnchangegroup.acl: hgext.acl.hook
+  error: pretxnchangegroup.acl hook raised an exception: [Errno 2] No such file or directory: '../acl.config'
+  transaction abort!
+  rollback completed
+  abort: No such file or directory: ../acl.config
+  no rollback information available
+  0:6675d58eff77
+  
+
+betty is allowed inside foo/ by a acl.config file
+
+  $ echo '[acl.allow]' >> acl.config
+  $ echo 'foo/** = betty' >> acl.config
+  $ do_push betty
+  Pushing as user betty
+  hgrc = """
+  [hooks]
+  pretxnchangegroup.acl = python:hgext.acl.hook
+  [acl]
+  sources = push
+  [acl.allow]
+  foo/** = fred
+  [acl.deny]
+  foo/bar/** = fred
+  foo/Bar/** = fred
+  [acl.allow]
+  ** = barney
+  **/*.txt = wilma
+  [acl]
+  config = ../acl.config
+  """
+  acl.config = """
+  [acl.allow]
+  foo/** = betty
+  """
+  pushing to ../b
+  searching for changes
+  common changesets up to 6675d58eff77
+  3 changesets found
+  list of changesets:
+  ef1ea85a6374b77d6da9dcda9541f498f2d17df7
+  f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
+  911600dab2ae7a9baff75958b84fe606851ce955
+  adding changesets
+  bundling changes: 0 chunks
+  bundling changes: 1 chunks
+  bundling changes: 2 chunks
+  bundling changes: 3 chunks
+  bundling changes: 4 chunks
+  bundling changes: 5 chunks
+  bundling changes: 6 chunks
+  bundling changes: 7 chunks
+  bundling changes: 8 chunks
+  bundling changes: 9 chunks
+  bundling manifests: 0 chunks
+  bundling manifests: 1 chunks
+  bundling manifests: 2 chunks
+  bundling manifests: 3 chunks
+  bundling manifests: 4 chunks
+  bundling manifests: 5 chunks
+  bundling manifests: 6 chunks
+  bundling manifests: 7 chunks
+  bundling manifests: 8 chunks
+  bundling manifests: 9 chunks
+  bundling files: foo/Bar/file.txt 0 chunks
+  bundling files: foo/Bar/file.txt 1 chunks
+  bundling files: foo/Bar/file.txt 2 chunks
+  bundling files: foo/Bar/file.txt 3 chunks
+  bundling files: foo/file.txt 4 chunks
+  bundling files: foo/file.txt 5 chunks
+  bundling files: foo/file.txt 6 chunks
+  bundling files: foo/file.txt 7 chunks
+  bundling files: quux/file.py 8 chunks
+  bundling files: quux/file.py 9 chunks
+  bundling files: quux/file.py 10 chunks
+  bundling files: quux/file.py 11 chunks
+  changesets: 1 chunks
+  add changeset ef1ea85a6374
+  changesets: 2 chunks
+  add changeset f9cafe1212c8
+  changesets: 3 chunks
+  add changeset 911600dab2ae
+  adding manifests
+  manifests: 1/3 chunks (33.33%)
+  manifests: 2/3 chunks (66.67%)
+  manifests: 3/3 chunks (100.00%)
+  adding file changes
+  adding foo/Bar/file.txt revisions
+  files: 1/3 chunks (33.33%)
+  adding foo/file.txt revisions
+  files: 2/3 chunks (66.67%)
+  adding quux/file.py revisions
+  files: 3/3 chunks (100.00%)
+  added 3 changesets with 3 changes to 3 files
+  calling hook pretxnchangegroup.acl: hgext.acl.hook
+  acl: acl.allow.branches not enabled
+  acl: acl.deny.branches not enabled
+  acl: acl.allow enabled, 1 entries for user betty
+  acl: acl.deny enabled, 0 entries for user betty
+  acl: branch access granted: "ef1ea85a6374" on branch "default"
+  acl: allowing changeset ef1ea85a6374
+  acl: branch access granted: "f9cafe1212c8" on branch "default"
+  acl: allowing changeset f9cafe1212c8
+  acl: branch access granted: "911600dab2ae" on branch "default"
+  acl: user betty not allowed on quux/file.py
+  error: pretxnchangegroup.acl hook failed: acl: access denied for changeset 911600dab2ae
+  transaction abort!
+  rollback completed
+  abort: acl: access denied for changeset 911600dab2ae
+  no rollback information available
+  0:6675d58eff77
+  
+
+acl.config can set only [acl.allow]/[acl.deny]
+
+  $ echo '[hooks]' >> acl.config
+  $ echo 'changegroup.acl = false' >> acl.config
+  $ do_push barney
+  Pushing as user barney
+  hgrc = """
+  [hooks]
+  pretxnchangegroup.acl = python:hgext.acl.hook
+  [acl]
+  sources = push
+  [acl.allow]
+  foo/** = fred
+  [acl.deny]
+  foo/bar/** = fred
+  foo/Bar/** = fred
+  [acl.allow]
+  ** = barney
+  **/*.txt = wilma
+  [acl]
+  config = ../acl.config
+  """
+  acl.config = """
+  [acl.allow]
+  foo/** = betty
+  [hooks]
+  changegroup.acl = false
+  """
+  pushing to ../b
+  searching for changes
+  common changesets up to 6675d58eff77
+  3 changesets found
+  list of changesets:
+  ef1ea85a6374b77d6da9dcda9541f498f2d17df7
+  f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
+  911600dab2ae7a9baff75958b84fe606851ce955
+  adding changesets
+  bundling changes: 0 chunks
+  bundling changes: 1 chunks
+  bundling changes: 2 chunks
+  bundling changes: 3 chunks
+  bundling changes: 4 chunks
+  bundling changes: 5 chunks
+  bundling changes: 6 chunks
+  bundling changes: 7 chunks
+  bundling changes: 8 chunks
+  bundling changes: 9 chunks
+  bundling manifests: 0 chunks
+  bundling manifests: 1 chunks
+  bundling manifests: 2 chunks
+  bundling manifests: 3 chunks
+  bundling manifests: 4 chunks
+  bundling manifests: 5 chunks
+  bundling manifests: 6 chunks
+  bundling manifests: 7 chunks
+  bundling manifests: 8 chunks
+  bundling manifests: 9 chunks
+  bundling files: foo/Bar/file.txt 0 chunks
+  bundling files: foo/Bar/file.txt 1 chunks
+  bundling files: foo/Bar/file.txt 2 chunks
+  bundling files: foo/Bar/file.txt 3 chunks
+  bundling files: foo/file.txt 4 chunks
+  bundling files: foo/file.txt 5 chunks
+  bundling files: foo/file.txt 6 chunks
+  bundling files: foo/file.txt 7 chunks
+  bundling files: quux/file.py 8 chunks
+  bundling files: quux/file.py 9 chunks
+  bundling files: quux/file.py 10 chunks
+  bundling files: quux/file.py 11 chunks
+  changesets: 1 chunks
+  add changeset ef1ea85a6374
+  changesets: 2 chunks
+  add changeset f9cafe1212c8
+  changesets: 3 chunks
+  add changeset 911600dab2ae
+  adding manifests
+  manifests: 1/3 chunks (33.33%)
+  manifests: 2/3 chunks (66.67%)
+  manifests: 3/3 chunks (100.00%)
+  adding file changes
+  adding foo/Bar/file.txt revisions
+  files: 1/3 chunks (33.33%)
+  adding foo/file.txt revisions
+  files: 2/3 chunks (66.67%)
+  adding quux/file.py revisions
+  files: 3/3 chunks (100.00%)
+  added 3 changesets with 3 changes to 3 files
+  calling hook pretxnchangegroup.acl: hgext.acl.hook
+  acl: acl.allow.branches not enabled
+  acl: acl.deny.branches not enabled
+  acl: acl.allow enabled, 1 entries for user barney
+  acl: acl.deny enabled, 0 entries for user barney
+  acl: branch access granted: "ef1ea85a6374" on branch "default"
+  acl: allowing changeset ef1ea85a6374
+  acl: branch access granted: "f9cafe1212c8" on branch "default"
+  acl: allowing changeset f9cafe1212c8
+  acl: branch access granted: "911600dab2ae" on branch "default"
+  acl: allowing changeset 911600dab2ae
+  updating the branch cache
+  rolling back to revision 0 (undo push)
+  0:6675d58eff77
+  
+
+asterisk
+
+  $ init_config
+
+asterisk test
+
+  $ echo '[acl.allow]' >> $config
+  $ echo "** = fred" >> $config
+
+fred is always allowed
+
+  $ do_push fred
+  Pushing as user fred
+  hgrc = """
+  [acl]
+  sources = push
+  [extensions]
+  [acl.allow]
+  ** = fred
+  """
+  pushing to ../b
+  searching for changes
+  common changesets up to 6675d58eff77
+  invalidating branch cache (tip differs)
+  3 changesets found
+  list of changesets:
+  ef1ea85a6374b77d6da9dcda9541f498f2d17df7
+  f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
+  911600dab2ae7a9baff75958b84fe606851ce955
+  adding changesets
+  bundling changes: 0 chunks
+  bundling changes: 1 chunks
+  bundling changes: 2 chunks
+  bundling changes: 3 chunks
+  bundling changes: 4 chunks
+  bundling changes: 5 chunks
+  bundling changes: 6 chunks
+  bundling changes: 7 chunks
+  bundling changes: 8 chunks
+  bundling changes: 9 chunks
+  bundling manifests: 0 chunks
+  bundling manifests: 1 chunks
+  bundling manifests: 2 chunks
+  bundling manifests: 3 chunks
+  bundling manifests: 4 chunks
+  bundling manifests: 5 chunks
+  bundling manifests: 6 chunks
+  bundling manifests: 7 chunks
+  bundling manifests: 8 chunks
+  bundling manifests: 9 chunks
+  bundling files: foo/Bar/file.txt 0 chunks
+  bundling files: foo/Bar/file.txt 1 chunks
+  bundling files: foo/Bar/file.txt 2 chunks
+  bundling files: foo/Bar/file.txt 3 chunks
+  bundling files: foo/file.txt 4 chunks
+  bundling files: foo/file.txt 5 chunks
+  bundling files: foo/file.txt 6 chunks
+  bundling files: foo/file.txt 7 chunks
+  bundling files: quux/file.py 8 chunks
+  bundling files: quux/file.py 9 chunks
+  bundling files: quux/file.py 10 chunks
+  bundling files: quux/file.py 11 chunks
+  changesets: 1 chunks
+  add changeset ef1ea85a6374
+  changesets: 2 chunks
+  add changeset f9cafe1212c8
+  changesets: 3 chunks
+  add changeset 911600dab2ae
+  adding manifests
+  manifests: 1/3 chunks (33.33%)
+  manifests: 2/3 chunks (66.67%)
+  manifests: 3/3 chunks (100.00%)
+  adding file changes
+  adding foo/Bar/file.txt revisions
+  files: 1/3 chunks (33.33%)
+  adding foo/file.txt revisions
+  files: 2/3 chunks (66.67%)
+  adding quux/file.py revisions
+  files: 3/3 chunks (100.00%)
+  added 3 changesets with 3 changes to 3 files
+  calling hook pretxnchangegroup.acl: hgext.acl.hook
+  acl: acl.allow.branches not enabled
+  acl: acl.deny.branches not enabled
+  acl: acl.allow enabled, 1 entries for user fred
+  acl: acl.deny not enabled
+  acl: branch access granted: "ef1ea85a6374" on branch "default"
+  acl: allowing changeset ef1ea85a6374
+  acl: branch access granted: "f9cafe1212c8" on branch "default"
+  acl: allowing changeset f9cafe1212c8
+  acl: branch access granted: "911600dab2ae" on branch "default"
+  acl: allowing changeset 911600dab2ae
+  updating the branch cache
+  rolling back to revision 0 (undo push)
+  0:6675d58eff77
+  
+
+  $ echo '[acl.deny]' >> $config
+  $ echo "foo/Bar/** = *" >> $config
+
+no one is allowed inside foo/Bar/
+
+  $ do_push fred
+  Pushing as user fred
+  hgrc = """
+  [acl]
+  sources = push
+  [extensions]
+  [acl.allow]
+  ** = fred
+  [acl.deny]
+  foo/Bar/** = *
+  """
+  pushing to ../b
+  searching for changes
+  common changesets up to 6675d58eff77
+  invalidating branch cache (tip differs)
+  3 changesets found
+  list of changesets:
+  ef1ea85a6374b77d6da9dcda9541f498f2d17df7
+  f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
+  911600dab2ae7a9baff75958b84fe606851ce955
+  adding changesets
+  bundling changes: 0 chunks
+  bundling changes: 1 chunks
+  bundling changes: 2 chunks
+  bundling changes: 3 chunks
+  bundling changes: 4 chunks
+  bundling changes: 5 chunks
+  bundling changes: 6 chunks
+  bundling changes: 7 chunks
+  bundling changes: 8 chunks
+  bundling changes: 9 chunks
+  bundling manifests: 0 chunks
+  bundling manifests: 1 chunks
+  bundling manifests: 2 chunks
+  bundling manifests: 3 chunks
+  bundling manifests: 4 chunks
+  bundling manifests: 5 chunks
+  bundling manifests: 6 chunks
+  bundling manifests: 7 chunks
+  bundling manifests: 8 chunks
+  bundling manifests: 9 chunks
+  bundling files: foo/Bar/file.txt 0 chunks
+  bundling files: foo/Bar/file.txt 1 chunks
+  bundling files: foo/Bar/file.txt 2 chunks
+  bundling files: foo/Bar/file.txt 3 chunks
+  bundling files: foo/file.txt 4 chunks
+  bundling files: foo/file.txt 5 chunks
+  bundling files: foo/file.txt 6 chunks
+  bundling files: foo/file.txt 7 chunks
+  bundling files: quux/file.py 8 chunks
+  bundling files: quux/file.py 9 chunks
+  bundling files: quux/file.py 10 chunks
+  bundling files: quux/file.py 11 chunks
+  changesets: 1 chunks
+  add changeset ef1ea85a6374
+  changesets: 2 chunks
+  add changeset f9cafe1212c8
+  changesets: 3 chunks
+  add changeset 911600dab2ae
+  adding manifests
+  manifests: 1/3 chunks (33.33%)
+  manifests: 2/3 chunks (66.67%)
+  manifests: 3/3 chunks (100.00%)
+  adding file changes
+  adding foo/Bar/file.txt revisions
+  files: 1/3 chunks (33.33%)
+  adding foo/file.txt revisions
+  files: 2/3 chunks (66.67%)
+  adding quux/file.py revisions
+  files: 3/3 chunks (100.00%)
+  added 3 changesets with 3 changes to 3 files
+  calling hook pretxnchangegroup.acl: hgext.acl.hook
+  acl: acl.allow.branches not enabled
+  acl: acl.deny.branches not enabled
+  acl: acl.allow enabled, 1 entries for user fred
+  acl: acl.deny enabled, 1 entries for user fred
+  acl: branch access granted: "ef1ea85a6374" on branch "default"
+  acl: allowing changeset ef1ea85a6374
+  acl: branch access granted: "f9cafe1212c8" on branch "default"
+  acl: user fred denied on foo/Bar/file.txt
+  error: pretxnchangegroup.acl hook failed: acl: access denied for changeset f9cafe1212c8
+  transaction abort!
+  rollback completed
+  abort: acl: access denied for changeset f9cafe1212c8
+  no rollback information available
+  0:6675d58eff77
+  
+
+Groups
+
+  $ init_config
+
+OS-level groups
+
+  $ echo '[acl.allow]' >> $config
+  $ echo "** = @group1" >> $config
+
+@group1 is always allowed
+
+  $ do_push fred
+  Pushing as user fred
+  hgrc = """
+  [acl]
+  sources = push
+  [extensions]
+  [acl.allow]
+  ** = @group1
+  """
+  pushing to ../b
+  searching for changes
+  common changesets up to 6675d58eff77
+  3 changesets found
+  list of changesets:
+  ef1ea85a6374b77d6da9dcda9541f498f2d17df7
+  f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
+  911600dab2ae7a9baff75958b84fe606851ce955
+  adding changesets
+  bundling changes: 0 chunks
+  bundling changes: 1 chunks
+  bundling changes: 2 chunks
+  bundling changes: 3 chunks
+  bundling changes: 4 chunks
+  bundling changes: 5 chunks
+  bundling changes: 6 chunks
+  bundling changes: 7 chunks
+  bundling changes: 8 chunks
+  bundling changes: 9 chunks
+  bundling manifests: 0 chunks
+  bundling manifests: 1 chunks
+  bundling manifests: 2 chunks
+  bundling manifests: 3 chunks
+  bundling manifests: 4 chunks
+  bundling manifests: 5 chunks
+  bundling manifests: 6 chunks
+  bundling manifests: 7 chunks
+  bundling manifests: 8 chunks
+  bundling manifests: 9 chunks
+  bundling files: foo/Bar/file.txt 0 chunks
+  bundling files: foo/Bar/file.txt 1 chunks
+  bundling files: foo/Bar/file.txt 2 chunks
+  bundling files: foo/Bar/file.txt 3 chunks
+  bundling files: foo/file.txt 4 chunks
+  bundling files: foo/file.txt 5 chunks
+  bundling files: foo/file.txt 6 chunks
+  bundling files: foo/file.txt 7 chunks
+  bundling files: quux/file.py 8 chunks
+  bundling files: quux/file.py 9 chunks
+  bundling files: quux/file.py 10 chunks
+  bundling files: quux/file.py 11 chunks
+  changesets: 1 chunks
+  add changeset ef1ea85a6374
+  changesets: 2 chunks
+  add changeset f9cafe1212c8
+  changesets: 3 chunks
+  add changeset 911600dab2ae
+  adding manifests
+  manifests: 1/3 chunks (33.33%)
+  manifests: 2/3 chunks (66.67%)
+  manifests: 3/3 chunks (100.00%)
+  adding file changes
+  adding foo/Bar/file.txt revisions
+  files: 1/3 chunks (33.33%)
+  adding foo/file.txt revisions
+  files: 2/3 chunks (66.67%)
+  adding quux/file.py revisions
+  files: 3/3 chunks (100.00%)
+  added 3 changesets with 3 changes to 3 files
+  calling hook pretxnchangegroup.acl: hgext.acl.hook
+  acl: acl.allow.branches not enabled
+  acl: acl.deny.branches not enabled
+  acl: "group1" not defined in [acl.groups]
+  acl: acl.allow enabled, 1 entries for user fred
+  acl: acl.deny not enabled
+  acl: branch access granted: "ef1ea85a6374" on branch "default"
+  acl: allowing changeset ef1ea85a6374
+  acl: branch access granted: "f9cafe1212c8" on branch "default"
+  acl: allowing changeset f9cafe1212c8
+  acl: branch access granted: "911600dab2ae" on branch "default"
+  acl: allowing changeset 911600dab2ae
+  updating the branch cache
+  rolling back to revision 0 (undo push)
+  0:6675d58eff77
+  
+
+  $ echo '[acl.deny]' >> $config
+  $ echo "foo/Bar/** = @group1" >> $config
+
+@group is allowed inside anything but foo/Bar/
+
+  $ do_push fred
+  Pushing as user fred
+  hgrc = """
+  [acl]
+  sources = push
+  [extensions]
+  [acl.allow]
+  ** = @group1
+  [acl.deny]
+  foo/Bar/** = @group1
+  """
+  pushing to ../b
+  searching for changes
+  common changesets up to 6675d58eff77
+  invalidating branch cache (tip differs)
+  3 changesets found
+  list of changesets:
+  ef1ea85a6374b77d6da9dcda9541f498f2d17df7
+  f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
+  911600dab2ae7a9baff75958b84fe606851ce955
+  adding changesets
+  bundling changes: 0 chunks
+  bundling changes: 1 chunks
+  bundling changes: 2 chunks
+  bundling changes: 3 chunks
+  bundling changes: 4 chunks
+  bundling changes: 5 chunks
+  bundling changes: 6 chunks
+  bundling changes: 7 chunks
+  bundling changes: 8 chunks
+  bundling changes: 9 chunks
+  bundling manifests: 0 chunks
+  bundling manifests: 1 chunks
+  bundling manifests: 2 chunks
+  bundling manifests: 3 chunks
+  bundling manifests: 4 chunks
+  bundling manifests: 5 chunks
+  bundling manifests: 6 chunks
+  bundling manifests: 7 chunks
+  bundling manifests: 8 chunks
+  bundling manifests: 9 chunks
+  bundling files: foo/Bar/file.txt 0 chunks
+  bundling files: foo/Bar/file.txt 1 chunks
+  bundling files: foo/Bar/file.txt 2 chunks
+  bundling files: foo/Bar/file.txt 3 chunks
+  bundling files: foo/file.txt 4 chunks
+  bundling files: foo/file.txt 5 chunks
+  bundling files: foo/file.txt 6 chunks
+  bundling files: foo/file.txt 7 chunks
+  bundling files: quux/file.py 8 chunks
+  bundling files: quux/file.py 9 chunks
+  bundling files: quux/file.py 10 chunks
+  bundling files: quux/file.py 11 chunks
+  changesets: 1 chunks
+  add changeset ef1ea85a6374
+  changesets: 2 chunks
+  add changeset f9cafe1212c8
+  changesets: 3 chunks
+  add changeset 911600dab2ae
+  adding manifests
+  manifests: 1/3 chunks (33.33%)
+  manifests: 2/3 chunks (66.67%)
+  manifests: 3/3 chunks (100.00%)
+  adding file changes
+  adding foo/Bar/file.txt revisions
+  files: 1/3 chunks (33.33%)
+  adding foo/file.txt revisions
+  files: 2/3 chunks (66.67%)
+  adding quux/file.py revisions
+  files: 3/3 chunks (100.00%)
+  added 3 changesets with 3 changes to 3 files
+  calling hook pretxnchangegroup.acl: hgext.acl.hook
+  acl: acl.allow.branches not enabled
+  acl: acl.deny.branches not enabled
+  acl: "group1" not defined in [acl.groups]
+  acl: acl.allow enabled, 1 entries for user fred
+  acl: "group1" not defined in [acl.groups]
+  acl: acl.deny enabled, 1 entries for user fred
+  acl: branch access granted: "ef1ea85a6374" on branch "default"
+  acl: allowing changeset ef1ea85a6374
+  acl: branch access granted: "f9cafe1212c8" on branch "default"
+  acl: user fred denied on foo/Bar/file.txt
+  error: pretxnchangegroup.acl hook failed: acl: access denied for changeset f9cafe1212c8
+  transaction abort!
+  rollback completed
+  abort: acl: access denied for changeset f9cafe1212c8
+  no rollback information available
+  0:6675d58eff77
+  
+
+Invalid group
+
+Disable the fakegroups trick to get real failures
+
+  $ grep -v fakegroups $config > config.tmp
+  $ mv config.tmp $config
+  $ echo '[acl.allow]' >> $config
+  $ echo "** = @unlikelytoexist" >> $config
+  $ do_push fred 2>&1 | grep unlikelytoexist
+  ** = @unlikelytoexist
+  acl: "unlikelytoexist" not defined in [acl.groups]
+  error: pretxnchangegroup.acl hook failed: group 'unlikelytoexist' is undefined
+  abort: group 'unlikelytoexist' is undefined
--- a/tests/test-add	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-#!/bin/sh
-
-hg init a
-cd a
-echo a > a
-hg add -n
-hg st
-hg add
-hg st
-hg forget a
-hg add
-hg st
-
-echo b > b
-hg add -n b
-hg st
-hg add b || echo "failed to add b"
-hg st
-echo % should fail
-hg add b
-hg st
-
-hg ci -m 0 --traceback
-echo % should fail
-hg add a
-
-echo aa > a
-hg ci -m 1
-hg up 0
-echo aaa > a
-hg ci -m 2
-
-hg merge
-hg st
-echo % should fail
-hg add a
-hg st
-hg resolve -m a
-hg ci -m merge
-
-echo % issue683
-hg forget a
-hg add a
-hg st
-hg rm a
-hg st
-echo a > a
-hg add a
-hg st
-
-hg add c && echo "unexpected addition of missing file"
-echo c > c
-hg add d c && echo "unexpected addition of missing file"
-hg st
-
--- a/tests/test-add.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-adding a
-? a
-adding a
-A a
-adding a
-A a
-A a
-? b
-A a
-A b
-% should fail
-b already tracked!
-A a
-A b
-% should fail
-a already tracked!
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-merging a
-warning: conflicts during merge.
-merging a failed!
-0 files updated, 0 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
-M a
-? a.orig
-% should fail
-a already tracked!
-M a
-? a.orig
-% issue683
-? a.orig
-R a
-? a.orig
-M a
-? a.orig
-c: No such file or directory
-d: No such file or directory
-M a
-A c
-? a.orig
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-add.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,99 @@
+  $ hg init a
+  $ cd a
+  $ echo a > a
+  $ hg add -n
+  adding a
+  $ hg st
+  ? a
+  $ hg add
+  adding a
+  $ hg st
+  A a
+  $ hg forget a
+  $ hg add
+  adding a
+  $ hg st
+  A a
+
+  $ echo b > b
+  $ hg add -n b
+  $ hg st
+  A a
+  ? b
+  $ hg add b
+  $ hg st
+  A a
+  A b
+
+should fail
+
+  $ hg add b
+  b already tracked!
+  $ hg st
+  A a
+  A b
+
+  $ hg ci -m 0 --traceback
+
+should fail
+
+  $ hg add a
+  a already tracked!
+
+  $ echo aa > a
+  $ hg ci -m 1
+  $ hg up 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo aaa > a
+  $ hg ci -m 2
+  created new head
+
+  $ hg merge
+  merging a
+  warning: conflicts during merge.
+  merging a failed!
+  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
+  [1]
+  $ hg st
+  M a
+  ? a.orig
+
+should fail
+
+  $ hg add a
+  a already tracked!
+  $ hg st
+  M a
+  ? a.orig
+  $ hg resolve -m a
+  $ hg ci -m merge
+
+issue683
+
+  $ hg forget a
+  $ hg add a
+  $ hg st
+  ? a.orig
+  $ hg rm a
+  $ hg st
+  R a
+  ? a.orig
+  $ echo a > a
+  $ hg add a
+  $ hg st
+  M a
+  ? a.orig
+
+  $ hg add c && echo "unexpected addition of missing file"
+  c: No such file or directory
+  [1]
+  $ echo c > c
+  $ hg add d c && echo "unexpected addition of missing file"
+  d: No such file or directory
+  [1]
+  $ hg st
+  M a
+  A c
+  ? a.orig
+
--- a/tests/test-addremove	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-#!/bin/sh
-
-hg init rep
-cd rep
-mkdir dir
-touch foo dir/bar
-hg -v addremove
-hg -v commit -m "add 1" -d "1000000 0"
-cd dir/
-touch ../foo_2 bar_2
-hg -v addremove
-hg -v commit -m "add 2" -d "1000000 0"
-
-cd ..
-hg init sim
-cd sim
-echo a > a
-echo a >> a
-echo a >> a
-echo c > c
-hg commit -Ama
-mv a b
-rm c
-echo d > d
-hg addremove -n -s 50 # issue 1696
-hg addremove -s 50
-hg commit -mb
--- a/tests/test-addremove-similar	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-#!/bin/sh
-
-hg init rep; cd rep
-
-touch empty-file
-python -c 'for x in range(10000): print x' > large-file
-
-hg addremove
-
-hg commit -m A
-
-rm large-file empty-file
-python -c 'for x in range(10,10000): print x' > another-file
-
-hg addremove -s50
-
-hg commit -m B
-
-echo % comparing two empty files caused ZeroDivisionError in the past
-hg update -C 0
-rm empty-file
-touch another-empty-file
-hg addremove -s50
-
-cd ..
-
-hg init rep2; cd rep2
-
-python -c 'for x in range(10000): print x' > large-file
-python -c 'for x in range(50): print x' > tiny-file
-
-hg addremove
-
-hg commit -m A
-
-python -c 'for x in range(70): print x' > small-file
-rm tiny-file
-rm large-file
-
-hg addremove -s50
-
-hg commit -m B
-
-echo % should all fail
-hg addremove -s foo
-hg addremove -s -1
-hg addremove -s 1e6
-
-cd ..
-
-echo '% issue 1527'
-hg init rep3; cd rep3
-mkdir d
-echo a > d/a
-hg add d/a
-hg commit -m 1
-
-mv d/a d/b
-hg addremove -s80
-hg debugstate
-mv d/b c
-echo "% no copies found here (since the target isn't in d"
-hg addremove -s80 d
-echo "% copies here"
-hg addremove -s80
-
-true
--- a/tests/test-addremove-similar.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-adding empty-file
-adding large-file
-adding another-file
-removing empty-file
-removing large-file
-recording removal of large-file as rename to another-file (99% similar)
-% comparing two empty files caused ZeroDivisionError in the past
-2 files updated, 0 files merged, 1 files removed, 0 files unresolved
-adding another-empty-file
-removing empty-file
-adding large-file
-adding tiny-file
-removing large-file
-adding small-file
-removing tiny-file
-recording removal of tiny-file as rename to small-file (82% similar)
-% should all fail
-abort: similarity must be a number
-abort: similarity must be between 0 and 100
-abort: similarity must be between 0 and 100
-% issue 1527
-removing d/a
-adding d/b
-recording removal of d/a as rename to d/b (100% similar)
-r   0          0 1970-01-01 00:00:00 d/a
-a   0         -1 unset               d/b
-copy: d/a -> d/b
-% no copies found here (since the target isn't in d
-removing d/b
-% copies here
-adding c
-recording removal of d/a as rename to c (100% similar)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-addremove-similar.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,100 @@
+  $ hg init rep; cd rep
+
+  $ touch empty-file
+  $ python -c 'for x in range(10000): print x' > large-file
+
+  $ hg addremove
+  adding empty-file
+  adding large-file
+
+  $ hg commit -m A
+
+  $ rm large-file empty-file
+  $ python -c 'for x in range(10,10000): print x' > another-file
+
+  $ hg addremove -s50
+  adding another-file
+  removing empty-file
+  removing large-file
+  recording removal of large-file as rename to another-file (99% similar)
+
+  $ hg commit -m B
+
+comparing two empty files caused ZeroDivisionError in the past
+
+  $ hg update -C 0
+  2 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ rm empty-file
+  $ touch another-empty-file
+  $ hg addremove -s50
+  adding another-empty-file
+  removing empty-file
+
+  $ cd ..
+
+  $ hg init rep2; cd rep2
+
+  $ python -c 'for x in range(10000): print x' > large-file
+  $ python -c 'for x in range(50): print x' > tiny-file
+
+  $ hg addremove
+  adding large-file
+  adding tiny-file
+
+  $ hg commit -m A
+
+  $ python -c 'for x in range(70): print x' > small-file
+  $ rm tiny-file
+  $ rm large-file
+
+  $ hg addremove -s50
+  removing large-file
+  adding small-file
+  removing tiny-file
+  recording removal of tiny-file as rename to small-file (82% similar)
+
+  $ hg commit -m B
+
+should all fail
+
+  $ hg addremove -s foo
+  abort: similarity must be a number
+  [255]
+  $ hg addremove -s -1
+  abort: similarity must be between 0 and 100
+  [255]
+  $ hg addremove -s 1e6
+  abort: similarity must be between 0 and 100
+  [255]
+
+  $ cd ..
+
+issue 1527
+
+  $ hg init rep3; cd rep3
+  $ mkdir d
+  $ echo a > d/a
+  $ hg add d/a
+  $ hg commit -m 1
+
+  $ mv d/a d/b
+  $ hg addremove -s80
+  removing d/a
+  adding d/b
+  recording removal of d/a as rename to d/b (100% similar)
+  $ hg debugstate
+  r   0          0 1970-01-01 00:00:00 d/a
+  a   0         -1 unset               d/b
+  copy: d/a -> d/b
+  $ mv d/b c
+
+no copies found here (since the target isn't in d
+
+  $ hg addremove -s80 d
+  removing d/b
+
+copies here
+
+  $ hg addremove -s80
+  adding c
+  recording removal of d/a as rename to c (100% similar)
--- a/tests/test-addremove.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-adding dir/bar
-adding foo
-dir/bar
-foo
-committed changeset 0:d44511117907
-adding dir/bar_2
-adding foo_2
-dir/bar_2
-foo_2
-committed changeset 1:a85812e0561a
-adding a
-adding c
-removing a
-adding b
-removing c
-adding d
-recording removal of a as rename to b (100% similar)
-removing a
-adding b
-removing c
-adding d
-recording removal of a as rename to b (100% similar)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-addremove.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,47 @@
+  $ hg init rep
+  $ cd rep
+  $ mkdir dir
+  $ touch foo dir/bar
+  $ hg -v addremove
+  adding dir/bar
+  adding foo
+  $ hg -v commit -m "add 1"
+  dir/bar
+  foo
+  committed changeset 0:6f7f953567a2
+  $ cd dir/
+  $ touch ../foo_2 bar_2
+  $ hg -v addremove
+  adding dir/bar_2
+  adding foo_2
+  $ hg -v commit -m "add 2"
+  dir/bar_2
+  foo_2
+  committed changeset 1:e65414bf35c5
+
+  $ cd ..
+  $ hg init sim
+  $ cd sim
+  $ echo a > a
+  $ echo a >> a
+  $ echo a >> a
+  $ echo c > c
+  $ hg commit -Ama
+  adding a
+  adding c
+  $ mv a b
+  $ rm c
+  $ echo d > d
+  $ hg addremove -n -s 50 # issue 1696
+  removing a
+  adding b
+  removing c
+  adding d
+  recording removal of a as rename to b (100% similar)
+  $ hg addremove -s 50
+  removing a
+  adding b
+  removing c
+  adding d
+  recording removal of a as rename to b (100% similar)
+  $ hg commit -mb
--- a/tests/test-alias	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-#!/bin/sh
-
-cat >> $HGRCPATH <<EOF
-[alias]
-myinit = init
-cleanstatus = status -c
-unknown = bargle
-ambiguous = s
-recursive = recursive
-nodefinition =
-mylog = log
-lognull = log -r null
-shortlog = log --template '{rev} {node|short} | {date|isodate}\n'
-dln = lognull --debug
-nousage = rollback
-put = export -r 0 -o "\$FOO/%R.diff"
-rt = root
-
-[defaults]
-mylog = -q
-lognull = -q
-log = -v
-EOF
-
-echo '% basic'
-hg myinit alias
-
-echo '% unknown'
-hg unknown
-hg help unknown
-
-echo '% ambiguous'
-hg ambiguous
-hg help ambiguous
-
-echo '% recursive'
-hg recursive
-hg help recursive
-
-echo '% no definition'
-hg nodef
-hg help nodef
-
-cd alias
-
-echo '% no usage'
-hg nousage
-
-echo foo > foo
-hg ci -Amfoo
-
-echo '% with opts'
-hg cleanst
-
-echo '% with opts and whitespace'
-hg shortlog
-
-echo '% interaction with defaults'
-hg mylog
-hg lognull
-
-echo '% properly recursive'
-hg dln
-
-echo '% path expanding'
-FOO=`pwd` hg put
-cat 0.diff
-
-echo '% invalid arguments'
-hg rt foo
-
-exit 0
--- a/tests/test-alias.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-% basic
-% unknown
-alias 'unknown' resolves to unknown command 'bargle'
-alias 'unknown' resolves to unknown command 'bargle'
-% ambiguous
-alias 'ambiguous' resolves to ambiguous command 's'
-alias 'ambiguous' resolves to ambiguous command 's'
-% recursive
-alias 'recursive' resolves to unknown command 'recursive'
-alias 'recursive' resolves to unknown command 'recursive'
-% no definition
-no definition for alias 'nodefinition'
-no definition for alias 'nodefinition'
-% no usage
-no rollback information available
-adding foo
-% with opts
-C foo
-% with opts and whitespace
-0 e63c23eaa88a | 1970-01-01 00:00 +0000
-% interaction with defaults
-0:e63c23eaa88a
--1:000000000000
-% properly recursive
-changeset:   -1:0000000000000000000000000000000000000000
-parent:      -1:0000000000000000000000000000000000000000
-parent:      -1:0000000000000000000000000000000000000000
-manifest:    -1:0000000000000000000000000000000000000000
-user:        
-date:        Thu Jan 01 00:00:00 1970 +0000
-extra:       branch=default
-
-% path expanding
-# HG changeset patch
-# User test
-# Date 0 0
-# Node ID e63c23eaa88ae77967edcf4ea194d31167c478b0
-# Parent  0000000000000000000000000000000000000000
-foo
-
-diff -r 000000000000 -r e63c23eaa88a foo
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/foo	Thu Jan 01 00:00:00 1970 +0000
-@@ -0,0 +1,1 @@
-+foo
-% invalid arguments
-hg rt: invalid arguments
-hg rt 
-
-alias for: hg root
-
-print the root (top) of the current working directory
-
-    Print the root directory of the current repository.
-
-    Returns 0 on success.
-
-use "hg -v help rt" to show global options
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-alias.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,200 @@
+  $ cat >> $HGRCPATH <<EOF
+  > [alias]
+  > myinit = init
+  > cleanstatus = status -c
+  > unknown = bargle
+  > ambiguous = s
+  > recursive = recursive
+  > nodefinition =
+  > no--cwd = status --cwd elsewhere
+  > no-R = status -R elsewhere
+  > no--repo = status --repo elsewhere
+  > no--repository = status --repository elsewhere
+  > mylog = log
+  > lognull = log -r null
+  > shortlog = log --template '{rev} {node|short} | {date|isodate}\n'
+  > dln = lognull --debug
+  > nousage = rollback
+  > put = export -r 0 -o "\$FOO/%R.diff"
+  > blank = !echo
+  > self = !echo '\$0'
+  > echo = !echo '\$@'
+  > echo1 = !echo '\$1'
+  > echo2 = !echo '\$2'
+  > echo13 = !echo '\$1' '\$3'
+  > count = !hg log -r '\$@' --template='.' | wc -c | sed -e 's/ //g'
+  > rt = root
+  > 
+  > [defaults]
+  > mylog = -q
+  > lognull = -q
+  > log = -v
+  > EOF
+
+
+basic
+
+  $ hg myinit alias
+
+
+unknown
+
+  $ hg unknown
+  alias 'unknown' resolves to unknown command 'bargle'
+  $ hg help unknown
+  alias 'unknown' resolves to unknown command 'bargle'
+
+
+ambiguous
+
+  $ hg ambiguous
+  alias 'ambiguous' resolves to ambiguous command 's'
+  $ hg help ambiguous
+  alias 'ambiguous' resolves to ambiguous command 's'
+
+
+recursive
+
+  $ hg recursive
+  alias 'recursive' resolves to unknown command 'recursive'
+  $ hg help recursive
+  alias 'recursive' resolves to unknown command 'recursive'
+
+
+no definition
+
+  $ hg nodef
+  no definition for alias 'nodefinition'
+  $ hg help nodef
+  no definition for alias 'nodefinition'
+
+
+invalid options
+
+  $ hg no--cwd
+  error in definition for alias 'no--cwd': --cwd may only be given on the command line
+  $ hg help no--cwd
+  error in definition for alias 'no--cwd': --cwd may only be given on the command line
+  $ hg no-R
+  error in definition for alias 'no-R': -R may only be given on the command line
+  $ hg help no-R
+  error in definition for alias 'no-R': -R may only be given on the command line
+  $ hg no--repo
+  error in definition for alias 'no--repo': --repo may only be given on the command line
+  $ hg help no--repo
+  error in definition for alias 'no--repo': --repo may only be given on the command line
+  $ hg no--repository
+  error in definition for alias 'no--repository': --repository may only be given on the command line
+  $ hg help no--repository
+  error in definition for alias 'no--repository': --repository may only be given on the command line
+
+  $ cd alias
+
+
+no usage
+
+  $ hg nousage
+  no rollback information available
+
+  $ echo foo > foo
+  $ hg ci -Amfoo
+  adding foo
+
+
+with opts
+
+  $ hg cleanst
+  C foo
+
+
+with opts and whitespace
+
+  $ hg shortlog
+  0 e63c23eaa88a | 1970-01-01 00:00 +0000
+
+
+interaction with defaults
+
+  $ hg mylog
+  0:e63c23eaa88a
+  $ hg lognull
+  -1:000000000000
+
+
+properly recursive
+
+  $ hg dln
+  changeset:   -1:0000000000000000000000000000000000000000
+  parent:      -1:0000000000000000000000000000000000000000
+  parent:      -1:0000000000000000000000000000000000000000
+  manifest:    -1:0000000000000000000000000000000000000000
+  user:        
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  extra:       branch=default
+  
+
+
+path expanding
+
+  $ FOO=`pwd` hg put
+  $ cat 0.diff
+  # HG changeset patch
+  # User test
+  # Date 0 0
+  # Node ID e63c23eaa88ae77967edcf4ea194d31167c478b0
+  # Parent  0000000000000000000000000000000000000000
+  foo
+  
+  diff -r 000000000000 -r e63c23eaa88a foo
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/foo	Thu Jan 01 00:00:00 1970 +0000
+  @@ -0,0 +1,1 @@
+  +foo
+
+
+simple shell aliases
+
+  $ hg blank
+  
+  $ hg blank foo
+  
+  $ hg echo
+  
+  $ hg self
+  self
+  $ hg echo foo
+  foo
+  $ hg echo 'test $2' foo
+  test $2 foo
+  $ hg echo1 foo bar baz
+  foo
+  $ hg echo2 foo bar baz
+  bar
+  $ hg echo13 foo bar baz test
+  foo baz
+  $ hg echo2 foo
+  
+  $ echo bar > bar
+  $ hg ci -qA -m bar
+  $ hg count .
+  1
+  $ hg count 'branch(default)'
+  2
+
+
+invalid arguments
+
+  $ hg rt foo
+  hg rt: invalid arguments
+  hg rt 
+  
+  alias for: hg root
+  
+  print the root (top) of the current working directory
+  
+      Print the root directory of the current repository.
+  
+      Returns 0 on success.
+  
+  use "hg -v help rt" to show global options
+  [255]
--- a/tests/test-annotate	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,115 +0,0 @@
-#!/bin/sh
-
-HGMERGE=true; export HGMERGE
-
-echo % init
-hg init
-
-echo % commit
-echo 'a' > a
-hg ci -A -m test -u nobody -d '1 0'
-
-echo % annotate -c
-hg annotate -c a
-
-echo % annotate -cl
-hg annotate -cl a
-
-echo % annotate -d
-hg annotate -d a
-
-echo % annotate -n
-hg annotate -n a
-
-echo % annotate -nl
-hg annotate -nl a
-
-echo % annotate -u
-hg annotate -u a
-
-echo % annotate -cdnu
-hg annotate -cdnu a
-
-echo % annotate -cdnul
-hg annotate -cdnul a
-
-cat <<EOF >>a
-a
-a
-EOF
-hg ci -ma1 -d '1 0'
-hg cp a b
-hg ci -mb -d '1 0'
-cat <<EOF >> b
-b4
-b5
-b6
-EOF
-hg ci -mb2 -d '2 0'
-
-echo % annotate -n b
-hg annotate -n b
-echo % annotate --no-follow b
-hg annotate --no-follow b
-echo % annotate -nl b
-hg annotate -nl b
-echo % annotate -nf b
-hg annotate -nf b
-echo % annotate -nlf b
-hg annotate -nlf b
-
-hg up -C 2
-cat <<EOF >> b
-b4
-c
-b5
-EOF
-hg ci -mb2.1 -d '2 0'
-hg merge
-hg ci -mmergeb -d '3 0'
-echo % annotate after merge
-hg annotate -nf b
-echo % annotate after merge with -l
-hg annotate -nlf b
-
-hg up -C 1
-hg cp a b
-cat <<EOF > b
-a
-z
-a
-EOF
-hg ci -mc -d '3 0'
-hg merge
-cat <<EOF >> b
-b4
-c
-b5
-EOF
-echo d >> b
-hg ci -mmerge2 -d '4 0'
-echo % annotate after rename merge
-hg annotate -nf b
-echo % annotate after rename merge with -l
-hg annotate -nlf b
-
-echo % linkrev vs rev
-hg annotate -r tip -n a
-echo % linkrev vs rev with -l
-hg annotate -r tip -nl a
-
-# test issue 589
-# annotate was crashing when trying to --follow something
-# like A -> B -> A
-echo % generate ABA rename configuration
-echo foo > foo
-hg add foo
-hg ci -m addfoo
-hg rename foo bar
-hg ci -m renamefoo
-hg rename bar foo
-hg ci -m renamebar
-
-echo % annotate after ABA with follow
-hg annotate --follow foo
-
--- a/tests/test-annotate.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,105 +0,0 @@
-% init
-% commit
-adding a
-% annotate -c
-8435f90966e4: a
-% annotate -cl
-8435f90966e4:1: a
-% annotate -d
-Thu Jan 01 00:00:01 1970 +0000: a
-% annotate -n
-0: a
-% annotate -nl
-0:1: a
-% annotate -u
-nobody: a
-% annotate -cdnu
-nobody 0 8435f90966e4 Thu Jan 01 00:00:01 1970 +0000: a
-% annotate -cdnul
-nobody 0 8435f90966e4 Thu Jan 01 00:00:01 1970 +0000:1: a
-% annotate -n b
-0: a
-1: a
-1: a
-3: b4
-3: b5
-3: b6
-% annotate --no-follow b
-2: a
-2: a
-2: a
-3: b4
-3: b5
-3: b6
-% annotate -nl b
-0:1: a
-1:2: a
-1:3: a
-3:4: b4
-3:5: b5
-3:6: b6
-% annotate -nf b
-0 a: a
-1 a: a
-1 a: a
-3 b: b4
-3 b: b5
-3 b: b6
-% annotate -nlf b
-0 a:1: a
-1 a:2: a
-1 a:3: a
-3 b:4: b4
-3 b:5: b5
-3 b:6: b6
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-merging b
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-% annotate after merge
-0 a: a
-1 a: a
-1 a: a
-3 b: b4
-4 b: c
-3 b: b5
-% annotate after merge with -l
-0 a:1: a
-1 a:2: a
-1 a:3: a
-3 b:4: b4
-4 b:5: c
-3 b:5: b5
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-created new head
-merging b
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-% annotate after rename merge
-0 a: a
-6 b: z
-1 a: a
-3 b: b4
-4 b: c
-3 b: b5
-7 b: d
-% annotate after rename merge with -l
-0 a:1: a
-6 b:2: z
-1 a:3: a
-3 b:4: b4
-4 b:5: c
-3 b:5: b5
-7 b:7: d
-% linkrev vs rev
-0: a
-1: a
-1: a
-% linkrev vs rev with -l
-0:1: a
-1:2: a
-1:3: a
-% generate ABA rename configuration
-% annotate after ABA with follow
-foo: foo
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-annotate.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,230 @@
+  $ HGMERGE=true; export HGMERGE
+
+init
+
+  $ hg init
+
+commit
+
+  $ echo 'a' > a
+  $ hg ci -A -m test -u nobody -d '1 0'
+  adding a
+
+annotate -c
+
+  $ hg annotate -c a
+  8435f90966e4: a
+
+annotate -cl
+
+  $ hg annotate -cl a
+  8435f90966e4:1: a
+
+annotate -d
+
+  $ hg annotate -d a
+  Thu Jan 01 00:00:01 1970 +0000: a
+
+annotate -n
+
+  $ hg annotate -n a
+  0: a
+
+annotate -nl
+
+  $ hg annotate -nl a
+  0:1: a
+
+annotate -u
+
+  $ hg annotate -u a
+  nobody: a
+
+annotate -cdnu
+
+  $ hg annotate -cdnu a
+  nobody 0 8435f90966e4 Thu Jan 01 00:00:01 1970 +0000: a
+
+annotate -cdnul
+
+  $ hg annotate -cdnul a
+  nobody 0 8435f90966e4 Thu Jan 01 00:00:01 1970 +0000:1: a
+
+  $ cat <<EOF >>a
+  > a
+  > a
+  > EOF
+  $ hg ci -ma1 -d '1 0'
+  $ hg cp a b
+  $ hg ci -mb -d '1 0'
+  $ cat <<EOF >> b
+  > b4
+  > b5
+  > b6
+  > EOF
+  $ hg ci -mb2 -d '2 0'
+
+annotate -n b
+
+  $ hg annotate -n b
+  0: a
+  1: a
+  1: a
+  3: b4
+  3: b5
+  3: b6
+
+annotate --no-follow b
+
+  $ hg annotate --no-follow b
+  2: a
+  2: a
+  2: a
+  3: b4
+  3: b5
+  3: b6
+
+annotate -nl b
+
+  $ hg annotate -nl b
+  0:1: a
+  1:2: a
+  1:3: a
+  3:4: b4
+  3:5: b5
+  3:6: b6
+
+annotate -nf b
+
+  $ hg annotate -nf b
+  0 a: a
+  1 a: a
+  1 a: a
+  3 b: b4
+  3 b: b5
+  3 b: b6
+
+annotate -nlf b
+
+  $ hg annotate -nlf b
+  0 a:1: a
+  1 a:2: a
+  1 a:3: a
+  3 b:4: b4
+  3 b:5: b5
+  3 b:6: b6
+
+  $ hg up -C 2
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cat <<EOF >> b
+  > b4
+  > c
+  > b5
+  > EOF
+  $ hg ci -mb2.1 -d '2 0'
+  created new head
+  $ hg merge
+  merging b
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg ci -mmergeb -d '3 0'
+
+annotate after merge
+
+  $ hg annotate -nf b
+  0 a: a
+  1 a: a
+  1 a: a
+  3 b: b4
+  4 b: c
+  3 b: b5
+
+annotate after merge with -l
+
+  $ hg annotate -nlf b
+  0 a:1: a
+  1 a:2: a
+  1 a:3: a
+  3 b:4: b4
+  4 b:5: c
+  3 b:5: b5
+
+  $ hg up -C 1
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg cp a b
+  $ cat <<EOF > b
+  > a
+  > z
+  > a
+  > EOF
+  $ hg ci -mc -d '3 0'
+  created new head
+  $ hg merge
+  merging b
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ cat <<EOF >> b
+  > b4
+  > c
+  > b5
+  > EOF
+  $ echo d >> b
+  $ hg ci -mmerge2 -d '4 0'
+
+annotate after rename merge
+
+  $ hg annotate -nf b
+  0 a: a
+  6 b: z
+  1 a: a
+  3 b: b4
+  4 b: c
+  3 b: b5
+  7 b: d
+
+annotate after rename merge with -l
+
+  $ hg annotate -nlf b
+  0 a:1: a
+  6 b:2: z
+  1 a:3: a
+  3 b:4: b4
+  4 b:5: c
+  3 b:5: b5
+  7 b:7: d
+
+linkrev vs rev
+
+  $ hg annotate -r tip -n a
+  0: a
+  1: a
+  1: a
+
+linkrev vs rev with -l
+
+  $ hg annotate -r tip -nl a
+  0:1: a
+  1:2: a
+  1:3: a
+
+test issue 589
+
+annotate was crashing when trying to --follow something
+
+like A -> B -> A
+
+generate ABA rename configuration
+
+  $ echo foo > foo
+  $ hg add foo
+  $ hg ci -m addfoo
+  $ hg rename foo bar
+  $ hg ci -m renamefoo
+  $ hg rename bar foo
+  $ hg ci -m renamebar
+
+annotate after ABA with follow
+
+  $ hg annotate --follow foo
+  foo: foo
+
--- a/tests/test-archive	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,150 +0,0 @@
-#!/bin/sh
-
-mkdir test
-cd test
-hg init
-echo foo>foo
-hg commit -Am 1 -d '1 0'
-echo bar>bar
-hg commit -Am 2 -d '2 0'
-mkdir baz
-echo bletch>baz/bletch
-hg commit -Am 3 -d '1000000000 0'
-echo "[web]" >> .hg/hgrc
-echo "name = test-archive" >> .hg/hgrc
-cp .hg/hgrc .hg/hgrc-base
-
-# check http return codes
-test_archtype() {
-    echo "allow_archive = $1" >> .hg/hgrc
-    hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log
-    cat hg.pid >> $DAEMON_PIDS
-    echo % $1 allowed should give 200
-    "$TESTDIR/get-with-headers.py" localhost:$HGPORT "/archive/tip.$2" | head -n 1
-    echo % $3 and $4 disallowed should both give 403
-    "$TESTDIR/get-with-headers.py" localhost:$HGPORT "/archive/tip.$3" | head -n 1
-    "$TESTDIR/get-with-headers.py" localhost:$HGPORT "/archive/tip.$4" | head -n 1
-    "$TESTDIR/killdaemons.py"
-    cat errors.log
-    cp .hg/hgrc-base .hg/hgrc
-}
-
-echo
-test_archtype gz tar.gz tar.bz2 zip
-test_archtype bz2 tar.bz2 zip tar.gz
-test_archtype zip zip tar.gz tar.bz2
-
-echo "allow_archive = gz bz2 zip" >> .hg/hgrc
-hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log
-cat hg.pid >> $DAEMON_PIDS
-
-echo % invalid arch type should give 404
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT "/archive/tip.invalid" | head -n 1
-echo
-
-TIP=`hg id -v | cut -f1 -d' '`
-QTIP=`hg id -q`
-cat > getarchive.py <<EOF
-import os, sys, urllib2
-try:
-    # Set stdout to binary mode for win32 platforms
-    import msvcrt
-    msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
-except ImportError:
-    pass
-    
-node, archive = sys.argv[1:]
-f = urllib2.urlopen('http://127.0.0.1:%s/?cmd=archive;node=%s;type=%s'
-                    % (os.environ['HGPORT'], node, archive))
-sys.stdout.write(f.read())
-EOF
-python getarchive.py "$TIP" gz | gunzip | tar tf - 2>/dev/null | sed "s/$QTIP/TIP/"
-python getarchive.py "$TIP" bz2 | bunzip2 | tar tf - 2>/dev/null | sed "s/$QTIP/TIP/"
-python getarchive.py "$TIP" zip > archive.zip
-unzip -t archive.zip | sed "s/$QTIP/TIP/"
-
-"$TESTDIR/killdaemons.py"
-
-hg archive -t tar test.tar
-tar tf test.tar
-
-hg archive -t tbz2 -X baz test.tar.bz2
-bunzip2 -dc test.tar.bz2 | tar tf - 2>/dev/null
-
-hg archive -t tgz -p %b-%h test-%h.tar.gz
-gzip -dc test-$QTIP.tar.gz | tar tf - 2>/dev/null | sed "s/$QTIP/TIP/"
-
-hg archive autodetected_test.tar
-tar tf autodetected_test.tar
-
-# The '-t' should override autodetection
-hg archive -t tar autodetect_override_test.zip
-tar tf autodetect_override_test.zip
-
-for ext in tar tar.gz tgz tar.bz2 tbz2 zip; do
-    hg archive auto_test.$ext
-    if [ -d auto_test.$ext ]; then
-        echo "extension $ext was not autodetected."
-    fi
-done
-
-cat > md5comp.py <<EOF
-try:
-    from hashlib import md5
-except ImportError:
-    from md5 import md5
-import sys
-f1, f2 = sys.argv[1:3]
-h1 = md5(file(f1, 'rb').read()).hexdigest()
-h2 = md5(file(f2, 'rb').read()).hexdigest()
-print h1 == h2 or "md5 differ: " + repr((h1, h2))
-EOF
-
-# archive name is stored in the archive, so create similar
-# archives and rename them afterwards.
-hg archive -t tgz tip.tar.gz
-mv tip.tar.gz tip1.tar.gz
-sleep 1
-hg archive -t tgz tip.tar.gz
-mv tip.tar.gz tip2.tar.gz
-python md5comp.py tip1.tar.gz tip2.tar.gz
-
-hg archive -t zip -p /illegal test.zip
-hg archive -t zip -p very/../bad test.zip
-
-hg archive --config ui.archivemeta=false -t zip -r 2 test.zip
-unzip -t test.zip
-
-hg archive -t tar - | tar tf - 2>/dev/null | sed "s/$QTIP/TIP/"
-
-hg archive -r 0 -t tar rev-%r.tar
-if [ -f rev-0.tar ]; then
-    echo 'rev-0.tar created'
-fi
-
-echo '% test .hg_archival.txt'
-hg archive ../test-tags
-cat ../test-tags/.hg_archival.txt
-hg tag -r 2 mytag
-hg tag -r 2 anothertag
-hg archive -r 2 ../test-lasttag
-cat ../test-lasttag/.hg_archival.txt
-
-hg archive -t bogus test.bogus
-
-echo % server errors
-cat errors.log
-
-echo '% empty repo'
-hg init ../empty
-cd ../empty
-hg archive ../test-empty
-
-echo '% old file -- date clamped to 1980'
-touch -d 1975-01-01 old
-hg add old
-hg commit -m old
-hg archive ../old.zip
-unzip -l ../old.zip | grep 80 && echo ok
-
-exit 0
--- a/tests/test-archive-symlinks	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-#!/bin/sh
-
-"$TESTDIR/hghave" symlink || exit 80
-
-origdir=`pwd`
-
-hg init repo
-cd repo
-ln -s nothing dangling
-# avoid tar warnings about old timestamp
-hg ci -d '2000-01-01 00:00:00 +0000' -qAm 'add symlink'
-
-hg archive -t files ../archive
-hg archive -t tar -p tar ../archive.tar
-hg archive -t zip -p zip ../archive.zip
-
-echo '% files'
-cd "$origdir"
-cd archive
-$TESTDIR/readlink.py dangling
-
-echo '% tar'
-cd "$origdir"
-tar xf archive.tar
-cd tar
-$TESTDIR/readlink.py dangling
-
-echo '% zip'
-cd "$origdir"
-unzip archive.zip > /dev/null
-cd zip
-$TESTDIR/readlink.py dangling
--- a/tests/test-archive-symlinks.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-% files
-dangling -> nothing
-% tar
-dangling -> nothing
-% zip
-dangling -> nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-archive-symlinks.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,38 @@
+  $ "$TESTDIR/hghave" symlink || exit 80
+
+  $ origdir=`pwd`
+
+  $ hg init repo
+  $ cd repo
+  $ ln -s nothing dangling
+
+avoid tar warnings about old timestamp
+
+  $ hg ci -d '2000-01-01 00:00:00 +0000' -qAm 'add symlink'
+
+  $ hg archive -t files ../archive
+  $ hg archive -t tar -p tar ../archive.tar
+  $ hg archive -t zip -p zip ../archive.zip
+
+files
+
+  $ cd "$origdir"
+  $ cd archive
+  $ $TESTDIR/readlink.py dangling
+  dangling -> nothing
+
+tar
+
+  $ cd "$origdir"
+  $ tar xf archive.tar
+  $ cd tar
+  $ $TESTDIR/readlink.py dangling
+  dangling -> nothing
+
+zip
+
+  $ cd "$origdir"
+  $ unzip archive.zip > /dev/null
+  $ cd zip
+  $ $TESTDIR/readlink.py dangling
+  dangling -> nothing
--- a/tests/test-archive.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-adding foo
-adding bar
-adding baz/bletch
-
-% gz allowed should give 200
-200 Script output follows
-% tar.bz2 and zip disallowed should both give 403
-403 Archive type not allowed: bz2
-403 Archive type not allowed: zip
-% bz2 allowed should give 200
-200 Script output follows
-% zip and tar.gz disallowed should both give 403
-403 Archive type not allowed: zip
-403 Archive type not allowed: gz
-% zip allowed should give 200
-200 Script output follows
-% tar.gz and tar.bz2 disallowed should both give 403
-403 Archive type not allowed: gz
-403 Archive type not allowed: bz2
-% invalid arch type should give 404
-404 Unsupported archive type: None
-
-test-archive-TIP/.hg_archival.txt
-test-archive-TIP/bar
-test-archive-TIP/baz/bletch
-test-archive-TIP/foo
-test-archive-TIP/.hg_archival.txt
-test-archive-TIP/bar
-test-archive-TIP/baz/bletch
-test-archive-TIP/foo
-Archive:  archive.zip
-    testing: test-archive-TIP/.hg_archival.txt   OK
-    testing: test-archive-TIP/bar   OK
-    testing: test-archive-TIP/baz/bletch   OK
-    testing: test-archive-TIP/foo   OK
-No errors detected in compressed data of archive.zip.
-test/.hg_archival.txt
-test/bar
-test/baz/bletch
-test/foo
-test/.hg_archival.txt
-test/bar
-test/foo
-test-TIP/.hg_archival.txt
-test-TIP/bar
-test-TIP/baz/bletch
-test-TIP/foo
-autodetected_test/.hg_archival.txt
-autodetected_test/bar
-autodetected_test/baz/bletch
-autodetected_test/foo
-autodetect_override_test.zip/.hg_archival.txt
-autodetect_override_test.zip/bar
-autodetect_override_test.zip/baz/bletch
-autodetect_override_test.zip/foo
-True
-abort: archive prefix contains illegal components
-Archive:  test.zip
-    testing: test/bar                 OK
-    testing: test/baz/bletch          OK
-    testing: test/foo                 OK
-No errors detected in compressed data of test.zip.
-test-TIP/.hg_archival.txt
-test-TIP/bar
-test-TIP/baz/bletch
-test-TIP/foo
-rev-0.tar created
-% test .hg_archival.txt
-repo: daa7f7c60e0a224faa4ff77ca41b2760562af264
-node: 2c0277f05ed49d1c8328fb9ba92fba7a5ebcb33e
-branch: default
-latesttag: null
-latesttagdistance: 3
-repo: daa7f7c60e0a224faa4ff77ca41b2760562af264
-node: 2c0277f05ed49d1c8328fb9ba92fba7a5ebcb33e
-branch: default
-tag: anothertag
-tag: mytag
-abort: unknown archive type 'bogus'
-% server errors
-% empty repo
-abort: no working directory: please specify a revision
-% old file -- date clamped to 1980
-      147  1980-01-01 00:00   old/.hg_archival.txt
-        0  1980-01-01 00:00   old/old
-ok
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-archive.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,235 @@
+  $ mkdir test
+  $ cd test
+  $ hg init
+  $ echo foo>foo
+  $ hg commit -Am 1 -d '1 0'
+  adding foo
+  $ echo bar>bar
+  $ hg commit -Am 2 -d '2 0'
+  adding bar
+  $ mkdir baz
+  $ echo bletch>baz/bletch
+  $ hg commit -Am 3 -d '1000000000 0'
+  adding baz/bletch
+  $ echo "[web]" >> .hg/hgrc
+  $ echo "name = test-archive" >> .hg/hgrc
+  $ cp .hg/hgrc .hg/hgrc-base
+  > test_archtype() {
+  >     echo "allow_archive = $1" >> .hg/hgrc
+  >     hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log
+  >     cat hg.pid >> $DAEMON_PIDS
+  >     echo % $1 allowed should give 200
+  >     "$TESTDIR/get-with-headers.py" localhost:$HGPORT "/archive/tip.$2" | head -n 1
+  >     echo % $3 and $4 disallowed should both give 403
+  >     "$TESTDIR/get-with-headers.py" localhost:$HGPORT "/archive/tip.$3" | head -n 1
+  >     "$TESTDIR/get-with-headers.py" localhost:$HGPORT "/archive/tip.$4" | head -n 1
+  >     "$TESTDIR/killdaemons.py"
+  >     cat errors.log
+  >     cp .hg/hgrc-base .hg/hgrc
+  > }
+
+check http return codes
+
+
+  $ test_archtype gz tar.gz tar.bz2 zip
+  % gz allowed should give 200
+  200 Script output follows
+  % tar.bz2 and zip disallowed should both give 403
+  403 Archive type not allowed: bz2
+  403 Archive type not allowed: zip
+  $ test_archtype bz2 tar.bz2 zip tar.gz
+  % bz2 allowed should give 200
+  200 Script output follows
+  % zip and tar.gz disallowed should both give 403
+  403 Archive type not allowed: zip
+  403 Archive type not allowed: gz
+  $ test_archtype zip zip tar.gz tar.bz2
+  % zip allowed should give 200
+  200 Script output follows
+  % tar.gz and tar.bz2 disallowed should both give 403
+  403 Archive type not allowed: gz
+  403 Archive type not allowed: bz2
+
+  $ echo "allow_archive = gz bz2 zip" >> .hg/hgrc
+  $ hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log
+  $ cat hg.pid >> $DAEMON_PIDS
+
+invalid arch type should give 404
+
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT "/archive/tip.invalid" | head -n 1
+  404 Unsupported archive type: None
+
+  $ TIP=`hg id -v | cut -f1 -d' '`
+  $ QTIP=`hg id -q`
+  $ cat > getarchive.py <<EOF
+  > import os, sys, urllib2
+  > try:
+  >     # Set stdout to binary mode for win32 platforms
+  >     import msvcrt
+  >     msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
+  > except ImportError:
+  >     pass
+  > node, archive = sys.argv[1:]
+  > f = urllib2.urlopen('http://127.0.0.1:%s/?cmd=archive;node=%s;type=%s'
+  >                     % (os.environ['HGPORT'], node, archive))
+  > sys.stdout.write(f.read())
+  > EOF
+  $ python getarchive.py "$TIP" gz | gunzip | tar tf - 2>/dev/null
+  test-archive-2c0277f05ed4/.hg_archival.txt
+  test-archive-2c0277f05ed4/bar
+  test-archive-2c0277f05ed4/baz/bletch
+  test-archive-2c0277f05ed4/foo
+  $ python getarchive.py "$TIP" bz2 | bunzip2 | tar tf - 2>/dev/null
+  test-archive-2c0277f05ed4/.hg_archival.txt
+  test-archive-2c0277f05ed4/bar
+  test-archive-2c0277f05ed4/baz/bletch
+  test-archive-2c0277f05ed4/foo
+  $ python getarchive.py "$TIP" zip > archive.zip
+  $ unzip -t archive.zip
+  Archive:  archive.zip
+      testing: test-archive-2c0277f05ed4/.hg_archival.txt   OK
+      testing: test-archive-2c0277f05ed4/bar   OK
+      testing: test-archive-2c0277f05ed4/baz/bletch   OK
+      testing: test-archive-2c0277f05ed4/foo   OK
+  No errors detected in compressed data of archive.zip.
+
+  $ "$TESTDIR/killdaemons.py"
+
+  $ hg archive -t tar test.tar
+  $ tar tf test.tar
+  test/.hg_archival.txt
+  test/bar
+  test/baz/bletch
+  test/foo
+
+  $ hg archive -t tbz2 -X baz test.tar.bz2
+  $ bunzip2 -dc test.tar.bz2 | tar tf - 2>/dev/null
+  test/.hg_archival.txt
+  test/bar
+  test/foo
+
+  $ hg archive -t tgz -p %b-%h test-%h.tar.gz
+  $ gzip -dc test-$QTIP.tar.gz | tar tf - 2>/dev/null
+  test-2c0277f05ed4/.hg_archival.txt
+  test-2c0277f05ed4/bar
+  test-2c0277f05ed4/baz/bletch
+  test-2c0277f05ed4/foo
+
+  $ hg archive autodetected_test.tar
+  $ tar tf autodetected_test.tar
+  autodetected_test/.hg_archival.txt
+  autodetected_test/bar
+  autodetected_test/baz/bletch
+  autodetected_test/foo
+
+The '-t' should override autodetection
+
+  $ hg archive -t tar autodetect_override_test.zip
+  $ tar tf autodetect_override_test.zip
+  autodetect_override_test.zip/.hg_archival.txt
+  autodetect_override_test.zip/bar
+  autodetect_override_test.zip/baz/bletch
+  autodetect_override_test.zip/foo
+
+  $ for ext in tar tar.gz tgz tar.bz2 tbz2 zip; do
+  >     hg archive auto_test.$ext
+  >     if [ -d auto_test.$ext ]; then
+  >         echo "extension $ext was not autodetected."
+  >     fi
+  > done
+
+  $ cat > md5comp.py <<EOF
+  > try:
+  >     from hashlib import md5
+  > except ImportError:
+  >     from md5 import md5
+  > import sys
+  > f1, f2 = sys.argv[1:3]
+  > h1 = md5(file(f1, 'rb').read()).hexdigest()
+  > h2 = md5(file(f2, 'rb').read()).hexdigest()
+  > print h1 == h2 or "md5 differ: " + repr((h1, h2))
+  > EOF
+
+archive name is stored in the archive, so create similar
+
+archives and rename them afterwards.
+
+  $ hg archive -t tgz tip.tar.gz
+  $ mv tip.tar.gz tip1.tar.gz
+  $ sleep 1
+  $ hg archive -t tgz tip.tar.gz
+  $ mv tip.tar.gz tip2.tar.gz
+  $ python md5comp.py tip1.tar.gz tip2.tar.gz
+  True
+
+  $ hg archive -t zip -p /illegal test.zip
+  abort: archive prefix contains illegal components
+  [255]
+  $ hg archive -t zip -p very/../bad test.zip
+
+  $ hg archive --config ui.archivemeta=false -t zip -r 2 test.zip
+  $ unzip -t test.zip
+  Archive:  test.zip
+      testing: test/bar                 OK
+      testing: test/baz/bletch          OK
+      testing: test/foo                 OK
+  No errors detected in compressed data of test.zip.
+
+  $ hg archive -t tar - | tar tf - 2>/dev/null
+  test-2c0277f05ed4/.hg_archival.txt
+  test-2c0277f05ed4/bar
+  test-2c0277f05ed4/baz/bletch
+  test-2c0277f05ed4/foo
+
+  $ hg archive -r 0 -t tar rev-%r.tar
+  $ if [ -f rev-0.tar ]; then
+  $ fi
+
+test .hg_archival.txt
+
+  $ hg archive ../test-tags
+  $ cat ../test-tags/.hg_archival.txt
+  repo: daa7f7c60e0a224faa4ff77ca41b2760562af264
+  node: 2c0277f05ed49d1c8328fb9ba92fba7a5ebcb33e
+  branch: default
+  latesttag: null
+  latesttagdistance: 3
+  $ hg tag -r 2 mytag
+  $ hg tag -r 2 anothertag
+  $ hg archive -r 2 ../test-lasttag
+  $ cat ../test-lasttag/.hg_archival.txt
+  repo: daa7f7c60e0a224faa4ff77ca41b2760562af264
+  node: 2c0277f05ed49d1c8328fb9ba92fba7a5ebcb33e
+  branch: default
+  tag: anothertag
+  tag: mytag
+
+  $ hg archive -t bogus test.bogus
+  abort: unknown archive type 'bogus'
+  [255]
+
+server errors
+
+  $ cat errors.log
+
+empty repo
+
+  $ hg init ../empty
+  $ cd ../empty
+  $ hg archive ../test-empty
+  abort: no working directory: please specify a revision
+  [255]
+old file -- date clamped to 1980
+
+  $ touch -t 197501010000 old
+  $ hg add old
+  $ hg commit -m old
+  $ hg archive ../old.zip
+  $ unzip -l ../old.zip
+  Archive:  ../old.zip
+  \s*Length.* (re)
+  *-----* (glob)
+  *147*80*00:00*old/.hg_archival.txt (glob)
+  *0*80*00:00*old/old (glob)
+  *-----* (glob)
+  \s*147\s+2 files (re)
--- a/tests/test-audit-path	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-#!/bin/sh
-
-hg init
-
-echo % should fail
-hg add .hg/00changelog.i
-
-mkdir a
-echo a > a/a
-hg ci -Ama
-ln -s a b
-echo b > a/b
-
-echo % should fail
-hg add b/b
-
-echo % should succeed
-hg add b
-
-echo % should still fail - maybe
-hg add b/b
-
-echo % unbundle tampered bundle
-hg init target
-cd target
-hg unbundle $TESTDIR/tampered.hg
-
-echo % attack .hg/test
-hg manifest -r0
-hg update -Cr0
-
-echo % attack foo/.hg/test
-hg manifest -r1
-hg update -Cr1
-
-echo % attack back/test where back symlinks to ..
-hg manifest -r2
-hg update -Cr2
-
-echo % attack ../test
-hg manifest -r3
-hg update -Cr3
-
-echo % attack /tmp/test
-hg manifest -r4
-hg update -Cr4 2>&1 | sed -e "s|/.*/test-audit-path|[HGTMP]/test-audit-path|"
-
-exit 0
--- a/tests/test-audit-path.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-% should fail
-abort: path contains illegal component: .hg/00changelog.i
-adding a/a
-% should fail
-abort: path 'b/b' traverses symbolic link 'b'
-% should succeed
-% should still fail - maybe
-abort: path 'b/b' traverses symbolic link 'b'
-% unbundle tampered bundle
-adding changesets
-adding manifests
-adding file changes
-added 5 changesets with 6 changes to 6 files (+4 heads)
-(run 'hg heads' to see heads, 'hg merge' to merge)
-% attack .hg/test
-.hg/test
-abort: path contains illegal component: .hg/test
-% attack foo/.hg/test
-foo/.hg/test
-abort: path 'foo/.hg/test' is inside repo 'foo'
-% attack back/test where back symlinks to ..
-back
-back/test
-abort: path 'back/test' traverses symbolic link 'back'
-% attack ../test
-../test
-abort: path contains illegal component: ../test
-% attack /tmp/test
-/tmp/test
-abort: No such file or directory: [HGTMP]/test-audit-path/target//tmp/test
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-audit-path.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,82 @@
+  $ hg init
+
+should fail
+
+  $ hg add .hg/00changelog.i
+  abort: path contains illegal component: .hg/00changelog.i
+  [255]
+
+  $ mkdir a
+  $ echo a > a/a
+  $ hg ci -Ama
+  adding a/a
+  $ ln -s a b
+  $ echo b > a/b
+
+should fail
+
+  $ hg add b/b
+  abort: path 'b/b' traverses symbolic link 'b'
+  [255]
+
+should succeed
+
+  $ hg add b
+
+should still fail - maybe
+
+  $ hg add b/b
+  abort: path 'b/b' traverses symbolic link 'b'
+  [255]
+
+unbundle tampered bundle
+
+  $ hg init target
+  $ cd target
+  $ hg unbundle $TESTDIR/tampered.hg
+  adding changesets
+  adding manifests
+  adding file changes
+  added 5 changesets with 6 changes to 6 files (+4 heads)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+
+attack .hg/test
+
+  $ hg manifest -r0
+  .hg/test
+  $ hg update -Cr0
+  abort: path contains illegal component: .hg/test
+  [255]
+
+attack foo/.hg/test
+
+  $ hg manifest -r1
+  foo/.hg/test
+  $ hg update -Cr1
+  abort: path 'foo/.hg/test' is inside repo 'foo'
+  [255]
+
+attack back/test where back symlinks to ..
+
+  $ hg manifest -r2
+  back
+  back/test
+  $ hg update -Cr2
+  abort: path 'back/test' traverses symbolic link 'back'
+  [255]
+
+attack ../test
+
+  $ hg manifest -r3
+  ../test
+  $ hg update -Cr3
+  abort: path contains illegal component: ../test
+  [255]
+
+attack /tmp/test
+
+  $ hg manifest -r4
+  /tmp/test
+  $ hg update -Cr4
+  abort: No such file or directory: */test-audit-path.t/target//tmp/test (glob)
+  [255]
--- a/tests/test-backout	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,159 +0,0 @@
-#!/bin/sh
-
-HGMERGE=true; export HGMERGE
-
-hg init basic
-cd basic
-
-echo '# should complain'
-hg backout
-hg backout -r 0 0
-
-echo '# basic operation'
-echo a > a
-hg commit -d '0 0' -A -m a
-echo b >> a
-hg commit -d '1 0' -m b
-
-hg backout -d '2 0' tip
-cat a
-
-echo '# file that was removed is recreated'
-cd ..
-hg init remove
-cd remove
-
-echo content > a
-hg commit -d '0 0' -A -m a
-
-hg rm a
-hg commit -d '1 0' -m b
-
-hg backout -d '2 0' --merge tip
-cat a
-
-echo '# backout of backout is as if nothing happened'
-
-hg backout -d '3 0' --merge tip
-cat a 2>/dev/null || echo cat: a: No such file or directory
-
-echo '# across branch'
-cd ..
-hg init branch
-cd branch
-echo a > a
-hg ci -Am0
-echo b > b
-hg ci -Am1
-hg co -C 0
-# should fail
-hg backout 1
-echo c > c
-hg ci -Am2
-# should fail
-hg backout 1
-
-echo '# backout with merge'
-cd ..
-hg init merge
-cd merge
-
-echo line 1 > a
-echo line 2 >> a
-hg commit -d '0 0' -A -m a
-# remove line 1
-echo line 2 > a
-hg commit -d '1 0' -m b
-
-echo line 3 >> a
-hg commit -d '2 0' -m c
-
-hg backout --merge -d '3 0' 1
-hg commit -d '4 0' -m d
-# check line 1 is back
-cat a
-
-echo '# backout should not back out subsequent changesets'
-hg init onecs
-cd onecs
-echo 1 > a
-hg commit -d '0 0' -A -m a
-echo 2 >> a
-hg commit -d '1 0' -m b
-echo 1 > b
-hg commit -d '2 0' -A -m c
-hg backout -d '3 0' 1
-hg locate b
-hg update -C tip
-hg locate b
-
-cd ..
-hg init m
-cd m
-echo a > a
-hg commit -d '0 0' -A -m a
-echo b > b
-hg commit -d '1 0' -A -m b
-echo c > c
-hg commit -d '2 0' -A -m b
-hg update 1
-echo d > d
-hg commit -d '3 0' -A -m c
-hg merge 2
-hg commit -d '4 0' -A -m d
-
-echo '# backout of merge should fail'
-
-hg backout 4
-
-echo '# backout of merge with bad parent should fail'
-
-hg backout --parent 0 4
-
-echo '# backout of non-merge with parent should fail'
-
-hg backout --parent 0 3
-
-echo '# backout with valid parent should be ok'
-
-hg backout -d '5 0' --parent 2 4
-
-hg rollback
-hg update -C
-
-hg backout -d '6 0' --parent 3 4
-
-cd ..
-
-echo '# named branches'
-
-hg init named_branches
-cd named_branches
-
-echo default > default
-hg ci -d '0 0' -Am default
-hg branch branch1
-echo branch1 > file1
-hg ci -d '1 0' -Am file1
-hg branch branch2
-echo branch2 > file2
-hg ci -d '2 0' -Am file2
-hg backout -d '3 0' -r 1 -m 'backout on branch1'
-# XXX maybe backout shouldn't suggest a merge here as it is a different branch?
-
-echo '% on branch2 with branch1 not merged, so file1 should still exist:'
-hg id
-hg st -A
-
-echo '% on branch2 with branch1 merged, so file1 should be gone:'
-hg merge
-hg ci -d '4 0' -m 'merge backout of branch1'
-hg id
-hg st -A
-
-echo '% on branch1, so no file1 and file2:'
-hg co -C branch1
-hg id
-hg st -A
-
-exit 0
--- a/tests/test-backout.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-# should complain
-abort: please specify a revision to backout
-abort: please specify just one revision
-# basic operation
-adding a
-reverting a
-changeset 2:2929462c3dff backs out changeset 1:a820f4f40a57
-a
-# file that was removed is recreated
-adding a
-adding a
-changeset 2:de31bdc76c0d backs out changeset 1:76862dcce372
-content
-# backout of backout is as if nothing happened
-removing a
-changeset 3:7f6d0f120113 backs out changeset 2:de31bdc76c0d
-cat: a: No such file or directory
-# across branch
-adding a
-adding b
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-abort: cannot backout change on a different branch
-adding c
-created new head
-abort: cannot backout change on a different branch
-# backout with merge
-adding a
-reverting a
-created new head
-changeset 3:26b8ccb9ad91 backs out changeset 1:5a50a024c182
-merging with changeset 3:26b8ccb9ad91
-merging a
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-line 1
-line 2
-line 3
-# backout should not back out subsequent changesets
-adding a
-adding b
-reverting a
-created new head
-changeset 3:3202beb76721 backs out changeset 1:22bca4c721e5
-the backout changeset is a new head - do not forget to merge
-(use "backout --merge" if you want to auto-merge)
-b
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-adding a
-adding b
-adding c
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-adding d
-created new head
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-# backout of merge should fail
-abort: cannot backout a merge changeset without --parent
-# backout of merge with bad parent should fail
-abort: cb9a9f314b8b is not a parent of b2f3bb92043e
-# backout of non-merge with parent should fail
-abort: cannot use --parent on non-merge changeset
-# backout with valid parent should be ok
-removing d
-changeset 5:10e5328c8435 backs out changeset 4:b2f3bb92043e
-rolling back to revision 4 (undo commit)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-removing c
-changeset 5:033590168430 backs out changeset 4:b2f3bb92043e
-# named branches
-adding default
-marked working directory as branch branch1
-adding file1
-marked working directory as branch branch2
-adding file2
-removing file1
-created new head
-changeset 3:d4e8f6db59fb backs out changeset 1:bf1602f437f3
-the backout changeset is a new head - do not forget to merge
-(use "backout --merge" if you want to auto-merge)
-% on branch2 with branch1 not merged, so file1 should still exist:
-45bbcd363bf0 (branch2)
-C default
-C file1
-C file2
-% on branch2 with branch1 merged, so file1 should be gone:
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-22149cdde76d (branch2) tip
-C default
-C file2
-% on branch1, so no file1 and file2:
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-bf1602f437f3 (branch1)
-C default
-C file1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-backout.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,261 @@
+  $ HGMERGE=true; export HGMERGE
+
+  $ hg init basic
+  $ cd basic
+
+should complain
+
+  $ hg backout
+  abort: please specify a revision to backout
+  [255]
+  $ hg backout -r 0 0
+  abort: please specify just one revision
+  [255]
+
+basic operation
+
+  $ echo a > a
+  $ hg commit -d '0 0' -A -m a
+  adding a
+  $ echo b >> a
+  $ hg commit -d '1 0' -m b
+
+  $ hg backout -d '2 0' tip
+  reverting a
+  changeset 2:2929462c3dff backs out changeset 1:a820f4f40a57
+  $ cat a
+  a
+
+file that was removed is recreated
+
+  $ cd ..
+  $ hg init remove
+  $ cd remove
+
+  $ echo content > a
+  $ hg commit -d '0 0' -A -m a
+  adding a
+
+  $ hg rm a
+  $ hg commit -d '1 0' -m b
+
+  $ hg backout -d '2 0' --merge tip
+  adding a
+  changeset 2:de31bdc76c0d backs out changeset 1:76862dcce372
+  $ cat a
+  content
+
+backout of backout is as if nothing happened
+
+  $ hg backout -d '3 0' --merge tip
+  removing a
+  changeset 3:7f6d0f120113 backs out changeset 2:de31bdc76c0d
+  $ cat a 2>/dev/null || echo cat: a: No such file or directory
+  cat: a: No such file or directory
+
+across branch
+
+  $ cd ..
+  $ hg init branch
+  $ cd branch
+  $ echo a > a
+  $ hg ci -Am0
+  adding a
+  $ echo b > b
+  $ hg ci -Am1
+  adding b
+  $ hg co -C 0
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+should fail
+
+  $ hg backout 1
+  abort: cannot backout change on a different branch
+  [255]
+  $ echo c > c
+  $ hg ci -Am2
+  adding c
+  created new head
+
+should fail
+
+  $ hg backout 1
+  abort: cannot backout change on a different branch
+  [255]
+
+backout with merge
+
+  $ cd ..
+  $ hg init merge
+  $ cd merge
+
+  $ echo line 1 > a
+  $ echo line 2 >> a
+  $ hg commit -d '0 0' -A -m a
+  adding a
+
+remove line 1
+
+  $ echo line 2 > a
+  $ hg commit -d '1 0' -m b
+
+  $ echo line 3 >> a
+  $ hg commit -d '2 0' -m c
+
+  $ hg backout --merge -d '3 0' 1
+  reverting a
+  created new head
+  changeset 3:26b8ccb9ad91 backs out changeset 1:5a50a024c182
+  merging with changeset 3:26b8ccb9ad91
+  merging a
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg commit -d '4 0' -m d
+
+check line 1 is back
+
+  $ cat a
+  line 1
+  line 2
+  line 3
+
+backout should not back out subsequent changesets
+
+  $ hg init onecs
+  $ cd onecs
+  $ echo 1 > a
+  $ hg commit -d '0 0' -A -m a
+  adding a
+  $ echo 2 >> a
+  $ hg commit -d '1 0' -m b
+  $ echo 1 > b
+  $ hg commit -d '2 0' -A -m c
+  adding b
+  $ hg backout -d '3 0' 1
+  reverting a
+  created new head
+  changeset 3:3202beb76721 backs out changeset 1:22bca4c721e5
+  the backout changeset is a new head - do not forget to merge
+  (use "backout --merge" if you want to auto-merge)
+  $ hg locate b
+  b
+  $ hg update -C tip
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg locate b
+  [1]
+
+  $ cd ..
+  $ hg init m
+  $ cd m
+  $ echo a > a
+  $ hg commit -d '0 0' -A -m a
+  adding a
+  $ echo b > b
+  $ hg commit -d '1 0' -A -m b
+  adding b
+  $ echo c > c
+  $ hg commit -d '2 0' -A -m b
+  adding c
+  $ hg update 1
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo d > d
+  $ hg commit -d '3 0' -A -m c
+  adding d
+  created new head
+  $ hg merge 2
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg commit -d '4 0' -A -m d
+
+backout of merge should fail
+
+  $ hg backout 4
+  abort: cannot backout a merge changeset without --parent
+  [255]
+
+backout of merge with bad parent should fail
+
+  $ hg backout --parent 0 4
+  abort: cb9a9f314b8b is not a parent of b2f3bb92043e
+  [255]
+
+backout of non-merge with parent should fail
+
+  $ hg backout --parent 0 3
+  abort: cannot use --parent on non-merge changeset
+  [255]
+
+backout with valid parent should be ok
+
+  $ hg backout -d '5 0' --parent 2 4
+  removing d
+  changeset 5:10e5328c8435 backs out changeset 4:b2f3bb92043e
+
+  $ hg rollback
+  rolling back to revision 4 (undo commit)
+  $ hg update -C
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ hg backout -d '6 0' --parent 3 4
+  removing c
+  changeset 5:033590168430 backs out changeset 4:b2f3bb92043e
+
+  $ cd ..
+
+named branches
+
+  $ hg init named_branches
+  $ cd named_branches
+
+  $ echo default > default
+  $ hg ci -d '0 0' -Am default
+  adding default
+  $ hg branch branch1
+  marked working directory as branch branch1
+  $ echo branch1 > file1
+  $ hg ci -d '1 0' -Am file1
+  adding file1
+  $ hg branch branch2
+  marked working directory as branch branch2
+  $ echo branch2 > file2
+  $ hg ci -d '2 0' -Am file2
+  adding file2
+  $ hg backout -d '3 0' -r 1 -m 'backout on branch1'
+  removing file1
+  created new head
+  changeset 3:d4e8f6db59fb backs out changeset 1:bf1602f437f3
+  the backout changeset is a new head - do not forget to merge
+  (use "backout --merge" if you want to auto-merge)
+
+XXX maybe backout shouldn't suggest a merge here as it is a different branch?
+
+on branch2 with branch1 not merged, so file1 should still exist:
+
+  $ hg id
+  45bbcd363bf0 (branch2)
+  $ hg st -A
+  C default
+  C file1
+  C file2
+
+on branch2 with branch1 merged, so file1 should be gone:
+
+  $ hg merge
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg ci -d '4 0' -m 'merge backout of branch1'
+  $ hg id
+  22149cdde76d (branch2) tip
+  $ hg st -A
+  C default
+  C file2
+
+on branch1, so no file1 and file2:
+
+  $ hg co -C branch1
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg id
+  bf1602f437f3 (branch1)
+  $ hg st -A
+  C default
+  C file1
--- a/tests/test-backwards-remove	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-#!/bin/sh
-hg init
-echo This is file a1 > a
-hg add a
-hg commit -m "commit #0" -d "1000000 0"
-ls
-echo This is file b1 > b
-hg add b
-hg commit -m "commit #1" -d "1000000 0"
-hg co 0
-# B should disappear
-ls
--- a/tests/test-backwards-remove.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-a
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-backwards-remove.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,16 @@
+  $ hg init
+  $ echo This is file a1 > a
+  $ hg add a
+  $ hg commit -m "commit #0"
+  $ ls
+  a
+  $ echo This is file b1 > b
+  $ hg add b
+  $ hg commit -m "commit #1"
+  $ hg co 0
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+B should disappear
+
+  $ ls
+  a
--- a/tests/test-bad-extension	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-#!/bin/sh
-
-echo 'raise Exception("bit bucket overflow")' > badext.py
-abspath=`pwd`/badext.py
-
-echo '[extensions]' >> $HGRCPATH
-echo "gpg =" >> $HGRCPATH
-echo "hgext.gpg =" >> $HGRCPATH
-echo "badext = $abspath" >> $HGRCPATH
-echo "badext2 =" >> $HGRCPATH
-
-hg -q help help 2>&1 | python -c \
-  "import sys; sys.stdout.write(sys.stdin.read().replace('$abspath', '.../badext.py'))"
--- a/tests/test-bad-extension.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-*** failed to import extension badext from .../badext.py: bit bucket overflow
-*** failed to import extension badext2: No module named badext2
-hg help [TOPIC]
-
-show help for a given topic or a help overview
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-bad-extension.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,15 @@
+  $ echo 'raise Exception("bit bucket overflow")' > badext.py
+  $ abspath=`pwd`/badext.py
+
+  $ echo '[extensions]' >> $HGRCPATH
+  $ echo "gpg =" >> $HGRCPATH
+  $ echo "hgext.gpg =" >> $HGRCPATH
+  $ echo "badext = $abspath" >> $HGRCPATH
+  $ echo "badext2 =" >> $HGRCPATH
+
+  $ hg -q help help
+  \*\*\* failed to import extension badext from */badext.py: bit bucket overflow (glob)
+  *** failed to import extension badext2: No module named badext2
+  hg help [TOPIC]
+  
+  show help for a given topic or a help overview
--- a/tests/test-bad-pull	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-#!/bin/sh
-
-hg clone http://localhost:$HGPORT/ copy
-echo $?
-test -d copy || echo copy: No such file or directory
-
-cat > dumb.py <<EOF
-import BaseHTTPServer, SimpleHTTPServer, os, signal
-
-def run(server_class=BaseHTTPServer.HTTPServer,
-        handler_class=SimpleHTTPServer.SimpleHTTPRequestHandler):
-    server_address = ('localhost', int(os.environ['HGPORT']))
-    httpd = server_class(server_address, handler_class)
-    httpd.serve_forever()
-
-signal.signal(signal.SIGTERM, lambda x: sys.exit(0))
-run()
-EOF
-
-python dumb.py 2>/dev/null &
-echo $! >> $DAEMON_PIDS
-
-# give the server some time to start running
-sleep 1
-
-hg clone http://localhost:$HGPORT/foo copy2 2>&1 | \
-    sed -e 's/404.*/404/' -e 's/Date:.*/Date:/'
-echo $?
-
-kill $!
--- a/tests/test-bad-pull.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-abort: error: Connection refused
-255
-copy: No such file or directory
-abort: HTTP Error 404
-0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-bad-pull.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,30 @@
+  $ hg clone http://localhost:$HGPORT/ copy
+  abort: error: Connection refused
+  [255]
+
+  $ test -d copy || echo copy: No such file or directory
+  copy: No such file or directory
+
+  $ cat > dumb.py <<EOF
+  > import BaseHTTPServer, SimpleHTTPServer, os, signal
+  > def run(server_class=BaseHTTPServer.HTTPServer,
+  >         handler_class=SimpleHTTPServer.SimpleHTTPRequestHandler):
+  >     server_address = ('localhost', int(os.environ['HGPORT']))
+  >     httpd = server_class(server_address, handler_class)
+  >     httpd.serve_forever()
+  > signal.signal(signal.SIGTERM, lambda x: sys.exit(0))
+  > run()
+  > EOF
+
+  $ python dumb.py 2>/dev/null &
+  $ echo $! >> $DAEMON_PIDS
+
+give the server some time to start running
+
+  $ sleep 1
+
+  $ hg clone http://localhost:$HGPORT/foo copy2 2>&1
+  abort: HTTP Error 404: * (glob)
+  [255]
+
+  $ kill $!
--- a/tests/test-basic	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-#!/bin/sh
-
-mkdir t
-cd t
-hg init
-echo a > a
-hg add a
-hg commit -m test -d "1000000 0"
-hg history
-hg manifest --debug
-hg cat a
-hg verify
--- a/tests/test-basic.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-changeset:   0:0acdaf898367
-tag:         tip
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     test
-
-b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 644   a
-a
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 1 changesets, 1 total revisions
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-basic.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,40 @@
+Create a repository:
+
+  $ mkdir t
+  $ cd t
+  $ hg init
+
+Make a changeset:
+
+  $ echo a > a
+  $ hg add a
+  $ hg commit -m test
+
+This command is ancient:
+
+  $ hg history
+  changeset:   0:acb14030fe0a
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     test
+  
+
+Poke around at hashes:
+
+  $ hg manifest --debug
+  b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 644   a
+
+  $ hg cat a
+  a
+
+Verify should succeed:
+
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 1 changesets, 1 total revisions
+
+At the end...
--- a/tests/test-bheads	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,186 +0,0 @@
-#!/bin/sh
-
-heads()
-{
-    hg heads --template '{rev}: {desc|firstline|strip} ({branches})\n' "$@"
-}
-
-hg init a
-cd a
-echo 'root' >root
-hg add root
-hg commit -m "Adding root node"
-heads
-echo '-------'
-heads .
-
-echo '======='
-echo 'a' >a
-hg add a
-hg branch a
-hg commit -m "Adding a branch"
-heads
-echo '-------'
-heads .
-
-echo '======='
-hg update -C 0
-echo 'b' >b
-hg add b
-hg branch b
-hg commit -m "Adding b branch"
-heads
-echo '-------'
-heads .
-
-echo '======='
-echo 'bh1' >bh1
-hg add bh1
-hg commit -m "Adding b branch head 1"
-heads
-echo '-------'
-heads .
-
-echo '======='
-hg update -C 2
-echo 'bh2' >bh2
-hg add bh2
-hg commit -m "Adding b branch head 2"
-heads
-echo '-------'
-heads .
-
-echo '======='
-hg update -C 2
-echo 'bh3' >bh3
-hg add bh3
-hg commit -m "Adding b branch head 3"
-heads
-echo '-------'
-heads .
-
-echo '======='
-hg merge 4
-hg commit -m "Merging b branch head 2 and b branch head 3"
-heads
-echo '-------'
-heads .
-
-echo '======='
-echo 'c' >c
-hg add c
-hg branch c
-hg commit -m "Adding c branch"
-heads
-echo '-------'
-heads .
-
-echo '======='
-heads -r 3 .
-echo $?
-echo '-------'
-heads -r 2 .
-echo $?
-echo '-------'
-hg update -C 4
-echo $?
-echo '-------'
-heads -r 3 .
-echo $?
-echo '-------'
-heads -r 2 .
-echo $?
-echo '-------'
-heads -r 7 .
-echo $?
-
-echo '======='
-for i in 0 1 2 3 4 5 6 7; do
-    hg update -C "$i"
-    heads
-    echo '-------'
-    heads .
-    echo '-------'
-done
-
-echo '======='
-for i in a b c z; do
-    heads "$i"
-    echo '-------'
-done
-
-echo '======='
-heads 0 1 2 3 4 5 6 7
-
-echo '% topological heads'
-heads -t
-
-echo '______________'
-cd ..
-
-hg init newheadmsg
-cd newheadmsg
-
-echo '% created new head message'
-echo '% init: no msg'
-echo 1 > a
-hg ci -Am "a0: Initial root"
-echo 2 >> a
-hg ci -m "a1 (HN)"
-
-hg branch b
-echo 1 > b
-hg ci -Am "b2: Initial root for branch b"
-echo 2 >> b
-hg ci -m "b3 (HN)"
-
-echo '% case NN: msg'
-hg up -q null
-hg branch -f b
-echo 1 > bb
-hg ci -Am "b4 (NN): new topo root for branch b"
-
-echo '% case HN: no msg'
-echo 2 >> bb
-hg ci -m "b5 (HN)"
-
-echo '% case BN: msg'
-hg branch -f default
-echo 1 > aa
-hg ci -Am "a6 (BN): new branch root"
-
-echo '% case CN: msg'
-hg up -q 4
-echo 3 >> bbb
-hg ci -Am "b7 (CN): regular new head"
-
-echo '% case BB: msg'
-hg up -q 4
-hg merge -q 3
-hg branch -f default
-hg ci -m "a8 (BB): weird new branch root"
-
-echo '% case CB: msg'
-hg up -q 4
-hg merge -q 1
-hg ci -m "b9 (CB): new head from branch merge"
-
-echo '% case HB: no msg'
-hg up -q 7
-hg merge -q 6
-hg ci -m "b10 (HB): continuing head from branch merge"
-
-echo '% case CC: msg'
-hg up -q 4
-hg merge -q 2
-hg ci -m "b11 (CC): new head from merge"
-
-echo '% case CH: no msg'
-hg up -q 2
-hg merge -q 10
-hg ci -m "b12 (CH): continuing head from merge"
-
-echo '% case HH: no msg'
-hg merge -q 3
-hg ci -m "b12 (HH): merging two heads"
-
--- a/tests/test-bheads.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,209 +0,0 @@
-0: Adding root node ()
--------
-0: Adding root node ()
-=======
-marked working directory as branch a
-1: Adding a branch (a)
-0: Adding root node ()
--------
-1: Adding a branch (a)
-=======
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-marked working directory as branch b
-2: Adding b branch (b)
-1: Adding a branch (a)
-0: Adding root node ()
--------
-2: Adding b branch (b)
-=======
-3: Adding b branch head 1 (b)
-1: Adding a branch (a)
-0: Adding root node ()
--------
-3: Adding b branch head 1 (b)
-=======
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-created new head
-4: Adding b branch head 2 (b)
-3: Adding b branch head 1 (b)
-1: Adding a branch (a)
-0: Adding root node ()
--------
-4: Adding b branch head 2 (b)
-3: Adding b branch head 1 (b)
-=======
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-created new head
-5: Adding b branch head 3 (b)
-4: Adding b branch head 2 (b)
-3: Adding b branch head 1 (b)
-1: Adding a branch (a)
-0: Adding root node ()
--------
-5: Adding b branch head 3 (b)
-4: Adding b branch head 2 (b)
-3: Adding b branch head 1 (b)
-=======
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-6: Merging b branch head 2 and b branch head 3 (b)
-3: Adding b branch head 1 (b)
-1: Adding a branch (a)
-0: Adding root node ()
--------
-6: Merging b branch head 2 and b branch head 3 (b)
-3: Adding b branch head 1 (b)
-=======
-marked working directory as branch c
-7: Adding c branch (c)
-6: Merging b branch head 2 and b branch head 3 (b)
-3: Adding b branch head 1 (b)
-1: Adding a branch (a)
-0: Adding root node ()
--------
-7: Adding c branch (c)
-=======
-no open branch heads found on branches c (started at 3)
-1
--------
-7: Adding c branch (c)
-0
--------
-0 files updated, 0 files merged, 2 files removed, 0 files unresolved
-0
--------
-3: Adding b branch head 1 (b)
-0
--------
-6: Merging b branch head 2 and b branch head 3 (b)
-3: Adding b branch head 1 (b)
-0
--------
-no open branch heads found on branches b (started at 7)
-1
-=======
-0 files updated, 0 files merged, 2 files removed, 0 files unresolved
-7: Adding c branch (c)
-6: Merging b branch head 2 and b branch head 3 (b)
-3: Adding b branch head 1 (b)
-1: Adding a branch (a)
-0: Adding root node ()
--------
-0: Adding root node ()
--------
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-7: Adding c branch (c)
-6: Merging b branch head 2 and b branch head 3 (b)
-3: Adding b branch head 1 (b)
-1: Adding a branch (a)
-0: Adding root node ()
--------
-1: Adding a branch (a)
--------
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-7: Adding c branch (c)
-6: Merging b branch head 2 and b branch head 3 (b)
-3: Adding b branch head 1 (b)
-1: Adding a branch (a)
-0: Adding root node ()
--------
-6: Merging b branch head 2 and b branch head 3 (b)
-3: Adding b branch head 1 (b)
--------
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-7: Adding c branch (c)
-6: Merging b branch head 2 and b branch head 3 (b)
-3: Adding b branch head 1 (b)
-1: Adding a branch (a)
-0: Adding root node ()
--------
-6: Merging b branch head 2 and b branch head 3 (b)
-3: Adding b branch head 1 (b)
--------
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-7: Adding c branch (c)
-6: Merging b branch head 2 and b branch head 3 (b)
-3: Adding b branch head 1 (b)
-1: Adding a branch (a)
-0: Adding root node ()
--------
-6: Merging b branch head 2 and b branch head 3 (b)
-3: Adding b branch head 1 (b)
--------
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-7: Adding c branch (c)
-6: Merging b branch head 2 and b branch head 3 (b)
-3: Adding b branch head 1 (b)
-1: Adding a branch (a)
-0: Adding root node ()
--------
-6: Merging b branch head 2 and b branch head 3 (b)
-3: Adding b branch head 1 (b)
--------
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-7: Adding c branch (c)
-6: Merging b branch head 2 and b branch head 3 (b)
-3: Adding b branch head 1 (b)
-1: Adding a branch (a)
-0: Adding root node ()
--------
-6: Merging b branch head 2 and b branch head 3 (b)
-3: Adding b branch head 1 (b)
--------
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-7: Adding c branch (c)
-6: Merging b branch head 2 and b branch head 3 (b)
-3: Adding b branch head 1 (b)
-1: Adding a branch (a)
-0: Adding root node ()
--------
-7: Adding c branch (c)
--------
-=======
-1: Adding a branch (a)
--------
-6: Merging b branch head 2 and b branch head 3 (b)
-3: Adding b branch head 1 (b)
--------
-7: Adding c branch (c)
--------
-abort: unknown revision 'z'!
--------
-=======
-7: Adding c branch (c)
-6: Merging b branch head 2 and b branch head 3 (b)
-3: Adding b branch head 1 (b)
-1: Adding a branch (a)
-0: Adding root node ()
-% topological heads
-7: Adding c branch (c)
-3: Adding b branch head 1 (b)
-1: Adding a branch (a)
-______________
-% created new head message
-% init: no msg
-adding a
-marked working directory as branch b
-adding b
-% case NN: msg
-marked working directory as branch b
-adding bb
-created new head
-% case HN: no msg
-% case BN: msg
-marked working directory as branch default
-adding aa
-created new head
-% case CN: msg
-adding bbb
-created new head
-% case BB: msg
-marked working directory as branch default
-created new head
-% case CB: msg
-created new head
-% case HB: no msg
-% case CC: msg
-created new head
-% case CH: no msg
-% case HH: no msg
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-bheads.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,367 @@
+  $ heads()
+  > {
+  >    hg heads --template '{rev}: {desc|firstline|strip} ({branches})\n' "$@"
+  > }
+
+  $ hg init a
+  $ cd a
+  $ echo 'root' >root
+  $ hg add root
+  $ hg commit -m "Adding root node"
+  $ heads
+  0: Adding root node ()
+-------
+  $ heads .
+  0: Adding root node ()
+
+=======
+
+  $ echo 'a' >a
+  $ hg add a
+  $ hg branch a
+  marked working directory as branch a
+  $ hg commit -m "Adding a branch"
+  $ heads
+  1: Adding a branch (a)
+  0: Adding root node ()
+-------
+  $ heads .
+  1: Adding a branch (a)
+
+=======
+
+  $ hg update -C 0
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo 'b' >b
+  $ hg add b
+  $ hg branch b
+  marked working directory as branch b
+  $ hg commit -m "Adding b branch"
+  $ heads
+  2: Adding b branch (b)
+  1: Adding a branch (a)
+  0: Adding root node ()
+-------
+  $ heads .
+  2: Adding b branch (b)
+
+=======
+
+  $ echo 'bh1' >bh1
+  $ hg add bh1
+  $ hg commit -m "Adding b branch head 1"
+  $ heads
+  3: Adding b branch head 1 (b)
+  1: Adding a branch (a)
+  0: Adding root node ()
+-------
+  $ heads .
+  3: Adding b branch head 1 (b)
+
+=======
+
+  $ hg update -C 2
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo 'bh2' >bh2
+  $ hg add bh2
+  $ hg commit -m "Adding b branch head 2"
+  created new head
+  $ heads
+  4: Adding b branch head 2 (b)
+  3: Adding b branch head 1 (b)
+  1: Adding a branch (a)
+  0: Adding root node ()
+  $ heads .
+  4: Adding b branch head 2 (b)
+  3: Adding b branch head 1 (b)
+
+=======
+
+  $ hg update -C 2
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo 'bh3' >bh3
+  $ hg add bh3
+  $ hg commit -m "Adding b branch head 3"
+  created new head
+  $ heads
+  5: Adding b branch head 3 (b)
+  4: Adding b branch head 2 (b)
+  3: Adding b branch head 1 (b)
+  1: Adding a branch (a)
+  0: Adding root node ()
+-------
+  $ heads .
+  5: Adding b branch head 3 (b)
+  4: Adding b branch head 2 (b)
+  3: Adding b branch head 1 (b)
+
+=======
+
+  $ hg merge 4
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg commit -m "Merging b branch head 2 and b branch head 3"
+  $ heads
+  6: Merging b branch head 2 and b branch head 3 (b)
+  3: Adding b branch head 1 (b)
+  1: Adding a branch (a)
+  0: Adding root node ()
+-------
+  $ heads .
+  6: Merging b branch head 2 and b branch head 3 (b)
+  3: Adding b branch head 1 (b)
+
+=======
+
+  $ echo 'c' >c
+  $ hg add c
+  $ hg branch c
+  marked working directory as branch c
+  $ hg commit -m "Adding c branch"
+  $ heads
+  7: Adding c branch (c)
+  6: Merging b branch head 2 and b branch head 3 (b)
+  3: Adding b branch head 1 (b)
+  1: Adding a branch (a)
+  0: Adding root node ()
+-------
+  $ heads .
+  7: Adding c branch (c)
+
+=======
+
+  $ heads -r 3 .
+  no open branch heads found on branches c (started at 3)
+  [1]
+  $ heads -r 2 .
+  7: Adding c branch (c)
+-------
+  $ hg update -C 4
+  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
+-------
+  $ heads -r 3 .
+  3: Adding b branch head 1 (b)
+-------
+  $ heads -r 2 .
+  6: Merging b branch head 2 and b branch head 3 (b)
+  3: Adding b branch head 1 (b)
+-------
+  $ heads -r 7 .
+  no open branch heads found on branches b (started at 7)
+  [1]
+
+=======
+
+  $ for i in 0 1 2 3 4 5 6 7; do
+  >     hg update -C "$i"
+  >     heads
+  >     echo '-------'
+  >     heads .
+  >     echo '-------'
+  > done
+  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  7: Adding c branch (c)
+  6: Merging b branch head 2 and b branch head 3 (b)
+  3: Adding b branch head 1 (b)
+  1: Adding a branch (a)
+  0: Adding root node ()
+  -------
+  0: Adding root node ()
+  -------
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  7: Adding c branch (c)
+  6: Merging b branch head 2 and b branch head 3 (b)
+  3: Adding b branch head 1 (b)
+  1: Adding a branch (a)
+  0: Adding root node ()
+  -------
+  1: Adding a branch (a)
+  -------
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  7: Adding c branch (c)
+  6: Merging b branch head 2 and b branch head 3 (b)
+  3: Adding b branch head 1 (b)
+  1: Adding a branch (a)
+  0: Adding root node ()
+  -------
+  6: Merging b branch head 2 and b branch head 3 (b)
+  3: Adding b branch head 1 (b)
+  -------
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  7: Adding c branch (c)
+  6: Merging b branch head 2 and b branch head 3 (b)
+  3: Adding b branch head 1 (b)
+  1: Adding a branch (a)
+  0: Adding root node ()
+  -------
+  6: Merging b branch head 2 and b branch head 3 (b)
+  3: Adding b branch head 1 (b)
+  -------
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  7: Adding c branch (c)
+  6: Merging b branch head 2 and b branch head 3 (b)
+  3: Adding b branch head 1 (b)
+  1: Adding a branch (a)
+  0: Adding root node ()
+  -------
+  6: Merging b branch head 2 and b branch head 3 (b)
+  3: Adding b branch head 1 (b)
+  -------
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  7: Adding c branch (c)
+  6: Merging b branch head 2 and b branch head 3 (b)
+  3: Adding b branch head 1 (b)
+  1: Adding a branch (a)
+  0: Adding root node ()
+  -------
+  6: Merging b branch head 2 and b branch head 3 (b)
+  3: Adding b branch head 1 (b)
+  -------
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  7: Adding c branch (c)
+  6: Merging b branch head 2 and b branch head 3 (b)
+  3: Adding b branch head 1 (b)
+  1: Adding a branch (a)
+  0: Adding root node ()
+  -------
+  6: Merging b branch head 2 and b branch head 3 (b)
+  3: Adding b branch head 1 (b)
+  -------
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  7: Adding c branch (c)
+  6: Merging b branch head 2 and b branch head 3 (b)
+  3: Adding b branch head 1 (b)
+  1: Adding a branch (a)
+  0: Adding root node ()
+  -------
+  7: Adding c branch (c)
+  -------
+
+=======
+
+  $ for i in a b c z; do
+  >     heads "$i"
+  >     echo '-------'
+  > done
+  1: Adding a branch (a)
+  -------
+  6: Merging b branch head 2 and b branch head 3 (b)
+  3: Adding b branch head 1 (b)
+  -------
+  7: Adding c branch (c)
+  -------
+  abort: unknown revision 'z'!
+  -------
+
+=======
+
+  $ heads 0 1 2 3 4 5 6 7
+  7: Adding c branch (c)
+  6: Merging b branch head 2 and b branch head 3 (b)
+  3: Adding b branch head 1 (b)
+  1: Adding a branch (a)
+  0: Adding root node ()
+
+Topological heads:
+
+  $ heads -t
+  7: Adding c branch (c)
+  3: Adding b branch head 1 (b)
+  1: Adding a branch (a)
+
+  $ cd ..
+______________
+
+"created new head" message tests
+
+  $ hg init newheadmsg
+  $ cd newheadmsg
+
+Init: no msg
+
+  $ echo 1 > a
+  $ hg ci -Am "a0: Initial root"
+  adding a
+  $ echo 2 >> a
+  $ hg ci -m "a1 (HN)"
+
+  $ hg branch b
+  marked working directory as branch b
+  $ echo 1 > b
+  $ hg ci -Am "b2: Initial root for branch b"
+  adding b
+  $ echo 2 >> b
+  $ hg ci -m "b3 (HN)"
+
+Case NN: msg
+
+  $ hg up -q null
+  $ hg branch -f b
+  marked working directory as branch b
+  $ echo 1 > bb
+  $ hg ci -Am "b4 (NN): new topo root for branch b"
+  adding bb
+  created new head
+
+Case HN: no msg
+
+  $ echo 2 >> bb
+  $ hg ci -m "b5 (HN)"
+
+Case BN: msg
+
+  $ hg branch -f default
+  marked working directory as branch default
+  $ echo 1 > aa
+  $ hg ci -Am "a6 (BN): new branch root"
+  adding aa
+  created new head
+
+Case CN: msg
+
+  $ hg up -q 4
+  $ echo 3 >> bbb
+  $ hg ci -Am "b7 (CN): regular new head"
+  adding bbb
+  created new head
+
+Case BB: msg
+
+  $ hg up -q 4
+  $ hg merge -q 3
+  $ hg branch -f default
+  marked working directory as branch default
+  $ hg ci -m "a8 (BB): weird new branch root"
+  created new head
+
+Case CB: msg
+
+  $ hg up -q 4
+  $ hg merge -q 1
+  $ hg ci -m "b9 (CB): new head from branch merge"
+  created new head
+
+Case HB: no msg
+
+  $ hg up -q 7
+  $ hg merge -q 6
+  $ hg ci -m "b10 (HB): continuing head from branch merge"
+
+Case CC: msg
+
+  $ hg up -q 4
+  $ hg merge -q 2
+  $ hg ci -m "b11 (CC): new head from merge"
+  created new head
+
+Case CH: no msg
+
+  $ hg up -q 2
+  $ hg merge -q 10
+  $ hg ci -m "b12 (CH): continuing head from merge"
+
+Case HH: no msg
+
+  $ hg merge -q 3
+  $ hg ci -m "b12 (HH): merging two heads"
+
--- a/tests/test-bisect	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +0,0 @@
-#!/bin/sh
-
-set -e
-
-echo % init
-hg init
-
-echo % committing changes
-count=0
-echo > a
-while test $count -lt 32 ; do
-    echo 'a' >> a
-    test $count -eq 0 && hg add
-    hg ci -m "msg $count" -d "$count 0"
-    echo % committed changeset $count
-    count=`expr $count + 1`
-done
-
-echo % log
-hg log
-
-echo % hg up -C
-hg up -C
-
-echo % bisect test
-hg bisect -r
-hg bisect -b
-hg bisect -g 1
-hg bisect -g
-echo skip
-hg bisect -s
-hg bisect -g
-hg bisect -g
-hg bisect -b
-hg bisect -g
-
-echo % bisect reverse test
-hg bisect -r
-hg bisect -b null
-hg bisect -g tip
-hg bisect -g
-echo skip
-hg bisect -s
-hg bisect -g
-hg bisect -g
-hg bisect -b
-hg bisect -g
-
-hg bisect -r
-hg bisect -g tip
-hg bisect -b tip || echo error
-
-hg bisect -r
-hg bisect -g null
-hg bisect -bU tip
-hg id
-
-echo % reproduce AssertionError, issue1228 and issue1182
-hg bisect -r
-hg bisect -b 4
-hg bisect -g 0
-hg bisect -s
-hg bisect -s
-hg bisect -s
-
-echo % reproduce non converging bisect, issue1182
-hg bisect -r
-hg bisect -g 0
-hg bisect -b 2
-hg bisect -s
-
-echo % test no action
-hg bisect -r
-hg bisect || echo failure
-
-echo % reproduce AssertionError, issue1445
-hg bisect -r
-hg bisect -b 6
-hg bisect -g 0
-hg bisect -s
-hg bisect -s
-hg bisect -s
-hg bisect -s 
-hg bisect -g
-
-set +e
-
-echo % test invalid command
-# assuming that the shell returns 127 if command not found ...
-hg bisect -r
-hg bisect --command 'exit 127'
-
-echo % test bisecting command
-cat > script.py <<EOF
-#!/usr/bin/env python
-import sys
-from mercurial import ui, hg
-repo = hg.repository(ui.ui(), '.')
-if repo['.'].rev() < 6:
-    sys.exit(1)
-EOF
-chmod +x script.py
-hg bisect -r
-hg bisect --good tip
-hg bisect --bad 0
-hg bisect --command "'`pwd`/script.py' and some parameters"
-true
--- a/tests/test-bisect.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,321 +0,0 @@
-% init
-% committing changes
-adding a
-% committed changeset 0
-% committed changeset 1
-% committed changeset 2
-% committed changeset 3
-% committed changeset 4
-% committed changeset 5
-% committed changeset 6
-% committed changeset 7
-% committed changeset 8
-% committed changeset 9
-% committed changeset 10
-% committed changeset 11
-% committed changeset 12
-% committed changeset 13
-% committed changeset 14
-% committed changeset 15
-% committed changeset 16
-% committed changeset 17
-% committed changeset 18
-% committed changeset 19
-% committed changeset 20
-% committed changeset 21
-% committed changeset 22
-% committed changeset 23
-% committed changeset 24
-% committed changeset 25
-% committed changeset 26
-% committed changeset 27
-% committed changeset 28
-% committed changeset 29
-% committed changeset 30
-% committed changeset 31
-% log
-changeset:   31:58c80a7c8a40
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:31 1970 +0000
-summary:     msg 31
-
-changeset:   30:ed2d2f24b11c
-user:        test
-date:        Thu Jan 01 00:00:30 1970 +0000
-summary:     msg 30
-
-changeset:   29:b5bd63375ab9
-user:        test
-date:        Thu Jan 01 00:00:29 1970 +0000
-summary:     msg 29
-
-changeset:   28:8e0c2264c8af
-user:        test
-date:        Thu Jan 01 00:00:28 1970 +0000
-summary:     msg 28
-
-changeset:   27:288867a866e9
-user:        test
-date:        Thu Jan 01 00:00:27 1970 +0000
-summary:     msg 27
-
-changeset:   26:3efc6fd51aeb
-user:        test
-date:        Thu Jan 01 00:00:26 1970 +0000
-summary:     msg 26
-
-changeset:   25:02a84173a97a
-user:        test
-date:        Thu Jan 01 00:00:25 1970 +0000
-summary:     msg 25
-
-changeset:   24:10e0acd3809e
-user:        test
-date:        Thu Jan 01 00:00:24 1970 +0000
-summary:     msg 24
-
-changeset:   23:5ec79163bff4
-user:        test
-date:        Thu Jan 01 00:00:23 1970 +0000
-summary:     msg 23
-
-changeset:   22:06c7993750ce
-user:        test
-date:        Thu Jan 01 00:00:22 1970 +0000
-summary:     msg 22
-
-changeset:   21:e5db6aa3fe2a
-user:        test
-date:        Thu Jan 01 00:00:21 1970 +0000
-summary:     msg 21
-
-changeset:   20:7128fb4fdbc9
-user:        test
-date:        Thu Jan 01 00:00:20 1970 +0000
-summary:     msg 20
-
-changeset:   19:52798545b482
-user:        test
-date:        Thu Jan 01 00:00:19 1970 +0000
-summary:     msg 19
-
-changeset:   18:86977a90077e
-user:        test
-date:        Thu Jan 01 00:00:18 1970 +0000
-summary:     msg 18
-
-changeset:   17:03515f4a9080
-user:        test
-date:        Thu Jan 01 00:00:17 1970 +0000
-summary:     msg 17
-
-changeset:   16:a2e6ea4973e9
-user:        test
-date:        Thu Jan 01 00:00:16 1970 +0000
-summary:     msg 16
-
-changeset:   15:e7fa0811edb0
-user:        test
-date:        Thu Jan 01 00:00:15 1970 +0000
-summary:     msg 15
-
-changeset:   14:ce8f0998e922
-user:        test
-date:        Thu Jan 01 00:00:14 1970 +0000
-summary:     msg 14
-
-changeset:   13:9d7d07bc967c
-user:        test
-date:        Thu Jan 01 00:00:13 1970 +0000
-summary:     msg 13
-
-changeset:   12:1941b52820a5
-user:        test
-date:        Thu Jan 01 00:00:12 1970 +0000
-summary:     msg 12
-
-changeset:   11:7b4cd9578619
-user:        test
-date:        Thu Jan 01 00:00:11 1970 +0000
-summary:     msg 11
-
-changeset:   10:7c5eff49a6b6
-user:        test
-date:        Thu Jan 01 00:00:10 1970 +0000
-summary:     msg 10
-
-changeset:   9:eb44510ef29a
-user:        test
-date:        Thu Jan 01 00:00:09 1970 +0000
-summary:     msg 9
-
-changeset:   8:453eb4dba229
-user:        test
-date:        Thu Jan 01 00:00:08 1970 +0000
-summary:     msg 8
-
-changeset:   7:03750880c6b5
-user:        test
-date:        Thu Jan 01 00:00:07 1970 +0000
-summary:     msg 7
-
-changeset:   6:a3d5c6fdf0d3
-user:        test
-date:        Thu Jan 01 00:00:06 1970 +0000
-summary:     msg 6
-
-changeset:   5:7874a09ea728
-user:        test
-date:        Thu Jan 01 00:00:05 1970 +0000
-summary:     msg 5
-
-changeset:   4:9b2ba8336a65
-user:        test
-date:        Thu Jan 01 00:00:04 1970 +0000
-summary:     msg 4
-
-changeset:   3:b53bea5e2fcb
-user:        test
-date:        Thu Jan 01 00:00:03 1970 +0000
-summary:     msg 3
-
-changeset:   2:db07c04beaca
-user:        test
-date:        Thu Jan 01 00:00:02 1970 +0000
-summary:     msg 2
-
-changeset:   1:5cd978ea5149
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-summary:     msg 1
-
-changeset:   0:b99c7b9c8e11
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     msg 0
-
-% hg up -C
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% bisect test
-Testing changeset 16:a2e6ea4973e9 (30 changesets remaining, ~4 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-Testing changeset 23:5ec79163bff4 (15 changesets remaining, ~3 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-skip
-Testing changeset 24:10e0acd3809e (15 changesets remaining, ~3 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-Testing changeset 27:288867a866e9 (7 changesets remaining, ~2 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-Testing changeset 29:b5bd63375ab9 (4 changesets remaining, ~2 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-Testing changeset 28:8e0c2264c8af (2 changesets remaining, ~1 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-The first bad revision is:
-changeset:   29:b5bd63375ab9
-user:        test
-date:        Thu Jan 01 00:00:29 1970 +0000
-summary:     msg 29
-
-% bisect reverse test
-Testing changeset 15:e7fa0811edb0 (32 changesets remaining, ~5 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-Testing changeset 7:03750880c6b5 (16 changesets remaining, ~4 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-skip
-Testing changeset 6:a3d5c6fdf0d3 (16 changesets remaining, ~4 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-Testing changeset 2:db07c04beaca (7 changesets remaining, ~2 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-Testing changeset 0:b99c7b9c8e11 (3 changesets remaining, ~1 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-Testing changeset 1:5cd978ea5149 (2 changesets remaining, ~1 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-The first good revision is:
-changeset:   1:5cd978ea5149
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-summary:     msg 1
-
-abort: starting revisions are not directly related
-error
-Testing changeset 15:e7fa0811edb0 (32 changesets remaining, ~5 tests)
-5cd978ea5149
-% reproduce AssertionError, issue1228 and issue1182
-Testing changeset 2:db07c04beaca (4 changesets remaining, ~2 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-Testing changeset 1:5cd978ea5149 (4 changesets remaining, ~2 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-Testing changeset 3:b53bea5e2fcb (4 changesets remaining, ~2 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-Due to skipped revisions, the first bad revision could be any of:
-changeset:   1:5cd978ea5149
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-summary:     msg 1
-
-changeset:   2:db07c04beaca
-user:        test
-date:        Thu Jan 01 00:00:02 1970 +0000
-summary:     msg 2
-
-changeset:   3:b53bea5e2fcb
-user:        test
-date:        Thu Jan 01 00:00:03 1970 +0000
-summary:     msg 3
-
-changeset:   4:9b2ba8336a65
-user:        test
-date:        Thu Jan 01 00:00:04 1970 +0000
-summary:     msg 4
-
-% reproduce non converging bisect, issue1182
-Testing changeset 1:5cd978ea5149 (2 changesets remaining, ~1 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-Due to skipped revisions, the first bad revision could be any of:
-changeset:   1:5cd978ea5149
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-summary:     msg 1
-
-changeset:   2:db07c04beaca
-user:        test
-date:        Thu Jan 01 00:00:02 1970 +0000
-summary:     msg 2
-
-% test no action
-abort: cannot bisect (no known good revisions)
-failure
-% reproduce AssertionError, issue1445
-Testing changeset 3:b53bea5e2fcb (6 changesets remaining, ~2 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-Testing changeset 2:db07c04beaca (6 changesets remaining, ~2 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-Testing changeset 4:9b2ba8336a65 (6 changesets remaining, ~2 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-Testing changeset 1:5cd978ea5149 (6 changesets remaining, ~2 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-Testing changeset 5:7874a09ea728 (6 changesets remaining, ~2 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-The first bad revision is:
-changeset:   6:a3d5c6fdf0d3
-user:        test
-date:        Thu Jan 01 00:00:06 1970 +0000
-summary:     msg 6
-
-% test invalid command
-abort: failed to execute exit 127
-% test bisecting command
-Testing changeset 15:e7fa0811edb0 (31 changesets remaining, ~4 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-Changeset 15:e7fa0811edb0: good
-Changeset 7:03750880c6b5: good
-Changeset 3:b53bea5e2fcb: bad
-Changeset 5:7874a09ea728: bad
-Changeset 6:a3d5c6fdf0d3: good
-The first good revision is:
-changeset:   6:a3d5c6fdf0d3
-user:        test
-date:        Thu Jan 01 00:00:06 1970 +0000
-summary:     msg 6
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-bisect.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,421 @@
+  $ hg init
+
+
+committing changes
+
+  $ count=0
+  $ echo > a
+  $ while test $count -lt 32 ; do
+  >     echo 'a' >> a
+  >     test $count -eq 0 && hg add
+  >     hg ci -m "msg $count" -d "$count 0"
+  >     count=`expr $count + 1`
+  > done
+  adding a
+
+
+  $ hg log
+  changeset:   31:58c80a7c8a40
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:31 1970 +0000
+  summary:     msg 31
+  
+  changeset:   30:ed2d2f24b11c
+  user:        test
+  date:        Thu Jan 01 00:00:30 1970 +0000
+  summary:     msg 30
+  
+  changeset:   29:b5bd63375ab9
+  user:        test
+  date:        Thu Jan 01 00:00:29 1970 +0000
+  summary:     msg 29
+  
+  changeset:   28:8e0c2264c8af
+  user:        test
+  date:        Thu Jan 01 00:00:28 1970 +0000
+  summary:     msg 28
+  
+  changeset:   27:288867a866e9
+  user:        test
+  date:        Thu Jan 01 00:00:27 1970 +0000
+  summary:     msg 27
+  
+  changeset:   26:3efc6fd51aeb
+  user:        test
+  date:        Thu Jan 01 00:00:26 1970 +0000
+  summary:     msg 26
+  
+  changeset:   25:02a84173a97a
+  user:        test
+  date:        Thu Jan 01 00:00:25 1970 +0000
+  summary:     msg 25
+  
+  changeset:   24:10e0acd3809e
+  user:        test
+  date:        Thu Jan 01 00:00:24 1970 +0000
+  summary:     msg 24
+  
+  changeset:   23:5ec79163bff4
+  user:        test
+  date:        Thu Jan 01 00:00:23 1970 +0000
+  summary:     msg 23
+  
+  changeset:   22:06c7993750ce
+  user:        test
+  date:        Thu Jan 01 00:00:22 1970 +0000
+  summary:     msg 22
+  
+  changeset:   21:e5db6aa3fe2a
+  user:        test
+  date:        Thu Jan 01 00:00:21 1970 +0000
+  summary:     msg 21
+  
+  changeset:   20:7128fb4fdbc9
+  user:        test
+  date:        Thu Jan 01 00:00:20 1970 +0000
+  summary:     msg 20
+  
+  changeset:   19:52798545b482
+  user:        test
+  date:        Thu Jan 01 00:00:19 1970 +0000
+  summary:     msg 19
+  
+  changeset:   18:86977a90077e
+  user:        test
+  date:        Thu Jan 01 00:00:18 1970 +0000
+  summary:     msg 18
+  
+  changeset:   17:03515f4a9080
+  user:        test
+  date:        Thu Jan 01 00:00:17 1970 +0000
+  summary:     msg 17
+  
+  changeset:   16:a2e6ea4973e9
+  user:        test
+  date:        Thu Jan 01 00:00:16 1970 +0000
+  summary:     msg 16
+  
+  changeset:   15:e7fa0811edb0
+  user:        test
+  date:        Thu Jan 01 00:00:15 1970 +0000
+  summary:     msg 15
+  
+  changeset:   14:ce8f0998e922
+  user:        test
+  date:        Thu Jan 01 00:00:14 1970 +0000
+  summary:     msg 14
+  
+  changeset:   13:9d7d07bc967c
+  user:        test
+  date:        Thu Jan 01 00:00:13 1970 +0000
+  summary:     msg 13
+  
+  changeset:   12:1941b52820a5
+  user:        test
+  date:        Thu Jan 01 00:00:12 1970 +0000
+  summary:     msg 12
+  
+  changeset:   11:7b4cd9578619
+  user:        test
+  date:        Thu Jan 01 00:00:11 1970 +0000
+  summary:     msg 11
+  
+  changeset:   10:7c5eff49a6b6
+  user:        test
+  date:        Thu Jan 01 00:00:10 1970 +0000
+  summary:     msg 10
+  
+  changeset:   9:eb44510ef29a
+  user:        test
+  date:        Thu Jan 01 00:00:09 1970 +0000
+  summary:     msg 9
+  
+  changeset:   8:453eb4dba229
+  user:        test
+  date:        Thu Jan 01 00:00:08 1970 +0000
+  summary:     msg 8
+  
+  changeset:   7:03750880c6b5
+  user:        test
+  date:        Thu Jan 01 00:00:07 1970 +0000
+  summary:     msg 7
+  
+  changeset:   6:a3d5c6fdf0d3
+  user:        test
+  date:        Thu Jan 01 00:00:06 1970 +0000
+  summary:     msg 6
+  
+  changeset:   5:7874a09ea728
+  user:        test
+  date:        Thu Jan 01 00:00:05 1970 +0000
+  summary:     msg 5
+  
+  changeset:   4:9b2ba8336a65
+  user:        test
+  date:        Thu Jan 01 00:00:04 1970 +0000
+  summary:     msg 4
+  
+  changeset:   3:b53bea5e2fcb
+  user:        test
+  date:        Thu Jan 01 00:00:03 1970 +0000
+  summary:     msg 3
+  
+  changeset:   2:db07c04beaca
+  user:        test
+  date:        Thu Jan 01 00:00:02 1970 +0000
+  summary:     msg 2
+  
+  changeset:   1:5cd978ea5149
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  summary:     msg 1
+  
+  changeset:   0:b99c7b9c8e11
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     msg 0
+  
+
+  $ hg up -C
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+bisect test
+
+  $ hg bisect -r
+  $ hg bisect -b
+  $ hg bisect -g 1
+  Testing changeset 16:a2e6ea4973e9 (30 changesets remaining, ~4 tests)
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg bisect -g
+  Testing changeset 23:5ec79163bff4 (15 changesets remaining, ~3 tests)
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+skip
+
+  $ hg bisect -s
+  Testing changeset 24:10e0acd3809e (15 changesets remaining, ~3 tests)
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg bisect -g
+  Testing changeset 27:288867a866e9 (7 changesets remaining, ~2 tests)
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg bisect -g
+  Testing changeset 29:b5bd63375ab9 (4 changesets remaining, ~2 tests)
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg bisect -b
+  Testing changeset 28:8e0c2264c8af (2 changesets remaining, ~1 tests)
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg bisect -g
+  The first bad revision is:
+  changeset:   29:b5bd63375ab9
+  user:        test
+  date:        Thu Jan 01 00:00:29 1970 +0000
+  summary:     msg 29
+  
+
+mark revsets instead of single revs
+
+  $ hg bisect -r
+  $ hg bisect -b "0::3"
+  $ hg bisect -s "13::16"
+  $ hg bisect -g "26::tip"
+  Testing changeset 12:1941b52820a5 (23 changesets remaining, ~4 tests)
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cat .hg/bisect.state
+  skip 9d7d07bc967ca98ad0600c24953fd289ad5fa991
+  skip ce8f0998e922c179e80819d5066fbe46e2998784
+  skip e7fa0811edb063f6319531f0d0a865882138e180
+  skip a2e6ea4973e9196ddd3386493b0c214b41fd97d3
+  bad b99c7b9c8e11558adef3fad9af211c58d46f325b
+  bad 5cd978ea51499179507ee7b6f340d2dbaa401185
+  bad db07c04beaca44cf24832541e7f4a2346a95275b
+  bad b53bea5e2fcb30d3e00bd3409507a5659ce0fd8b
+  good 3efc6fd51aeb8594398044c6c846ca59ae021203
+  good 288867a866e9adb7a29880b66936c874b80f4651
+  good 8e0c2264c8af790daf3585ada0669d93dee09c83
+  good b5bd63375ab9a290419f2024b7f4ee9ea7ce90a8
+  good ed2d2f24b11c368fa8aa0da9f4e1db580abade59
+  good 58c80a7c8a4025a94cedaf7b4a4e3124e8909a96
+
+bisect reverse test
+
+  $ hg bisect -r
+  $ hg bisect -b null
+  $ hg bisect -g tip
+  Testing changeset 15:e7fa0811edb0 (32 changesets remaining, ~5 tests)
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg bisect -g
+  Testing changeset 7:03750880c6b5 (16 changesets remaining, ~4 tests)
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+skip
+
+  $ hg bisect -s
+  Testing changeset 6:a3d5c6fdf0d3 (16 changesets remaining, ~4 tests)
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg bisect -g
+  Testing changeset 2:db07c04beaca (7 changesets remaining, ~2 tests)
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg bisect -g
+  Testing changeset 0:b99c7b9c8e11 (3 changesets remaining, ~1 tests)
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg bisect -b
+  Testing changeset 1:5cd978ea5149 (2 changesets remaining, ~1 tests)
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg bisect -g
+  The first good revision is:
+  changeset:   1:5cd978ea5149
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  summary:     msg 1
+  
+  $ false
+  [1]
+
+
+  $ hg bisect -r
+  $ hg bisect -g tip
+  $ hg bisect -b tip
+  abort: starting revisions are not directly related
+  [255]
+
+  $ hg bisect -r
+  $ hg bisect -g null
+  $ hg bisect -bU tip
+  Testing changeset 15:e7fa0811edb0 (32 changesets remaining, ~5 tests)
+  $ hg id
+  5cd978ea5149
+
+
+reproduce AssertionError, issue1228 and issue1182
+
+  $ hg bisect -r
+  $ hg bisect -b 4
+  $ hg bisect -g 0
+  Testing changeset 2:db07c04beaca (4 changesets remaining, ~2 tests)
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg bisect -s
+  Testing changeset 1:5cd978ea5149 (4 changesets remaining, ~2 tests)
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg bisect -s
+  Testing changeset 3:b53bea5e2fcb (4 changesets remaining, ~2 tests)
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg bisect -s
+  Due to skipped revisions, the first bad revision could be any of:
+  changeset:   1:5cd978ea5149
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  summary:     msg 1
+  
+  changeset:   2:db07c04beaca
+  user:        test
+  date:        Thu Jan 01 00:00:02 1970 +0000
+  summary:     msg 2
+  
+  changeset:   3:b53bea5e2fcb
+  user:        test
+  date:        Thu Jan 01 00:00:03 1970 +0000
+  summary:     msg 3
+  
+  changeset:   4:9b2ba8336a65
+  user:        test
+  date:        Thu Jan 01 00:00:04 1970 +0000
+  summary:     msg 4
+  
+
+
+reproduce non converging bisect, issue1182
+
+  $ hg bisect -r
+  $ hg bisect -g 0
+  $ hg bisect -b 2
+  Testing changeset 1:5cd978ea5149 (2 changesets remaining, ~1 tests)
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg bisect -s
+  Due to skipped revisions, the first bad revision could be any of:
+  changeset:   1:5cd978ea5149
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  summary:     msg 1
+  
+  changeset:   2:db07c04beaca
+  user:        test
+  date:        Thu Jan 01 00:00:02 1970 +0000
+  summary:     msg 2
+  
+
+
+test no action
+
+  $ hg bisect -r
+  $ hg bisect
+  abort: cannot bisect (no known good revisions)
+  [255]
+
+
+reproduce AssertionError, issue1445
+
+  $ hg bisect -r
+  $ hg bisect -b 6
+  $ hg bisect -g 0
+  Testing changeset 3:b53bea5e2fcb (6 changesets remaining, ~2 tests)
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg bisect -s
+  Testing changeset 2:db07c04beaca (6 changesets remaining, ~2 tests)
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg bisect -s
+  Testing changeset 4:9b2ba8336a65 (6 changesets remaining, ~2 tests)
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg bisect -s
+  Testing changeset 1:5cd978ea5149 (6 changesets remaining, ~2 tests)
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg bisect -s
+  Testing changeset 5:7874a09ea728 (6 changesets remaining, ~2 tests)
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg bisect -g
+  The first bad revision is:
+  changeset:   6:a3d5c6fdf0d3
+  user:        test
+  date:        Thu Jan 01 00:00:06 1970 +0000
+  summary:     msg 6
+  
+
+  $ set +e
+
+test invalid command
+assuming that the shell returns 127 if command not found ...
+
+  $ hg bisect -r
+  $ hg bisect --command 'exit 127'
+  abort: failed to execute exit 127
+  [255]
+
+
+test bisecting command
+
+  $ cat > script.py <<EOF
+  > #!/usr/bin/env python
+  > import sys
+  > from mercurial import ui, hg
+  > repo = hg.repository(ui.ui(), '.')
+  > if repo['.'].rev() < 6:
+  >     sys.exit(1)
+  > EOF
+  $ chmod +x script.py
+  $ hg bisect -r
+  $ hg bisect --good tip
+  $ hg bisect --bad 0
+  Testing changeset 15:e7fa0811edb0 (31 changesets remaining, ~4 tests)
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg bisect --command "'`pwd`/script.py' and some parameters"
+  Changeset 15:e7fa0811edb0: good
+  Changeset 7:03750880c6b5: good
+  Changeset 3:b53bea5e2fcb: bad
+  Changeset 5:7874a09ea728: bad
+  Changeset 6:a3d5c6fdf0d3: good
+  The first good revision is:
+  changeset:   6:a3d5c6fdf0d3
+  user:        test
+  date:        Thu Jan 01 00:00:06 1970 +0000
+  summary:     msg 6
+  
--- a/tests/test-bisect2	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,153 +0,0 @@
-#!/bin/sh
-
-# The tests in test-bisect are done on a linear history.
-# Here the following repository history is used for testing:
-#
-#                     17
-#                      |
-#               18    16 
-#                 \  /
-#                  15
-#                 /  \
-#                /    \
-#              10     13
-#              / \     |
-#             /   \    |  14
-#        7   6     9  12 /
-#         \ / \    |   |/
-#          4   \   |  11
-#           \   \  |  /
-#            3   5 | /
-#             \ /  |/ 
-#              2   8
-#               \ /
-#                1
-#                |
-#                0
-
-set -e
-
-echo % init
-hg init
-
-echo % committing changes
-echo > a
-echo '0' >> a
-hg add a
-hg ci -m "0" -d "0 0"
-echo '1' >> a
-hg ci -m "1" -d "1 0"
-echo '2' >> a
-hg ci -m "2" -d "2 0"
-echo '3' >> a
-hg ci -m "3" -d "3 0"
-echo '4' >> a
-hg ci -m "4" -d "4 0"
-# create branch
-hg up -r 2
-echo '5' >> b
-hg add b
-hg ci -m "5" -d "5 0"
-
-# merge
-hg merge
-hg ci -m "merge 4,5" -d "6 0"
-
-# create branch
-hg up -r 4
-echo '7' > c
-hg add c
-hg ci -m "7" -d "7 0"
-
-# create branch
-hg up -r 1
-echo '8' > d
-hg add d
-hg ci -m "8" -d "8 0"
-echo '9' >> d
-hg ci -m "9" -d "9 0"
-
-# merge
-hg merge -r 6
-hg ci -m "merge 6,9" -d "10 0"
-
-# create branch
-hg up -r 8
-echo '11' > e
-hg add e
-hg ci -m "11" -d "11 0"
-echo '12' >> e
-hg ci -m "12" -d "12 0"
-echo '13' >> e
-hg ci -m "13" -d "13 0"
-
-# create branch
-hg up -r 11
-echo '14' > f
-hg add f
-hg ci -m "14" -d "14 0"
-
-# merge
-hg up -r 13 -C
-hg merge -r 10
-hg ci -m "merge 10,13" -d "15 0"
-echo '16' >> e
-hg ci -m "16" -d "16 0"
-echo '17' >> e
-hg ci -m "17" -d "17 0"
-
-# create branch
-hg up -r 15
-echo '18' >> e
-hg ci -m "18" -d "18 0"
-
-
-echo % log
-hg log
-
-echo % hg up -C
-hg up -C
-
-echo % complex bisect test 1  # first bad rev is 9
-hg bisect -r
-hg bisect -g 0
-hg bisect -b 17   # -> update to rev 6
-hg bisect -g      # -> update to rev 13
-hg bisect -s      # -> update to rev 10
-hg bisect -b      # -> update to rev 8
-hg bisect -g      # -> update to rev 9
-hg bisect -b
-
-echo % complex bisect test 2  # first good rev is 13
-hg bisect -r
-hg bisect -g 18
-hg bisect -b 1    # -> update to rev 6
-hg bisect -s      # -> update to rev 10
-hg bisect -b      # -> update to rev 12
-hg bisect -b      # -> update to rev 13
-hg bisect -g
-
-echo % complex bisect test 3  
-# first bad rev is 15 
-# 10,9,13 are skipped an might be the first bad revisions as well
-hg bisect -r
-hg bisect -g 1
-hg bisect -b 16   # -> update to rev 6
-hg bisect -g      # -> update to rev 13
-hg bisect -s      # -> update to rev 10
-hg bisect -s      # -> update to rev 12
-hg bisect -g      # -> update to rev 9
-hg bisect -s      # -> update to rev 15
-hg bisect -b
-
-echo % complex bisect test 4
-# first good revision is 17
-# 15,16 are skipped an might be the first good revisions as well
-hg bisect -r
-hg bisect -g 17
-hg bisect -b 8    # -> update to rev 10
-hg bisect -b      # -> update to rev 13
-hg bisect -b      # -> update to rev 15
-hg bisect -s      # -> update to rev 16
-hg bisect -s
-
--- a/tests/test-bisect2.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,229 +0,0 @@
-% init
-% committing changes
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-created new head
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-created new head
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-2 files updated, 0 files merged, 1 files removed, 0 files unresolved
-created new head
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-% log
-changeset:   18:d42e18c7bc9b
-tag:         tip
-parent:      15:857b178a7cf3
-user:        test
-date:        Thu Jan 01 00:00:18 1970 +0000
-summary:     18
-
-changeset:   17:228c06deef46
-user:        test
-date:        Thu Jan 01 00:00:17 1970 +0000
-summary:     17
-
-changeset:   16:609d82a7ebae
-user:        test
-date:        Thu Jan 01 00:00:16 1970 +0000
-summary:     16
-
-changeset:   15:857b178a7cf3
-parent:      13:b0a32c86eb31
-parent:      10:429fcd26f52d
-user:        test
-date:        Thu Jan 01 00:00:15 1970 +0000
-summary:     merge 10,13
-
-changeset:   14:faa450606157
-parent:      11:82ca6f06eccd
-user:        test
-date:        Thu Jan 01 00:00:14 1970 +0000
-summary:     14
-
-changeset:   13:b0a32c86eb31
-user:        test
-date:        Thu Jan 01 00:00:13 1970 +0000
-summary:     13
-
-changeset:   12:9f259202bbe7
-user:        test
-date:        Thu Jan 01 00:00:12 1970 +0000
-summary:     12
-
-changeset:   11:82ca6f06eccd
-parent:      8:dab8161ac8fc
-user:        test
-date:        Thu Jan 01 00:00:11 1970 +0000
-summary:     11
-
-changeset:   10:429fcd26f52d
-parent:      9:3c77083deb4a
-parent:      6:a214d5d3811a
-user:        test
-date:        Thu Jan 01 00:00:10 1970 +0000
-summary:     merge 6,9
-
-changeset:   9:3c77083deb4a
-user:        test
-date:        Thu Jan 01 00:00:09 1970 +0000
-summary:     9
-
-changeset:   8:dab8161ac8fc
-parent:      1:4ca5088da217
-user:        test
-date:        Thu Jan 01 00:00:08 1970 +0000
-summary:     8
-
-changeset:   7:50c76098bbf2
-parent:      4:5c668c22234f
-user:        test
-date:        Thu Jan 01 00:00:07 1970 +0000
-summary:     7
-
-changeset:   6:a214d5d3811a
-parent:      5:385a529b6670
-parent:      4:5c668c22234f
-user:        test
-date:        Thu Jan 01 00:00:06 1970 +0000
-summary:     merge 4,5
-
-changeset:   5:385a529b6670
-parent:      2:051e12f87bf1
-user:        test
-date:        Thu Jan 01 00:00:05 1970 +0000
-summary:     5
-
-changeset:   4:5c668c22234f
-user:        test
-date:        Thu Jan 01 00:00:04 1970 +0000
-summary:     4
-
-changeset:   3:0950834f0a9c
-user:        test
-date:        Thu Jan 01 00:00:03 1970 +0000
-summary:     3
-
-changeset:   2:051e12f87bf1
-user:        test
-date:        Thu Jan 01 00:00:02 1970 +0000
-summary:     2
-
-changeset:   1:4ca5088da217
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-summary:     1
-
-changeset:   0:33b1f9bc8bc5
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     0
-
-% hg up -C
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% complex bisect test 1
-Testing changeset 6:a214d5d3811a (15 changesets remaining, ~3 tests)
-0 files updated, 0 files merged, 2 files removed, 0 files unresolved
-Testing changeset 13:b0a32c86eb31 (9 changesets remaining, ~3 tests)
-3 files updated, 0 files merged, 1 files removed, 0 files unresolved
-Testing changeset 10:429fcd26f52d (9 changesets remaining, ~3 tests)
-3 files updated, 0 files merged, 1 files removed, 0 files unresolved
-Testing changeset 8:dab8161ac8fc (3 changesets remaining, ~1 tests)
-2 files updated, 0 files merged, 1 files removed, 0 files unresolved
-Testing changeset 9:3c77083deb4a (2 changesets remaining, ~1 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-The first bad revision is:
-changeset:   9:3c77083deb4a
-user:        test
-date:        Thu Jan 01 00:00:09 1970 +0000
-summary:     9
-
-% complex bisect test 2
-Testing changeset 6:a214d5d3811a (13 changesets remaining, ~3 tests)
-2 files updated, 0 files merged, 1 files removed, 0 files unresolved
-Testing changeset 10:429fcd26f52d (13 changesets remaining, ~3 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-Testing changeset 12:9f259202bbe7 (5 changesets remaining, ~2 tests)
-3 files updated, 0 files merged, 1 files removed, 0 files unresolved
-Testing changeset 13:b0a32c86eb31 (3 changesets remaining, ~1 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-The first good revision is:
-changeset:   13:b0a32c86eb31
-user:        test
-date:        Thu Jan 01 00:00:13 1970 +0000
-summary:     13
-
-% complex bisect test 3
-Testing changeset 6:a214d5d3811a (13 changesets remaining, ~3 tests)
-2 files updated, 0 files merged, 2 files removed, 0 files unresolved
-Testing changeset 13:b0a32c86eb31 (8 changesets remaining, ~3 tests)
-3 files updated, 0 files merged, 1 files removed, 0 files unresolved
-Testing changeset 10:429fcd26f52d (8 changesets remaining, ~3 tests)
-3 files updated, 0 files merged, 1 files removed, 0 files unresolved
-Testing changeset 12:9f259202bbe7 (8 changesets remaining, ~3 tests)
-3 files updated, 0 files merged, 1 files removed, 0 files unresolved
-Testing changeset 9:3c77083deb4a (5 changesets remaining, ~2 tests)
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-Testing changeset 15:857b178a7cf3 (5 changesets remaining, ~2 tests)
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-Due to skipped revisions, the first bad revision could be any of:
-changeset:   9:3c77083deb4a
-user:        test
-date:        Thu Jan 01 00:00:09 1970 +0000
-summary:     9
-
-changeset:   10:429fcd26f52d
-parent:      9:3c77083deb4a
-parent:      6:a214d5d3811a
-user:        test
-date:        Thu Jan 01 00:00:10 1970 +0000
-summary:     merge 6,9
-
-changeset:   13:b0a32c86eb31
-user:        test
-date:        Thu Jan 01 00:00:13 1970 +0000
-summary:     13
-
-changeset:   15:857b178a7cf3
-parent:      13:b0a32c86eb31
-parent:      10:429fcd26f52d
-user:        test
-date:        Thu Jan 01 00:00:15 1970 +0000
-summary:     merge 10,13
-
-% complex bisect test 4
-Testing changeset 13:b0a32c86eb31 (8 changesets remaining, ~3 tests)
-2 files updated, 0 files merged, 1 files removed, 0 files unresolved
-Testing changeset 10:429fcd26f52d (5 changesets remaining, ~2 tests)
-3 files updated, 0 files merged, 1 files removed, 0 files unresolved
-Testing changeset 15:857b178a7cf3 (3 changesets remaining, ~1 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-Testing changeset 16:609d82a7ebae (3 changesets remaining, ~1 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-Due to skipped revisions, the first good revision could be any of:
-changeset:   15:857b178a7cf3
-parent:      13:b0a32c86eb31
-parent:      10:429fcd26f52d
-user:        test
-date:        Thu Jan 01 00:00:15 1970 +0000
-summary:     merge 10,13
-
-changeset:   16:609d82a7ebae
-user:        test
-date:        Thu Jan 01 00:00:16 1970 +0000
-summary:     16
-
-changeset:   17:228c06deef46
-user:        test
-date:        Thu Jan 01 00:00:17 1970 +0000
-summary:     17
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-bisect2.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,429 @@
+# The tests in test-bisect are done on a linear history. Here the
+# following repository history is used for testing:
+#
+#                      17
+#                       |
+#                18    16
+#                  \  /
+#                   15
+#                  /  \
+#                 /    \
+#               10     13
+#               / \     |
+#              /   \    |  14
+#         7   6     9  12 /
+#          \ / \    |   |/
+#           4   \   |  11
+#            \   \  |  /
+#             3   5 | /
+#              \ /  |/
+#               2   8
+#                \ /
+#                 1
+#                 |
+#                 0
+
+init
+
+  $ hg init
+
+committing changes
+
+  $ echo > a
+  $ echo '0' >> a
+  $ hg add a
+  $ hg ci -m "0" -d "0 0"
+  $ echo '1' >> a
+  $ hg ci -m "1" -d "1 0"
+  $ echo '2' >> a
+  $ hg ci -m "2" -d "2 0"
+  $ echo '3' >> a
+  $ hg ci -m "3" -d "3 0"
+  $ echo '4' >> a
+  $ hg ci -m "4" -d "4 0"
+
+create branch
+
+  $ hg up -r 2
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo '5' >> b
+  $ hg add b
+  $ hg ci -m "5" -d "5 0"
+  created new head
+
+merge
+
+  $ hg merge
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg ci -m "merge 4,5" -d "6 0"
+
+create branch
+
+  $ hg up -r 4
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo '7' > c
+  $ hg add c
+  $ hg ci -m "7" -d "7 0"
+  created new head
+
+create branch
+
+  $ hg up -r 1
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo '8' > d
+  $ hg add d
+  $ hg ci -m "8" -d "8 0"
+  created new head
+  $ echo '9' >> d
+  $ hg ci -m "9" -d "9 0"
+
+merge
+
+  $ hg merge -r 6
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg ci -m "merge 6,9" -d "10 0"
+
+create branch
+
+  $ hg up -r 8
+  2 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo '11' > e
+  $ hg add e
+  $ hg ci -m "11" -d "11 0"
+  created new head
+  $ echo '12' >> e
+  $ hg ci -m "12" -d "12 0"
+  $ echo '13' >> e
+  $ hg ci -m "13" -d "13 0"
+
+create branch
+
+  $ hg up -r 11
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo '14' > f
+  $ hg add f
+  $ hg ci -m "14" -d "14 0"
+  created new head
+
+merge
+
+  $ hg up -r 13 -C
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg merge -r 10
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg ci -m "merge 10,13" -d "15 0"
+  $ echo '16' >> e
+  $ hg ci -m "16" -d "16 0"
+  $ echo '17' >> e
+  $ hg ci -m "17" -d "17 0"
+
+create branch
+
+  $ hg up -r 15
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo '18' >> e
+  $ hg ci -m "18" -d "18 0"
+  created new head
+
+log
+
+  $ hg log
+  changeset:   18:d42e18c7bc9b
+  tag:         tip
+  parent:      15:857b178a7cf3
+  user:        test
+  date:        Thu Jan 01 00:00:18 1970 +0000
+  summary:     18
+  
+  changeset:   17:228c06deef46
+  user:        test
+  date:        Thu Jan 01 00:00:17 1970 +0000
+  summary:     17
+  
+  changeset:   16:609d82a7ebae
+  user:        test
+  date:        Thu Jan 01 00:00:16 1970 +0000
+  summary:     16
+  
+  changeset:   15:857b178a7cf3
+  parent:      13:b0a32c86eb31
+  parent:      10:429fcd26f52d
+  user:        test
+  date:        Thu Jan 01 00:00:15 1970 +0000
+  summary:     merge 10,13
+  
+  changeset:   14:faa450606157
+  parent:      11:82ca6f06eccd
+  user:        test
+  date:        Thu Jan 01 00:00:14 1970 +0000
+  summary:     14
+  
+  changeset:   13:b0a32c86eb31
+  user:        test
+  date:        Thu Jan 01 00:00:13 1970 +0000
+  summary:     13
+  
+  changeset:   12:9f259202bbe7
+  user:        test
+  date:        Thu Jan 01 00:00:12 1970 +0000
+  summary:     12
+  
+  changeset:   11:82ca6f06eccd
+  parent:      8:dab8161ac8fc
+  user:        test
+  date:        Thu Jan 01 00:00:11 1970 +0000
+  summary:     11
+  
+  changeset:   10:429fcd26f52d
+  parent:      9:3c77083deb4a
+  parent:      6:a214d5d3811a
+  user:        test
+  date:        Thu Jan 01 00:00:10 1970 +0000
+  summary:     merge 6,9
+  
+  changeset:   9:3c77083deb4a
+  user:        test
+  date:        Thu Jan 01 00:00:09 1970 +0000
+  summary:     9
+  
+  changeset:   8:dab8161ac8fc
+  parent:      1:4ca5088da217
+  user:        test
+  date:        Thu Jan 01 00:00:08 1970 +0000
+  summary:     8
+  
+  changeset:   7:50c76098bbf2
+  parent:      4:5c668c22234f
+  user:        test
+  date:        Thu Jan 01 00:00:07 1970 +0000
+  summary:     7
+  
+  changeset:   6:a214d5d3811a
+  parent:      5:385a529b6670
+  parent:      4:5c668c22234f
+  user:        test
+  date:        Thu Jan 01 00:00:06 1970 +0000
+  summary:     merge 4,5
+  
+  changeset:   5:385a529b6670
+  parent:      2:051e12f87bf1
+  user:        test
+  date:        Thu Jan 01 00:00:05 1970 +0000
+  summary:     5
+  
+  changeset:   4:5c668c22234f
+  user:        test
+  date:        Thu Jan 01 00:00:04 1970 +0000
+  summary:     4
+  
+  changeset:   3:0950834f0a9c
+  user:        test
+  date:        Thu Jan 01 00:00:03 1970 +0000
+  summary:     3
+  
+  changeset:   2:051e12f87bf1
+  user:        test
+  date:        Thu Jan 01 00:00:02 1970 +0000
+  summary:     2
+  
+  changeset:   1:4ca5088da217
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  summary:     1
+  
+  changeset:   0:33b1f9bc8bc5
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     0
+  
+
+hg up -C
+
+  $ hg up -C
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+complex bisect test 1  # first bad rev is 9
+
+  $ hg bisect -r
+  $ hg bisect -g 0
+  $ hg bisect -b 17   # -> update to rev 6
+  Testing changeset 6:a214d5d3811a (15 changesets remaining, ~3 tests)
+  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  $ hg bisect -g      # -> update to rev 13
+  Testing changeset 13:b0a32c86eb31 (9 changesets remaining, ~3 tests)
+  3 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg bisect -s      # -> update to rev 10
+  Testing changeset 10:429fcd26f52d (9 changesets remaining, ~3 tests)
+  3 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg bisect -b      # -> update to rev 8
+  Testing changeset 8:dab8161ac8fc (3 changesets remaining, ~1 tests)
+  2 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg bisect -g      # -> update to rev 9
+  Testing changeset 9:3c77083deb4a (2 changesets remaining, ~1 tests)
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg bisect -b
+  The first bad revision is:
+  changeset:   9:3c77083deb4a
+  user:        test
+  date:        Thu Jan 01 00:00:09 1970 +0000
+  summary:     9
+  
+
+complex bisect test 2  # first good rev is 13
+
+  $ hg bisect -r
+  $ hg bisect -g 18
+  $ hg bisect -b 1    # -> update to rev 6
+  Testing changeset 6:a214d5d3811a (13 changesets remaining, ~3 tests)
+  2 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg bisect -s      # -> update to rev 10
+  Testing changeset 10:429fcd26f52d (13 changesets remaining, ~3 tests)
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg bisect -b      # -> update to rev 12
+  Testing changeset 12:9f259202bbe7 (5 changesets remaining, ~2 tests)
+  3 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg bisect -b      # -> update to rev 13
+  Testing changeset 13:b0a32c86eb31 (3 changesets remaining, ~1 tests)
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg bisect -g
+  The first good revision is:
+  changeset:   13:b0a32c86eb31
+  user:        test
+  date:        Thu Jan 01 00:00:13 1970 +0000
+  summary:     13
+  
+
+complex bisect test 3
+
+first bad rev is 15
+10,9,13 are skipped an might be the first bad revisions as well
+
+  $ hg bisect -r
+  $ hg bisect -g 1
+  $ hg bisect -b 16   # -> update to rev 6
+  Testing changeset 6:a214d5d3811a (13 changesets remaining, ~3 tests)
+  2 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  $ hg bisect -g      # -> update to rev 13
+  Testing changeset 13:b0a32c86eb31 (8 changesets remaining, ~3 tests)
+  3 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg bisect -s      # -> update to rev 10
+  Testing changeset 10:429fcd26f52d (8 changesets remaining, ~3 tests)
+  3 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg bisect -s      # -> update to rev 12
+  Testing changeset 12:9f259202bbe7 (8 changesets remaining, ~3 tests)
+  3 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg bisect -g      # -> update to rev 9
+  Testing changeset 9:3c77083deb4a (5 changesets remaining, ~2 tests)
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg bisect -s      # -> update to rev 15
+  Testing changeset 15:857b178a7cf3 (5 changesets remaining, ~2 tests)
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg bisect -b
+  Due to skipped revisions, the first bad revision could be any of:
+  changeset:   9:3c77083deb4a
+  user:        test
+  date:        Thu Jan 01 00:00:09 1970 +0000
+  summary:     9
+  
+  changeset:   10:429fcd26f52d
+  parent:      9:3c77083deb4a
+  parent:      6:a214d5d3811a
+  user:        test
+  date:        Thu Jan 01 00:00:10 1970 +0000
+  summary:     merge 6,9
+  
+  changeset:   13:b0a32c86eb31
+  user:        test
+  date:        Thu Jan 01 00:00:13 1970 +0000
+  summary:     13
+  
+  changeset:   15:857b178a7cf3
+  parent:      13:b0a32c86eb31
+  parent:      10:429fcd26f52d
+  user:        test
+  date:        Thu Jan 01 00:00:15 1970 +0000
+  summary:     merge 10,13
+  
+
+complex bisect test 4
+
+first good revision is 17
+15,16 are skipped an might be the first good revisions as well
+
+  $ hg bisect -r
+  $ hg bisect -g 17
+  $ hg bisect -b 8    # -> update to rev 10
+  Testing changeset 13:b0a32c86eb31 (8 changesets remaining, ~3 tests)
+  2 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg bisect -b      # -> update to rev 13
+  Testing changeset 10:429fcd26f52d (5 changesets remaining, ~2 tests)
+  3 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg bisect -b      # -> update to rev 15
+  Testing changeset 15:857b178a7cf3 (3 changesets remaining, ~1 tests)
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg bisect -s      # -> update to rev 16
+  Testing changeset 16:609d82a7ebae (3 changesets remaining, ~1 tests)
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg bisect -s
+  Due to skipped revisions, the first good revision could be any of:
+  changeset:   15:857b178a7cf3
+  parent:      13:b0a32c86eb31
+  parent:      10:429fcd26f52d
+  user:        test
+  date:        Thu Jan 01 00:00:15 1970 +0000
+  summary:     merge 10,13
+  
+  changeset:   16:609d82a7ebae
+  user:        test
+  date:        Thu Jan 01 00:00:16 1970 +0000
+  summary:     16
+  
+  changeset:   17:228c06deef46
+  user:        test
+  date:        Thu Jan 01 00:00:17 1970 +0000
+  summary:     17
+  
+
+test unrelated revs:
+
+  $ hg bisect --reset
+  $ hg bisect -b 7
+  $ hg bisect -g 14
+  abort: starting revisions are not directly related
+  [255]
+  $ hg bisect --reset
+
+end at merge: 17 bad, 11 good (but 9 is first bad)
+
+  $ hg bisect -r
+  $ hg bisect -b 17
+  $ hg bisect -g 11
+  Testing changeset 13:b0a32c86eb31 (5 changesets remaining, ~2 tests)
+  3 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg bisect -g
+  Testing changeset 15:857b178a7cf3 (3 changesets remaining, ~1 tests)
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg bisect -b
+  The first bad revision is:
+  changeset:   15:857b178a7cf3
+  parent:      13:b0a32c86eb31
+  parent:      10:429fcd26f52d
+  user:        test
+  date:        Thu Jan 01 00:00:15 1970 +0000
+  summary:     merge 10,13
+  
+  Not all ancestors of this changeset have been checked.
+  To check the other ancestors, start from the common ancestor, dab8161ac8fc.
+  $ hg bisect -g 8 # dab8161ac8fc
+  Testing changeset 9:3c77083deb4a (3 changesets remaining, ~1 tests)
+  1 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  $ hg bisect -b
+  The first bad revision is:
+  changeset:   9:3c77083deb4a
+  user:        test
+  date:        Thu Jan 01 00:00:09 1970 +0000
+  summary:     9
+  
--- a/tests/test-bookmarks	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +0,0 @@
-#!/bin/sh
-
-echo "[extensions]" >> $HGRCPATH
-echo "bookmarks=" >> $HGRCPATH
-
-hg init
-
-echo % no bookmarks
-hg bookmarks
-
-echo % bookmark rev -1
-hg bookmark X
-
-echo % list bookmarks
-hg bookmarks
-
-echo % list bookmarks with color
-hg --config extensions.color= --config color.mode=ansi \
-    bookmarks --color=always
-
-echo a > a
-hg add a
-hg commit -m 0
-
-echo % bookmark X moved to rev 0
-hg bookmarks
-
-echo % look up bookmark
-hg log -r X
-
-echo % second bookmark for rev 0
-hg bookmark X2
-
-echo % bookmark rev -1 again
-hg bookmark -r null Y
-
-echo % list bookmarks
-hg bookmarks
-
-echo b > b
-hg add b
-hg commit -m 1
-
-echo % bookmarks X and X2 moved to rev 1, Y at rev -1
-hg bookmarks
-
-echo % bookmark rev 0 again
-hg bookmark -r 0 Z
-
-echo c > c
-hg add c
-hg commit -m 2
-
-echo % bookmarks X and X2 moved to rev 2, Y at rev -1, Z at rev 0
-hg bookmarks
-
-echo % rename nonexistent bookmark
-hg bookmark -m A B
-
-echo % rename to existent bookmark
-hg bookmark -m X Y
-
-echo % force rename to existent bookmark
-hg bookmark -f -m X Y
-
-echo % list bookmarks
-hg bookmark
-
-echo % rename without new name
-hg bookmark -m Y
-
-echo % delete without name
-hg bookmark -d
-
-echo % delete nonexistent bookmark
-hg bookmark -d A
-
-echo % bookmark name with spaces should be stripped
-hg bookmark ' x  y '
-
-echo % list bookmarks
-hg bookmarks
-
-echo % look up stripped bookmark name
-hg log -r '"x  y"'
-
-echo % reject bookmark name with newline
-hg bookmark '
-'
-
-echo % bookmark with existing name
-hg bookmark Z
-
-echo % force bookmark with existing name
-hg bookmark -f Z
-
-echo % list bookmarks
-hg bookmark
-
-echo % revision but no bookmark name
-hg bookmark -r .
-
-echo % bookmark name with whitespace only
-hg bookmark ' '
-
-true
--- a/tests/test-bookmarks-current	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-#!/bin/sh
-
-echo "[extensions]" >> $HGRCPATH
-echo "bookmarks=" >> $HGRCPATH
-
-echo "[bookmarks]" >> $HGRCPATH
-echo "track.current = True" >> $HGRCPATH
-
-hg init
-
-echo % no bookmarks
-hg bookmarks
-
-echo % set bookmark X
-hg bookmark X
-
-echo % list bookmarks
-hg bookmark
-
-echo % list bookmarks with color
-hg --config extensions.color= --config color.mode=ansi \
-    bookmark --color=always
-
-echo % update to bookmark X
-hg update X
-
-echo % list bookmarks
-hg bookmarks
-
-echo % rename
-hg bookmark -m X Z
-
-echo % list bookmarks
-hg bookmarks
-
-echo % new bookmark Y
-hg bookmark Y
-
-echo % list bookmarks
-hg bookmark
-
-echo % commit
-echo 'b' > b
-hg add b
-hg commit -m'test'
-
-echo % list bookmarks
-hg bookmark
-
-echo % delete bookmarks
-hg bookmark -d Y
-hg bookmark -d Z
-
-echo % list bookmarks
-hg bookmark
-
-echo % update to tip
-hg update tip
-
-echo % set bookmark Y using -r .
-hg bookmark -r . Y
-
-echo % list bookmarks
-hg bookmark
--- a/tests/test-bookmarks-current.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-% no bookmarks
-no bookmarks set
-% set bookmark X
-% list bookmarks
- * X                         -1:000000000000
-% list bookmarks with color
- * X                         -1:000000000000
-% update to bookmark X
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% list bookmarks
- * X                         -1:000000000000
-% rename
-% list bookmarks
- * Z                         -1:000000000000
-% new bookmark Y
-% list bookmarks
- * Y                         -1:000000000000
-   Z                         -1:000000000000
-% commit
-% list bookmarks
- * Y                         0:719295282060
-   Z                         -1:000000000000
-% delete bookmarks
-% list bookmarks
-no bookmarks set
-% update to tip
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% set bookmark Y using -r .
-% list bookmarks
- * Y                         0:719295282060
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-bookmarks-current.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,92 @@
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "bookmarks=" >> $HGRCPATH
+
+  $ echo "[bookmarks]" >> $HGRCPATH
+  $ echo "track.current = True" >> $HGRCPATH
+
+  $ hg init
+
+no bookmarks
+
+  $ hg bookmarks
+  no bookmarks set
+
+set bookmark X
+
+  $ hg bookmark X
+
+list bookmarks
+
+  $ hg bookmark
+   * X                         -1:000000000000
+
+list bookmarks with color
+
+  $ hg --config extensions.color= --config color.mode=ansi \
+  >     bookmark --color=always
+   * X                         -1:000000000000
+
+update to bookmark X
+
+  $ hg update X
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+list bookmarks
+
+  $ hg bookmarks
+   * X                         -1:000000000000
+
+rename
+
+  $ hg bookmark -m X Z
+
+list bookmarks
+
+  $ hg bookmarks
+   * Z                         -1:000000000000
+
+new bookmark Y
+
+  $ hg bookmark Y
+
+list bookmarks
+
+  $ hg bookmark
+   * Y                         -1:000000000000
+     Z                         -1:000000000000
+
+commit
+
+  $ echo 'b' > b
+  $ hg add b
+  $ hg commit -m'test'
+
+list bookmarks
+
+  $ hg bookmark
+   * Y                         0:719295282060
+     Z                         -1:000000000000
+
+delete bookmarks
+
+  $ hg bookmark -d Y
+  $ hg bookmark -d Z
+
+list bookmarks
+
+  $ hg bookmark
+  no bookmarks set
+
+update to tip
+
+  $ hg update tip
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+set bookmark Y using -r .
+
+  $ hg bookmark -r . Y
+
+list bookmarks
+
+  $ hg bookmark
+   * Y                         0:719295282060
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-bookmarks-pushpull.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,66 @@
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "bookmarks=" >> $HGRCPATH
+
+  $ echo "[bookmarks]" >> $HGRCPATH
+  $ echo "track.current = True" >> $HGRCPATH
+
+initialize
+
+  $ hg init a
+  $ cd a
+  $ echo 'test' > test
+  $ hg commit -Am'test'
+  adding test
+
+set bookmarks
+
+  $ hg bookmark X
+  $ hg bookmark Y
+  $ hg bookmark Z
+
+import bookmark by name
+
+  $ hg init ../b
+  $ cd ../b
+  $ hg pull ../a
+  pulling from ../a
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  (run 'hg update' to get a working copy)
+  $ hg bookmarks
+  no bookmarks set
+  $ hg pull -B X ../a
+  pulling from ../a
+  searching for changes
+  no changes found
+  importing bookmark X
+  $ hg bookmark
+     X                         0:4e3505fd9583
+
+export bookmark by name
+
+  $ hg bookmark W
+  $ hg bookmark foo
+  $ hg bookmark foobar
+  $ hg push -B W ../a
+  pushing to ../a
+  searching for changes
+  no changes found
+  exporting bookmark W
+  $ hg -R ../a bookmarks
+     Y                         0:4e3505fd9583
+     X                         0:4e3505fd9583
+   * Z                         0:4e3505fd9583
+     W                         -1:000000000000
+
+push/pull name that doesn't exist
+
+  $ hg push -B badname ../a
+  bookmark badname does not exist on the local or remote repository!
+  [2]
+  $ hg pull -B anotherbadname ../a
+  abort: remote bookmark anotherbadname not found!
+  [255]
--- a/tests/test-bookmarks-rebase	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-#!/bin/sh
-
-. $TESTDIR/helpers.sh
-
-echo "[extensions]" >> $HGRCPATH
-echo "rebase=" >> $HGRCPATH
-echo "bookmarks=" >> $HGRCPATH
-
-echo % initialize repository
-hg init
-
-echo 'a' > a
-hg ci -A -m "0"
-
-echo 'b' > b
-hg ci -A -m "1"
-
-hg up 0
-echo 'c' > c
-hg ci -A -m "2"
-
-echo 'd' > d
-hg ci -A -m "3"
-
-hg bookmark -r 1 one
-hg bookmark -r 3 two
-
-echo % bookmark list
-hg bookmark
-
-echo % rebase
-hg rebase -s two -d one 2>&1 | cleanrebase
-
-hg log
--- a/tests/test-bookmarks-rebase.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-% initialize repository
-adding a
-adding b
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-adding c
-created new head
-adding d
-% bookmark list
- * two                       3:2ae46b1d99a7
-   one                       1:925d80f479bb
-% rebase
-saved backup bundle to 
-changeset:   3:9163974d1cb5
-tag:         one
-tag:         tip
-tag:         two
-parent:      1:925d80f479bb
-parent:      2:db815d6d32e6
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     3
-
-changeset:   2:db815d6d32e6
-parent:      0:f7b1eb17ad24
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     2
-
-changeset:   1:925d80f479bb
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     1
-
-changeset:   0:f7b1eb17ad24
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     0
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-bookmarks-rebase.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,68 @@
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "rebase=" >> $HGRCPATH
+  $ echo "bookmarks=" >> $HGRCPATH
+
+initialize repository
+
+  $ hg init
+
+  $ echo 'a' > a
+  $ hg ci -A -m "0"
+  adding a
+
+  $ echo 'b' > b
+  $ hg ci -A -m "1"
+  adding b
+
+  $ hg up 0
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo 'c' > c
+  $ hg ci -A -m "2"
+  adding c
+  created new head
+
+  $ echo 'd' > d
+  $ hg ci -A -m "3"
+  adding d
+
+  $ hg bookmark -r 1 one
+  $ hg bookmark -r 3 two
+
+bookmark list
+
+  $ hg bookmark
+   * two                       3:2ae46b1d99a7
+     one                       1:925d80f479bb
+
+rebase
+
+  $ hg rebase -s two -d one
+  saved backup bundle to * (glob)
+
+  $ hg log
+  changeset:   3:9163974d1cb5
+  tag:         one
+  tag:         tip
+  tag:         two
+  parent:      1:925d80f479bb
+  parent:      2:db815d6d32e6
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     3
+  
+  changeset:   2:db815d6d32e6
+  parent:      0:f7b1eb17ad24
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     2
+  
+  changeset:   1:925d80f479bb
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     1
+  
+  changeset:   0:f7b1eb17ad24
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     0
+  
--- a/tests/test-bookmarks-strip	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-#!/bin/sh
-
-. $TESTDIR/helpers.sh
-echo "[extensions]" >> $HGRCPATH
-echo "bookmarks=" >> $HGRCPATH
-echo "mq=" >> $HGRCPATH
-
-hg init
-
-echo qqq>qqq.txt
-
-echo % add file
-hg add
-
-echo % commit first revision
-hg ci -m 1 -u user -d "1 0"
-
-echo % set bookmark
-hg book test
-
-echo www>>qqq.txt
-
-echo % commit second revision
-hg ci -m 2 -u usr -d "1 0"
-
-echo % set bookmark
-hg book test2
-
-echo % update to -2
-hg update -r -2
-
-echo eee>>qqq.txt
-
-echo % commit new head
-hg ci -m 3 -u user -d "1 0"
-
-echo % bookmarks updated?
-hg book
-
-echo % strip to revision 1
-hg strip 1 | hidebackup
-
-echo % list bookmarks
-hg book
-
--- a/tests/test-bookmarks-strip.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-% add file
-adding qqq.txt
-% commit first revision
-% set bookmark
-% commit second revision
-% set bookmark
-% update to -2
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% commit new head
-created new head
-% bookmarks updated?
-   test                      1:16b24da7e457
-   test2                     1:16b24da7e457
-% strip to revision 1
-saved backup bundle to 
-% list bookmarks
- * test                      1:9f1b7e78eff8
- * test2                     1:9f1b7e78eff8
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-bookmarks-strip.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,60 @@
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "bookmarks=" >> $HGRCPATH
+  $ echo "mq=" >> $HGRCPATH
+
+  $ hg init
+
+  $ echo qqq>qqq.txt
+
+add file
+
+  $ hg add
+  adding qqq.txt
+
+commit first revision
+
+  $ hg ci -m 1
+
+set bookmark
+
+  $ hg book test
+
+  $ echo www>>qqq.txt
+
+commit second revision
+
+  $ hg ci -m 2
+
+set bookmark
+
+  $ hg book test2
+
+update to -2
+
+  $ hg update -r -2
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ echo eee>>qqq.txt
+
+commit new head
+
+  $ hg ci -m 3
+  created new head
+
+bookmarks updated?
+
+  $ hg book
+     test                      1:25e1ee7a0081
+     test2                     1:25e1ee7a0081
+
+strip to revision 1
+
+  $ hg strip 1
+  saved backup bundle to * (glob)
+
+list bookmarks
+
+  $ hg book
+   * test                      1:8cf31af87a2b
+   * test2                     1:8cf31af87a2b
+
--- a/tests/test-bookmarks.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-% no bookmarks
-no bookmarks set
-% bookmark rev -1
-% list bookmarks
- * X                         -1:000000000000
-% list bookmarks with color
- * X                         -1:000000000000
-% bookmark X moved to rev 0
- * X                         0:f7b1eb17ad24
-% look up bookmark
-changeset:   0:f7b1eb17ad24
-tag:         X
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     0
-
-% second bookmark for rev 0
-% bookmark rev -1 again
-% list bookmarks
- * X2                        0:f7b1eb17ad24
- * X                         0:f7b1eb17ad24
-   Y                         -1:000000000000
-% bookmarks X and X2 moved to rev 1, Y at rev -1
- * X2                        1:925d80f479bb
- * X                         1:925d80f479bb
-   Y                         -1:000000000000
-% bookmark rev 0 again
-% bookmarks X and X2 moved to rev 2, Y at rev -1, Z at rev 0
- * X2                        2:0316ce92851d
- * X                         2:0316ce92851d
-   Z                         0:f7b1eb17ad24
-   Y                         -1:000000000000
-% rename nonexistent bookmark
-abort: a bookmark of this name does not exist
-% rename to existent bookmark
-abort: a bookmark of the same name already exists
-% force rename to existent bookmark
-% list bookmarks
- * X2                        2:0316ce92851d
- * Y                         2:0316ce92851d
-   Z                         0:f7b1eb17ad24
-% rename without new name
-abort: new bookmark name required
-% delete without name
-abort: bookmark name required
-% delete nonexistent bookmark
-abort: a bookmark of this name does not exist
-% bookmark name with spaces should be stripped
-% list bookmarks
- * X2                        2:0316ce92851d
- * Y                         2:0316ce92851d
-   Z                         0:f7b1eb17ad24
- * x  y                      2:0316ce92851d
-% look up stripped bookmark name
-changeset:   2:0316ce92851d
-tag:         X2
-tag:         Y
-tag:         tip
-tag:         x  y
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     2
-
-% reject bookmark name with newline
-abort: bookmark name cannot contain newlines
-% bookmark with existing name
-abort: a bookmark of the same name already exists
-% force bookmark with existing name
-% list bookmarks
- * X2                        2:0316ce92851d
- * Y                         2:0316ce92851d
- * Z                         2:0316ce92851d
- * x  y                      2:0316ce92851d
-% revision but no bookmark name
-abort: bookmark name required
-% bookmark name with whitespace only
-abort: bookmark names cannot consist entirely of whitespace
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-bookmarks.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,189 @@
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "bookmarks=" >> $HGRCPATH
+
+  $ hg init
+
+no bookmarks
+
+  $ hg bookmarks
+  no bookmarks set
+
+bookmark rev -1
+
+  $ hg bookmark X
+
+list bookmarks
+
+  $ hg bookmarks
+   * X                         -1:000000000000
+
+list bookmarks with color
+
+  $ hg --config extensions.color= --config color.mode=ansi \
+  >    bookmarks --color=always
+   * X                         -1:000000000000
+
+  $ echo a > a
+  $ hg add a
+  $ hg commit -m 0
+
+bookmark X moved to rev 0
+
+  $ hg bookmarks
+   * X                         0:f7b1eb17ad24
+
+look up bookmark
+
+  $ hg log -r X
+  changeset:   0:f7b1eb17ad24
+  tag:         X
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     0
+  
+
+second bookmark for rev 0
+
+  $ hg bookmark X2
+
+bookmark rev -1 again
+
+  $ hg bookmark -r null Y
+
+list bookmarks
+
+  $ hg bookmarks
+   * X2                        0:f7b1eb17ad24
+   * X                         0:f7b1eb17ad24
+     Y                         -1:000000000000
+
+  $ echo b > b
+  $ hg add b
+  $ hg commit -m 1
+
+bookmarks X and X2 moved to rev 1, Y at rev -1
+
+  $ hg bookmarks
+   * X2                        1:925d80f479bb
+   * X                         1:925d80f479bb
+     Y                         -1:000000000000
+
+bookmark rev 0 again
+
+  $ hg bookmark -r 0 Z
+
+  $ echo c > c
+  $ hg add c
+  $ hg commit -m 2
+
+bookmarks X and X2 moved to rev 2, Y at rev -1, Z at rev 0
+
+  $ hg bookmarks
+   * X2                        2:0316ce92851d
+   * X                         2:0316ce92851d
+     Z                         0:f7b1eb17ad24
+     Y                         -1:000000000000
+
+rename nonexistent bookmark
+
+  $ hg bookmark -m A B
+  abort: a bookmark of this name does not exist
+  [255]
+
+rename to existent bookmark
+
+  $ hg bookmark -m X Y
+  abort: a bookmark of the same name already exists
+  [255]
+
+force rename to existent bookmark
+
+  $ hg bookmark -f -m X Y
+
+list bookmarks
+
+  $ hg bookmark
+   * X2                        2:0316ce92851d
+   * Y                         2:0316ce92851d
+     Z                         0:f7b1eb17ad24
+
+rename without new name
+
+  $ hg bookmark -m Y
+  abort: new bookmark name required
+  [255]
+
+delete without name
+
+  $ hg bookmark -d
+  abort: bookmark name required
+  [255]
+
+delete nonexistent bookmark
+
+  $ hg bookmark -d A
+  abort: a bookmark of this name does not exist
+  [255]
+
+bookmark name with spaces should be stripped
+
+  $ hg bookmark ' x  y '
+
+list bookmarks
+
+  $ hg bookmarks
+   * X2                        2:0316ce92851d
+   * Y                         2:0316ce92851d
+     Z                         0:f7b1eb17ad24
+   * x  y                      2:0316ce92851d
+
+look up stripped bookmark name
+
+  $ hg log -r '"x  y"'
+  changeset:   2:0316ce92851d
+  tag:         X2
+  tag:         Y
+  tag:         tip
+  tag:         x  y
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     2
+  
+
+reject bookmark name with newline
+
+  $ hg bookmark '
+  > '
+  abort: bookmark name cannot contain newlines
+  [255]
+
+bookmark with existing name
+
+  $ hg bookmark Z
+  abort: a bookmark of the same name already exists
+  [255]
+
+force bookmark with existing name
+
+  $ hg bookmark -f Z
+
+list bookmarks
+
+  $ hg bookmark
+   * X2                        2:0316ce92851d
+   * Y                         2:0316ce92851d
+   * Z                         2:0316ce92851d
+   * x  y                      2:0316ce92851d
+
+revision but no bookmark name
+
+  $ hg bookmark -r .
+  abort: bookmark name required
+  [255]
+
+bookmark name with whitespace only
+
+  $ hg bookmark ' '
+  abort: bookmark names cannot consist entirely of whitespace
+  [255]
--- a/tests/test-branch-option	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-#!/bin/sh
-
-# test branch selection options
-hg init branch
-cd branch
-hg branch a
-echo a > foo
-hg ci -d '0 0' -Ama
-echo a2 > foo
-hg ci -d '0 0' -ma2
-hg up 0
-hg branch c
-echo c > foo
-hg ci -d '0 0' -mc
-hg tag -l z
-cd ..
-hg clone -r 0 branch branch2
-cd branch2
-hg up 0
-hg branch b
-echo b > foo
-hg ci -d '0 0' -mb
-hg up 0
-hg --encoding utf-8 branch æ
-echo ae1 > foo
-hg ci -d '0 0' -mae1
-hg up 0
-hg --encoding utf-8 branch -f æ
-echo ae2 > foo
-hg ci -d '0 0' -mae2
-hg up 0
-hg branch -f b
-echo b2 > foo
-hg ci -d '0 0' -mb2
-
-echo unknown branch and fallback
-hg in -qbz
-hg in -q ../branch#z
-hg out -qbz
-echo in rev c branch a
-hg in -qr c ../branch#a
-hg in -qr c -b a
-echo out branch .
-hg out -q ../branch#.
-hg out -q -b .
-echo out branch . non-ascii
-hg --encoding utf-8 up æ
-hg --encoding latin1 out -q ../branch#.
-hg --encoding latin1 out -q -b .
-echo clone branch b
-cd ..
-hg clone branch2#b branch3
-hg -q -R branch3 heads b
-hg -q -R branch3 parents
-rm -rf branch3
-echo clone rev a branch b
-hg clone -r a branch2#b branch3
-hg -q -R branch3 heads b
-hg -q -R branch3 parents
-rm -rf branch3
--- a/tests/test-branch-option.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-marked working directory as branch a
-adding foo
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-marked working directory as branch c
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-updating to branch a
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-marked working directory as branch b
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-marked working directory as branch æ
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-marked working directory as branch æ
-created new head
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-marked working directory as branch b
-created new head
-unknown branch and fallback
-abort: unknown branch 'z'!
-2:f25d57ab0566
-abort: unknown branch 'z'!
-in rev c branch a
-1:dd6e60a716c6
-2:f25d57ab0566
-1:dd6e60a716c6
-2:f25d57ab0566
-out branch .
-1:b84708d77ab7
-4:65511d0e2b55
-1:b84708d77ab7
-4:65511d0e2b55
-out branch . non-ascii
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-2:df5a44224d4e
-3:4f4a5125ca10
-2:df5a44224d4e
-3:4f4a5125ca10
-clone branch b
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 3 changesets with 3 changes to 1 files (+1 heads)
-updating to branch b
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-2:65511d0e2b55
-1:b84708d77ab7
-2:65511d0e2b55
-clone rev a branch b
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 3 changesets with 3 changes to 1 files (+1 heads)
-updating to branch a
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-2:65511d0e2b55
-1:b84708d77ab7
-0:5b65ba7c951d
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-branch-option.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,129 @@
+test branch selection options
+
+  $ hg init branch
+  $ cd branch
+  $ hg branch a
+  marked working directory as branch a
+  $ echo a > foo
+  $ hg ci -d '0 0' -Ama
+  adding foo
+  $ echo a2 > foo
+  $ hg ci -d '0 0' -ma2
+  $ hg up 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg branch c
+  marked working directory as branch c
+  $ echo c > foo
+  $ hg ci -d '0 0' -mc
+  $ hg tag -l z
+  $ cd ..
+  $ hg clone -r 0 branch branch2
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  updating to branch a
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd branch2
+  $ hg up 0
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg branch b
+  marked working directory as branch b
+  $ echo b > foo
+  $ hg ci -d '0 0' -mb
+  $ hg up 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg --encoding utf-8 branch æ
+  marked working directory as branch æ
+  $ echo ae1 > foo
+  $ hg ci -d '0 0' -mae1
+  $ hg up 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg --encoding utf-8 branch -f æ
+  marked working directory as branch æ
+  $ echo ae2 > foo
+  $ hg ci -d '0 0' -mae2
+  created new head
+  $ hg up 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg branch -f b
+  marked working directory as branch b
+  $ echo b2 > foo
+  $ hg ci -d '0 0' -mb2
+  created new head
+
+unknown branch and fallback
+
+  $ hg in -qbz
+  abort: unknown branch 'z'!
+  [255]
+  $ hg in -q ../branch#z
+  2:f25d57ab0566
+  $ hg out -qbz
+  abort: unknown branch 'z'!
+  [255]
+
+in rev c branch a
+
+  $ hg in -qr c ../branch#a
+  1:dd6e60a716c6
+  2:f25d57ab0566
+  $ hg in -qr c -b a
+  1:dd6e60a716c6
+  2:f25d57ab0566
+
+out branch .
+
+  $ hg out -q ../branch#.
+  1:b84708d77ab7
+  4:65511d0e2b55
+  $ hg out -q -b .
+  1:b84708d77ab7
+  4:65511d0e2b55
+
+out branch . non-ascii
+
+  $ hg --encoding utf-8 up æ
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg --encoding latin1 out -q ../branch#.
+  2:df5a44224d4e
+  3:4f4a5125ca10
+  $ hg --encoding latin1 out -q -b .
+  2:df5a44224d4e
+  3:4f4a5125ca10
+
+clone branch b
+
+  $ cd ..
+  $ hg clone branch2#b branch3
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 3 changesets with 3 changes to 1 files (+1 heads)
+  updating to branch b
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg -q -R branch3 heads b
+  2:65511d0e2b55
+  1:b84708d77ab7
+  $ hg -q -R branch3 parents
+  2:65511d0e2b55
+  $ rm -rf branch3
+
+clone rev a branch b
+
+  $ hg clone -r a branch2#b branch3
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 3 changesets with 3 changes to 1 files (+1 heads)
+  updating to branch a
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg -q -R branch3 heads b
+  2:65511d0e2b55
+  1:b84708d77ab7
+  $ hg -q -R branch3 parents
+  0:5b65ba7c951d
+  $ rm -rf branch3
--- a/tests/test-branches	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,94 +0,0 @@
-#!/bin/sh
-
-hg init a
-cd a
-echo 'root' >root
-hg add root
-hg commit -d '0 0' -m "Adding root node"
-
-echo 'a' >a
-hg add a
-hg branch a
-hg commit -d '1 0' -m "Adding a branch"
-
-hg branch q
-echo 'aa' >a
-hg branch -C
-hg commit -d '2 0' -m "Adding to a branch"
-
-hg update -C 0
-echo 'b' >b
-hg add b
-hg branch b
-hg commit -d '2 0' -m "Adding b branch"
-
-echo 'bh1' >bh1
-hg add bh1
-hg commit -d '3 0' -m "Adding b branch head 1"
-
-hg update -C 2
-echo 'bh2' >bh2
-hg add bh2
-hg commit -d '4 0' -m "Adding b branch head 2"
-
-echo 'c' >c
-hg add c
-hg branch c
-hg commit -d '5 0' -m "Adding c branch"
-
-hg branch tip
-hg branch null
-hg branch .
-
-echo 'd' >d
-hg add d
-hg branch 'a branch name much longer than the default justification used by branches'
-hg commit -d '6 0' -m "Adding d branch"
-
-hg branches
-echo '-------'
-hg branches -a
-
-echo "--- Branch a"
-hg log -b a
-
-echo "---- Branch b"
-hg log -b b
-
-echo "---- going to test branch closing"
-hg branches
-hg up -C b
-echo 'xxx1' >> b
-hg commit -d '7 0' -m 'adding cset to branch b'
-hg up -C aee39cd168d0
-echo 'xxx2' >> b
-hg commit -d '8 0' -m 'adding head to branch b'
-echo 'xxx3' >> b
-hg commit -d '9 0' -m 'adding another cset to branch b'
-hg branches
-hg heads --closed
-hg heads
-hg commit -d '9 0' --close-branch -m 'prune bad branch'
-hg branches -a
-hg up -C b
-hg commit -d '9 0' --close-branch -m 'close this part branch too'
-echo '--- b branch should be inactive'
-hg branches
-hg branches -c
-hg branches -a
-hg heads b
-hg heads --closed b
-echo 'xxx4' >> b
-hg commit -d '9 0' -m 'reopen branch with a change'
-echo '--- branch b is back in action'
-hg branches -a
-echo '---- test heads listings'
-hg heads
-echo '% branch default'
-hg heads default
-echo '% branch a'
-hg heads a
-hg heads --active a
-echo '% branch b'
-hg heads b
-hg heads --closed b
--- a/tests/test-branches.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,244 +0,0 @@
-marked working directory as branch a
-marked working directory as branch q
-reset working directory to branch a
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-marked working directory as branch b
-1 files updated, 0 files merged, 2 files removed, 0 files unresolved
-marked working directory as branch c
-abort: the name 'tip' is reserved
-abort: the name 'null' is reserved
-abort: the name '.' is reserved
-marked working directory as branch a branch name much longer than the default justification used by branches
-a branch name much longer than the default justification used by branches 7:10ff5895aa57
-b                              4:aee39cd168d0
-c                              6:589736a22561 (inactive)
-a                              5:d8cbc61dbaa6 (inactive)
-default                        0:19709c5a4e75 (inactive)
--------
-a branch name much longer than the default justification used by branches 7:10ff5895aa57
-b                              4:aee39cd168d0
---- Branch a
-changeset:   5:d8cbc61dbaa6
-branch:      a
-parent:      2:881fe2b92ad0
-user:        test
-date:        Thu Jan 01 00:00:04 1970 +0000
-summary:     Adding b branch head 2
-
-changeset:   2:881fe2b92ad0
-branch:      a
-user:        test
-date:        Thu Jan 01 00:00:02 1970 +0000
-summary:     Adding to a branch
-
-changeset:   1:dd6b440dd85a
-branch:      a
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-summary:     Adding a branch
-
----- Branch b
-changeset:   4:aee39cd168d0
-branch:      b
-user:        test
-date:        Thu Jan 01 00:00:03 1970 +0000
-summary:     Adding b branch head 1
-
-changeset:   3:ac22033332d1
-branch:      b
-parent:      0:19709c5a4e75
-user:        test
-date:        Thu Jan 01 00:00:02 1970 +0000
-summary:     Adding b branch
-
----- going to test branch closing
-a branch name much longer than the default justification used by branches 7:10ff5895aa57
-b                              4:aee39cd168d0
-c                              6:589736a22561 (inactive)
-a                              5:d8cbc61dbaa6 (inactive)
-default                        0:19709c5a4e75 (inactive)
-2 files updated, 0 files merged, 4 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-b                             10:bfbe841b666e
-a branch name much longer than the default justification used by branches 7:10ff5895aa57
-c                              6:589736a22561 (inactive)
-a                              5:d8cbc61dbaa6 (inactive)
-default                        0:19709c5a4e75 (inactive)
-changeset:   10:bfbe841b666e
-branch:      b
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:09 1970 +0000
-summary:     adding another cset to branch b
-
-changeset:   8:eebb944467c9
-branch:      b
-parent:      4:aee39cd168d0
-user:        test
-date:        Thu Jan 01 00:00:07 1970 +0000
-summary:     adding cset to branch b
-
-changeset:   7:10ff5895aa57
-branch:      a branch name much longer than the default justification used by branches
-user:        test
-date:        Thu Jan 01 00:00:06 1970 +0000
-summary:     Adding d branch
-
-changeset:   6:589736a22561
-branch:      c
-user:        test
-date:        Thu Jan 01 00:00:05 1970 +0000
-summary:     Adding c branch
-
-changeset:   5:d8cbc61dbaa6
-branch:      a
-parent:      2:881fe2b92ad0
-user:        test
-date:        Thu Jan 01 00:00:04 1970 +0000
-summary:     Adding b branch head 2
-
-changeset:   0:19709c5a4e75
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     Adding root node
-
-changeset:   10:bfbe841b666e
-branch:      b
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:09 1970 +0000
-summary:     adding another cset to branch b
-
-changeset:   8:eebb944467c9
-branch:      b
-parent:      4:aee39cd168d0
-user:        test
-date:        Thu Jan 01 00:00:07 1970 +0000
-summary:     adding cset to branch b
-
-changeset:   7:10ff5895aa57
-branch:      a branch name much longer than the default justification used by branches
-user:        test
-date:        Thu Jan 01 00:00:06 1970 +0000
-summary:     Adding d branch
-
-changeset:   6:589736a22561
-branch:      c
-user:        test
-date:        Thu Jan 01 00:00:05 1970 +0000
-summary:     Adding c branch
-
-changeset:   5:d8cbc61dbaa6
-branch:      a
-parent:      2:881fe2b92ad0
-user:        test
-date:        Thu Jan 01 00:00:04 1970 +0000
-summary:     Adding b branch head 2
-
-changeset:   0:19709c5a4e75
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     Adding root node
-
-b                              8:eebb944467c9
-a branch name much longer than the default justification used by branches 7:10ff5895aa57
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
---- b branch should be inactive
-a branch name much longer than the default justification used by branches 7:10ff5895aa57
-c                              6:589736a22561 (inactive)
-a                              5:d8cbc61dbaa6 (inactive)
-default                        0:19709c5a4e75 (inactive)
-a branch name much longer than the default justification used by branches 7:10ff5895aa57
-b                             12:2da6583810df (closed)
-c                              6:589736a22561 (inactive)
-a                              5:d8cbc61dbaa6 (inactive)
-default                        0:19709c5a4e75 (inactive)
-a branch name much longer than the default justification used by branches 7:10ff5895aa57
-no open branch heads found on branches b
-changeset:   12:2da6583810df
-branch:      b
-tag:         tip
-parent:      8:eebb944467c9
-user:        test
-date:        Thu Jan 01 00:00:09 1970 +0000
-summary:     close this part branch too
-
-changeset:   11:c84627f3c15d
-branch:      b
-user:        test
-date:        Thu Jan 01 00:00:09 1970 +0000
-summary:     prune bad branch
-
-reopening closed branch head 12
---- branch b is back in action
-b                             13:6ac12926b8c3
-a branch name much longer than the default justification used by branches 7:10ff5895aa57
----- test heads listings
-changeset:   13:6ac12926b8c3
-branch:      b
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:09 1970 +0000
-summary:     reopen branch with a change
-
-changeset:   7:10ff5895aa57
-branch:      a branch name much longer than the default justification used by branches
-user:        test
-date:        Thu Jan 01 00:00:06 1970 +0000
-summary:     Adding d branch
-
-changeset:   6:589736a22561
-branch:      c
-user:        test
-date:        Thu Jan 01 00:00:05 1970 +0000
-summary:     Adding c branch
-
-changeset:   5:d8cbc61dbaa6
-branch:      a
-parent:      2:881fe2b92ad0
-user:        test
-date:        Thu Jan 01 00:00:04 1970 +0000
-summary:     Adding b branch head 2
-
-changeset:   0:19709c5a4e75
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     Adding root node
-
-% branch default
-changeset:   0:19709c5a4e75
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     Adding root node
-
-% branch a
-changeset:   5:d8cbc61dbaa6
-branch:      a
-parent:      2:881fe2b92ad0
-user:        test
-date:        Thu Jan 01 00:00:04 1970 +0000
-summary:     Adding b branch head 2
-
-no open branch heads found on branches a
-% branch b
-changeset:   13:6ac12926b8c3
-branch:      b
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:09 1970 +0000
-summary:     reopen branch with a change
-
-changeset:   13:6ac12926b8c3
-branch:      b
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:09 1970 +0000
-summary:     reopen branch with a change
-
-changeset:   11:c84627f3c15d
-branch:      b
-user:        test
-date:        Thu Jan 01 00:00:09 1970 +0000
-summary:     prune bad branch
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-branches.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,398 @@
+  $ hg init a
+  $ cd a
+  $ echo 'root' >root
+  $ hg add root
+  $ hg commit -d '0 0' -m "Adding root node"
+
+  $ echo 'a' >a
+  $ hg add a
+  $ hg branch a
+  marked working directory as branch a
+  $ hg commit -d '1 0' -m "Adding a branch"
+
+  $ hg branch q
+  marked working directory as branch q
+  $ echo 'aa' >a
+  $ hg branch -C
+  reset working directory to branch a
+  $ hg commit -d '2 0' -m "Adding to a branch"
+
+  $ hg update -C 0
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo 'b' >b
+  $ hg add b
+  $ hg branch b
+  marked working directory as branch b
+  $ hg commit -d '2 0' -m "Adding b branch"
+
+  $ echo 'bh1' >bh1
+  $ hg add bh1
+  $ hg commit -d '3 0' -m "Adding b branch head 1"
+
+  $ hg update -C 2
+  1 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  $ echo 'bh2' >bh2
+  $ hg add bh2
+  $ hg commit -d '4 0' -m "Adding b branch head 2"
+
+  $ echo 'c' >c
+  $ hg add c
+  $ hg branch c
+  marked working directory as branch c
+  $ hg commit -d '5 0' -m "Adding c branch"
+
+  $ hg branch tip
+  abort: the name 'tip' is reserved
+  [255]
+  $ hg branch null
+  abort: the name 'null' is reserved
+  [255]
+  $ hg branch .
+  abort: the name '.' is reserved
+  [255]
+
+  $ echo 'd' >d
+  $ hg add d
+  $ hg branch 'a branch name much longer than the default justification used by branches'
+  marked working directory as branch a branch name much longer than the default justification used by branches
+  $ hg commit -d '6 0' -m "Adding d branch"
+
+  $ hg branches
+  a branch name much longer than the default justification used by branches 7:10ff5895aa57
+  b                              4:aee39cd168d0
+  c                              6:589736a22561 (inactive)
+  a                              5:d8cbc61dbaa6 (inactive)
+  default                        0:19709c5a4e75 (inactive)
+
+-------
+
+  $ hg branches -a
+  a branch name much longer than the default justification used by branches 7:10ff5895aa57
+  b                              4:aee39cd168d0
+
+--- Branch a
+
+  $ hg log -b a
+  changeset:   5:d8cbc61dbaa6
+  branch:      a
+  parent:      2:881fe2b92ad0
+  user:        test
+  date:        Thu Jan 01 00:00:04 1970 +0000
+  summary:     Adding b branch head 2
+  
+  changeset:   2:881fe2b92ad0
+  branch:      a
+  user:        test
+  date:        Thu Jan 01 00:00:02 1970 +0000
+  summary:     Adding to a branch
+  
+  changeset:   1:dd6b440dd85a
+  branch:      a
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  summary:     Adding a branch
+  
+
+---- Branch b
+
+  $ hg log -b b
+  changeset:   4:aee39cd168d0
+  branch:      b
+  user:        test
+  date:        Thu Jan 01 00:00:03 1970 +0000
+  summary:     Adding b branch head 1
+  
+  changeset:   3:ac22033332d1
+  branch:      b
+  parent:      0:19709c5a4e75
+  user:        test
+  date:        Thu Jan 01 00:00:02 1970 +0000
+  summary:     Adding b branch
+  
+
+---- going to test branch closing
+
+  $ hg branches
+  a branch name much longer than the default justification used by branches 7:10ff5895aa57
+  b                              4:aee39cd168d0
+  c                              6:589736a22561 (inactive)
+  a                              5:d8cbc61dbaa6 (inactive)
+  default                        0:19709c5a4e75 (inactive)
+  $ hg up -C b
+  2 files updated, 0 files merged, 4 files removed, 0 files unresolved
+  $ echo 'xxx1' >> b
+  $ hg commit -d '7 0' -m 'adding cset to branch b'
+  $ hg up -C aee39cd168d0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo 'xxx2' >> b
+  $ hg commit -d '8 0' -m 'adding head to branch b'
+  created new head
+  $ echo 'xxx3' >> b
+  $ hg commit -d '9 0' -m 'adding another cset to branch b'
+  $ hg branches
+  b                             10:bfbe841b666e
+  a branch name much longer than the default justification used by branches 7:10ff5895aa57
+  c                              6:589736a22561 (inactive)
+  a                              5:d8cbc61dbaa6 (inactive)
+  default                        0:19709c5a4e75 (inactive)
+  $ hg heads --closed
+  changeset:   10:bfbe841b666e
+  branch:      b
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:09 1970 +0000
+  summary:     adding another cset to branch b
+  
+  changeset:   8:eebb944467c9
+  branch:      b
+  parent:      4:aee39cd168d0
+  user:        test
+  date:        Thu Jan 01 00:00:07 1970 +0000
+  summary:     adding cset to branch b
+  
+  changeset:   7:10ff5895aa57
+  branch:      a branch name much longer than the default justification used by branches
+  user:        test
+  date:        Thu Jan 01 00:00:06 1970 +0000
+  summary:     Adding d branch
+  
+  changeset:   6:589736a22561
+  branch:      c
+  user:        test
+  date:        Thu Jan 01 00:00:05 1970 +0000
+  summary:     Adding c branch
+  
+  changeset:   5:d8cbc61dbaa6
+  branch:      a
+  parent:      2:881fe2b92ad0
+  user:        test
+  date:        Thu Jan 01 00:00:04 1970 +0000
+  summary:     Adding b branch head 2
+  
+  changeset:   0:19709c5a4e75
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     Adding root node
+  
+  $ hg heads
+  changeset:   10:bfbe841b666e
+  branch:      b
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:09 1970 +0000
+  summary:     adding another cset to branch b
+  
+  changeset:   8:eebb944467c9
+  branch:      b
+  parent:      4:aee39cd168d0
+  user:        test
+  date:        Thu Jan 01 00:00:07 1970 +0000
+  summary:     adding cset to branch b
+  
+  changeset:   7:10ff5895aa57
+  branch:      a branch name much longer than the default justification used by branches
+  user:        test
+  date:        Thu Jan 01 00:00:06 1970 +0000
+  summary:     Adding d branch
+  
+  changeset:   6:589736a22561
+  branch:      c
+  user:        test
+  date:        Thu Jan 01 00:00:05 1970 +0000
+  summary:     Adding c branch
+  
+  changeset:   5:d8cbc61dbaa6
+  branch:      a
+  parent:      2:881fe2b92ad0
+  user:        test
+  date:        Thu Jan 01 00:00:04 1970 +0000
+  summary:     Adding b branch head 2
+  
+  changeset:   0:19709c5a4e75
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     Adding root node
+  
+  $ hg commit -d '9 0' --close-branch -m 'prune bad branch'
+  $ hg branches -a
+  b                              8:eebb944467c9
+  a branch name much longer than the default justification used by branches 7:10ff5895aa57
+  $ hg up -C b
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg commit -d '9 0' --close-branch -m 'close this part branch too'
+
+--- b branch should be inactive
+
+  $ hg branches
+  a branch name much longer than the default justification used by branches 7:10ff5895aa57
+  c                              6:589736a22561 (inactive)
+  a                              5:d8cbc61dbaa6 (inactive)
+  default                        0:19709c5a4e75 (inactive)
+  $ hg branches -c
+  a branch name much longer than the default justification used by branches 7:10ff5895aa57
+  b                             12:2da6583810df (closed)
+  c                              6:589736a22561 (inactive)
+  a                              5:d8cbc61dbaa6 (inactive)
+  default                        0:19709c5a4e75 (inactive)
+  $ hg branches -a
+  a branch name much longer than the default justification used by branches 7:10ff5895aa57
+  $ hg heads b
+  no open branch heads found on branches b
+  [1]
+  $ hg heads --closed b
+  changeset:   12:2da6583810df
+  branch:      b
+  tag:         tip
+  parent:      8:eebb944467c9
+  user:        test
+  date:        Thu Jan 01 00:00:09 1970 +0000
+  summary:     close this part branch too
+  
+  changeset:   11:c84627f3c15d
+  branch:      b
+  user:        test
+  date:        Thu Jan 01 00:00:09 1970 +0000
+  summary:     prune bad branch
+  
+  $ echo 'xxx4' >> b
+  $ hg commit -d '9 0' -m 'reopen branch with a change'
+  reopening closed branch head 12
+
+--- branch b is back in action
+
+  $ hg branches -a
+  b                             13:6ac12926b8c3
+  a branch name much longer than the default justification used by branches 7:10ff5895aa57
+
+---- test heads listings
+
+  $ hg heads
+  changeset:   13:6ac12926b8c3
+  branch:      b
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:09 1970 +0000
+  summary:     reopen branch with a change
+  
+  changeset:   7:10ff5895aa57
+  branch:      a branch name much longer than the default justification used by branches
+  user:        test
+  date:        Thu Jan 01 00:00:06 1970 +0000
+  summary:     Adding d branch
+  
+  changeset:   6:589736a22561
+  branch:      c
+  user:        test
+  date:        Thu Jan 01 00:00:05 1970 +0000
+  summary:     Adding c branch
+  
+  changeset:   5:d8cbc61dbaa6
+  branch:      a
+  parent:      2:881fe2b92ad0
+  user:        test
+  date:        Thu Jan 01 00:00:04 1970 +0000
+  summary:     Adding b branch head 2
+  
+  changeset:   0:19709c5a4e75
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     Adding root node
+  
+
+branch default
+
+  $ hg heads default
+  changeset:   0:19709c5a4e75
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     Adding root node
+  
+
+branch a
+
+  $ hg heads a
+  changeset:   5:d8cbc61dbaa6
+  branch:      a
+  parent:      2:881fe2b92ad0
+  user:        test
+  date:        Thu Jan 01 00:00:04 1970 +0000
+  summary:     Adding b branch head 2
+  
+  $ hg heads --active a
+  no open branch heads found on branches a
+  [1]
+
+branch b
+
+  $ hg heads b
+  changeset:   13:6ac12926b8c3
+  branch:      b
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:09 1970 +0000
+  summary:     reopen branch with a change
+  
+  $ hg heads --closed b
+  changeset:   13:6ac12926b8c3
+  branch:      b
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:09 1970 +0000
+  summary:     reopen branch with a change
+  
+  changeset:   11:c84627f3c15d
+  branch:      b
+  user:        test
+  date:        Thu Jan 01 00:00:09 1970 +0000
+  summary:     prune bad branch
+  
+default branch colors:
+
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "color =" >> $HGRCPATH
+
+  $ hg up -C c
+  3 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  $ hg commit -d '9 0' --close-branch -m 'reclosing this branch'
+  $ hg up -C b
+  2 files updated, 0 files merged, 3 files removed, 0 files unresolved
+  $ hg branches --color=always
+  b                             13:6ac12926b8c3
+  a branch name much longer than the default justification used by branches 7:10ff5895aa57
+  a                              5:d8cbc61dbaa6 (inactive)
+  default                        0:19709c5a4e75 (inactive)
+
+default closed branch color:
+
+  $ hg branches --color=always --closed
+  b                             13:6ac12926b8c3
+  a branch name much longer than the default justification used by branches 7:10ff5895aa57
+  c                             14:717d2e6fabe1 (closed)
+  a                              5:d8cbc61dbaa6 (inactive)
+  default                        0:19709c5a4e75 (inactive)
+
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "color =" >> $HGRCPATH
+  $ echo "[color]" >> $HGRCPATH
+  $ echo "branches.active = green" >> $HGRCPATH
+  $ echo "branches.closed = blue" >> $HGRCPATH
+  $ echo "branches.current = red" >> $HGRCPATH
+  $ echo "branches.inactive = magenta" >> $HGRCPATH
+  $ echo "log.changeset = cyan" >> $HGRCPATH
+
+custom branch colors:
+
+  $ hg branches --color=always
+  b                             13:6ac12926b8c3
+  a branch name much longer than the default justification used by branches 7:10ff5895aa57
+  a                              5:d8cbc61dbaa6 (inactive)
+  default                        0:19709c5a4e75 (inactive)
+
+custom closed branch color:
+
+  $ hg branches --color=always --closed
+  b                             13:6ac12926b8c3
+  a branch name much longer than the default justification used by branches 7:10ff5895aa57
+  c                             14:717d2e6fabe1 (closed)
+  a                              5:d8cbc61dbaa6 (inactive)
+  default                        0:19709c5a4e75 (inactive)
--- a/tests/test-branchmap	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-#!/bin/sh
-
-hgserve()
-{
-    hg serve -a localhost -p $HGPORT1 -d --pid-file=hg.pid -E errors.log -v $@ \
-        | sed -e 's/:[0-9][0-9]*//g' -e 's/http:\/\/[^/]*\//http:\/\/localhost\//'
-    cat hg.pid >> "$DAEMON_PIDS"
-}
-
-hg init a
-hg --encoding utf-8 -R a branch æ
-echo foo > a/foo
-hg -R a ci -Am foo
-
-hgserve -R a --config web.push_ssl=False --config web.allow_push=* --encoding latin1
-hg --encoding utf-8 clone http://localhost:$HGPORT1 b
-hg --encoding utf-8 -R b log
-echo bar >> b/foo
-hg -R b ci -m bar
-hg --encoding utf-8 -R b push | sed "s/$HGPORT1/PORT/"
-hg -R a --encoding utf-8 log
-
-kill `cat hg.pid`
-
-
-# verify 7e7d56fe4833 (encoding fallback in branchmap to maintain compatibility with 1.3.x)
-
-cat <<EOF > oldhg
-import sys
-from mercurial import ui, hg, commands
-
-class StdoutWrapper(object):
-    def __init__(self, stdout):
-        self._file = stdout
-
-    def write(self, data):
-        if data == '47\n':
-            # latin1 encoding is one %xx (3 bytes) shorter
-            data = '44\n'
-        elif data.startswith('%C3%A6 '):
-            # translate to latin1 encoding
-            data = '%%E6 %s' % data[7:]
-        self._file.write(data)
-
-    def __getattr__(self, name):
-        return getattr(self._file, name)
-
-sys.stdout = StdoutWrapper(sys.stdout)
-sys.stderr = StdoutWrapper(sys.stderr)
-
-myui = ui.ui()
-repo = hg.repository(myui, 'a')
-commands.serve(myui, repo, stdio=True)
-EOF
-
-echo baz >> b/foo
-hg -R b ci -m baz
-hg push -R b -e 'python oldhg' ssh://dummy/ --encoding latin1
--- a/tests/test-branchmap.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-marked working directory as branch æ
-adding foo
-listening at http://localhost/ (bound to 127.0.0.1)
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-updating to branch æ
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-changeset:   0:867c11ce77b8
-branch:      æ
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     foo
-
-pushing to http://localhost:PORT
-searching for changes
-remote: adding changesets
-remote: adding manifests
-remote: adding file changes
-remote: added 1 changesets with 1 changes to 1 files
-changeset:   1:58e7c90d67cb
-branch:      æ
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     bar
-
-changeset:   0:867c11ce77b8
-branch:      æ
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     foo
-
-pushing to ssh://dummy/
-searching for changes
-remote: adding changesets
-remote: adding manifests
-remote: adding file changes
-remote: added 1 changesets with 1 changes to 1 files
--- a/tests/test-bundle	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,168 +0,0 @@
-#!/bin/sh
-
-cp "$TESTDIR"/printenv.py .
-
-echo "====== Setting up test"
-hg init test
-cd test
-echo 0 > afile
-hg add afile
-hg commit -m "0.0" -d "1000000 0"
-echo 1 >> afile
-hg commit -m "0.1" -d "1000000 0"
-echo 2 >> afile
-hg commit -m "0.2" -d "1000000 0"
-echo 3 >> afile
-hg commit -m "0.3" -d "1000000 0"
-hg update -C 0
-echo 1 >> afile
-hg commit -m "1.1" -d "1000000 0"
-echo 2 >> afile
-hg commit -m "1.2" -d "1000000 0"
-echo "a line" > fred
-echo 3 >> afile
-hg add fred
-hg commit -m "1.3" -d "1000000 0"
-hg mv afile adifferentfile
-hg commit -m "1.3m" -d "1000000 0"
-hg update -C 3
-hg mv afile anotherfile
-hg commit -m "0.3m" -d "1000000 0"
-hg verify
-cd ..
-hg init empty
-
-echo "====== Bundle --all"
-hg -R test bundle --all all.hg
-
-echo "====== Bundle test to full.hg"
-hg -R test bundle full.hg empty
-echo "====== Unbundle full.hg in test"
-hg -R test unbundle full.hg
-echo "====== Verify empty"
-hg -R empty heads
-hg -R empty verify
-
-echo "====== Pull full.hg into test (using --cwd)"
-hg --cwd test pull ../full.hg
-echo "====== Pull full.hg into empty (using --cwd)"
-hg --cwd empty pull ../full.hg
-echo "====== Rollback empty"
-hg -R empty rollback
-echo "====== Pull full.hg into empty again (using --cwd)"
-hg --cwd empty pull ../full.hg
-
-echo "====== Pull full.hg into test (using -R)"
-hg -R test pull full.hg
-echo "====== Pull full.hg into empty (using -R)"
-hg -R empty pull full.hg
-echo "====== Rollback empty"
-hg -R empty rollback
-echo "====== Pull full.hg into empty again (using -R)"
-hg -R empty pull full.hg
-
-echo "====== Log -R full.hg in fresh empty"
-rm -r empty
-hg init empty
-cd empty
-hg -R bundle://../full.hg log
-
-echo "====== Pull ../full.hg into empty (with hook)"
-echo '[hooks]' >> .hg/hgrc
-echo 'changegroup = python ../printenv.py changegroup' >> .hg/hgrc
-#doesn't work (yet ?)
-#hg -R bundle://../full.hg verify
-hg pull bundle://../full.hg
-echo "====== Rollback empty"
-hg rollback
-cd ..
-echo "====== Log -R bundle:empty+full.hg"
-hg -R bundle:empty+full.hg log --template="{rev} "
-echo ""
-echo "====== Pull full.hg into empty again (using -R; with hook)"
-hg -R empty pull full.hg
-
-echo "====== Create partial clones"
-rm -r empty
-hg init empty
-hg clone -r 3 test partial
-hg clone partial partial2
-cd partial
-echo "====== Log -R full.hg in partial"
-hg -R bundle://../full.hg log
-echo "====== Incoming full.hg in partial"
-hg incoming bundle://../full.hg
-echo "====== Outgoing -R full.hg vs partial2 in partial"
-hg -R bundle://../full.hg outgoing ../partial2
-echo "====== Outgoing -R does-not-exist.hg vs partial2 in partial"
-hg -R bundle://../does-not-exist.hg outgoing ../partial2
-cd ..
-
-echo "====== Direct clone from bundle (all-history)"
-hg clone full.hg full-clone
-hg -R full-clone heads
-rm -r full-clone
-
-# test for http://mercurial.selenic.com/bts/issue216
-echo "====== Unbundle incremental bundles into fresh empty in one go"
-rm -r empty
-hg init empty
-hg -R test bundle --base null -r 0 ../0.hg
-hg -R test bundle --base 0    -r 1 ../1.hg
-hg -R empty unbundle -u ../0.hg ../1.hg
-
-# test for 540d1059c802
-echo "====== test for 540d1059c802"
-hg init orig
-cd orig
-echo foo > foo
-hg add foo
-hg ci -m 'add foo'
-
-hg clone . ../copy
-hg tag foo
-
-cd ../copy
-echo >> foo
-hg ci -m 'change foo'
-hg bundle ../bundle.hg ../orig
-
-cd ../orig
-hg incoming ../bundle.hg
-cd ..
-
-# test for http://mercurial.selenic.com/bts/issue1144
-echo "===== test that verify bundle does not traceback"
-# partial history bundle, fails w/ unkown parent
-hg -R bundle.hg verify
-# full history bundle, refuses to verify non-local repo
-hg -R all.hg verify
-# but, regular verify must continue to work
-hg -R orig verify
-
-echo "====== diff against bundle"
-hg init b
-cd b
-hg -R ../all.hg diff -r tip
-cd ..
-
-echo "====== bundle single branch"
-hg init branchy
-cd branchy
-echo a >a
-hg ci -Ama
-echo b >b
-hg ci -Amb
-echo b1 >b1
-hg ci -Amb1
-hg up 0
-echo c >c
-hg ci -Amc
-echo c1 >c1
-hg ci -Amc1
-hg clone -q .#tip part
-echo "== bundling via incoming"
-hg in -R part --bundle incoming.hg --template "{node}\n" .
-echo "== bundling"
-hg bundle bundle.hg part --debug
-
--- a/tests/test-bundle-r	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,122 +0,0 @@
-#!/bin/sh
-
-hg init test
-cd test
-cat >>afile <<EOF
-0
-EOF
-hg add afile
-hg commit -m "0.0" -d "1000000 0"
-cat >>afile <<EOF
-1
-EOF
-hg commit -m "0.1" -d "1000000 0"
-cat >>afile <<EOF
-2
-EOF
-hg commit -m "0.2" -d "1000000 0"
-cat >>afile <<EOF
-3
-EOF
-hg commit -m "0.3" -d "1000000 0"
-hg update -C 0
-cat >>afile <<EOF
-1
-EOF
-hg commit -m "1.1" -d "1000000 0"
-cat >>afile <<EOF
-2
-EOF
-hg commit -m "1.2" -d "1000000 0"
-cat >fred <<EOF
-a line
-EOF
-cat >>afile <<EOF
-3
-EOF
-hg add fred
-hg commit -m "1.3" -d "1000000 0"
-hg mv afile adifferentfile
-hg commit -m "1.3m" -d "1000000 0"
-hg update -C 3
-hg mv afile anotherfile
-hg commit -m "0.3m" -d "1000000 0"
-hg debugindex .hg/store/data/afile.i
-hg debugindex .hg/store/data/adifferentfile.i
-hg debugindex .hg/store/data/anotherfile.i
-hg debugindex .hg/store/data/fred.i
-hg debugindex .hg/store/00manifest.i
-hg verify
-cd ..
-for i in 0 1 2 3 4 5 6 7 8; do
-   mkdir test-"$i"
-   hg --cwd test-"$i" init
-   hg -R test bundle -r "$i" test-"$i".hg test-"$i"
-   cd test-"$i"
-   hg unbundle ../test-"$i".hg
-   hg verify
-   hg tip -q
-   cd ..
-done
-cd test-8
-hg pull ../test-7
-hg verify
-hg rollback
-cd ..
-
-echo % should fail
-hg -R test bundle --base 2 -r tip test-bundle-branch1.hg test-3
-hg -R test bundle -r tip test-bundle-branch1.hg
-
-hg -R test bundle --base 2 -r tip test-bundle-branch1.hg
-hg -R test bundle --base 2 -r 7 test-bundle-branch2.hg
-hg -R test bundle --base 2 test-bundle-all.hg
-hg -R test bundle --base 3 -r tip test-bundle-should-fail.hg
-# empty bundle
-hg -R test bundle --base 7 --base 8 test-bundle-empty.hg
-
-# issue76 msg2163
-hg -R test bundle --base 3 -r 3 -r 3 test-bundle-cset-3.hg
-# issue1910
-hg -R test bundle --base 7 test-bundle-cset-7.hg
-
-hg clone test-2 test-9
-cd test-9
-echo % 2
-hg tip -q
-hg unbundle ../test-bundle-should-fail.hg
-echo % 2
-hg tip -q
-hg unbundle ../test-bundle-all.hg
-echo % 8
-hg tip -q
-hg verify
-hg rollback
-echo % 2
-hg tip -q
-hg unbundle ../test-bundle-branch1.hg
-echo % 4
-hg tip -q
-hg verify
-hg rollback
-hg unbundle ../test-bundle-branch2.hg
-echo % 6
-hg tip -q
-hg verify
-hg rollback
-hg unbundle ../test-bundle-cset-7.hg
-echo % 4
-hg tip -q
-hg verify
-
-cd ../test
-hg merge 7
-hg ci -m merge -d "1000000 0"
-cd ..
-hg -R test bundle --base 2 test-bundle-head.hg
-hg clone test-2 test-10
-cd test-10
-hg unbundle ../test-bundle-head.hg
-echo % 9
-hg tip -q
-hg verify
--- a/tests/test-bundle-r.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,250 +0,0 @@
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-1 files updated, 0 files merged, 2 files removed, 0 files unresolved
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0       3      0       0 362fef284ce2 000000000000 000000000000
-     1         3       5      1       1 125144f7e028 362fef284ce2 000000000000
-     2         8       7      2       2 4c982badb186 125144f7e028 000000000000
-     3        15       9      3       3 19b1fc555737 4c982badb186 000000000000
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0      75      0       7 2565f3199a74 000000000000 000000000000
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0      75      0       8 2565f3199a74 000000000000 000000000000
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0       8      0       6 12ab3bcc5ea4 000000000000 000000000000
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0      48      0       0 43eadb1d2d06 000000000000 000000000000
-     1        48      48      1       1 8b89697eba2c 43eadb1d2d06 000000000000
-     2        96      48      2       2 626a32663c2f 8b89697eba2c 000000000000
-     3       144      48      3       3 f54c32f13478 626a32663c2f 000000000000
-     4       192      58      3       6 de68e904d169 626a32663c2f 000000000000
-     5       250      68      3       7 09bb521d218d de68e904d169 000000000000
-     6       318      54      6       8 1fde233dfb0f f54c32f13478 000000000000
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-4 files, 9 changesets, 7 total revisions
-searching for changes
-1 changesets found
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-(run 'hg update' to get a working copy)
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 1 changesets, 1 total revisions
-0:5649c9d34dd8
-searching for changes
-2 changesets found
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 2 changes to 1 files
-(run 'hg update' to get a working copy)
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 2 changesets, 2 total revisions
-1:10b2180f755b
-searching for changes
-3 changesets found
-adding changesets
-adding manifests
-adding file changes
-added 3 changesets with 3 changes to 1 files
-(run 'hg update' to get a working copy)
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 3 changesets, 3 total revisions
-2:d62976ca1e50
-searching for changes
-4 changesets found
-adding changesets
-adding manifests
-adding file changes
-added 4 changesets with 4 changes to 1 files
-(run 'hg update' to get a working copy)
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 4 changesets, 4 total revisions
-3:ac69c658229d
-searching for changes
-2 changesets found
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 2 changes to 1 files
-(run 'hg update' to get a working copy)
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 2 changesets, 2 total revisions
-1:5f4f3ceb285e
-searching for changes
-3 changesets found
-adding changesets
-adding manifests
-adding file changes
-added 3 changesets with 3 changes to 1 files
-(run 'hg update' to get a working copy)
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 3 changesets, 3 total revisions
-2:024e4e7df376
-searching for changes
-4 changesets found
-adding changesets
-adding manifests
-adding file changes
-added 4 changesets with 5 changes to 2 files
-(run 'hg update' to get a working copy)
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-2 files, 4 changesets, 5 total revisions
-3:1e3f6b843bd6
-searching for changes
-5 changesets found
-adding changesets
-adding manifests
-adding file changes
-added 5 changesets with 6 changes to 3 files
-(run 'hg update' to get a working copy)
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-3 files, 5 changesets, 6 total revisions
-4:27f57c869697
-searching for changes
-5 changesets found
-adding changesets
-adding manifests
-adding file changes
-added 5 changesets with 5 changes to 2 files
-(run 'hg update' to get a working copy)
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-2 files, 5 changesets, 5 total revisions
-4:088ff9d6e1e1
-pulling from ../test-7
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 4 changesets with 2 changes to 3 files (+1 heads)
-(run 'hg heads' to see heads, 'hg merge' to merge)
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-4 files, 9 changesets, 7 total revisions
-rolling back to revision 4 (undo pull)
-% should fail
-abort: --base is incompatible with specifying a destination
-abort: repository default-push not found!
-2 changesets found
-4 changesets found
-6 changesets found
-1 changesets found
-no changes found
-1 changesets found
-4 changesets found
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% 2
-2:d62976ca1e50
-adding changesets
-transaction abort!
-rollback completed
-abort: 00changelog.i@ac69c658229d: unknown parent!
-% 2
-2:d62976ca1e50
-adding changesets
-adding manifests
-adding file changes
-added 6 changesets with 4 changes to 4 files (+1 heads)
-(run 'hg heads' to see heads, 'hg merge' to merge)
-% 8
-8:088ff9d6e1e1
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-4 files, 9 changesets, 7 total revisions
-rolling back to revision 2 (undo unbundle)
-% 2
-2:d62976ca1e50
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 2 changes to 2 files
-(run 'hg update' to get a working copy)
-% 4
-4:088ff9d6e1e1
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-2 files, 5 changesets, 5 total revisions
-rolling back to revision 2 (undo unbundle)
-adding changesets
-adding manifests
-adding file changes
-added 4 changesets with 3 changes to 3 files (+1 heads)
-(run 'hg heads' to see heads, 'hg merge' to merge)
-% 6
-6:27f57c869697
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-3 files, 7 changesets, 6 total revisions
-rolling back to revision 2 (undo unbundle)
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 2 changes to 2 files
-(run 'hg update' to get a working copy)
-% 4
-4:088ff9d6e1e1
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-2 files, 5 changesets, 5 total revisions
-warning: detected divergent renames of afile to:
- anotherfile
- adifferentfile
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-7 changesets found
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-adding changesets
-adding manifests
-adding file changes
-added 7 changesets with 4 changes to 4 files
-(run 'hg update' to get a working copy)
-% 9
-9:e3061ea42e4c
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-4 files, 10 changesets, 7 total revisions
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-bundle-r.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,371 @@
+  $ hg init test
+  $ cd test
+  $ echo "0" >> afile
+  $ hg add afile
+  $ hg commit -m "0.0"
+  $ echo "1" >> afile
+  $ hg commit -m "0.1"
+  $ echo "2" >> afile
+  $ hg commit -m "0.2"
+  $ echo "3" >> afile
+  $ hg commit -m "0.3"
+  $ hg update -C 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo "1" >> afile
+  $ hg commit -m "1.1"
+  created new head
+  $ echo "2" >> afile
+  $ hg commit -m "1.2"
+  $ echo "a line" > fred
+  $ echo "3" >> afile
+  $ hg add fred
+  $ hg commit -m "1.3"
+  $ hg mv afile adifferentfile
+  $ hg commit -m "1.3m"
+  $ hg update -C 3
+  1 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  $ hg mv afile anotherfile
+  $ hg commit -m "0.3m"
+  $ hg debugindex .hg/store/data/afile.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0       3      0       0 362fef284ce2 000000000000 000000000000
+       1         3       5      1       1 125144f7e028 362fef284ce2 000000000000
+       2         8       7      2       2 4c982badb186 125144f7e028 000000000000
+       3        15       9      3       3 19b1fc555737 4c982badb186 000000000000
+  $ hg debugindex .hg/store/data/adifferentfile.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0      75      0       7 2565f3199a74 000000000000 000000000000
+  $ hg debugindex .hg/store/data/anotherfile.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0      75      0       8 2565f3199a74 000000000000 000000000000
+  $ hg debugindex .hg/store/data/fred.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0       8      0       6 12ab3bcc5ea4 000000000000 000000000000
+  $ hg debugindex .hg/store/00manifest.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0      48      0       0 43eadb1d2d06 000000000000 000000000000
+       1        48      48      1       1 8b89697eba2c 43eadb1d2d06 000000000000
+       2        96      48      2       2 626a32663c2f 8b89697eba2c 000000000000
+       3       144      48      3       3 f54c32f13478 626a32663c2f 000000000000
+       4       192      58      3       6 de68e904d169 626a32663c2f 000000000000
+       5       250      68      3       7 09bb521d218d de68e904d169 000000000000
+       6       318      54      6       8 1fde233dfb0f f54c32f13478 000000000000
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  4 files, 9 changesets, 7 total revisions
+  $ cd ..
+  $ for i in 0 1 2 3 4 5 6 7 8; do
+  >    mkdir test-"$i"
+  >    hg --cwd test-"$i" init
+  >    hg -R test bundle -r "$i" test-"$i".hg test-"$i"
+  >    cd test-"$i"
+  >    hg unbundle ../test-"$i".hg
+  >    hg verify
+  >    hg tip -q
+  >    cd ..
+  > done
+  searching for changes
+  1 changesets found
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  (run 'hg update' to get a working copy)
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 1 changesets, 1 total revisions
+  0:f9ee2f85a263
+  searching for changes
+  2 changesets found
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 1 files
+  (run 'hg update' to get a working copy)
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 2 changesets, 2 total revisions
+  1:34c2bf6b0626
+  searching for changes
+  3 changesets found
+  adding changesets
+  adding manifests
+  adding file changes
+  added 3 changesets with 3 changes to 1 files
+  (run 'hg update' to get a working copy)
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 3 changesets, 3 total revisions
+  2:e38ba6f5b7e0
+  searching for changes
+  4 changesets found
+  adding changesets
+  adding manifests
+  adding file changes
+  added 4 changesets with 4 changes to 1 files
+  (run 'hg update' to get a working copy)
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 4 changesets, 4 total revisions
+  3:eebf5a27f8ca
+  searching for changes
+  2 changesets found
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 1 files
+  (run 'hg update' to get a working copy)
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 2 changesets, 2 total revisions
+  1:095197eb4973
+  searching for changes
+  3 changesets found
+  adding changesets
+  adding manifests
+  adding file changes
+  added 3 changesets with 3 changes to 1 files
+  (run 'hg update' to get a working copy)
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 3 changesets, 3 total revisions
+  2:1bb50a9436a7
+  searching for changes
+  4 changesets found
+  adding changesets
+  adding manifests
+  adding file changes
+  added 4 changesets with 5 changes to 2 files
+  (run 'hg update' to get a working copy)
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  2 files, 4 changesets, 5 total revisions
+  3:7373c1169842
+  searching for changes
+  5 changesets found
+  adding changesets
+  adding manifests
+  adding file changes
+  added 5 changesets with 6 changes to 3 files
+  (run 'hg update' to get a working copy)
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  3 files, 5 changesets, 6 total revisions
+  4:a6a34bfa0076
+  searching for changes
+  5 changesets found
+  adding changesets
+  adding manifests
+  adding file changes
+  added 5 changesets with 5 changes to 2 files
+  (run 'hg update' to get a working copy)
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  2 files, 5 changesets, 5 total revisions
+  4:aa35859c02ea
+  $ cd test-8
+  $ hg pull ../test-7
+  pulling from ../test-7
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 4 changesets with 2 changes to 3 files (+1 heads)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  4 files, 9 changesets, 7 total revisions
+  $ hg rollback
+  rolling back to revision 4 (undo pull)
+  $ cd ..
+
+should fail
+
+  $ hg -R test bundle --base 2 -r tip test-bundle-branch1.hg test-3
+  abort: --base is incompatible with specifying a destination
+  [255]
+  $ hg -R test bundle -r tip test-bundle-branch1.hg
+  abort: repository default-push not found!
+  [255]
+
+  $ hg -R test bundle --base 2 -r tip test-bundle-branch1.hg
+  2 changesets found
+  $ hg -R test bundle --base 2 -r 7 test-bundle-branch2.hg
+  4 changesets found
+  $ hg -R test bundle --base 2 test-bundle-all.hg
+  6 changesets found
+  $ hg -R test bundle --base 3 -r tip test-bundle-should-fail.hg
+  1 changesets found
+
+empty bundle
+
+  $ hg -R test bundle --base 7 --base 8 test-bundle-empty.hg
+  no changes found
+  [1]
+
+issue76 msg2163
+
+  $ hg -R test bundle --base 3 -r 3 -r 3 test-bundle-cset-3.hg
+  1 changesets found
+
+issue1910
+
+  $ hg -R test bundle --base 7 test-bundle-cset-7.hg
+  4 changesets found
+
+  $ hg clone test-2 test-9
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd test-9
+
+revision 2
+
+  $ hg tip -q
+  2:e38ba6f5b7e0
+  $ hg unbundle ../test-bundle-should-fail.hg
+  adding changesets
+  transaction abort!
+  rollback completed
+  abort: 00changelog.i@eebf5a27f8ca: unknown parent!
+  [255]
+
+revision 2
+
+  $ hg tip -q
+  2:e38ba6f5b7e0
+  $ hg unbundle ../test-bundle-all.hg
+  adding changesets
+  adding manifests
+  adding file changes
+  added 6 changesets with 4 changes to 4 files (+1 heads)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+
+revision 8
+
+  $ hg tip -q
+  8:aa35859c02ea
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  4 files, 9 changesets, 7 total revisions
+  $ hg rollback
+  rolling back to revision 2 (undo unbundle)
+
+revision 2
+
+  $ hg tip -q
+  2:e38ba6f5b7e0
+  $ hg unbundle ../test-bundle-branch1.hg
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 2 files
+  (run 'hg update' to get a working copy)
+
+revision 4
+
+  $ hg tip -q
+  4:aa35859c02ea
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  2 files, 5 changesets, 5 total revisions
+  $ hg rollback
+  rolling back to revision 2 (undo unbundle)
+  $ hg unbundle ../test-bundle-branch2.hg
+  adding changesets
+  adding manifests
+  adding file changes
+  added 4 changesets with 3 changes to 3 files (+1 heads)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+
+revision 6
+
+  $ hg tip -q
+  6:a6a34bfa0076
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  3 files, 7 changesets, 6 total revisions
+  $ hg rollback
+  rolling back to revision 2 (undo unbundle)
+  $ hg unbundle ../test-bundle-cset-7.hg
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 2 files
+  (run 'hg update' to get a working copy)
+
+revision 4
+
+  $ hg tip -q
+  4:aa35859c02ea
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  2 files, 5 changesets, 5 total revisions
+
+  $ cd ../test
+  $ hg merge 7
+  warning: detected divergent renames of afile to:
+   anotherfile
+   adifferentfile
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg ci -m merge
+  $ cd ..
+  $ hg -R test bundle --base 2 test-bundle-head.hg
+  7 changesets found
+  $ hg clone test-2 test-10
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd test-10
+  $ hg unbundle ../test-bundle-head.hg
+  adding changesets
+  adding manifests
+  adding file changes
+  added 7 changesets with 4 changes to 4 files
+  (run 'hg update' to get a working copy)
+
+revision 9
+
+  $ hg tip -q
+  9:905597b0d5d4
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  4 files, 10 changesets, 7 total revisions
--- a/tests/test-bundle-type	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-#!/bin/sh
-
-echo % bundle w/o type option
-hg init t1
-hg init t2
-cd t1
-echo blablablablabla > file.txt
-hg ci -Ama
-hg log | grep summary
-hg bundle ../b1 ../t2
-
-cd ../t2
-hg pull ../b1
-hg up
-hg log | grep summary
-cd ..
-
-for t in "None" "bzip2" "gzip"; do
-  echo % test bundle type $t
-  hg init t$t
-  cd t1
-  hg bundle -t $t ../b$t ../t$t
-  cut -b 1-6 ../b$t | head -n 1
-  cd ../t$t
-  hg pull ../b$t
-  hg up
-  hg log | grep summary
-  cd ..
-done
-
-echo % test garbage file
-echo garbage > bgarbage
-hg init tgarbage
-cd tgarbage
-hg pull ../bgarbage
-cd ..
-
-echo % test invalid bundle type
-cd t1
-hg bundle -a -t garbage ../bgarbage
-cd ..
--- a/tests/test-bundle-type.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-% bundle w/o type option
-adding file.txt
-summary:     a
-searching for changes
-1 changesets found
-pulling from ../b1
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-(run 'hg update' to get a working copy)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-summary:     a
-% test bundle type None
-searching for changes
-1 changesets found
-HG10UN
-pulling from ../bNone
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-(run 'hg update' to get a working copy)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-summary:     a
-% test bundle type bzip2
-searching for changes
-1 changesets found
-HG10BZ
-pulling from ../bbzip2
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-(run 'hg update' to get a working copy)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-summary:     a
-% test bundle type gzip
-searching for changes
-1 changesets found
-HG10GZ
-pulling from ../bgzip
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-(run 'hg update' to get a working copy)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-summary:     a
-% test garbage file
-abort: ../bgarbage: not a Mercurial bundle file
-% test invalid bundle type
-1 changesets found
-abort: unknown bundle type specified with --type
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-bundle-type.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,101 @@
+bundle w/o type option
+
+  $ hg init t1
+  $ hg init t2
+  $ cd t1
+  $ echo blablablablabla > file.txt
+  $ hg ci -Ama
+  adding file.txt
+  $ hg log | grep summary
+  summary:     a
+  $ hg bundle ../b1 ../t2
+  searching for changes
+  1 changesets found
+
+  $ cd ../t2
+  $ hg pull ../b1
+  pulling from ../b1
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  (run 'hg update' to get a working copy)
+  $ hg up
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg log | grep summary
+  summary:     a
+  $ cd ..
+
+test bundle types
+
+  $ for t in "None" "bzip2" "gzip"; do
+  >   echo % test bundle type $t
+  >   hg init t$t
+  >   cd t1
+  >   hg bundle -t $t ../b$t ../t$t
+  >   cut -b 1-6 ../b$t | head -n 1
+  >   cd ../t$t
+  >   hg pull ../b$t
+  >   hg up
+  >   hg log | grep summary
+  >   cd ..
+  > done
+  % test bundle type None
+  searching for changes
+  1 changesets found
+  HG10UN
+  pulling from ../bNone
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  (run 'hg update' to get a working copy)
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  summary:     a
+  % test bundle type bzip2
+  searching for changes
+  1 changesets found
+  HG10BZ
+  pulling from ../bbzip2
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  (run 'hg update' to get a working copy)
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  summary:     a
+  % test bundle type gzip
+  searching for changes
+  1 changesets found
+  HG10GZ
+  pulling from ../bgzip
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  (run 'hg update' to get a working copy)
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  summary:     a
+
+test garbage file
+
+  $ echo garbage > bgarbage
+  $ hg init tgarbage
+  $ cd tgarbage
+  $ hg pull ../bgarbage
+  abort: ../bgarbage: not a Mercurial bundle
+  [255]
+  $ cd ..
+
+test invalid bundle type
+
+  $ cd t1
+  $ hg bundle -a -t garbage ../bgarbage
+  1 changesets found
+  abort: unknown bundle type specified with --type
+  [255]
+  $ cd ..
--- a/tests/test-bundle-vs-outgoing	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-#!/bin/sh
-
-# this structure seems to tickle a bug in bundle's search for
-# changesets, so first we have to recreate it
-#
-# o  8
-# |
-# | o  7
-# | |
-# | o  6
-# |/|
-# o |  5
-# | |
-# o |  4
-# | |
-# | o  3
-# | |
-# | o  2
-# |/
-# o  1
-# |
-# o  0
-
-mkrev()
-{
-    revno=$1
-    echo "rev $revno"
-    echo "rev $revno" > foo.txt
-    hg -q ci -m"rev $revno"
-}
-
-set -e
-echo "% setup test repo1"
-hg init repo1
-cd repo1
-echo "rev 0" > foo.txt
-hg ci -Am"rev 0"
-mkrev 1
-
-# first branch
-mkrev 2
-mkrev 3
-
-# back to rev 1 to create second branch
-hg up -r1
-mkrev 4
-mkrev 5
-
-# merge first branch to second branch
-hg up -C -r5
-HGMERGE=internal:local hg merge
-echo "merge rev 5, rev 3" > foo.txt
-hg ci -m"merge first branch to second branch"
-
-# one more commit following the merge
-mkrev 7
-
-# back to "second branch" to make another head
-hg up -r5
-mkrev 8
-
-echo "[extensions]" >> $HGRCPATH
-echo "graphlog=" >> $HGRCPATH
-
-echo "% the story so far"
-hg glog --template "{rev}\n"
-
-# check that "hg outgoing" really does the right thing
-echo "% sanity check of outgoing: expect revs 4 5 6 7 8"
-hg clone -r3 . ../repo2
-# this should (and does) report 5 outgoing revisions: 4 5 6 7 8
-hg outgoing --template "{rev}\n" ../repo2
-
-echo "% test bundle (destination repo): expect 5 revisions"
-# this should bundle the same 5 revisions that outgoing reported, but it
-# actually bundles 7
-hg bundle foo.bundle ../repo2
-
-echo "% test bundle (base revision): expect 5 revisions"
-# this should (and does) give exactly the same result as bundle
-# with a destination repo... i.e. it's wrong too
-hg bundle --base 3 foo.bundle
-
-
--- a/tests/test-bundle-vs-outgoing.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-% setup test repo1
-adding foo.txt
-rev 1
-rev 2
-rev 3
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-rev 4
-rev 5
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-rev 7
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-rev 8
-% the story so far
-@  8
-|
-| o  7
-| |
-| o  6
-|/|
-o |  5
-| |
-o |  4
-| |
-| o  3
-| |
-| o  2
-|/
-o  1
-|
-o  0
-
-% sanity check of outgoing: expect revs 4 5 6 7 8
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 4 changesets with 4 changes to 1 files
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-comparing with ../repo2
-searching for changes
-4
-5
-6
-7
-8
-% test bundle (destination repo): expect 5 revisions
-searching for changes
-5 changesets found
-% test bundle (base revision): expect 5 revisions
-5 changesets found
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-bundle-vs-outgoing.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,145 @@
+this structure seems to tickle a bug in bundle's search for
+changesets, so first we have to recreate it
+
+o  8
+|
+| o  7
+| |
+| o  6
+|/|
+o |  5
+| |
+o |  4
+| |
+| o  3
+| |
+| o  2
+|/
+o  1
+|
+o  0
+
+  $ mkrev()
+  > {
+  >     revno=$1
+  >     echo "rev $revno"
+  >     echo "rev $revno" > foo.txt
+  >     hg -q ci -m"rev $revno"
+  > }
+
+setup test repo1
+
+  $ hg init repo1
+  $ cd repo1
+  $ echo "rev 0" > foo.txt
+  $ hg ci -Am"rev 0"
+  adding foo.txt
+  $ mkrev 1
+  rev 1
+
+first branch
+
+  $ mkrev 2
+  rev 2
+  $ mkrev 3
+  rev 3
+
+back to rev 1 to create second branch
+
+  $ hg up -r1
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ mkrev 4
+  rev 4
+  $ mkrev 5
+  rev 5
+
+merge first branch to second branch
+
+  $ hg up -C -r5
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ HGMERGE=internal:local hg merge
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ echo "merge rev 5, rev 3" > foo.txt
+  $ hg ci -m"merge first branch to second branch"
+
+one more commit following the merge
+
+  $ mkrev 7
+  rev 7
+
+back to "second branch" to make another head
+
+  $ hg up -r5
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ mkrev 8
+  rev 8
+
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "graphlog=" >> $HGRCPATH
+
+the story so far
+
+  $ hg glog --template "{rev}\n"
+  @  8
+  |
+  | o  7
+  | |
+  | o  6
+  |/|
+  o |  5
+  | |
+  o |  4
+  | |
+  | o  3
+  | |
+  | o  2
+  |/
+  o  1
+  |
+  o  0
+  
+
+check that "hg outgoing" really does the right thing
+
+sanity check of outgoing: expect revs 4 5 6 7 8
+
+  $ hg clone -r3 . ../repo2
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 4 changesets with 4 changes to 1 files
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+this should (and does) report 5 outgoing revisions: 4 5 6 7 8
+
+  $ hg outgoing --template "{rev}\n" ../repo2
+  comparing with ../repo2
+  searching for changes
+  4
+  5
+  6
+  7
+  8
+
+test bundle (destination repo): expect 5 revisions
+
+this should bundle the same 5 revisions that outgoing reported, but it
+
+actually bundles 7
+
+  $ hg bundle foo.bundle ../repo2
+  searching for changes
+  5 changesets found
+
+test bundle (base revision): expect 5 revisions
+
+this should (and does) give exactly the same result as bundle
+
+with a destination repo... i.e. it's wrong too
+
+  $ hg bundle --base 3 foo.bundle
+  5 changesets found
+
--- a/tests/test-bundle.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,365 +0,0 @@
-====== Setting up test
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-1 files updated, 0 files merged, 2 files removed, 0 files unresolved
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-4 files, 9 changesets, 7 total revisions
-====== Bundle --all
-9 changesets found
-====== Bundle test to full.hg
-searching for changes
-9 changesets found
-====== Unbundle full.hg in test
-adding changesets
-adding manifests
-adding file changes
-added 0 changesets with 0 changes to 4 files
-(run 'hg update' to get a working copy)
-====== Verify empty
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-0 files, 0 changesets, 0 total revisions
-====== Pull full.hg into test (using --cwd)
-pulling from ../full.hg
-searching for changes
-no changes found
-====== Pull full.hg into empty (using --cwd)
-pulling from ../full.hg
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 9 changesets with 7 changes to 4 files (+1 heads)
-(run 'hg heads' to see heads, 'hg merge' to merge)
-====== Rollback empty
-rolling back to revision -1 (undo pull)
-====== Pull full.hg into empty again (using --cwd)
-pulling from ../full.hg
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 9 changesets with 7 changes to 4 files (+1 heads)
-(run 'hg heads' to see heads, 'hg merge' to merge)
-====== Pull full.hg into test (using -R)
-pulling from full.hg
-searching for changes
-no changes found
-====== Pull full.hg into empty (using -R)
-pulling from full.hg
-searching for changes
-no changes found
-====== Rollback empty
-rolling back to revision -1 (undo pull)
-====== Pull full.hg into empty again (using -R)
-pulling from full.hg
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 9 changesets with 7 changes to 4 files (+1 heads)
-(run 'hg heads' to see heads, 'hg merge' to merge)
-====== Log -R full.hg in fresh empty
-changeset:   8:088ff9d6e1e1
-tag:         tip
-parent:      3:ac69c658229d
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     0.3m
-
-changeset:   7:27f57c869697
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     1.3m
-
-changeset:   6:1e3f6b843bd6
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     1.3
-
-changeset:   5:024e4e7df376
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     1.2
-
-changeset:   4:5f4f3ceb285e
-parent:      0:5649c9d34dd8
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     1.1
-
-changeset:   3:ac69c658229d
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     0.3
-
-changeset:   2:d62976ca1e50
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     0.2
-
-changeset:   1:10b2180f755b
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     0.1
-
-changeset:   0:5649c9d34dd8
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     0.0
-
-====== Pull ../full.hg into empty (with hook)
-changegroup hook: HG_NODE=5649c9d34dd87d0ecb5fd39672128376e83b22e1 HG_SOURCE=pull HG_URL=bundle:../full.hg 
-pulling from bundle://../full.hg
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 9 changesets with 7 changes to 4 files (+1 heads)
-(run 'hg heads' to see heads, 'hg merge' to merge)
-====== Rollback empty
-rolling back to revision -1 (undo pull)
-====== Log -R bundle:empty+full.hg
-8 7 6 5 4 3 2 1 0 
-====== Pull full.hg into empty again (using -R; with hook)
-changegroup hook: HG_NODE=5649c9d34dd87d0ecb5fd39672128376e83b22e1 HG_SOURCE=pull HG_URL=bundle:empty+full.hg 
-pulling from full.hg
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 9 changesets with 7 changes to 4 files (+1 heads)
-(run 'hg heads' to see heads, 'hg merge' to merge)
-====== Create partial clones
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 4 changesets with 4 changes to 1 files
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-====== Log -R full.hg in partial
-changeset:   8:088ff9d6e1e1
-tag:         tip
-parent:      3:ac69c658229d
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     0.3m
-
-changeset:   7:27f57c869697
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     1.3m
-
-changeset:   6:1e3f6b843bd6
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     1.3
-
-changeset:   5:024e4e7df376
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     1.2
-
-changeset:   4:5f4f3ceb285e
-parent:      0:5649c9d34dd8
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     1.1
-
-changeset:   3:ac69c658229d
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     0.3
-
-changeset:   2:d62976ca1e50
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     0.2
-
-changeset:   1:10b2180f755b
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     0.1
-
-changeset:   0:5649c9d34dd8
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     0.0
-
-====== Incoming full.hg in partial
-comparing with bundle://../full.hg
-searching for changes
-changeset:   4:5f4f3ceb285e
-parent:      0:5649c9d34dd8
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     1.1
-
-changeset:   5:024e4e7df376
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     1.2
-
-changeset:   6:1e3f6b843bd6
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     1.3
-
-changeset:   7:27f57c869697
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     1.3m
-
-changeset:   8:088ff9d6e1e1
-tag:         tip
-parent:      3:ac69c658229d
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     0.3m
-
-====== Outgoing -R full.hg vs partial2 in partial
-comparing with ../partial2
-searching for changes
-changeset:   4:5f4f3ceb285e
-parent:      0:5649c9d34dd8
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     1.1
-
-changeset:   5:024e4e7df376
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     1.2
-
-changeset:   6:1e3f6b843bd6
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     1.3
-
-changeset:   7:27f57c869697
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     1.3m
-
-changeset:   8:088ff9d6e1e1
-tag:         tip
-parent:      3:ac69c658229d
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     0.3m
-
-====== Outgoing -R does-not-exist.hg vs partial2 in partial
-abort: No such file or directory: ../does-not-exist.hg
-====== Direct clone from bundle (all-history)
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 9 changesets with 7 changes to 4 files (+1 heads)
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-changeset:   8:088ff9d6e1e1
-tag:         tip
-parent:      3:ac69c658229d
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     0.3m
-
-changeset:   7:27f57c869697
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     1.3m
-
-====== Unbundle incremental bundles into fresh empty in one go
-1 changesets found
-1 changesets found
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-====== test for 540d1059c802
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-searching for changes
-1 changesets found
-comparing with ../bundle.hg
-searching for changes
-changeset:   2:ed1b79f46b9a
-tag:         tip
-parent:      0:bbd179dfa0a7
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     change foo
-
-===== test that verify bundle does not traceback
-abort: 00changelog.i@bbd179dfa0a7: unknown parent!
-abort: cannot verify bundle or remote repos
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-2 files, 2 changesets, 2 total revisions
-====== diff against bundle
-diff -r 088ff9d6e1e1 anotherfile
---- a/anotherfile	Mon Jan 12 13:46:40 1970 +0000
-+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
-@@ -1,4 +0,0 @@
--0
--1
--2
--3
-====== bundle single branch
-adding a
-adding b
-adding b1
-0 files updated, 0 files merged, 2 files removed, 0 files unresolved
-adding c
-created new head
-adding c1
-== bundling via incoming
-comparing with .
-searching for changes
-d2ae7f538514cd87c17547b0de4cea71fe1af9fb
-5ece8e77363e2b5269e27c66828b72da29e4341a
-== bundling
-searching for changes
-common changesets up to c0025332f9ed
-2 changesets found
-list of changesets:
-d2ae7f538514cd87c17547b0de4cea71fe1af9fb
-5ece8e77363e2b5269e27c66828b72da29e4341a
-bundling changes: 0 chunks
-bundling changes: 1 chunks
-bundling changes: 2 chunks
-bundling changes: 3 chunks
-bundling changes: 4 chunks
-bundling changes: 5 chunks
-bundling changes: 6 chunks
-bundling manifests: 0 chunks
-bundling manifests: 1 chunks
-bundling manifests: 2 chunks
-bundling manifests: 3 chunks
-bundling manifests: 4 chunks
-bundling manifests: 5 chunks
-bundling manifests: 6 chunks
-bundling files: b 0 chunks
-bundling files: b 1 chunks
-bundling files: b 2 chunks
-bundling files: b 3 chunks
-bundling files: b1 4 chunks
-bundling files: b1 5 chunks
-bundling files: b1 6 chunks
-bundling files: b1 7 chunks
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-bundle.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,562 @@
+  $ cp "$TESTDIR"/printenv.py .
+
+Setting up test
+
+  $ hg init test
+  $ cd test
+  $ echo 0 > afile
+  $ hg add afile
+  $ hg commit -m "0.0"
+  $ echo 1 >> afile
+  $ hg commit -m "0.1"
+  $ echo 2 >> afile
+  $ hg commit -m "0.2"
+  $ echo 3 >> afile
+  $ hg commit -m "0.3"
+  $ hg update -C 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo 1 >> afile
+  $ hg commit -m "1.1"
+  created new head
+  $ echo 2 >> afile
+  $ hg commit -m "1.2"
+  $ echo "a line" > fred
+  $ echo 3 >> afile
+  $ hg add fred
+  $ hg commit -m "1.3"
+  $ hg mv afile adifferentfile
+  $ hg commit -m "1.3m"
+  $ hg update -C 3
+  1 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  $ hg mv afile anotherfile
+  $ hg commit -m "0.3m"
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  4 files, 9 changesets, 7 total revisions
+  $ cd ..
+  $ hg init empty
+
+Bundle --all
+
+  $ hg -R test bundle --all all.hg
+  9 changesets found
+
+Bundle test to full.hg
+
+  $ hg -R test bundle full.hg empty
+  searching for changes
+  9 changesets found
+
+Unbundle full.hg in test
+
+  $ hg -R test unbundle full.hg
+  adding changesets
+  adding manifests
+  adding file changes
+  added 0 changesets with 0 changes to 4 files
+  (run 'hg update' to get a working copy)
+
+Verify empty
+
+  $ hg -R empty heads
+  [1]
+  $ hg -R empty verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  0 files, 0 changesets, 0 total revisions
+
+Pull full.hg into test (using --cwd)
+
+  $ hg --cwd test pull ../full.hg
+  pulling from ../full.hg
+  searching for changes
+  no changes found
+
+Pull full.hg into empty (using --cwd)
+
+  $ hg --cwd empty pull ../full.hg
+  pulling from ../full.hg
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 9 changesets with 7 changes to 4 files (+1 heads)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+
+Rollback empty
+
+  $ hg -R empty rollback
+  rolling back to revision -1 (undo pull)
+
+Pull full.hg into empty again (using --cwd)
+
+  $ hg --cwd empty pull ../full.hg
+  pulling from ../full.hg
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 9 changesets with 7 changes to 4 files (+1 heads)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+
+Pull full.hg into test (using -R)
+
+  $ hg -R test pull full.hg
+  pulling from full.hg
+  searching for changes
+  no changes found
+
+Pull full.hg into empty (using -R)
+
+  $ hg -R empty pull full.hg
+  pulling from full.hg
+  searching for changes
+  no changes found
+
+Rollback empty
+
+  $ hg -R empty rollback
+  rolling back to revision -1 (undo pull)
+
+Pull full.hg into empty again (using -R)
+
+  $ hg -R empty pull full.hg
+  pulling from full.hg
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 9 changesets with 7 changes to 4 files (+1 heads)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+
+Log -R full.hg in fresh empty
+
+  $ rm -r empty
+  $ hg init empty
+  $ cd empty
+  $ hg -R bundle://../full.hg log
+  changeset:   8:aa35859c02ea
+  tag:         tip
+  parent:      3:eebf5a27f8ca
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     0.3m
+  
+  changeset:   7:a6a34bfa0076
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     1.3m
+  
+  changeset:   6:7373c1169842
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     1.3
+  
+  changeset:   5:1bb50a9436a7
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     1.2
+  
+  changeset:   4:095197eb4973
+  parent:      0:f9ee2f85a263
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     1.1
+  
+  changeset:   3:eebf5a27f8ca
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     0.3
+  
+  changeset:   2:e38ba6f5b7e0
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     0.2
+  
+  changeset:   1:34c2bf6b0626
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     0.1
+  
+  changeset:   0:f9ee2f85a263
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     0.0
+  
+
+Pull ../full.hg into empty (with hook)
+
+  $ echo '[hooks]' >> .hg/hgrc
+  $ echo 'changegroup = python ../printenv.py changegroup' >> .hg/hgrc
+
+doesn't work (yet ?)
+
+hg -R bundle://../full.hg verify
+
+  $ hg pull bundle://../full.hg
+  changegroup hook: HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735 HG_SOURCE=pull HG_URL=bundle:../full.hg 
+  pulling from bundle://../full.hg
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 9 changesets with 7 changes to 4 files (+1 heads)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+
+Rollback empty
+
+  $ hg rollback
+  rolling back to revision -1 (undo pull)
+  $ cd ..
+
+Log -R bundle:empty+full.hg
+
+  $ hg -R bundle:empty+full.hg log --template="{rev} "; echo ""
+  8 7 6 5 4 3 2 1 0 
+
+Pull full.hg into empty again (using -R; with hook)
+
+  $ hg -R empty pull full.hg
+  changegroup hook: HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735 HG_SOURCE=pull HG_URL=bundle:empty+full.hg 
+  pulling from full.hg
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 9 changesets with 7 changes to 4 files (+1 heads)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+
+Create partial clones
+
+  $ rm -r empty
+  $ hg init empty
+  $ hg clone -r 3 test partial
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 4 changesets with 4 changes to 1 files
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg clone partial partial2
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd partial
+
+Log -R full.hg in partial
+
+  $ hg -R bundle://../full.hg log
+  changeset:   8:aa35859c02ea
+  tag:         tip
+  parent:      3:eebf5a27f8ca
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     0.3m
+  
+  changeset:   7:a6a34bfa0076
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     1.3m
+  
+  changeset:   6:7373c1169842
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     1.3
+  
+  changeset:   5:1bb50a9436a7
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     1.2
+  
+  changeset:   4:095197eb4973
+  parent:      0:f9ee2f85a263
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     1.1
+  
+  changeset:   3:eebf5a27f8ca
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     0.3
+  
+  changeset:   2:e38ba6f5b7e0
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     0.2
+  
+  changeset:   1:34c2bf6b0626
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     0.1
+  
+  changeset:   0:f9ee2f85a263
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     0.0
+  
+
+Incoming full.hg in partial
+
+  $ hg incoming bundle://../full.hg
+  comparing with bundle://../full.hg
+  searching for changes
+  changeset:   4:095197eb4973
+  parent:      0:f9ee2f85a263
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     1.1
+  
+  changeset:   5:1bb50a9436a7
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     1.2
+  
+  changeset:   6:7373c1169842
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     1.3
+  
+  changeset:   7:a6a34bfa0076
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     1.3m
+  
+  changeset:   8:aa35859c02ea
+  tag:         tip
+  parent:      3:eebf5a27f8ca
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     0.3m
+  
+
+Outgoing -R full.hg vs partial2 in partial
+
+  $ hg -R bundle://../full.hg outgoing ../partial2
+  comparing with ../partial2
+  searching for changes
+  changeset:   4:095197eb4973
+  parent:      0:f9ee2f85a263
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     1.1
+  
+  changeset:   5:1bb50a9436a7
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     1.2
+  
+  changeset:   6:7373c1169842
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     1.3
+  
+  changeset:   7:a6a34bfa0076
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     1.3m
+  
+  changeset:   8:aa35859c02ea
+  tag:         tip
+  parent:      3:eebf5a27f8ca
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     0.3m
+  
+
+Outgoing -R does-not-exist.hg vs partial2 in partial
+
+  $ hg -R bundle://../does-not-exist.hg outgoing ../partial2
+  abort: No such file or directory: ../does-not-exist.hg
+  [255]
+  $ cd ..
+
+Direct clone from bundle (all-history)
+
+  $ hg clone full.hg full-clone
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 9 changesets with 7 changes to 4 files (+1 heads)
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg -R full-clone heads
+  changeset:   8:aa35859c02ea
+  tag:         tip
+  parent:      3:eebf5a27f8ca
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     0.3m
+  
+  changeset:   7:a6a34bfa0076
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     1.3m
+  
+  $ rm -r full-clone
+
+test for http://mercurial.selenic.com/bts/issue216
+
+Unbundle incremental bundles into fresh empty in one go
+
+  $ rm -r empty
+  $ hg init empty
+  $ hg -R test bundle --base null -r 0 ../0.hg
+  1 changesets found
+  $ hg -R test bundle --base 0    -r 1 ../1.hg
+  1 changesets found
+  $ hg -R empty unbundle -u ../0.hg ../1.hg
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+test for 540d1059c802
+
+test for 540d1059c802
+
+  $ hg init orig
+  $ cd orig
+  $ echo foo > foo
+  $ hg add foo
+  $ hg ci -m 'add foo'
+
+  $ hg clone . ../copy
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg tag foo
+
+  $ cd ../copy
+  $ echo >> foo
+  $ hg ci -m 'change foo'
+  $ hg bundle ../bundle.hg ../orig
+  searching for changes
+  1 changesets found
+
+  $ cd ../orig
+  $ hg incoming ../bundle.hg
+  comparing with ../bundle.hg
+  searching for changes
+  changeset:   2:ed1b79f46b9a
+  tag:         tip
+  parent:      0:bbd179dfa0a7
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     change foo
+  
+  $ cd ..
+
+test for http://mercurial.selenic.com/bts/issue1144
+
+test that verify bundle does not traceback
+
+partial history bundle, fails w/ unkown parent
+
+  $ hg -R bundle.hg verify
+  abort: 00changelog.i@bbd179dfa0a7: unknown parent!
+  [255]
+
+full history bundle, refuses to verify non-local repo
+
+  $ hg -R all.hg verify
+  abort: cannot verify bundle or remote repos
+  [255]
+
+but, regular verify must continue to work
+
+  $ hg -R orig verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  2 files, 2 changesets, 2 total revisions
+
+diff against bundle
+
+  $ hg init b
+  $ cd b
+  $ hg -R ../all.hg diff -r tip
+  diff -r aa35859c02ea anotherfile
+  --- a/anotherfile	Thu Jan 01 00:00:00 1970 +0000
+  +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  @@ -1,4 +0,0 @@
+  -0
+  -1
+  -2
+  -3
+  $ cd ..
+
+bundle single branch
+
+  $ hg init branchy
+  $ cd branchy
+  $ echo a >a
+  $ hg ci -Ama
+  adding a
+  $ echo b >b
+  $ hg ci -Amb
+  adding b
+  $ echo b1 >b1
+  $ hg ci -Amb1
+  adding b1
+  $ hg up 0
+  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  $ echo c >c
+  $ hg ci -Amc
+  adding c
+  created new head
+  $ echo c1 >c1
+  $ hg ci -Amc1
+  adding c1
+  $ hg clone -q .#tip part
+
+== bundling via incoming
+
+  $ hg in -R part --bundle incoming.hg --template "{node}\n" .
+  comparing with .
+  searching for changes
+  d2ae7f538514cd87c17547b0de4cea71fe1af9fb
+  5ece8e77363e2b5269e27c66828b72da29e4341a
+
+== bundling
+
+  $ hg bundle bundle.hg part --debug
+  searching for changes
+  common changesets up to c0025332f9ed
+  2 changesets found
+  list of changesets:
+  d2ae7f538514cd87c17547b0de4cea71fe1af9fb
+  5ece8e77363e2b5269e27c66828b72da29e4341a
+  bundling changes: 0 chunks
+  bundling changes: 1 chunks
+  bundling changes: 2 chunks
+  bundling changes: 3 chunks
+  bundling changes: 4 chunks
+  bundling changes: 5 chunks
+  bundling changes: 6 chunks
+  bundling manifests: 0 chunks
+  bundling manifests: 1 chunks
+  bundling manifests: 2 chunks
+  bundling manifests: 3 chunks
+  bundling manifests: 4 chunks
+  bundling manifests: 5 chunks
+  bundling manifests: 6 chunks
+  bundling files: b 0 chunks
+  bundling files: b 1 chunks
+  bundling files: b 2 chunks
+  bundling files: b 3 chunks
+  bundling files: b1 4 chunks
+  bundling files: b1 5 chunks
+  bundling files: b1 6 chunks
+  bundling files: b1 7 chunks
+
--- a/tests/test-cat	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-#!/bin/sh
-#
-mkdir t
-cd t
-hg init
-echo 0 > a
-echo 0 > b
-hg ci -A -m m -d "1000000 0"
-hg rm a
-hg cat a
-hg cat --decode a # more tests in test-encode
-echo 1 > b
-hg ci -m m -d "1000000 0"
-echo 2 > b
-hg cat -r 0 a
-hg cat -r 0 b
-hg cat -r 1 a
-hg cat -r 1 b
--- a/tests/test-cat.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-adding a
-adding b
-0
-0
-0
-0
-a: no such file in rev 03f6b0774996
-1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-cat.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,23 @@
+  $ hg init
+  $ echo 0 > a
+  $ echo 0 > b
+  $ hg ci -A -m m
+  adding a
+  adding b
+  $ hg rm a
+  $ hg cat a
+  0
+  $ hg cat --decode a # more tests in test-encode
+  0
+  $ echo 1 > b
+  $ hg ci -m m
+  $ echo 2 > b
+  $ hg cat -r 0 a
+  0
+  $ hg cat -r 0 b
+  0
+  $ hg cat -r 1 a
+  a: no such file in rev 7040230c159c
+  [1]
+  $ hg cat -r 1 b
+  1
--- a/tests/test-changelog-exec	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-#!/bin/sh
-# b51a8138292a introduced a regression where we would mention in the
-# changelog executable files added by the second parent of a merge.
-# Test that that doesn't happen anymore
-
-"$TESTDIR/hghave" execbit || exit 80
-
-hg init repo
-cd repo
-echo foo > foo
-hg ci -qAm 'add foo'
-
-echo bar > bar
-chmod +x bar
-hg ci -qAm 'add bar'
-echo '% manifest of p2:'
-hg manifest
-echo
-
-hg up -qC 0
-echo >> foo
-hg ci -m 'change foo'
-echo '% manifest of p1:'
-hg manifest
-
-hg merge
-hg ci -m 'merge'
-
-echo '% this should not mention bar:'
-hg tip -v
-
-hg debugindex .hg/store/data/bar.i
--- a/tests/test-changelog-exec.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-% manifest of p2:
-bar
-foo
-
-created new head
-% manifest of p1:
-foo
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-% this should not mention bar:
-changeset:   3:ef2fc9b4a51b
-tag:         tip
-parent:      2:ed1b79f46b9a
-parent:      1:d394a8db219b
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-description:
-merge
-
-
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0       5      0       1 b004912a8510 000000000000 000000000000
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-changelog-exec.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,53 @@
+b51a8138292a introduced a regression where we would mention in the
+changelog executable files added by the second parent of a merge. Test
+that that doesn't happen anymore
+
+  $ "$TESTDIR/hghave" execbit || exit 80
+
+  $ hg init repo
+  $ cd repo
+  $ echo foo > foo
+  $ hg ci -qAm 'add foo'
+
+  $ echo bar > bar
+  $ chmod +x bar
+  $ hg ci -qAm 'add bar'
+
+manifest of p2:
+
+  $ hg manifest
+  bar
+  foo
+
+  $ hg up -qC 0
+  $ echo >> foo
+  $ hg ci -m 'change foo'
+  created new head
+
+manifest of p1:
+
+  $ hg manifest
+  foo
+
+  $ hg merge
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg ci -m 'merge'
+
+this should not mention bar:
+
+  $ hg tip -v
+  changeset:   3:ef2fc9b4a51b
+  tag:         tip
+  parent:      2:ed1b79f46b9a
+  parent:      1:d394a8db219b
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  description:
+  merge
+  
+  
+
+  $ hg debugindex .hg/store/data/bar.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0       5      0       1 b004912a8510 000000000000 000000000000
--- a/tests/test-check-code	Wed Sep 22 17:13:49 2010 -0500
+++ b/tests/test-check-code	Wed Sep 22 18:29:41 2010 -0500
@@ -35,3 +35,5 @@
 
 check_code=`dirname $0`/../contrib/check-code.py
 ${check_code} ./wrong.py ./correct.py ./quote.py ./non-py24.py
+
+exit 0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-check-code-hg.py	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,24 @@
+# Pass all working directory files through check-code.py
+
+import sys, os, imp
+rootdir = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '..'))
+if not os.path.isdir(os.path.join(rootdir, '.hg')):
+    sys.stderr.write('skipped: cannot check code on non-repository sources\n')
+    sys.exit(80)
+
+checkpath = os.path.join(rootdir, 'contrib/check-code.py')
+checkcode = imp.load_source('checkcode', checkpath)
+
+from mercurial import hg, ui
+u = ui.ui()
+repo = hg.repository(u, rootdir)
+checked = 0
+wctx = repo[None]
+for f in wctx:
+    # ignore removed and unknown files
+    if f not in wctx:
+        continue
+    checked += 1
+    checkcode.checkfile(os.path.join(rootdir, f))
+if not checked:
+    sys.stderr.write('no file checked!\n')
--- a/tests/test-children	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-#!/bin/sh
-# test children command
-
-cat <<EOF >> $HGRCPATH
-[extensions]
-children =
-EOF
-
-echo "% init"
-hg init t
-cd t
-
-echo "% no working directory"
-hg children
-
-echo % setup
-echo 0 > file0
-hg ci -qAm 0 -d '0 0'
-
-echo 1 > file1
-hg ci -qAm 1 -d '1 0'
-
-echo 2 >> file0
-hg ci -qAm 2 -d '2 0'
-
-hg co null
-echo 3 > file3
-hg ci -qAm 3 -d '3 0'
-
-echo "% hg children at revision 3 (tip)"
-hg children
-
-hg co null
-echo "% hg children at nullrev (should be 0 and 3)"
-hg children
-
-hg co 1
-echo "% hg children at revision 1 (should be 2)"
-hg children
-
-hg co 2
-echo "% hg children at revision 2 (other head)"
-hg children
-
-for i in null 0 1 2 3; do
-  echo "% hg children -r $i"
-  hg children -r $i
-done
-
-echo "% hg children -r 0 file0 (should be 2)"
-hg children -r 0 file0
-
-echo "% hg children -r 1 file0 (should be 2)"
-hg children -r 1 file0
-
-hg co 0
-echo "% hg children file0 at revision 0 (should be 2)"
-hg children file0
-
--- a/tests/test-children.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-% init
-% no working directory
-% setup
-0 files updated, 0 files merged, 2 files removed, 0 files unresolved
-% hg children at revision 3 (tip)
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-% hg children at nullrev (should be 0 and 3)
-changeset:   0:4df8521a7374
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     0
-
-changeset:   3:e2962852269d
-tag:         tip
-parent:      -1:000000000000
-user:        test
-date:        Thu Jan 01 00:00:03 1970 +0000
-summary:     3
-
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% hg children at revision 1 (should be 2)
-changeset:   2:8f5eea5023c2
-user:        test
-date:        Thu Jan 01 00:00:02 1970 +0000
-summary:     2
-
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% hg children at revision 2 (other head)
-% hg children -r null
-changeset:   0:4df8521a7374
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     0
-
-changeset:   3:e2962852269d
-tag:         tip
-parent:      -1:000000000000
-user:        test
-date:        Thu Jan 01 00:00:03 1970 +0000
-summary:     3
-
-% hg children -r 0
-changeset:   1:708c093edef0
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-summary:     1
-
-% hg children -r 1
-changeset:   2:8f5eea5023c2
-user:        test
-date:        Thu Jan 01 00:00:02 1970 +0000
-summary:     2
-
-% hg children -r 2
-% hg children -r 3
-% hg children -r 0 file0 (should be 2)
-changeset:   2:8f5eea5023c2
-user:        test
-date:        Thu Jan 01 00:00:02 1970 +0000
-summary:     2
-
-% hg children -r 1 file0 (should be 2)
-changeset:   2:8f5eea5023c2
-user:        test
-date:        Thu Jan 01 00:00:02 1970 +0000
-summary:     2
-
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-% hg children file0 at revision 0 (should be 2)
-changeset:   2:8f5eea5023c2
-user:        test
-date:        Thu Jan 01 00:00:02 1970 +0000
-summary:     2
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-children.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,123 @@
+test children command
+
+  $ cat <<EOF >> $HGRCPATH
+  > [extensions]
+  > children =
+  > EOF
+
+init
+  $ hg init t
+  $ cd t
+
+no working directory
+  $ hg children
+
+setup
+  $ echo 0 > file0
+  $ hg ci -qAm 0 -d '0 0'
+
+  $ echo 1 > file1
+  $ hg ci -qAm 1 -d '1 0'
+
+  $ echo 2 >> file0
+  $ hg ci -qAm 2 -d '2 0'
+
+  $ hg co null
+  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  $ echo 3 > file3
+  $ hg ci -qAm 3 -d '3 0'
+
+hg children at revision 3 (tip)
+  $ hg children
+
+  $ hg co null
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+hg children at nullrev (should be 0 and 3)
+  $ hg children
+  changeset:   0:4df8521a7374
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     0
+  
+  changeset:   3:e2962852269d
+  tag:         tip
+  parent:      -1:000000000000
+  user:        test
+  date:        Thu Jan 01 00:00:03 1970 +0000
+  summary:     3
+  
+  $ hg co 1
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+hg children at revision 1 (should be 2)
+  $ hg children
+  changeset:   2:8f5eea5023c2
+  user:        test
+  date:        Thu Jan 01 00:00:02 1970 +0000
+  summary:     2
+  
+  $ hg co 2
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+hg children at revision 2 (other head)
+  $ hg children
+
+  $ for i in null 0 1 2 3; do
+  > echo "hg children -r $i"
+  > hg children -r $i
+  > done
+  hg children -r null
+  changeset:   0:4df8521a7374
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     0
+  
+  changeset:   3:e2962852269d
+  tag:         tip
+  parent:      -1:000000000000
+  user:        test
+  date:        Thu Jan 01 00:00:03 1970 +0000
+  summary:     3
+  
+  hg children -r 0
+  changeset:   1:708c093edef0
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  summary:     1
+  
+  hg children -r 1
+  changeset:   2:8f5eea5023c2
+  user:        test
+  date:        Thu Jan 01 00:00:02 1970 +0000
+  summary:     2
+  
+  hg children -r 2
+  hg children -r 3
+
+hg children -r 0 file0 (should be 2)
+  $ hg children -r 0 file0
+  changeset:   2:8f5eea5023c2
+  user:        test
+  date:        Thu Jan 01 00:00:02 1970 +0000
+  summary:     2
+  
+
+hg children -r 1 file0 (should be 2)
+  $ hg children -r 1 file0
+  changeset:   2:8f5eea5023c2
+  user:        test
+  date:        Thu Jan 01 00:00:02 1970 +0000
+  summary:     2
+  
+
+  $ hg co 0
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+hg children file0 at revision 0 (should be 2)
+  $ hg children file0
+  changeset:   2:8f5eea5023c2
+  user:        test
+  date:        Thu Jan 01 00:00:02 1970 +0000
+  summary:     2
+  
--- a/tests/test-churn	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-#!/bin/sh
-
-echo "[extensions]" >> $HGRCPATH
-echo "churn=" >> $HGRCPATH
-
-echo % create test repository
-hg init repo
-cd repo
-echo a > a
-hg ci -Am adda -u user1 -d 6:00
-echo b >> a
-echo b > b
-hg ci -m changeba -u user2 -d 9:00 a
-hg ci -Am addb -u user2 -d 9:30
-echo c >> a
-echo c >> b
-echo c > c
-hg ci -m changeca -u user3 -d 12:00 a
-hg ci -m changecb -u user3 -d 12:15 b
-hg ci -Am addc -u user3 -d 12:30
-mkdir -p d/e
-echo abc > d/e/f1.txt
-hg ci -Am "add d/e/f1.txt" -u user1 -d 12:45 d/e/f1.txt
-mkdir -p d/g
-echo def > d/g/f2.txt
-hg ci -Am "add d/g/f2.txt" -u user1 -d 13:00 d/g/f2.txt
-
-echo % churn separate directories
-cd d
-hg churn e
-echo % churn all
-hg churn
-echo % churn excluding one dir
-hg churn -X e
-echo % churn up to rev 2
-hg churn -r :2
-cd ..
-echo % churn with aliases
-cat > ../aliases <<EOF
-user1 alias1
-
-user3 alias3
-not-an-alias
-EOF
-hg churn --aliases ../aliases
-echo % churn with .hgchurn
-mv ../aliases .hgchurn
-hg churn
-rm .hgchurn
-echo % churn with column specifier
-COLUMNS=40 hg churn
-echo % churn by hour
-hg churn -f '%H' -s
-
-echo % churn with separated added/removed lines
-hg rm d/g/f2.txt
-hg ci -Am "removed d/g/f2.txt" -u user1 -d 14:00 d/g/f2.txt
-hg churn --diffstat
-echo % churn --diffstat with color
-hg --config extensions.color= churn --config color.mode=ansi \
-    --diffstat --color=always
-
-echo % changeset number churn
-hg churn -c
-
-echo 'with space = no-space' >> ../aliases
-echo a >> a
-hg commit -m a -u 'with space' -d 15:00
-echo % churn with space in alias
-hg churn --aliases ../aliases -r tip
-
-cd ..
-
-# issue 833: ZeroDivisionError
-hg init issue-833
-cd issue-833
-touch foo
-hg ci -Am foo
-# this was failing with a ZeroDivisionError
-hg churn
-cd ..
--- a/tests/test-churn.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-% create test repository
-adding a
-adding b
-adding c
-% churn separate directories
-user1      1 ***************************************************************
-% churn all
-user3      3 ***************************************************************
-user1      3 ***************************************************************
-user2      2 ******************************************
-% churn excluding one dir
-user3      3 ***************************************************************
-user2      2 ******************************************
-user1      2 ******************************************
-% churn up to rev 2
-user2      2 ***************************************************************
-user1      1 ********************************
-% churn with aliases
-skipping malformed alias: not-an-alias
-alias3      3 **************************************************************
-alias1      3 **************************************************************
-user2       2 *****************************************
-% churn with .hgchurn
-skipping malformed alias: not-an-alias
-alias3      3 **************************************************************
-alias1      3 **************************************************************
-user2       2 *****************************************
-% churn with column specifier
-user3      3 ***********************
-user1      3 ***********************
-user2      2 ***************
-% churn by hour
-06      1 *****************
-09      2 *********************************
-12      4 ******************************************************************
-13      1 *****************
-% churn with separated added/removed lines
-user1           +3/-1 +++++++++++++++++++++++++++++++++++++++++--------------
-user3           +3/-0 +++++++++++++++++++++++++++++++++++++++++
-user2           +2/-0 +++++++++++++++++++++++++++
-% churn --diffstat with color
-user1           +3/-1 +++++++++++++++++++++++++++++++++++++++++--------------
-user3           +3/-0 +++++++++++++++++++++++++++++++++++++++++
-user2           +2/-0 +++++++++++++++++++++++++++
-% changeset number churn
-user1      4 ***************************************************************
-user3      3 ***********************************************
-user2      2 ********************************
-% churn with space in alias
-no-space      1 ************************************************************
-adding foo
-test      0 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-churn.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,141 @@
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "churn=" >> $HGRCPATH
+
+create test repository
+
+  $ hg init repo
+  $ cd repo
+  $ echo a > a
+  $ hg ci -Am adda -u user1 -d 6:00
+  adding a
+  $ echo b >> a
+  $ echo b > b
+  $ hg ci -m changeba -u user2 -d 9:00 a
+  $ hg ci -Am addb -u user2 -d 9:30
+  adding b
+  $ echo c >> a
+  $ echo c >> b
+  $ echo c > c
+  $ hg ci -m changeca -u user3 -d 12:00 a
+  $ hg ci -m changecb -u user3 -d 12:15 b
+  $ hg ci -Am addc -u user3 -d 12:30
+  adding c
+  $ mkdir -p d/e
+  $ echo abc > d/e/f1.txt
+  $ hg ci -Am "add d/e/f1.txt" -u user1 -d 12:45 d/e/f1.txt
+  $ mkdir -p d/g
+  $ echo def > d/g/f2.txt
+  $ hg ci -Am "add d/g/f2.txt" -u user1 -d 13:00 d/g/f2.txt
+
+
+churn separate directories
+
+  $ cd d
+  $ hg churn e
+  user1      1 ***************************************************************
+
+churn all
+
+  $ hg churn
+  user3      3 ***************************************************************
+  user1      3 ***************************************************************
+  user2      2 ******************************************
+
+churn excluding one dir
+
+  $ hg churn -X e
+  user3      3 ***************************************************************
+  user2      2 ******************************************
+  user1      2 ******************************************
+
+churn up to rev 2
+
+  $ hg churn -r :2
+  user2      2 ***************************************************************
+  user1      1 ********************************
+  $ cd ..
+
+churn with aliases
+
+  $ cat > ../aliases <<EOF
+  > user1 alias1
+  > user3 alias3
+  > not-an-alias
+  > EOF
+
+churn with .hgchurn
+
+  $ mv ../aliases .hgchurn
+  $ hg churn
+  skipping malformed alias: not-an-alias
+  alias3      3 **************************************************************
+  alias1      3 **************************************************************
+  user2       2 *****************************************
+  $ rm .hgchurn
+
+churn with column specifier
+
+  $ COLUMNS=40 hg churn
+  user3      3 ***********************
+  user1      3 ***********************
+  user2      2 ***************
+
+churn by hour
+
+  $ hg churn -f '%H' -s
+  06      1 *****************
+  09      2 *********************************
+  12      4 ******************************************************************
+  13      1 *****************
+
+
+churn with separated added/removed lines
+
+  $ hg rm d/g/f2.txt
+  $ hg ci -Am "removed d/g/f2.txt" -u user1 -d 14:00 d/g/f2.txt
+  $ hg churn --diffstat
+  user1           +3/-1 +++++++++++++++++++++++++++++++++++++++++--------------
+  user3           +3/-0 +++++++++++++++++++++++++++++++++++++++++
+  user2           +2/-0 +++++++++++++++++++++++++++
+
+churn --diffstat with color
+
+  $ hg --config extensions.color= churn --config color.mode=ansi \
+  >     --diffstat --color=always
+  user1           +3/-1 +++++++++++++++++++++++++++++++++++++++++--------------
+  user3           +3/-0 +++++++++++++++++++++++++++++++++++++++++
+  user2           +2/-0 +++++++++++++++++++++++++++
+
+
+changeset number churn
+
+  $ hg churn -c
+  user1      4 ***************************************************************
+  user3      3 ***********************************************
+  user2      2 ********************************
+
+  $ echo 'with space = no-space' >> ../aliases
+  $ echo a >> a
+  $ hg commit -m a -u 'with space' -d 15:00
+
+churn with space in alias
+
+  $ hg churn --aliases ../aliases -r tip
+  no-space      1 ************************************************************
+
+  $ cd ..
+
+
+issue 833: ZeroDivisionError
+
+  $ hg init issue-833
+  $ cd issue-833
+  $ touch foo
+  $ hg ci -Am foo
+  adding foo
+
+this was failing with a ZeroDivisionError
+
+  $ hg churn
+  test      0 
+  $ cd ..
--- a/tests/test-clone	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,222 +0,0 @@
-#!/bin/sh
-
-echo
-echo % prepare repo a
-mkdir a
-cd a
-hg init
-echo a > a
-hg add a
-hg commit -m test
-echo first line > b
-hg add b
-# create a non-inlined filelog
-python -c 'for x in range(10000): print x' >> data1
-for j in 0 1 2 3 4 5 6 7 8 9; do
-    cat data1 >> b
-    hg commit -m test
-done
-echo % "list files in store/data (should show a 'b.d')"
-for i in .hg/store/data/*; do
-    echo $i
-done
-
-echo
-echo % default operation
-hg clone . ../b
-cd ../b
-cat a
-hg verify
-
-echo
-echo % no update, with debug option
-hg --debug clone -U . ../c
-cd ../c
-cat a 2>/dev/null || echo "a not present"
-hg verify
-
-echo
-echo % default destination
-mkdir ../d
-cd ../d
-hg clone ../a
-cd a
-hg cat a
-
-echo
-echo % "check that we drop the file: from the path before"
-echo % "writing the .hgrc"
-cd ../..
-hg clone file:a e
-grep 'file:' e/.hg/hgrc
-
-echo
-echo % check that path aliases are expanded
-hg clone -q -U --config 'paths.foobar=a#0' foobar f
-hg -R f showconfig paths.default | sed -e 's,.*/,,'
-
-echo
-echo % use --pull
-hg clone --pull a g
-hg -R g verify
-
-echo
-echo % clone to '.'
-mkdir h
-cd h
-hg clone ../a .
-cd ..
-
-echo
-echo
-echo % "*** tests for option -u ***"
-echo
-
-
-echo
-echo % "adding some more history to repo a"
-cd a
-echo % "tag ref1"
-hg tag ref1
-echo the quick brown fox >a
-hg ci -m "hacked default"
-echo % "updating back to ref1"
-hg up ref1
-echo
-echo % "add branch 'stable' to repo a for later tests"
-hg branch stable
-echo some text >a
-hg ci -m "starting branch stable"
-echo % "tag ref2"
-hg tag ref2
-echo some more text >a
-hg ci -m "another change for branch stable"
-echo
-echo % "updating back to ref2"
-hg up ref2
-echo
-echo % "parents of repo a"
-hg parents
-echo
-echo % "repo a has two heads"
-hg heads
-cd ..
-
-echo
-echo % "testing clone -U -u 1 a ua (must abort)"
-hg clone -U -u 1 a ua
-
-echo
-echo % "testing clone -u . a ua"
-hg clone -u . a ua
-echo
-echo % "repo ua has both heads"
-hg -R ua heads
-echo
-echo % "same revision checked out in repo a and ua"
-hg -R a parents --template "{node|short}\n"
-hg -R ua parents --template "{node|short}\n"
-rm -r ua
-
-echo
-echo % "testing clone --pull -u . a ua"
-hg clone --pull -u . a ua
-echo
-echo % "repo ua has both heads"
-hg -R ua heads
-echo
-echo % "same revision checked out in repo a and ua"
-hg -R a parents --template "{node|short}\n"
-hg -R ua parents --template "{node|short}\n"
-rm -r ua
-
-echo
-echo % "testing clone -u stable a ua"
-hg clone -u stable a ua
-echo
-echo % "repo ua has both heads"
-hg -R ua heads
-echo
-echo % "branch stable is checked out"
-hg -R ua parents
-rm -r ua
-
-echo
-echo % "testing clone a ua"
-hg clone a ua
-echo
-echo % "repo ua has both heads"
-hg -R ua heads
-echo
-echo % "branch default is checked out"
-hg -R ua parents
-rm -r ua
-
-echo
-echo % "testing clone -u . a#stable ua"
-hg clone -u . a#stable ua
-echo
-echo % "repo ua has only branch stable"
-hg -R ua heads
-echo
-echo % "same revision checked out in repo a and ua"
-hg -R a parents --template "{node|short}\n"
-hg -R ua parents --template "{node|short}\n"
-rm -r ua
-
-echo
-echo % "testing clone -u . -r stable a ua"
-hg clone -u . -r stable a ua
-echo
-echo % "repo ua has only branch stable"
-hg -R ua heads
-echo
-echo % "same revision checked out in repo a and ua"
-hg -R a parents --template "{node|short}\n"
-hg -R ua parents --template "{node|short}\n"
-rm -r ua
-
-echo
-echo % "testing clone -r stable a ua"
-hg clone -r stable a ua
-echo
-echo % "repo ua has only branch stable"
-hg -R ua heads
-echo
-echo % "branch stable is checked out"
-hg -R ua parents
-rm -r ua
-
-echo
-echo % "testing clone -u . -r stable -r default a ua"
-hg clone -u . -r stable -r default a ua
-echo
-echo % "repo ua has two heads"
-hg -R ua heads
-echo
-echo % "same revision checked out in repo a and ua"
-hg -R a parents --template "{node|short}\n"
-hg -R ua parents --template "{node|short}\n"
-rm -r ua
-
-cat <<EOF > simpleclone.py
-from mercurial import ui, hg
-myui = ui.ui()
-repo = hg.repository(myui, 'a')
-hg.clone(myui, repo, dest="ua")
-EOF
-
-python simpleclone.py
-rm -r ua
-
-cat <<EOF > branchclone.py
-from mercurial import ui, hg
-myui = ui.ui()
-repo = hg.repository(myui, 'a')
-hg.clone(myui, repo, dest="ua", branch=["stable",])
-EOF
-
-python branchclone.py
-rm -r ua
-
-exit 0
--- a/tests/test-clone-cgi	Wed Sep 22 17:13:49 2010 -0500
+++ b/tests/test-clone-cgi	Wed Sep 22 18:29:41 2010 -0500
@@ -55,7 +55,7 @@
 SERVER_SOFTWARE="Apache/2.0.53 (Fedora)"; export SERVER_SOFTWARE
 
 echo % try hgweb request
-QUERY_STRING="cmd=changegroup"; export QUERY_STRING
+QUERY_STRING="cmd=changegroup&roots=0000000000000000000000000000000000000000"; export QUERY_STRING
 python hgweb.cgi >page1 2>&1 ; echo $?
 python "$TESTDIR/md5sum.py" page1
 
--- a/tests/test-clone-r	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-#!/bin/sh
-
-hg init test
-cd test
-cat >>afile <<EOF
-0
-EOF
-hg add afile
-hg commit -m "0.0"
-cat >>afile <<EOF
-1
-EOF
-hg commit -m "0.1"
-cat >>afile <<EOF
-2
-EOF
-hg commit -m "0.2"
-cat >>afile <<EOF
-3
-EOF
-hg commit -m "0.3"
-hg update -C 0
-cat >>afile <<EOF
-1
-EOF
-hg commit -m "1.1"
-cat >>afile <<EOF
-2
-EOF
-hg commit -m "1.2"
-cat >fred <<EOF
-a line
-EOF
-cat >>afile <<EOF
-3
-EOF
-hg add fred
-hg commit -m "1.3"
-hg mv afile adifferentfile
-hg commit -m "1.3m"
-hg update -C 3
-hg mv afile anotherfile
-hg commit -m "0.3m"
-hg debugindex .hg/store/data/afile.i
-hg debugindex .hg/store/data/adifferentfile.i
-hg debugindex .hg/store/data/anotherfile.i
-hg debugindex .hg/store/data/fred.i
-hg debugindex .hg/store/00manifest.i
-hg verify
-cd ..
-for i in 0 1 2 3 4 5 6 7 8; do
-   hg clone -r "$i" test test-"$i"
-   cd test-"$i"
-   hg verify
-   cd ..
-done
-cd test-8
-hg pull ../test-7
-hg verify
--- a/tests/test-clone-r.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,147 +0,0 @@
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-1 files updated, 0 files merged, 2 files removed, 0 files unresolved
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0       3      0       0 362fef284ce2 000000000000 000000000000
-     1         3       5      1       1 125144f7e028 362fef284ce2 000000000000
-     2         8       7      2       2 4c982badb186 125144f7e028 000000000000
-     3        15       9      3       3 19b1fc555737 4c982badb186 000000000000
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0      75      0       7 2565f3199a74 000000000000 000000000000
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0      75      0       8 2565f3199a74 000000000000 000000000000
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0       8      0       6 12ab3bcc5ea4 000000000000 000000000000
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0      48      0       0 43eadb1d2d06 000000000000 000000000000
-     1        48      48      1       1 8b89697eba2c 43eadb1d2d06 000000000000
-     2        96      48      2       2 626a32663c2f 8b89697eba2c 000000000000
-     3       144      48      3       3 f54c32f13478 626a32663c2f 000000000000
-     4       192      58      3       6 de68e904d169 626a32663c2f 000000000000
-     5       250      68      3       7 09bb521d218d de68e904d169 000000000000
-     6       318      54      6       8 1fde233dfb0f f54c32f13478 000000000000
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-4 files, 9 changesets, 7 total revisions
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 1 changesets, 1 total revisions
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 2 changes to 1 files
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 2 changesets, 2 total revisions
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 3 changesets with 3 changes to 1 files
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 3 changesets, 3 total revisions
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 4 changesets with 4 changes to 1 files
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 4 changesets, 4 total revisions
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 2 changes to 1 files
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 2 changesets, 2 total revisions
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 3 changesets with 3 changes to 1 files
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 3 changesets, 3 total revisions
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 4 changesets with 5 changes to 2 files
-updating to branch default
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-2 files, 4 changesets, 5 total revisions
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 5 changesets with 6 changes to 3 files
-updating to branch default
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-3 files, 5 changesets, 6 total revisions
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 5 changesets with 5 changes to 2 files
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-2 files, 5 changesets, 5 total revisions
-pulling from ../test-7
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 4 changesets with 2 changes to 3 files (+1 heads)
-(run 'hg heads' to see heads, 'hg merge' to merge)
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-4 files, 9 changesets, 7 total revisions
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-clone-r.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,229 @@
+  $ hg init test
+  $ cd test
+
+  $ echo 0 >> afile
+  $ hg add afile
+  $ hg commit -m "0.0"
+
+  $ echo 1 >> afile
+  $ hg commit -m "0.1"
+
+  $ echo 2 >> afile
+  $ hg commit -m "0.2"
+
+  $ echo 3 >> afile
+  $ hg commit -m "0.3"
+
+  $ hg update -C 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ echo 1 >> afile
+  $ hg commit -m "1.1"
+  created new head
+
+  $ echo 2 >> afile
+  $ hg commit -m "1.2"
+
+  $ echo a line > fred
+  $ echo 3 >> afile
+  $ hg add fred
+  $ hg commit -m "1.3"
+  $ hg mv afile adifferentfile
+  $ hg commit -m "1.3m"
+
+  $ hg update -C 3
+  1 files updated, 0 files merged, 2 files removed, 0 files unresolved
+
+  $ hg mv afile anotherfile
+  $ hg commit -m "0.3m"
+
+  $ hg debugindex .hg/store/data/afile.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0       3      0       0 362fef284ce2 000000000000 000000000000
+       1         3       5      1       1 125144f7e028 362fef284ce2 000000000000
+       2         8       7      2       2 4c982badb186 125144f7e028 000000000000
+       3        15       9      3       3 19b1fc555737 4c982badb186 000000000000
+
+  $ hg debugindex .hg/store/data/adifferentfile.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0      75      0       7 2565f3199a74 000000000000 000000000000
+
+  $ hg debugindex .hg/store/data/anotherfile.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0      75      0       8 2565f3199a74 000000000000 000000000000
+
+  $ hg debugindex .hg/store/data/fred.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0       8      0       6 12ab3bcc5ea4 000000000000 000000000000
+
+  $ hg debugindex .hg/store/00manifest.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0      48      0       0 43eadb1d2d06 000000000000 000000000000
+       1        48      48      1       1 8b89697eba2c 43eadb1d2d06 000000000000
+       2        96      48      2       2 626a32663c2f 8b89697eba2c 000000000000
+       3       144      48      3       3 f54c32f13478 626a32663c2f 000000000000
+       4       192      58      3       6 de68e904d169 626a32663c2f 000000000000
+       5       250      68      3       7 09bb521d218d de68e904d169 000000000000
+       6       318      54      6       8 1fde233dfb0f f54c32f13478 000000000000
+
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  4 files, 9 changesets, 7 total revisions
+
+  $ cd ..
+
+  $ for i in 0 1 2 3 4 5 6 7 8; do
+  >   echo
+  >   echo ---- hg clone -r "$i" test test-"$i"
+  >   hg clone -r "$i" test test-"$i"
+  >   cd test-"$i"
+  >   hg verify
+  >   cd ..
+  > done
+  
+  ---- hg clone -r 0 test test-0
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 1 changesets, 1 total revisions
+  
+  ---- hg clone -r 1 test test-1
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 1 files
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 2 changesets, 2 total revisions
+  
+  ---- hg clone -r 2 test test-2
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 3 changesets with 3 changes to 1 files
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 3 changesets, 3 total revisions
+  
+  ---- hg clone -r 3 test test-3
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 4 changesets with 4 changes to 1 files
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 4 changesets, 4 total revisions
+  
+  ---- hg clone -r 4 test test-4
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 1 files
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 2 changesets, 2 total revisions
+  
+  ---- hg clone -r 5 test test-5
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 3 changesets with 3 changes to 1 files
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 3 changesets, 3 total revisions
+  
+  ---- hg clone -r 6 test test-6
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 4 changesets with 5 changes to 2 files
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  2 files, 4 changesets, 5 total revisions
+  
+  ---- hg clone -r 7 test test-7
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 5 changesets with 6 changes to 3 files
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  3 files, 5 changesets, 6 total revisions
+  
+  ---- hg clone -r 8 test test-8
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 5 changesets with 5 changes to 2 files
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  2 files, 5 changesets, 5 total revisions
+
+  $ cd test-8
+  $ hg pull ../test-7
+  pulling from ../test-7
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 4 changesets with 2 changes to 3 files (+1 heads)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  4 files, 9 changesets, 7 total revisions
+  $ cd ..
+
--- a/tests/test-clone-update-order	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-#!/bin/sh
-
-echo
-echo % prepare repo a
-mkdir a
-cd a
-hg init
-echo foo > bar
-hg commit -Am default
-hg up -r null
-hg branch mine
-echo hello > world
-hg commit -Am hello
-hg up -r null
-hg branch other
-echo good > bye
-hg commit -Am other
-hg up -r mine
-
-echo % test -U -u
-hg clone -U -u . .#other ../b -r 0 -r 1 -r 2 -b other
-
-echo % test -U
-hg clone -U .#other ../b -r 0 -r 1 -r 2 -b other
-rm -rf ../b
-
-echo % test -u .
-hg clone -u . .#other ../b -r 0 -r 1 -r 2 -b other
-rm -rf ../b
-
-echo % test -u 0
-hg clone -u 0 .#other ../b -r 0 -r 1 -r 2 -b other
-rm -rf ../b
-
-echo % test -u 1
-hg clone -u 1 .#other ../b -r 0 -r 1 -r 2 -b other
-rm -rf ../b
-
-echo % test -u 2
-hg clone -u 2 .#other ../b -r 0 -r 1 -r 2 -b other
-rm -rf ../b
-
-echo % test -r 0
-hg clone -u 2 .#other ../b -r 0 -r 1 -r 2 -b other
-rm -rf ../b
-
-echo % test -r mine ... mine is ignored
-hg clone -u 2 .#other ../b -r mine -r 0 -r 1 -r 2 -b other
-rm -rf ../b
-
-echo % test -b default
-hg clone .#other ../b -b default -b mine
-rm -rf ../b
-
-echo % test #other
-hg clone .#other ../b
-rm -rf ../b
-
-echo % test tip
-hg clone -U . ../c -r 1 -r 2 > /dev/null
-hg clone ../c ../b
-rm -rf ../b ../c
-cd ..
-
-rm -rf a
-exit 0
--- a/tests/test-clone-update-order.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-
-% prepare repo a
-adding bar
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-marked working directory as branch mine
-adding world
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-marked working directory as branch other
-adding bye
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-% test -U -u
-abort: cannot specify both --noupdate and --updaterev
-% test -U
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 3 changesets with 3 changes to 3 files (+2 heads)
-% test -u .
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 3 changesets with 3 changes to 3 files (+2 heads)
-updating to branch mine
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% test -u 0
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 3 changesets with 3 changes to 3 files (+2 heads)
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% test -u 1
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 3 changesets with 3 changes to 3 files (+2 heads)
-updating to branch mine
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% test -u 2
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 3 changesets with 3 changes to 3 files (+2 heads)
-updating to branch other
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% test -r 0
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 3 changesets with 3 changes to 3 files (+2 heads)
-updating to branch other
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% test -r mine ... mine is ignored
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 3 changesets with 3 changes to 3 files (+2 heads)
-updating to branch other
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% test -b default
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 3 changesets with 3 changes to 3 files (+2 heads)
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% test
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-updating to branch other
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% test tip
-updating to branch other
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-clone-update-order.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,111 @@
+  $ hg init
+  $ echo foo > bar
+  $ hg commit -Am default
+  adding bar
+  $ hg up -r null
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg branch mine
+  marked working directory as branch mine
+  $ echo hello > world
+  $ hg commit -Am hello
+  adding world
+  $ hg up -r null
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg branch other
+  marked working directory as branch other
+  $ echo good > bye
+  $ hg commit -Am other
+  adding bye
+  $ hg up -r mine
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+  $ hg clone -U -u . .#other ../b -r 0 -r 1 -r 2 -b other
+  abort: cannot specify both --noupdate and --updaterev
+  [255]
+
+  $ hg clone -U .#other ../b -r 0 -r 1 -r 2 -b other
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 3 changesets with 3 changes to 3 files (+2 heads)
+  $ rm -rf ../b
+
+  $ hg clone -u . .#other ../b -r 0 -r 1 -r 2 -b other
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 3 changesets with 3 changes to 3 files (+2 heads)
+  updating to branch mine
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm -rf ../b
+
+  $ hg clone -u 0 .#other ../b -r 0 -r 1 -r 2 -b other
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 3 changesets with 3 changes to 3 files (+2 heads)
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm -rf ../b
+
+  $ hg clone -u 1 .#other ../b -r 0 -r 1 -r 2 -b other
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 3 changesets with 3 changes to 3 files (+2 heads)
+  updating to branch mine
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm -rf ../b
+
+  $ hg clone -u 2 .#other ../b -r 0 -r 1 -r 2 -b other
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 3 changesets with 3 changes to 3 files (+2 heads)
+  updating to branch other
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm -rf ../b
+
+Test -r mine ... mine is ignored:
+
+  $ hg clone -u 2 .#other ../b -r mine -r 0 -r 1 -r 2 -b other
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 3 changesets with 3 changes to 3 files (+2 heads)
+  updating to branch other
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm -rf ../b
+
+  $ hg clone .#other ../b -b default -b mine
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 3 changesets with 3 changes to 3 files (+2 heads)
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm -rf ../b
+
+  $ hg clone .#other ../b
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  updating to branch other
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm -rf ../b
+
+  $ hg clone -U . ../c -r 1 -r 2 > /dev/null
+  $ hg clone ../c ../b
+  updating to branch other
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm -rf ../b ../c
+
--- a/tests/test-clone.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,323 +0,0 @@
-
-% prepare repo a
-% list files in store/data (should show a 'b.d')
-.hg/store/data/a.i
-.hg/store/data/b.d
-.hg/store/data/b.i
-
-% default operation
-updating to branch default
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-a
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-2 files, 11 changesets, 11 total revisions
-
-% no update, with debug option
-linked 8 files
-a not present
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-2 files, 11 changesets, 11 total revisions
-
-% default destination
-destination directory: a
-updating to branch default
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-a
-
-% check that we drop the file: from the path before
-% writing the .hgrc
-updating to branch default
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-
-% check that path aliases are expanded
-a#0
-
-% use --pull
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 11 changesets with 11 changes to 2 files
-updating to branch default
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-2 files, 11 changesets, 11 total revisions
-
-% clone to .
-updating to branch default
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-
-
-% *** tests for option -u ***
-
-
-% adding some more history to repo a
-% tag ref1
-% updating back to ref1
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-
-% add branch 'stable' to repo a for later tests
-marked working directory as branch stable
-% tag ref2
-
-% updating back to ref2
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-
-% parents of repo a
-changeset:   13:e8ece76546a6
-branch:      stable
-tag:         ref2
-parent:      10:a7949464abda
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     starting branch stable
-
-
-% repo a has two heads
-changeset:   15:0aae7cf88f0d
-branch:      stable
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     another change for branch stable
-
-changeset:   12:f21241060d6a
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     hacked default
-
-
-% testing clone -U -u 1 a ua (must abort)
-abort: cannot specify both --noupdate and --updaterev
-
-% testing clone -u . a ua
-updating to branch stable
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-
-% repo ua has both heads
-changeset:   15:0aae7cf88f0d
-branch:      stable
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     another change for branch stable
-
-changeset:   12:f21241060d6a
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     hacked default
-
-
-% same revision checked out in repo a and ua
-e8ece76546a6
-e8ece76546a6
-
-% testing clone --pull -u . a ua
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 16 changesets with 16 changes to 3 files (+1 heads)
-updating to branch stable
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-
-% repo ua has both heads
-changeset:   15:0aae7cf88f0d
-branch:      stable
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     another change for branch stable
-
-changeset:   12:f21241060d6a
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     hacked default
-
-
-% same revision checked out in repo a and ua
-e8ece76546a6
-e8ece76546a6
-
-% testing clone -u stable a ua
-updating to branch stable
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-
-% repo ua has both heads
-changeset:   15:0aae7cf88f0d
-branch:      stable
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     another change for branch stable
-
-changeset:   12:f21241060d6a
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     hacked default
-
-
-% branch stable is checked out
-changeset:   15:0aae7cf88f0d
-branch:      stable
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     another change for branch stable
-
-
-% testing clone a ua
-updating to branch default
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-
-% repo ua has both heads
-changeset:   15:0aae7cf88f0d
-branch:      stable
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     another change for branch stable
-
-changeset:   12:f21241060d6a
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     hacked default
-
-
-% branch default is checked out
-changeset:   12:f21241060d6a
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     hacked default
-
-
-% testing clone -u . a#stable ua
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 14 changesets with 14 changes to 3 files
-updating to branch stable
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-
-% repo ua has only branch stable
-changeset:   13:0aae7cf88f0d
-branch:      stable
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     another change for branch stable
-
-changeset:   10:a7949464abda
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     test
-
-
-% same revision checked out in repo a and ua
-e8ece76546a6
-e8ece76546a6
-
-% testing clone -u . -r stable a ua
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 14 changesets with 14 changes to 3 files
-updating to branch stable
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-
-% repo ua has only branch stable
-changeset:   13:0aae7cf88f0d
-branch:      stable
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     another change for branch stable
-
-changeset:   10:a7949464abda
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     test
-
-
-% same revision checked out in repo a and ua
-e8ece76546a6
-e8ece76546a6
-
-% testing clone -r stable a ua
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 14 changesets with 14 changes to 3 files
-updating to branch stable
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-
-% repo ua has only branch stable
-changeset:   13:0aae7cf88f0d
-branch:      stable
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     another change for branch stable
-
-changeset:   10:a7949464abda
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     test
-
-
-% branch stable is checked out
-changeset:   13:0aae7cf88f0d
-branch:      stable
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     another change for branch stable
-
-
-% testing clone -u . -r stable -r default a ua
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 16 changesets with 16 changes to 3 files (+1 heads)
-updating to branch stable
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-
-% repo ua has two heads
-changeset:   15:0aae7cf88f0d
-branch:      stable
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     another change for branch stable
-
-changeset:   12:f21241060d6a
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     hacked default
-
-
-% same revision checked out in repo a and ua
-e8ece76546a6
-e8ece76546a6
-updating to branch default
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 14 changesets with 14 changes to 3 files
-updating to branch stable
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-clone.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,451 @@
+Prepare repo a:
+
+  $ mkdir a
+  $ cd a
+  $ hg init
+  $ echo a > a
+  $ hg add a
+  $ hg commit -m test
+  $ echo first line > b
+  $ hg add b
+
+Create a non-inlined filelog:
+
+  $ python -c 'for x in range(10000): print x' >> data1
+  $ for j in 0 1 2 3 4 5 6 7 8 9; do
+  >   cat data1 >> b
+  >   hg commit -m test
+  > done
+
+List files in store/data (should show a 'b.d'):
+
+  $ for i in .hg/store/data/*; do
+  >   echo $i
+  > done
+  .hg/store/data/a.i
+  .hg/store/data/b.d
+  .hg/store/data/b.i
+
+Default operation:
+
+  $ hg clone . ../b
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd ../b
+  $ cat a
+  a
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  2 files, 11 changesets, 11 total revisions
+
+No update, with debug option:
+
+  $ hg --debug clone -U . ../c
+  linked 8 files
+  $ cd ../c
+  $ cat a 2>/dev/null || echo "a not present"
+  a not present
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  2 files, 11 changesets, 11 total revisions
+
+Default destination:
+
+  $ mkdir ../d
+  $ cd ../d
+  $ hg clone ../a
+  destination directory: a
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd a
+  $ hg cat a
+  a
+  $ cd ../..
+
+Check that we drop the 'file:' from the path before writing the .hgrc:
+
+  $ hg clone file:a e
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ grep 'file:' e/.hg/hgrc
+  [1]
+
+Check that path aliases are expanded:
+
+  $ hg clone -q -U --config 'paths.foobar=a#0' foobar f
+  $ hg -R f showconfig paths.default
+  */a#0 (glob)
+
+Use --pull:
+
+  $ hg clone --pull a g
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 11 changesets with 11 changes to 2 files
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg -R g verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  2 files, 11 changesets, 11 total revisions
+
+Clone to '.':
+
+  $ mkdir h
+  $ cd h
+  $ hg clone ../a .
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd ..
+
+
+*** Tests for option -u ***
+
+Adding some more history to repo a:
+
+  $ cd a
+  $ hg tag ref1
+  $ echo the quick brown fox >a
+  $ hg ci -m "hacked default"
+  $ hg up ref1
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg branch stable
+  marked working directory as branch stable
+  $ echo some text >a
+  $ hg ci -m "starting branch stable"
+  $ hg tag ref2
+  $ echo some more text >a
+  $ hg ci -m "another change for branch stable"
+  $ hg up ref2
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg parents
+  changeset:   13:e8ece76546a6
+  branch:      stable
+  tag:         ref2
+  parent:      10:a7949464abda
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     starting branch stable
+  
+
+Repo a has two heads:
+
+  $ hg heads
+  changeset:   15:0aae7cf88f0d
+  branch:      stable
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     another change for branch stable
+  
+  changeset:   12:f21241060d6a
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     hacked default
+  
+
+  $ cd ..
+
+
+Testing --noupdate with --updaterev (must abort):
+
+  $ hg clone --noupdate --updaterev 1 a ua
+  abort: cannot specify both --noupdate and --updaterev
+  [255]
+
+
+Testing clone -u:
+
+  $ hg clone -u . a ua
+  updating to branch stable
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+Repo ua has both heads:
+
+  $ hg -R ua heads
+  changeset:   15:0aae7cf88f0d
+  branch:      stable
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     another change for branch stable
+  
+  changeset:   12:f21241060d6a
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     hacked default
+  
+
+Same revision checked out in repo a and ua:
+
+  $ hg -R a parents --template "{node|short}\n"
+  e8ece76546a6
+  $ hg -R ua parents --template "{node|short}\n"
+  e8ece76546a6
+
+  $ rm -r ua
+
+
+Testing clone --pull -u:
+
+  $ hg clone --pull -u . a ua
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 16 changesets with 16 changes to 3 files (+1 heads)
+  updating to branch stable
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+Repo ua has both heads:
+
+  $ hg -R ua heads
+  changeset:   15:0aae7cf88f0d
+  branch:      stable
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     another change for branch stable
+  
+  changeset:   12:f21241060d6a
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     hacked default
+  
+
+Same revision checked out in repo a and ua:
+
+  $ hg -R a parents --template "{node|short}\n"
+  e8ece76546a6
+  $ hg -R ua parents --template "{node|short}\n"
+  e8ece76546a6
+
+  $ rm -r ua
+
+
+Testing clone -u <branch>:
+
+  $ hg clone -u stable a ua
+  updating to branch stable
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+Repo ua has both heads:
+
+  $ hg -R ua heads
+  changeset:   15:0aae7cf88f0d
+  branch:      stable
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     another change for branch stable
+  
+  changeset:   12:f21241060d6a
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     hacked default
+  
+
+Branch 'stable' is checked out:
+
+  $ hg -R ua parents
+  changeset:   15:0aae7cf88f0d
+  branch:      stable
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     another change for branch stable
+  
+
+  $ rm -r ua
+
+
+Testing default checkout:
+
+  $ hg clone a ua
+  updating to branch default
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+Repo ua has both heads:
+
+  $ hg -R ua heads
+  changeset:   15:0aae7cf88f0d
+  branch:      stable
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     another change for branch stable
+  
+  changeset:   12:f21241060d6a
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     hacked default
+  
+
+Branch 'default' is checked out:
+
+  $ hg -R ua parents
+  changeset:   12:f21241060d6a
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     hacked default
+  
+
+  $ rm -r ua
+
+
+Testing #<branch>:
+
+  $ hg clone -u . a#stable ua
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 14 changesets with 14 changes to 3 files
+  updating to branch stable
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
+
+  $ hg -R ua heads
+  changeset:   13:0aae7cf88f0d
+  branch:      stable
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     another change for branch stable
+  
+  changeset:   10:a7949464abda
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     test
+  
+
+Same revision checked out in repo a and ua:
+
+  $ hg -R a parents --template "{node|short}\n"
+  e8ece76546a6
+  $ hg -R ua parents --template "{node|short}\n"
+  e8ece76546a6
+
+  $ rm -r ua
+
+
+Testing -u -r <branch>:
+
+  $ hg clone -u . -r stable a ua
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 14 changesets with 14 changes to 3 files
+  updating to branch stable
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
+
+  $ hg -R ua heads
+  changeset:   13:0aae7cf88f0d
+  branch:      stable
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     another change for branch stable
+  
+  changeset:   10:a7949464abda
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     test
+  
+
+Same revision checked out in repo a and ua:
+
+  $ hg -R a parents --template "{node|short}\n"
+  e8ece76546a6
+  $ hg -R ua parents --template "{node|short}\n"
+  e8ece76546a6
+
+  $ rm -r ua
+
+
+Testing -r <branch>:
+
+  $ hg clone -r stable a ua
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 14 changesets with 14 changes to 3 files
+  updating to branch stable
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
+
+  $ hg -R ua heads
+  changeset:   13:0aae7cf88f0d
+  branch:      stable
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     another change for branch stable
+  
+  changeset:   10:a7949464abda
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     test
+  
+
+Branch 'stable' is checked out:
+
+  $ hg -R ua parents
+  changeset:   13:0aae7cf88f0d
+  branch:      stable
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     another change for branch stable
+  
+
+  $ rm -r ua
+
+
+Testing issue2267:
+
+  $ cat <<EOF > simpleclone.py
+  > from mercurial import ui, hg
+  > myui = ui.ui()
+  > repo = hg.repository(myui, 'a')
+  > hg.clone(myui, repo, dest="ua")
+  > EOF
+
+  $ python simpleclone.py
+  updating to branch default
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ rm -r ua
+
+  $ cat <<EOF > branchclone.py
+  > from mercurial import ui, hg
+  > myui = ui.ui()
+  > repo = hg.repository(myui, 'a')
+  > hg.clone(myui, repo, dest="ua", branch=["stable",])
+  > EOF
+
+  $ python branchclone.py
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 14 changesets with 14 changes to 3 files
+  updating to branch stable
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm -r ua
--- a/tests/test-command-template	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,210 +0,0 @@
-#!/bin/sh
-
-hg init a
-cd a
-echo a > a
-hg add a
-echo line 1 > b
-echo line 2 >> b
-hg commit -l b -d '1000000 0' -u 'User Name <user@hostname>'
-hg add b
-echo other 1 > c
-echo other 2 >> c
-echo >> c
-echo other 3 >> c
-hg commit -l c -d '1100000 0' -u 'A. N. Other <other@place>'
-hg add c
-hg commit -m 'no person' -d '1200000 0' -u 'other@place'
-echo c >> c
-hg commit -m 'no user, no domain' -d '1300000 0' -u 'person'
-echo foo > .hg/branch
-hg commit -m 'new branch' -d '1400000 0' -u 'person'
-hg co -q 3
-echo other 4 >> d
-hg add d
-hg commit -m 'new head' -d '1500000 0' -u 'person'
-hg merge -q foo
-hg commit -m 'merge' -d '1500001 0' -u 'person'
-# second branch starting at nullrev
-hg update null
-echo second > second
-hg add second
-hg commit -m second -d '1000000 0' -u 'User Name <user@hostname>'
-echo third > third
-hg add third
-hg mv second fourth
-hg commit -m third -d "2020-01-01 10:01"
-
-# make sure user/global hgrc does not affect tests
-echo '[ui]' > .hg/hgrc
-echo 'logtemplate =' >> .hg/hgrc
-echo 'style =' >> .hg/hgrc
-
-echo '# default style is like normal output'
-echo '#  normal'
-hg log > log.out
-hg log --style default > style.out
-cmp log.out style.out || diff -u log.out style.out
-echo '#  verbose'
-hg log -v > log.out
-hg log -v --style default > style.out
-cmp log.out style.out || diff -u log.out style.out
-echo '#  debug'
-hg log --debug > log.out
-hg log --debug --style default > style.out
-cmp log.out style.out || diff -u log.out style.out
-
-echo '# revision with no copies (used to print a traceback)'
-hg tip -v --template '\n'
-
-echo '# compact style works'
-hg log --style compact
-hg log -v --style compact
-hg log --debug --style compact
-
-# Test xml styles
-echo '# xml style works (--style xml)'
-hg log --style xml
-echo '# xml style works (-v --style xml)'
-hg log -v --style xml
-echo '# xml style works (--debug --style xml)'
-hg log --debug --style xml
-
-echo '# error if style not readable'
-touch q
-chmod 0 q
-hg log --style ./q
-
-echo '# error if no style'
-hg log --style notexist
-
-echo '# error if style missing key'
-echo 'q = q' > t
-hg log --style ./t
-
-echo '# error if include fails'
-echo 'changeset = q' >> t
-hg log --style ./t
-
-echo '# include works'
-rm q
-echo '{rev}' > q
-hg log --style ./t
-
-echo '# ui.style works'
-echo '[ui]' > .hg/hgrc
-echo 'style = t' >> .hg/hgrc
-hg log
-
-echo '# issue338'
-hg log --style=changelog > changelog
-cat changelog
-
-echo '# issue 2130'
-hg heads --style changelog
-
-echo "# keys work"
-for key in author branches date desc file_adds file_dels file_mods \
-        file_copies file_copies_switch files \
-        manifest node parents rev tags diffstat extras; do
-    for mode in '' --verbose --debug; do
-        hg log $mode --template "$key$mode: {$key}\n"
-    done
-done
-
-echo '# filters work'
-hg log --template '{author|domain}\n'
-hg log --template '{author|person}\n'
-hg log --template '{author|user}\n'
-hg log --template '{date|age}\n' > /dev/null || exit 1
-hg log -l1 --template '{date|age}\n' 
-hg log --template '{date|date}\n'
-hg log --template '{date|isodate}\n'
-hg log --template '{date|isodatesec}\n'
-hg log --template '{date|rfc822date}\n'
-hg log --template '{desc|firstline}\n'
-hg log --template '{node|short}\n'
-hg log --template '<changeset author="{author|xmlescape}"/>\n'
-
-echo '# formatnode filter works'
-echo '#  quiet'
-hg -q log -r 0 --template '{node|formatnode}\n'
-echo '#  normal'
-hg log -r 0 --template '{node|formatnode}\n'
-echo '#  verbose'
-hg -v log -r 0 --template '{node|formatnode}\n'
-echo '#  debug'
-hg --debug log -r 0 --template '{node|formatnode}\n'
-
-echo '# error on syntax'
-echo 'x = "f' >> t
-hg log
-
-cd ..
-
-echo '# latesttag'
-hg init latesttag
-cd latesttag
-
-echo a > file
-hg ci -Am a -d '0 0'
-
-echo b >> file
-hg ci -m b -d '1 0'
-
-echo c >> head1
-hg ci -Am h1c -d '2 0'
-
-hg update -q 1
-echo d >> head2
-hg ci -Am h2d -d '3 0'
-
-echo e >> head2
-hg ci -m h2e -d '4 0'
-
-hg merge -q
-hg ci -m merge -d '5 0'
-
-echo '# No tag set'
-hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
-
-echo '# one common tag: longuest path wins'
-hg tag -r 1 -m t1 -d '6 0' t1
-hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
-
-echo '# one ancestor tag: more recent wins'
-hg tag -r 2 -m t2 -d '7 0' t2
-hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
-
-echo '# two branch tags: more recent wins'
-hg tag -r 3 -m t3 -d '8 0' t3
-hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
-
-echo '# merged tag overrides'
-hg tag -r 5 -m t5 -d '9 0' t5
-hg tag -r 3 -m at3 -d '10 0' at3
-hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
-cd ..
-
-echo '# style path expansion (issue1948)'
-mkdir -p home/styles
-cat > home/styles/teststyle <<EOF
-changeset = 'test {rev}:{node|short}\n'
-EOF
-HOME=`pwd`/home; export HOME
-cat > latesttag/.hg/hgrc <<EOF
-[ui]
-style = ~/styles/teststyle
-EOF
-hg -R latesttag tip
-
-echo '# test recursive showlist template (issue1989)'
-cat > style1989 <<EOF
-changeset = '{file_mods}{manifest}{extras}'
-file_mod  = 'M|{author|person}\n'
-manifest = '{rev},{author}\n'
-extra = '{key}: {author}\n'
-EOF
-hg -R latesttag log -r tip --style=style1989
-
-echo '# done'
--- a/tests/test-command-template.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1089 +0,0 @@
-0 files updated, 0 files merged, 4 files removed, 0 files unresolved
-created new head
-# default style is like normal output
-#  normal
-#  verbose
-#  debug
-# revision with no copies (used to print a traceback)
-
-# compact style works
-8[tip]   95c24699272e   2020-01-01 10:01 +0000   test
-  third
-
-7:-1   29114dbae42b   1970-01-12 13:46 +0000   user
-  second
-
-6:5,4   c7b487c6c50e   1970-01-18 08:40 +0000   person
-  merge
-
-5:3   13207e5a10d9   1970-01-18 08:40 +0000   person
-  new head
-
-4   32a18f097fcc   1970-01-17 04:53 +0000   person
-  new branch
-
-3   10e46f2dcbf4   1970-01-16 01:06 +0000   person
-  no user, no domain
-
-2   97054abb4ab8   1970-01-14 21:20 +0000   other
-  no person
-
-1   b608e9d1a3f0   1970-01-13 17:33 +0000   other
-  other 1
-
-0   1e4e1b8f71e0   1970-01-12 13:46 +0000   user
-  line 1
-
-8[tip]   95c24699272e   2020-01-01 10:01 +0000   test
-  third
-
-7:-1   29114dbae42b   1970-01-12 13:46 +0000   User Name <user@hostname>
-  second
-
-6:5,4   c7b487c6c50e   1970-01-18 08:40 +0000   person
-  merge
-
-5:3   13207e5a10d9   1970-01-18 08:40 +0000   person
-  new head
-
-4   32a18f097fcc   1970-01-17 04:53 +0000   person
-  new branch
-
-3   10e46f2dcbf4   1970-01-16 01:06 +0000   person
-  no user, no domain
-
-2   97054abb4ab8   1970-01-14 21:20 +0000   other@place
-  no person
-
-1   b608e9d1a3f0   1970-01-13 17:33 +0000   A. N. Other <other@place>
-  other 1
-other 2
-
-other 3
-
-0   1e4e1b8f71e0   1970-01-12 13:46 +0000   User Name <user@hostname>
-  line 1
-line 2
-
-8[tip]:7,-1   95c24699272e   2020-01-01 10:01 +0000   test
-  third
-
-7:-1,-1   29114dbae42b   1970-01-12 13:46 +0000   User Name <user@hostname>
-  second
-
-6:5,4   c7b487c6c50e   1970-01-18 08:40 +0000   person
-  merge
-
-5:3,-1   13207e5a10d9   1970-01-18 08:40 +0000   person
-  new head
-
-4:3,-1   32a18f097fcc   1970-01-17 04:53 +0000   person
-  new branch
-
-3:2,-1   10e46f2dcbf4   1970-01-16 01:06 +0000   person
-  no user, no domain
-
-2:1,-1   97054abb4ab8   1970-01-14 21:20 +0000   other@place
-  no person
-
-1:0,-1   b608e9d1a3f0   1970-01-13 17:33 +0000   A. N. Other <other@place>
-  other 1
-other 2
-
-other 3
-
-0:-1,-1   1e4e1b8f71e0   1970-01-12 13:46 +0000   User Name <user@hostname>
-  line 1
-line 2
-
-# xml style works (--style xml)
-<?xml version="1.0"?>
-<log>
-<logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
-<tag>tip</tag>
-<author email="test">test</author>
-<date>2020-01-01T10:01:00+00:00</date>
-<msg xml:space="preserve">third</msg>
-</logentry>
-<logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
-<parent revision="-1" node="0000000000000000000000000000000000000000" />
-<author email="user@hostname">User Name</author>
-<date>1970-01-12T13:46:40+00:00</date>
-<msg xml:space="preserve">second</msg>
-</logentry>
-<logentry revision="6" node="c7b487c6c50ef1cf464cafdc4f4f5e615fc5999f">
-<parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
-<parent revision="4" node="32a18f097fcccf76ef282f62f8a85b3adf8d13c4" />
-<author email="person">person</author>
-<date>1970-01-18T08:40:01+00:00</date>
-<msg xml:space="preserve">merge</msg>
-</logentry>
-<logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
-<parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
-<author email="person">person</author>
-<date>1970-01-18T08:40:00+00:00</date>
-<msg xml:space="preserve">new head</msg>
-</logentry>
-<logentry revision="4" node="32a18f097fcccf76ef282f62f8a85b3adf8d13c4">
-<branch>foo</branch>
-<author email="person">person</author>
-<date>1970-01-17T04:53:20+00:00</date>
-<msg xml:space="preserve">new branch</msg>
-</logentry>
-<logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
-<author email="person">person</author>
-<date>1970-01-16T01:06:40+00:00</date>
-<msg xml:space="preserve">no user, no domain</msg>
-</logentry>
-<logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
-<author email="other@place">other</author>
-<date>1970-01-14T21:20:00+00:00</date>
-<msg xml:space="preserve">no person</msg>
-</logentry>
-<logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
-<author email="other@place">A. N. Other</author>
-<date>1970-01-13T17:33:20+00:00</date>
-<msg xml:space="preserve">other 1
-other 2
-
-other 3</msg>
-</logentry>
-<logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
-<author email="user@hostname">User Name</author>
-<date>1970-01-12T13:46:40+00:00</date>
-<msg xml:space="preserve">line 1
-line 2</msg>
-</logentry>
-</log>
-# xml style works (-v --style xml)
-<?xml version="1.0"?>
-<log>
-<logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
-<tag>tip</tag>
-<author email="test">test</author>
-<date>2020-01-01T10:01:00+00:00</date>
-<msg xml:space="preserve">third</msg>
-<paths>
-<path action="A">fourth</path>
-<path action="A">third</path>
-<path action="R">second</path>
-</paths>
-<copies>
-<copy source="second">fourth</copy>
-</copies>
-</logentry>
-<logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
-<parent revision="-1" node="0000000000000000000000000000000000000000" />
-<author email="user@hostname">User Name</author>
-<date>1970-01-12T13:46:40+00:00</date>
-<msg xml:space="preserve">second</msg>
-<paths>
-<path action="A">second</path>
-</paths>
-</logentry>
-<logentry revision="6" node="c7b487c6c50ef1cf464cafdc4f4f5e615fc5999f">
-<parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
-<parent revision="4" node="32a18f097fcccf76ef282f62f8a85b3adf8d13c4" />
-<author email="person">person</author>
-<date>1970-01-18T08:40:01+00:00</date>
-<msg xml:space="preserve">merge</msg>
-<paths>
-</paths>
-</logentry>
-<logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
-<parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
-<author email="person">person</author>
-<date>1970-01-18T08:40:00+00:00</date>
-<msg xml:space="preserve">new head</msg>
-<paths>
-<path action="A">d</path>
-</paths>
-</logentry>
-<logentry revision="4" node="32a18f097fcccf76ef282f62f8a85b3adf8d13c4">
-<branch>foo</branch>
-<author email="person">person</author>
-<date>1970-01-17T04:53:20+00:00</date>
-<msg xml:space="preserve">new branch</msg>
-<paths>
-</paths>
-</logentry>
-<logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
-<author email="person">person</author>
-<date>1970-01-16T01:06:40+00:00</date>
-<msg xml:space="preserve">no user, no domain</msg>
-<paths>
-<path action="M">c</path>
-</paths>
-</logentry>
-<logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
-<author email="other@place">other</author>
-<date>1970-01-14T21:20:00+00:00</date>
-<msg xml:space="preserve">no person</msg>
-<paths>
-<path action="A">c</path>
-</paths>
-</logentry>
-<logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
-<author email="other@place">A. N. Other</author>
-<date>1970-01-13T17:33:20+00:00</date>
-<msg xml:space="preserve">other 1
-other 2
-
-other 3</msg>
-<paths>
-<path action="A">b</path>
-</paths>
-</logentry>
-<logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
-<author email="user@hostname">User Name</author>
-<date>1970-01-12T13:46:40+00:00</date>
-<msg xml:space="preserve">line 1
-line 2</msg>
-<paths>
-<path action="A">a</path>
-</paths>
-</logentry>
-</log>
-# xml style works (--debug --style xml)
-<?xml version="1.0"?>
-<log>
-<logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
-<tag>tip</tag>
-<parent revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453" />
-<parent revision="-1" node="0000000000000000000000000000000000000000" />
-<author email="test">test</author>
-<date>2020-01-01T10:01:00+00:00</date>
-<msg xml:space="preserve">third</msg>
-<paths>
-<path action="A">fourth</path>
-<path action="A">third</path>
-<path action="R">second</path>
-</paths>
-<copies>
-<copy source="second">fourth</copy>
-</copies>
-<extra key="branch">default</extra>
-</logentry>
-<logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
-<parent revision="-1" node="0000000000000000000000000000000000000000" />
-<parent revision="-1" node="0000000000000000000000000000000000000000" />
-<author email="user@hostname">User Name</author>
-<date>1970-01-12T13:46:40+00:00</date>
-<msg xml:space="preserve">second</msg>
-<paths>
-<path action="A">second</path>
-</paths>
-<extra key="branch">default</extra>
-</logentry>
-<logentry revision="6" node="c7b487c6c50ef1cf464cafdc4f4f5e615fc5999f">
-<parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
-<parent revision="4" node="32a18f097fcccf76ef282f62f8a85b3adf8d13c4" />
-<author email="person">person</author>
-<date>1970-01-18T08:40:01+00:00</date>
-<msg xml:space="preserve">merge</msg>
-<paths>
-</paths>
-<extra key="branch">default</extra>
-</logentry>
-<logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
-<parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
-<parent revision="-1" node="0000000000000000000000000000000000000000" />
-<author email="person">person</author>
-<date>1970-01-18T08:40:00+00:00</date>
-<msg xml:space="preserve">new head</msg>
-<paths>
-<path action="A">d</path>
-</paths>
-<extra key="branch">default</extra>
-</logentry>
-<logentry revision="4" node="32a18f097fcccf76ef282f62f8a85b3adf8d13c4">
-<branch>foo</branch>
-<parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
-<parent revision="-1" node="0000000000000000000000000000000000000000" />
-<author email="person">person</author>
-<date>1970-01-17T04:53:20+00:00</date>
-<msg xml:space="preserve">new branch</msg>
-<paths>
-</paths>
-<extra key="branch">foo</extra>
-</logentry>
-<logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
-<parent revision="2" node="97054abb4ab824450e9164180baf491ae0078465" />
-<parent revision="-1" node="0000000000000000000000000000000000000000" />
-<author email="person">person</author>
-<date>1970-01-16T01:06:40+00:00</date>
-<msg xml:space="preserve">no user, no domain</msg>
-<paths>
-<path action="M">c</path>
-</paths>
-<extra key="branch">default</extra>
-</logentry>
-<logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
-<parent revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965" />
-<parent revision="-1" node="0000000000000000000000000000000000000000" />
-<author email="other@place">other</author>
-<date>1970-01-14T21:20:00+00:00</date>
-<msg xml:space="preserve">no person</msg>
-<paths>
-<path action="A">c</path>
-</paths>
-<extra key="branch">default</extra>
-</logentry>
-<logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
-<parent revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f" />
-<parent revision="-1" node="0000000000000000000000000000000000000000" />
-<author email="other@place">A. N. Other</author>
-<date>1970-01-13T17:33:20+00:00</date>
-<msg xml:space="preserve">other 1
-other 2
-
-other 3</msg>
-<paths>
-<path action="A">b</path>
-</paths>
-<extra key="branch">default</extra>
-</logentry>
-<logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
-<parent revision="-1" node="0000000000000000000000000000000000000000" />
-<parent revision="-1" node="0000000000000000000000000000000000000000" />
-<author email="user@hostname">User Name</author>
-<date>1970-01-12T13:46:40+00:00</date>
-<msg xml:space="preserve">line 1
-line 2</msg>
-<paths>
-<path action="A">a</path>
-</paths>
-<extra key="branch">default</extra>
-</logentry>
-</log>
-# error if style not readable
-abort: Permission denied: ./q
-# error if no style
-abort: style not found: notexist
-# error if style missing key
-abort: ./t: no key named 'changeset'
-# error if include fails
-abort: template file ./q: Permission denied
-# include works
-8
-7
-6
-5
-4
-3
-2
-1
-0
-# ui.style works
-8
-7
-6
-5
-4
-3
-2
-1
-0
-# issue338
-2020-01-01  test  <test>
-
-	* fourth, second, third:
-	third
-	[95c24699272e] [tip]
-
-1970-01-12  User Name  <user@hostname>
-
-	* second:
-	second
-	[29114dbae42b]
-
-1970-01-18  person  <person>
-
-	* merge
-	[c7b487c6c50e]
-
-	* d:
-	new head
-	[13207e5a10d9]
-
-1970-01-17  person  <person>
-
-	* new branch
-	[32a18f097fcc] <foo>
-
-1970-01-16  person  <person>
-
-	* c:
-	no user, no domain
-	[10e46f2dcbf4]
-
-1970-01-14  other  <other@place>
-
-	* c:
-	no person
-	[97054abb4ab8]
-
-1970-01-13  A. N. Other  <other@place>
-
-	* b:
-	other 1 other 2
-
-	other 3
-	[b608e9d1a3f0]
-
-1970-01-12  User Name  <user@hostname>
-
-	* a:
-	line 1 line 2
-	[1e4e1b8f71e0]
-
-# issue 2130
-2020-01-01  test  <test>
-
-	* fourth, second, third:
-	third
-	[95c24699272e] [tip]
-
-1970-01-18  person  <person>
-
-	* merge
-	[c7b487c6c50e]
-
-1970-01-17  person  <person>
-
-	* new branch
-	[32a18f097fcc] <foo>
-
-# keys work
-author: test
-author: User Name <user@hostname>
-author: person
-author: person
-author: person
-author: person
-author: other@place
-author: A. N. Other <other@place>
-author: User Name <user@hostname>
-author--verbose: test
-author--verbose: User Name <user@hostname>
-author--verbose: person
-author--verbose: person
-author--verbose: person
-author--verbose: person
-author--verbose: other@place
-author--verbose: A. N. Other <other@place>
-author--verbose: User Name <user@hostname>
-author--debug: test
-author--debug: User Name <user@hostname>
-author--debug: person
-author--debug: person
-author--debug: person
-author--debug: person
-author--debug: other@place
-author--debug: A. N. Other <other@place>
-author--debug: User Name <user@hostname>
-branches: 
-branches: 
-branches: 
-branches: 
-branches: foo
-branches: 
-branches: 
-branches: 
-branches: 
-branches--verbose: 
-branches--verbose: 
-branches--verbose: 
-branches--verbose: 
-branches--verbose: foo
-branches--verbose: 
-branches--verbose: 
-branches--verbose: 
-branches--verbose: 
-branches--debug: 
-branches--debug: 
-branches--debug: 
-branches--debug: 
-branches--debug: foo
-branches--debug: 
-branches--debug: 
-branches--debug: 
-branches--debug: 
-date: 1577872860.00
-date: 1000000.00
-date: 1500001.00
-date: 1500000.00
-date: 1400000.00
-date: 1300000.00
-date: 1200000.00
-date: 1100000.00
-date: 1000000.00
-date--verbose: 1577872860.00
-date--verbose: 1000000.00
-date--verbose: 1500001.00
-date--verbose: 1500000.00
-date--verbose: 1400000.00
-date--verbose: 1300000.00
-date--verbose: 1200000.00
-date--verbose: 1100000.00
-date--verbose: 1000000.00
-date--debug: 1577872860.00
-date--debug: 1000000.00
-date--debug: 1500001.00
-date--debug: 1500000.00
-date--debug: 1400000.00
-date--debug: 1300000.00
-date--debug: 1200000.00
-date--debug: 1100000.00
-date--debug: 1000000.00
-desc: third
-desc: second
-desc: merge
-desc: new head
-desc: new branch
-desc: no user, no domain
-desc: no person
-desc: other 1
-other 2
-
-other 3
-desc: line 1
-line 2
-desc--verbose: third
-desc--verbose: second
-desc--verbose: merge
-desc--verbose: new head
-desc--verbose: new branch
-desc--verbose: no user, no domain
-desc--verbose: no person
-desc--verbose: other 1
-other 2
-
-other 3
-desc--verbose: line 1
-line 2
-desc--debug: third
-desc--debug: second
-desc--debug: merge
-desc--debug: new head
-desc--debug: new branch
-desc--debug: no user, no domain
-desc--debug: no person
-desc--debug: other 1
-other 2
-
-other 3
-desc--debug: line 1
-line 2
-file_adds: fourth third
-file_adds: second
-file_adds: 
-file_adds: d
-file_adds: 
-file_adds: 
-file_adds: c
-file_adds: b
-file_adds: a
-file_adds--verbose: fourth third
-file_adds--verbose: second
-file_adds--verbose: 
-file_adds--verbose: d
-file_adds--verbose: 
-file_adds--verbose: 
-file_adds--verbose: c
-file_adds--verbose: b
-file_adds--verbose: a
-file_adds--debug: fourth third
-file_adds--debug: second
-file_adds--debug: 
-file_adds--debug: d
-file_adds--debug: 
-file_adds--debug: 
-file_adds--debug: c
-file_adds--debug: b
-file_adds--debug: a
-file_dels: second
-file_dels: 
-file_dels: 
-file_dels: 
-file_dels: 
-file_dels: 
-file_dels: 
-file_dels: 
-file_dels: 
-file_dels--verbose: second
-file_dels--verbose: 
-file_dels--verbose: 
-file_dels--verbose: 
-file_dels--verbose: 
-file_dels--verbose: 
-file_dels--verbose: 
-file_dels--verbose: 
-file_dels--verbose: 
-file_dels--debug: second
-file_dels--debug: 
-file_dels--debug: 
-file_dels--debug: 
-file_dels--debug: 
-file_dels--debug: 
-file_dels--debug: 
-file_dels--debug: 
-file_dels--debug: 
-file_mods: 
-file_mods: 
-file_mods: 
-file_mods: 
-file_mods: 
-file_mods: c
-file_mods: 
-file_mods: 
-file_mods: 
-file_mods--verbose: 
-file_mods--verbose: 
-file_mods--verbose: 
-file_mods--verbose: 
-file_mods--verbose: 
-file_mods--verbose: c
-file_mods--verbose: 
-file_mods--verbose: 
-file_mods--verbose: 
-file_mods--debug: 
-file_mods--debug: 
-file_mods--debug: 
-file_mods--debug: 
-file_mods--debug: 
-file_mods--debug: c
-file_mods--debug: 
-file_mods--debug: 
-file_mods--debug: 
-file_copies: fourth (second)
-file_copies: 
-file_copies: 
-file_copies: 
-file_copies: 
-file_copies: 
-file_copies: 
-file_copies: 
-file_copies: 
-file_copies--verbose: fourth (second)
-file_copies--verbose: 
-file_copies--verbose: 
-file_copies--verbose: 
-file_copies--verbose: 
-file_copies--verbose: 
-file_copies--verbose: 
-file_copies--verbose: 
-file_copies--verbose: 
-file_copies--debug: fourth (second)
-file_copies--debug: 
-file_copies--debug: 
-file_copies--debug: 
-file_copies--debug: 
-file_copies--debug: 
-file_copies--debug: 
-file_copies--debug: 
-file_copies--debug: 
-file_copies_switch: 
-file_copies_switch: 
-file_copies_switch: 
-file_copies_switch: 
-file_copies_switch: 
-file_copies_switch: 
-file_copies_switch: 
-file_copies_switch: 
-file_copies_switch: 
-file_copies_switch--verbose: 
-file_copies_switch--verbose: 
-file_copies_switch--verbose: 
-file_copies_switch--verbose: 
-file_copies_switch--verbose: 
-file_copies_switch--verbose: 
-file_copies_switch--verbose: 
-file_copies_switch--verbose: 
-file_copies_switch--verbose: 
-file_copies_switch--debug: 
-file_copies_switch--debug: 
-file_copies_switch--debug: 
-file_copies_switch--debug: 
-file_copies_switch--debug: 
-file_copies_switch--debug: 
-file_copies_switch--debug: 
-file_copies_switch--debug: 
-file_copies_switch--debug: 
-files: fourth second third
-files: second
-files: 
-files: d
-files: 
-files: c
-files: c
-files: b
-files: a
-files--verbose: fourth second third
-files--verbose: second
-files--verbose: 
-files--verbose: d
-files--verbose: 
-files--verbose: c
-files--verbose: c
-files--verbose: b
-files--verbose: a
-files--debug: fourth second third
-files--debug: second
-files--debug: 
-files--debug: d
-files--debug: 
-files--debug: c
-files--debug: c
-files--debug: b
-files--debug: a
-manifest: 8:94961b75a2da
-manifest: 7:f2dbc354b94e
-manifest: 6:91015e9dbdd7
-manifest: 5:4dc3def4f9b4
-manifest: 4:90ae8dda64e1
-manifest: 3:cb5a1327723b
-manifest: 2:6e0e82995c35
-manifest: 1:4e8d705b1e53
-manifest: 0:a0c8bcbbb45c
-manifest--verbose: 8:94961b75a2da
-manifest--verbose: 7:f2dbc354b94e
-manifest--verbose: 6:91015e9dbdd7
-manifest--verbose: 5:4dc3def4f9b4
-manifest--verbose: 4:90ae8dda64e1
-manifest--verbose: 3:cb5a1327723b
-manifest--verbose: 2:6e0e82995c35
-manifest--verbose: 1:4e8d705b1e53
-manifest--verbose: 0:a0c8bcbbb45c
-manifest--debug: 8:94961b75a2da554b4df6fb599e5bfc7d48de0c64
-manifest--debug: 7:f2dbc354b94e5ec0b4f10680ee0cee816101d0bf
-manifest--debug: 6:91015e9dbdd76a6791085d12b0a0ec7fcd22ffbf
-manifest--debug: 5:4dc3def4f9b4c6e8de820f6ee74737f91e96a216
-manifest--debug: 4:90ae8dda64e1a876c792bccb9af66284f6018363
-manifest--debug: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
-manifest--debug: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1
-manifest--debug: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55
-manifest--debug: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
-node: 95c24699272ef57d062b8bccc32c878bf841784a
-node: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
-node: c7b487c6c50ef1cf464cafdc4f4f5e615fc5999f
-node: 13207e5a10d9fd28ec424934298e176197f2c67f
-node: 32a18f097fcccf76ef282f62f8a85b3adf8d13c4
-node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
-node: 97054abb4ab824450e9164180baf491ae0078465
-node: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
-node: 1e4e1b8f71e05681d422154f5421e385fec3454f
-node--verbose: 95c24699272ef57d062b8bccc32c878bf841784a
-node--verbose: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
-node--verbose: c7b487c6c50ef1cf464cafdc4f4f5e615fc5999f
-node--verbose: 13207e5a10d9fd28ec424934298e176197f2c67f
-node--verbose: 32a18f097fcccf76ef282f62f8a85b3adf8d13c4
-node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
-node--verbose: 97054abb4ab824450e9164180baf491ae0078465
-node--verbose: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
-node--verbose: 1e4e1b8f71e05681d422154f5421e385fec3454f
-node--debug: 95c24699272ef57d062b8bccc32c878bf841784a
-node--debug: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
-node--debug: c7b487c6c50ef1cf464cafdc4f4f5e615fc5999f
-node--debug: 13207e5a10d9fd28ec424934298e176197f2c67f
-node--debug: 32a18f097fcccf76ef282f62f8a85b3adf8d13c4
-node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
-node--debug: 97054abb4ab824450e9164180baf491ae0078465
-node--debug: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
-node--debug: 1e4e1b8f71e05681d422154f5421e385fec3454f
-parents: 
-parents: -1:000000000000 
-parents: 5:13207e5a10d9 4:32a18f097fcc 
-parents: 3:10e46f2dcbf4 
-parents: 
-parents: 
-parents: 
-parents: 
-parents: 
-parents--verbose: 
-parents--verbose: -1:000000000000 
-parents--verbose: 5:13207e5a10d9 4:32a18f097fcc 
-parents--verbose: 3:10e46f2dcbf4 
-parents--verbose: 
-parents--verbose: 
-parents--verbose: 
-parents--verbose: 
-parents--verbose: 
-parents--debug: 7:29114dbae42b9f078cf2714dbe3a86bba8ec7453 -1:0000000000000000000000000000000000000000 
-parents--debug: -1:0000000000000000000000000000000000000000 -1:0000000000000000000000000000000000000000 
-parents--debug: 5:13207e5a10d9fd28ec424934298e176197f2c67f 4:32a18f097fcccf76ef282f62f8a85b3adf8d13c4 
-parents--debug: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47 -1:0000000000000000000000000000000000000000 
-parents--debug: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47 -1:0000000000000000000000000000000000000000 
-parents--debug: 2:97054abb4ab824450e9164180baf491ae0078465 -1:0000000000000000000000000000000000000000 
-parents--debug: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965 -1:0000000000000000000000000000000000000000 
-parents--debug: 0:1e4e1b8f71e05681d422154f5421e385fec3454f -1:0000000000000000000000000000000000000000 
-parents--debug: -1:0000000000000000000000000000000000000000 -1:0000000000000000000000000000000000000000 
-rev: 8
-rev: 7
-rev: 6
-rev: 5
-rev: 4
-rev: 3
-rev: 2
-rev: 1
-rev: 0
-rev--verbose: 8
-rev--verbose: 7
-rev--verbose: 6
-rev--verbose: 5
-rev--verbose: 4
-rev--verbose: 3
-rev--verbose: 2
-rev--verbose: 1
-rev--verbose: 0
-rev--debug: 8
-rev--debug: 7
-rev--debug: 6
-rev--debug: 5
-rev--debug: 4
-rev--debug: 3
-rev--debug: 2
-rev--debug: 1
-rev--debug: 0
-tags: tip
-tags: 
-tags: 
-tags: 
-tags: 
-tags: 
-tags: 
-tags: 
-tags: 
-tags--verbose: tip
-tags--verbose: 
-tags--verbose: 
-tags--verbose: 
-tags--verbose: 
-tags--verbose: 
-tags--verbose: 
-tags--verbose: 
-tags--verbose: 
-tags--debug: tip
-tags--debug: 
-tags--debug: 
-tags--debug: 
-tags--debug: 
-tags--debug: 
-tags--debug: 
-tags--debug: 
-tags--debug: 
-diffstat: 3: +2/-1
-diffstat: 1: +1/-0
-diffstat: 0: +0/-0
-diffstat: 1: +1/-0
-diffstat: 0: +0/-0
-diffstat: 1: +1/-0
-diffstat: 1: +4/-0
-diffstat: 1: +2/-0
-diffstat: 1: +1/-0
-diffstat--verbose: 3: +2/-1
-diffstat--verbose: 1: +1/-0
-diffstat--verbose: 0: +0/-0
-diffstat--verbose: 1: +1/-0
-diffstat--verbose: 0: +0/-0
-diffstat--verbose: 1: +1/-0
-diffstat--verbose: 1: +4/-0
-diffstat--verbose: 1: +2/-0
-diffstat--verbose: 1: +1/-0
-diffstat--debug: 3: +2/-1
-diffstat--debug: 1: +1/-0
-diffstat--debug: 0: +0/-0
-diffstat--debug: 1: +1/-0
-diffstat--debug: 0: +0/-0
-diffstat--debug: 1: +1/-0
-diffstat--debug: 1: +4/-0
-diffstat--debug: 1: +2/-0
-diffstat--debug: 1: +1/-0
-extras: branch=default
-extras: branch=default
-extras: branch=default
-extras: branch=default
-extras: branch=foo
-extras: branch=default
-extras: branch=default
-extras: branch=default
-extras: branch=default
-extras--verbose: branch=default
-extras--verbose: branch=default
-extras--verbose: branch=default
-extras--verbose: branch=default
-extras--verbose: branch=foo
-extras--verbose: branch=default
-extras--verbose: branch=default
-extras--verbose: branch=default
-extras--verbose: branch=default
-extras--debug: branch=default
-extras--debug: branch=default
-extras--debug: branch=default
-extras--debug: branch=default
-extras--debug: branch=foo
-extras--debug: branch=default
-extras--debug: branch=default
-extras--debug: branch=default
-extras--debug: branch=default
-# filters work
-
-hostname
-
-
-
-
-place
-place
-hostname
-test
-User Name
-person
-person
-person
-person
-other
-A. N. Other
-User Name
-test
-user
-person
-person
-person
-person
-other
-other
-user
-in the future
-Wed Jan 01 10:01:00 2020 +0000
-Mon Jan 12 13:46:40 1970 +0000
-Sun Jan 18 08:40:01 1970 +0000
-Sun Jan 18 08:40:00 1970 +0000
-Sat Jan 17 04:53:20 1970 +0000
-Fri Jan 16 01:06:40 1970 +0000
-Wed Jan 14 21:20:00 1970 +0000
-Tue Jan 13 17:33:20 1970 +0000
-Mon Jan 12 13:46:40 1970 +0000
-2020-01-01 10:01 +0000
-1970-01-12 13:46 +0000
-1970-01-18 08:40 +0000
-1970-01-18 08:40 +0000
-1970-01-17 04:53 +0000
-1970-01-16 01:06 +0000
-1970-01-14 21:20 +0000
-1970-01-13 17:33 +0000
-1970-01-12 13:46 +0000
-2020-01-01 10:01:00 +0000
-1970-01-12 13:46:40 +0000
-1970-01-18 08:40:01 +0000
-1970-01-18 08:40:00 +0000
-1970-01-17 04:53:20 +0000
-1970-01-16 01:06:40 +0000
-1970-01-14 21:20:00 +0000
-1970-01-13 17:33:20 +0000
-1970-01-12 13:46:40 +0000
-Wed, 01 Jan 2020 10:01:00 +0000
-Mon, 12 Jan 1970 13:46:40 +0000
-Sun, 18 Jan 1970 08:40:01 +0000
-Sun, 18 Jan 1970 08:40:00 +0000
-Sat, 17 Jan 1970 04:53:20 +0000
-Fri, 16 Jan 1970 01:06:40 +0000
-Wed, 14 Jan 1970 21:20:00 +0000
-Tue, 13 Jan 1970 17:33:20 +0000
-Mon, 12 Jan 1970 13:46:40 +0000
-third
-second
-merge
-new head
-new branch
-no user, no domain
-no person
-other 1
-line 1
-95c24699272e
-29114dbae42b
-c7b487c6c50e
-13207e5a10d9
-32a18f097fcc
-10e46f2dcbf4
-97054abb4ab8
-b608e9d1a3f0
-1e4e1b8f71e0
-<changeset author="test"/>
-<changeset author="User Name &lt;user@hostname&gt;"/>
-<changeset author="person"/>
-<changeset author="person"/>
-<changeset author="person"/>
-<changeset author="person"/>
-<changeset author="other@place"/>
-<changeset author="A. N. Other &lt;other@place&gt;"/>
-<changeset author="User Name &lt;user@hostname&gt;"/>
-# formatnode filter works
-#  quiet
-1e4e1b8f71e0
-#  normal
-1e4e1b8f71e0
-#  verbose
-1e4e1b8f71e0
-#  debug
-1e4e1b8f71e05681d422154f5421e385fec3454f
-# error on syntax
-abort: t:3: unmatched quotes
-# latesttag
-adding file
-adding head1
-adding head2
-created new head
-# No tag set
-5: null+5
-4: null+4
-3: null+3
-2: null+3
-1: null+2
-0: null+1
-# one common tag: longuest path wins
-6: t1+4
-5: t1+3
-4: t1+2
-3: t1+1
-2: t1+1
-1: t1+0
-0: null+1
-# one ancestor tag: more recent wins
-7: t2+3
-6: t2+2
-5: t2+1
-4: t1+2
-3: t1+1
-2: t2+0
-1: t1+0
-0: null+1
-# two branch tags: more recent wins
-8: t3+5
-7: t3+4
-6: t3+3
-5: t3+2
-4: t3+1
-3: t3+0
-2: t2+0
-1: t1+0
-0: null+1
-# merged tag overrides
-10: t5+5
-9: t5+4
-8: t5+3
-7: t5+2
-6: t5+1
-5: t5+0
-4: at3:t3+1
-3: at3:t3+0
-2: t2+0
-1: t1+0
-0: null+1
-# style path expansion (issue1948)
-test 10:dee8f28249af
-# test recursive showlist template (issue1989)
-M|test
-10,test
-branch: test
-# done
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-command-template.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,1332 @@
+  $ hg init a
+  $ cd a
+  $ echo a > a
+  $ hg add a
+  $ echo line 1 > b
+  $ echo line 2 >> b
+  $ hg commit -l b -d '1000000 0' -u 'User Name <user@hostname>'
+
+  $ hg add b
+  $ echo other 1 > c
+  $ echo other 2 >> c
+  $ echo >> c
+  $ echo other 3 >> c
+  $ hg commit -l c -d '1100000 0' -u 'A. N. Other <other@place>'
+
+  $ hg add c
+  $ hg commit -m 'no person' -d '1200000 0' -u 'other@place'
+  $ echo c >> c
+  $ hg commit -m 'no user, no domain' -d '1300000 0' -u 'person'
+
+  $ echo foo > .hg/branch
+  $ hg commit -m 'new branch' -d '1400000 0' -u 'person'
+
+  $ hg co -q 3
+  $ echo other 4 >> d
+  $ hg add d
+  $ hg commit -m 'new head' -d '1500000 0' -u 'person'
+
+  $ hg merge -q foo
+  $ hg commit -m 'merge' -d '1500001 0' -u 'person'
+
+Second branch starting at nullrev:
+
+  $ hg update null
+  0 files updated, 0 files merged, 4 files removed, 0 files unresolved
+  $ echo second > second
+  $ hg add second
+  $ hg commit -m second -d '1000000 0' -u 'User Name <user@hostname>'
+  created new head
+
+  $ echo third > third
+  $ hg add third
+  $ hg mv second fourth
+  $ hg commit -m third -d "2020-01-01 10:01"
+
+Make sure user/global hgrc does not affect tests
+
+  $ echo '[ui]' > .hg/hgrc
+  $ echo 'logtemplate =' >> .hg/hgrc
+  $ echo 'style =' >> .hg/hgrc
+
+Default style is like normal output:
+
+  $ hg log > log.out
+  $ hg log --style default > style.out
+  $ cmp log.out style.out || diff -u log.out style.out
+
+  $ hg log -v > log.out
+  $ hg log -v --style default > style.out
+  $ cmp log.out style.out || diff -u log.out style.out
+
+  $ hg log --debug > log.out
+  $ hg log --debug --style default > style.out
+  $ cmp log.out style.out || diff -u log.out style.out
+
+Revision with no copies (used to print a traceback):
+
+  $ hg tip -v --template '\n'
+  
+
+Compact style works:
+
+  $ hg log --style compact
+  8[tip]   95c24699272e   2020-01-01 10:01 +0000   test
+    third
+  
+  7:-1   29114dbae42b   1970-01-12 13:46 +0000   user
+    second
+  
+  6:5,4   c7b487c6c50e   1970-01-18 08:40 +0000   person
+    merge
+  
+  5:3   13207e5a10d9   1970-01-18 08:40 +0000   person
+    new head
+  
+  4   32a18f097fcc   1970-01-17 04:53 +0000   person
+    new branch
+  
+  3   10e46f2dcbf4   1970-01-16 01:06 +0000   person
+    no user, no domain
+  
+  2   97054abb4ab8   1970-01-14 21:20 +0000   other
+    no person
+  
+  1   b608e9d1a3f0   1970-01-13 17:33 +0000   other
+    other 1
+  
+  0   1e4e1b8f71e0   1970-01-12 13:46 +0000   user
+    line 1
+  
+
+  $ hg log -v --style compact
+  8[tip]   95c24699272e   2020-01-01 10:01 +0000   test
+    third
+  
+  7:-1   29114dbae42b   1970-01-12 13:46 +0000   User Name <user@hostname>
+    second
+  
+  6:5,4   c7b487c6c50e   1970-01-18 08:40 +0000   person
+    merge
+  
+  5:3   13207e5a10d9   1970-01-18 08:40 +0000   person
+    new head
+  
+  4   32a18f097fcc   1970-01-17 04:53 +0000   person
+    new branch
+  
+  3   10e46f2dcbf4   1970-01-16 01:06 +0000   person
+    no user, no domain
+  
+  2   97054abb4ab8   1970-01-14 21:20 +0000   other@place
+    no person
+  
+  1   b608e9d1a3f0   1970-01-13 17:33 +0000   A. N. Other <other@place>
+    other 1
+  other 2
+  
+  other 3
+  
+  0   1e4e1b8f71e0   1970-01-12 13:46 +0000   User Name <user@hostname>
+    line 1
+  line 2
+  
+
+  $ hg log --debug --style compact
+  8[tip]:7,-1   95c24699272e   2020-01-01 10:01 +0000   test
+    third
+  
+  7:-1,-1   29114dbae42b   1970-01-12 13:46 +0000   User Name <user@hostname>
+    second
+  
+  6:5,4   c7b487c6c50e   1970-01-18 08:40 +0000   person
+    merge
+  
+  5:3,-1   13207e5a10d9   1970-01-18 08:40 +0000   person
+    new head
+  
+  4:3,-1   32a18f097fcc   1970-01-17 04:53 +0000   person
+    new branch
+  
+  3:2,-1   10e46f2dcbf4   1970-01-16 01:06 +0000   person
+    no user, no domain
+  
+  2:1,-1   97054abb4ab8   1970-01-14 21:20 +0000   other@place
+    no person
+  
+  1:0,-1   b608e9d1a3f0   1970-01-13 17:33 +0000   A. N. Other <other@place>
+    other 1
+  other 2
+  
+  other 3
+  
+  0:-1,-1   1e4e1b8f71e0   1970-01-12 13:46 +0000   User Name <user@hostname>
+    line 1
+  line 2
+  
+
+Test xml styles:
+
+  $ hg log --style xml
+  <?xml version="1.0"?>
+  <log>
+  <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
+  <tag>tip</tag>
+  <author email="test">test</author>
+  <date>2020-01-01T10:01:00+00:00</date>
+  <msg xml:space="preserve">third</msg>
+  </logentry>
+  <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
+  <parent revision="-1" node="0000000000000000000000000000000000000000" />
+  <author email="user@hostname">User Name</author>
+  <date>1970-01-12T13:46:40+00:00</date>
+  <msg xml:space="preserve">second</msg>
+  </logentry>
+  <logentry revision="6" node="c7b487c6c50ef1cf464cafdc4f4f5e615fc5999f">
+  <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
+  <parent revision="4" node="32a18f097fcccf76ef282f62f8a85b3adf8d13c4" />
+  <author email="person">person</author>
+  <date>1970-01-18T08:40:01+00:00</date>
+  <msg xml:space="preserve">merge</msg>
+  </logentry>
+  <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
+  <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
+  <author email="person">person</author>
+  <date>1970-01-18T08:40:00+00:00</date>
+  <msg xml:space="preserve">new head</msg>
+  </logentry>
+  <logentry revision="4" node="32a18f097fcccf76ef282f62f8a85b3adf8d13c4">
+  <branch>foo</branch>
+  <author email="person">person</author>
+  <date>1970-01-17T04:53:20+00:00</date>
+  <msg xml:space="preserve">new branch</msg>
+  </logentry>
+  <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
+  <author email="person">person</author>
+  <date>1970-01-16T01:06:40+00:00</date>
+  <msg xml:space="preserve">no user, no domain</msg>
+  </logentry>
+  <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
+  <author email="other@place">other</author>
+  <date>1970-01-14T21:20:00+00:00</date>
+  <msg xml:space="preserve">no person</msg>
+  </logentry>
+  <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
+  <author email="other@place">A. N. Other</author>
+  <date>1970-01-13T17:33:20+00:00</date>
+  <msg xml:space="preserve">other 1
+  other 2
+  
+  other 3</msg>
+  </logentry>
+  <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
+  <author email="user@hostname">User Name</author>
+  <date>1970-01-12T13:46:40+00:00</date>
+  <msg xml:space="preserve">line 1
+  line 2</msg>
+  </logentry>
+  </log>
+
+  $ hg log -v --style xml
+  <?xml version="1.0"?>
+  <log>
+  <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
+  <tag>tip</tag>
+  <author email="test">test</author>
+  <date>2020-01-01T10:01:00+00:00</date>
+  <msg xml:space="preserve">third</msg>
+  <paths>
+  <path action="A">fourth</path>
+  <path action="A">third</path>
+  <path action="R">second</path>
+  </paths>
+  <copies>
+  <copy source="second">fourth</copy>
+  </copies>
+  </logentry>
+  <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
+  <parent revision="-1" node="0000000000000000000000000000000000000000" />
+  <author email="user@hostname">User Name</author>
+  <date>1970-01-12T13:46:40+00:00</date>
+  <msg xml:space="preserve">second</msg>
+  <paths>
+  <path action="A">second</path>
+  </paths>
+  </logentry>
+  <logentry revision="6" node="c7b487c6c50ef1cf464cafdc4f4f5e615fc5999f">
+  <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
+  <parent revision="4" node="32a18f097fcccf76ef282f62f8a85b3adf8d13c4" />
+  <author email="person">person</author>
+  <date>1970-01-18T08:40:01+00:00</date>
+  <msg xml:space="preserve">merge</msg>
+  <paths>
+  </paths>
+  </logentry>
+  <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
+  <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
+  <author email="person">person</author>
+  <date>1970-01-18T08:40:00+00:00</date>
+  <msg xml:space="preserve">new head</msg>
+  <paths>
+  <path action="A">d</path>
+  </paths>
+  </logentry>
+  <logentry revision="4" node="32a18f097fcccf76ef282f62f8a85b3adf8d13c4">
+  <branch>foo</branch>
+  <author email="person">person</author>
+  <date>1970-01-17T04:53:20+00:00</date>
+  <msg xml:space="preserve">new branch</msg>
+  <paths>
+  </paths>
+  </logentry>
+  <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
+  <author email="person">person</author>
+  <date>1970-01-16T01:06:40+00:00</date>
+  <msg xml:space="preserve">no user, no domain</msg>
+  <paths>
+  <path action="M">c</path>
+  </paths>
+  </logentry>
+  <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
+  <author email="other@place">other</author>
+  <date>1970-01-14T21:20:00+00:00</date>
+  <msg xml:space="preserve">no person</msg>
+  <paths>
+  <path action="A">c</path>
+  </paths>
+  </logentry>
+  <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
+  <author email="other@place">A. N. Other</author>
+  <date>1970-01-13T17:33:20+00:00</date>
+  <msg xml:space="preserve">other 1
+  other 2
+  
+  other 3</msg>
+  <paths>
+  <path action="A">b</path>
+  </paths>
+  </logentry>
+  <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
+  <author email="user@hostname">User Name</author>
+  <date>1970-01-12T13:46:40+00:00</date>
+  <msg xml:space="preserve">line 1
+  line 2</msg>
+  <paths>
+  <path action="A">a</path>
+  </paths>
+  </logentry>
+  </log>
+
+  $ hg log --debug --style xml
+  <?xml version="1.0"?>
+  <log>
+  <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
+  <tag>tip</tag>
+  <parent revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453" />
+  <parent revision="-1" node="0000000000000000000000000000000000000000" />
+  <author email="test">test</author>
+  <date>2020-01-01T10:01:00+00:00</date>
+  <msg xml:space="preserve">third</msg>
+  <paths>
+  <path action="A">fourth</path>
+  <path action="A">third</path>
+  <path action="R">second</path>
+  </paths>
+  <copies>
+  <copy source="second">fourth</copy>
+  </copies>
+  <extra key="branch">default</extra>
+  </logentry>
+  <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
+  <parent revision="-1" node="0000000000000000000000000000000000000000" />
+  <parent revision="-1" node="0000000000000000000000000000000000000000" />
+  <author email="user@hostname">User Name</author>
+  <date>1970-01-12T13:46:40+00:00</date>
+  <msg xml:space="preserve">second</msg>
+  <paths>
+  <path action="A">second</path>
+  </paths>
+  <extra key="branch">default</extra>
+  </logentry>
+  <logentry revision="6" node="c7b487c6c50ef1cf464cafdc4f4f5e615fc5999f">
+  <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
+  <parent revision="4" node="32a18f097fcccf76ef282f62f8a85b3adf8d13c4" />
+  <author email="person">person</author>
+  <date>1970-01-18T08:40:01+00:00</date>
+  <msg xml:space="preserve">merge</msg>
+  <paths>
+  </paths>
+  <extra key="branch">default</extra>
+  </logentry>
+  <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
+  <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
+  <parent revision="-1" node="0000000000000000000000000000000000000000" />
+  <author email="person">person</author>
+  <date>1970-01-18T08:40:00+00:00</date>
+  <msg xml:space="preserve">new head</msg>
+  <paths>
+  <path action="A">d</path>
+  </paths>
+  <extra key="branch">default</extra>
+  </logentry>
+  <logentry revision="4" node="32a18f097fcccf76ef282f62f8a85b3adf8d13c4">
+  <branch>foo</branch>
+  <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
+  <parent revision="-1" node="0000000000000000000000000000000000000000" />
+  <author email="person">person</author>
+  <date>1970-01-17T04:53:20+00:00</date>
+  <msg xml:space="preserve">new branch</msg>
+  <paths>
+  </paths>
+  <extra key="branch">foo</extra>
+  </logentry>
+  <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
+  <parent revision="2" node="97054abb4ab824450e9164180baf491ae0078465" />
+  <parent revision="-1" node="0000000000000000000000000000000000000000" />
+  <author email="person">person</author>
+  <date>1970-01-16T01:06:40+00:00</date>
+  <msg xml:space="preserve">no user, no domain</msg>
+  <paths>
+  <path action="M">c</path>
+  </paths>
+  <extra key="branch">default</extra>
+  </logentry>
+  <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
+  <parent revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965" />
+  <parent revision="-1" node="0000000000000000000000000000000000000000" />
+  <author email="other@place">other</author>
+  <date>1970-01-14T21:20:00+00:00</date>
+  <msg xml:space="preserve">no person</msg>
+  <paths>
+  <path action="A">c</path>
+  </paths>
+  <extra key="branch">default</extra>
+  </logentry>
+  <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
+  <parent revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f" />
+  <parent revision="-1" node="0000000000000000000000000000000000000000" />
+  <author email="other@place">A. N. Other</author>
+  <date>1970-01-13T17:33:20+00:00</date>
+  <msg xml:space="preserve">other 1
+  other 2
+  
+  other 3</msg>
+  <paths>
+  <path action="A">b</path>
+  </paths>
+  <extra key="branch">default</extra>
+  </logentry>
+  <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
+  <parent revision="-1" node="0000000000000000000000000000000000000000" />
+  <parent revision="-1" node="0000000000000000000000000000000000000000" />
+  <author email="user@hostname">User Name</author>
+  <date>1970-01-12T13:46:40+00:00</date>
+  <msg xml:space="preserve">line 1
+  line 2</msg>
+  <paths>
+  <path action="A">a</path>
+  </paths>
+  <extra key="branch">default</extra>
+  </logentry>
+  </log>
+
+
+Error if style not readable:
+
+  $ touch q
+  $ chmod 0 q
+  $ hg log --style ./q
+  abort: Permission denied: ./q
+  [255]
+
+Error if no style:
+
+  $ hg log --style notexist
+  abort: style not found: notexist
+  [255]
+
+Error if style missing key:
+
+  $ echo 'q = q' > t
+  $ hg log --style ./t
+  abort: ./t: no key named 'changeset'
+  [255]
+
+Error if include fails:
+
+  $ echo 'changeset = q' >> t
+  $ hg log --style ./t
+  abort: template file ./q: Permission denied
+  [255]
+
+Include works:
+
+  $ rm q
+  $ echo '{rev}' > q
+  $ hg log --style ./t
+  8
+  7
+  6
+  5
+  4
+  3
+  2
+  1
+  0
+
+ui.style works:
+
+  $ echo '[ui]' > .hg/hgrc
+  $ echo 'style = t' >> .hg/hgrc
+  $ hg log
+  8
+  7
+  6
+  5
+  4
+  3
+  2
+  1
+  0
+
+
+Issue338:
+
+  $ hg log --style=changelog > changelog
+
+  $ cat changelog
+  2020-01-01  test  <test>
+  
+  	* fourth, second, third:
+  	third
+  	[95c24699272e] [tip]
+  
+  1970-01-12  User Name  <user@hostname>
+  
+  	* second:
+  	second
+  	[29114dbae42b]
+  
+  1970-01-18  person  <person>
+  
+  	* merge
+  	[c7b487c6c50e]
+  
+  	* d:
+  	new head
+  	[13207e5a10d9]
+  
+  1970-01-17  person  <person>
+  
+  	* new branch
+  	[32a18f097fcc] <foo>
+  
+  1970-01-16  person  <person>
+  
+  	* c:
+  	no user, no domain
+  	[10e46f2dcbf4]
+  
+  1970-01-14  other  <other@place>
+  
+  	* c:
+  	no person
+  	[97054abb4ab8]
+  
+  1970-01-13  A. N. Other  <other@place>
+  
+  	* b:
+  	other 1 other 2
+  
+  	other 3
+  	[b608e9d1a3f0]
+  
+  1970-01-12  User Name  <user@hostname>
+  
+  	* a:
+  	line 1 line 2
+  	[1e4e1b8f71e0]
+  
+
+Issue 2130:
+
+  $ hg heads --style changelog
+  2020-01-01  test  <test>
+  
+  	* fourth, second, third:
+  	third
+  	[95c24699272e] [tip]
+  
+  1970-01-18  person  <person>
+  
+  	* merge
+  	[c7b487c6c50e]
+  
+  1970-01-17  person  <person>
+  
+  	* new branch
+  	[32a18f097fcc] <foo>
+  
+
+Keys work:
+
+  $ for key in author branches date desc file_adds file_dels file_mods \
+  >         file_copies file_copies_switch files \
+  >         manifest node parents rev tags diffstat extras; do
+  >     for mode in '' --verbose --debug; do
+  >         hg log $mode --template "$key$mode: {$key}\n"
+  >     done
+  > done
+  author: test
+  author: User Name <user@hostname>
+  author: person
+  author: person
+  author: person
+  author: person
+  author: other@place
+  author: A. N. Other <other@place>
+  author: User Name <user@hostname>
+  author--verbose: test
+  author--verbose: User Name <user@hostname>
+  author--verbose: person
+  author--verbose: person
+  author--verbose: person
+  author--verbose: person
+  author--verbose: other@place
+  author--verbose: A. N. Other <other@place>
+  author--verbose: User Name <user@hostname>
+  author--debug: test
+  author--debug: User Name <user@hostname>
+  author--debug: person
+  author--debug: person
+  author--debug: person
+  author--debug: person
+  author--debug: other@place
+  author--debug: A. N. Other <other@place>
+  author--debug: User Name <user@hostname>
+  branches: 
+  branches: 
+  branches: 
+  branches: 
+  branches: foo
+  branches: 
+  branches: 
+  branches: 
+  branches: 
+  branches--verbose: 
+  branches--verbose: 
+  branches--verbose: 
+  branches--verbose: 
+  branches--verbose: foo
+  branches--verbose: 
+  branches--verbose: 
+  branches--verbose: 
+  branches--verbose: 
+  branches--debug: 
+  branches--debug: 
+  branches--debug: 
+  branches--debug: 
+  branches--debug: foo
+  branches--debug: 
+  branches--debug: 
+  branches--debug: 
+  branches--debug: 
+  date: 1577872860.00
+  date: 1000000.00
+  date: 1500001.00
+  date: 1500000.00
+  date: 1400000.00
+  date: 1300000.00
+  date: 1200000.00
+  date: 1100000.00
+  date: 1000000.00
+  date--verbose: 1577872860.00
+  date--verbose: 1000000.00
+  date--verbose: 1500001.00
+  date--verbose: 1500000.00
+  date--verbose: 1400000.00
+  date--verbose: 1300000.00
+  date--verbose: 1200000.00
+  date--verbose: 1100000.00
+  date--verbose: 1000000.00
+  date--debug: 1577872860.00
+  date--debug: 1000000.00
+  date--debug: 1500001.00
+  date--debug: 1500000.00
+  date--debug: 1400000.00
+  date--debug: 1300000.00
+  date--debug: 1200000.00
+  date--debug: 1100000.00
+  date--debug: 1000000.00
+  desc: third
+  desc: second
+  desc: merge
+  desc: new head
+  desc: new branch
+  desc: no user, no domain
+  desc: no person
+  desc: other 1
+  other 2
+  
+  other 3
+  desc: line 1
+  line 2
+  desc--verbose: third
+  desc--verbose: second
+  desc--verbose: merge
+  desc--verbose: new head
+  desc--verbose: new branch
+  desc--verbose: no user, no domain
+  desc--verbose: no person
+  desc--verbose: other 1
+  other 2
+  
+  other 3
+  desc--verbose: line 1
+  line 2
+  desc--debug: third
+  desc--debug: second
+  desc--debug: merge
+  desc--debug: new head
+  desc--debug: new branch
+  desc--debug: no user, no domain
+  desc--debug: no person
+  desc--debug: other 1
+  other 2
+  
+  other 3
+  desc--debug: line 1
+  line 2
+  file_adds: fourth third
+  file_adds: second
+  file_adds: 
+  file_adds: d
+  file_adds: 
+  file_adds: 
+  file_adds: c
+  file_adds: b
+  file_adds: a
+  file_adds--verbose: fourth third
+  file_adds--verbose: second
+  file_adds--verbose: 
+  file_adds--verbose: d
+  file_adds--verbose: 
+  file_adds--verbose: 
+  file_adds--verbose: c
+  file_adds--verbose: b
+  file_adds--verbose: a
+  file_adds--debug: fourth third
+  file_adds--debug: second
+  file_adds--debug: 
+  file_adds--debug: d
+  file_adds--debug: 
+  file_adds--debug: 
+  file_adds--debug: c
+  file_adds--debug: b
+  file_adds--debug: a
+  file_dels: second
+  file_dels: 
+  file_dels: 
+  file_dels: 
+  file_dels: 
+  file_dels: 
+  file_dels: 
+  file_dels: 
+  file_dels: 
+  file_dels--verbose: second
+  file_dels--verbose: 
+  file_dels--verbose: 
+  file_dels--verbose: 
+  file_dels--verbose: 
+  file_dels--verbose: 
+  file_dels--verbose: 
+  file_dels--verbose: 
+  file_dels--verbose: 
+  file_dels--debug: second
+  file_dels--debug: 
+  file_dels--debug: 
+  file_dels--debug: 
+  file_dels--debug: 
+  file_dels--debug: 
+  file_dels--debug: 
+  file_dels--debug: 
+  file_dels--debug: 
+  file_mods: 
+  file_mods: 
+  file_mods: 
+  file_mods: 
+  file_mods: 
+  file_mods: c
+  file_mods: 
+  file_mods: 
+  file_mods: 
+  file_mods--verbose: 
+  file_mods--verbose: 
+  file_mods--verbose: 
+  file_mods--verbose: 
+  file_mods--verbose: 
+  file_mods--verbose: c
+  file_mods--verbose: 
+  file_mods--verbose: 
+  file_mods--verbose: 
+  file_mods--debug: 
+  file_mods--debug: 
+  file_mods--debug: 
+  file_mods--debug: 
+  file_mods--debug: 
+  file_mods--debug: c
+  file_mods--debug: 
+  file_mods--debug: 
+  file_mods--debug: 
+  file_copies: fourth (second)
+  file_copies: 
+  file_copies: 
+  file_copies: 
+  file_copies: 
+  file_copies: 
+  file_copies: 
+  file_copies: 
+  file_copies: 
+  file_copies--verbose: fourth (second)
+  file_copies--verbose: 
+  file_copies--verbose: 
+  file_copies--verbose: 
+  file_copies--verbose: 
+  file_copies--verbose: 
+  file_copies--verbose: 
+  file_copies--verbose: 
+  file_copies--verbose: 
+  file_copies--debug: fourth (second)
+  file_copies--debug: 
+  file_copies--debug: 
+  file_copies--debug: 
+  file_copies--debug: 
+  file_copies--debug: 
+  file_copies--debug: 
+  file_copies--debug: 
+  file_copies--debug: 
+  file_copies_switch: 
+  file_copies_switch: 
+  file_copies_switch: 
+  file_copies_switch: 
+  file_copies_switch: 
+  file_copies_switch: 
+  file_copies_switch: 
+  file_copies_switch: 
+  file_copies_switch: 
+  file_copies_switch--verbose: 
+  file_copies_switch--verbose: 
+  file_copies_switch--verbose: 
+  file_copies_switch--verbose: 
+  file_copies_switch--verbose: 
+  file_copies_switch--verbose: 
+  file_copies_switch--verbose: 
+  file_copies_switch--verbose: 
+  file_copies_switch--verbose: 
+  file_copies_switch--debug: 
+  file_copies_switch--debug: 
+  file_copies_switch--debug: 
+  file_copies_switch--debug: 
+  file_copies_switch--debug: 
+  file_copies_switch--debug: 
+  file_copies_switch--debug: 
+  file_copies_switch--debug: 
+  file_copies_switch--debug: 
+  files: fourth second third
+  files: second
+  files: 
+  files: d
+  files: 
+  files: c
+  files: c
+  files: b
+  files: a
+  files--verbose: fourth second third
+  files--verbose: second
+  files--verbose: 
+  files--verbose: d
+  files--verbose: 
+  files--verbose: c
+  files--verbose: c
+  files--verbose: b
+  files--verbose: a
+  files--debug: fourth second third
+  files--debug: second
+  files--debug: 
+  files--debug: d
+  files--debug: 
+  files--debug: c
+  files--debug: c
+  files--debug: b
+  files--debug: a
+  manifest: 8:94961b75a2da
+  manifest: 7:f2dbc354b94e
+  manifest: 6:91015e9dbdd7
+  manifest: 5:4dc3def4f9b4
+  manifest: 4:90ae8dda64e1
+  manifest: 3:cb5a1327723b
+  manifest: 2:6e0e82995c35
+  manifest: 1:4e8d705b1e53
+  manifest: 0:a0c8bcbbb45c
+  manifest--verbose: 8:94961b75a2da
+  manifest--verbose: 7:f2dbc354b94e
+  manifest--verbose: 6:91015e9dbdd7
+  manifest--verbose: 5:4dc3def4f9b4
+  manifest--verbose: 4:90ae8dda64e1
+  manifest--verbose: 3:cb5a1327723b
+  manifest--verbose: 2:6e0e82995c35
+  manifest--verbose: 1:4e8d705b1e53
+  manifest--verbose: 0:a0c8bcbbb45c
+  manifest--debug: 8:94961b75a2da554b4df6fb599e5bfc7d48de0c64
+  manifest--debug: 7:f2dbc354b94e5ec0b4f10680ee0cee816101d0bf
+  manifest--debug: 6:91015e9dbdd76a6791085d12b0a0ec7fcd22ffbf
+  manifest--debug: 5:4dc3def4f9b4c6e8de820f6ee74737f91e96a216
+  manifest--debug: 4:90ae8dda64e1a876c792bccb9af66284f6018363
+  manifest--debug: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
+  manifest--debug: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1
+  manifest--debug: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55
+  manifest--debug: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
+  node: 95c24699272ef57d062b8bccc32c878bf841784a
+  node: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
+  node: c7b487c6c50ef1cf464cafdc4f4f5e615fc5999f
+  node: 13207e5a10d9fd28ec424934298e176197f2c67f
+  node: 32a18f097fcccf76ef282f62f8a85b3adf8d13c4
+  node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
+  node: 97054abb4ab824450e9164180baf491ae0078465
+  node: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
+  node: 1e4e1b8f71e05681d422154f5421e385fec3454f
+  node--verbose: 95c24699272ef57d062b8bccc32c878bf841784a
+  node--verbose: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
+  node--verbose: c7b487c6c50ef1cf464cafdc4f4f5e615fc5999f
+  node--verbose: 13207e5a10d9fd28ec424934298e176197f2c67f
+  node--verbose: 32a18f097fcccf76ef282f62f8a85b3adf8d13c4
+  node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
+  node--verbose: 97054abb4ab824450e9164180baf491ae0078465
+  node--verbose: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
+  node--verbose: 1e4e1b8f71e05681d422154f5421e385fec3454f
+  node--debug: 95c24699272ef57d062b8bccc32c878bf841784a
+  node--debug: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
+  node--debug: c7b487c6c50ef1cf464cafdc4f4f5e615fc5999f
+  node--debug: 13207e5a10d9fd28ec424934298e176197f2c67f
+  node--debug: 32a18f097fcccf76ef282f62f8a85b3adf8d13c4
+  node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
+  node--debug: 97054abb4ab824450e9164180baf491ae0078465
+  node--debug: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
+  node--debug: 1e4e1b8f71e05681d422154f5421e385fec3454f
+  parents: 
+  parents: -1:000000000000 
+  parents: 5:13207e5a10d9 4:32a18f097fcc 
+  parents: 3:10e46f2dcbf4 
+  parents: 
+  parents: 
+  parents: 
+  parents: 
+  parents: 
+  parents--verbose: 
+  parents--verbose: -1:000000000000 
+  parents--verbose: 5:13207e5a10d9 4:32a18f097fcc 
+  parents--verbose: 3:10e46f2dcbf4 
+  parents--verbose: 
+  parents--verbose: 
+  parents--verbose: 
+  parents--verbose: 
+  parents--verbose: 
+  parents--debug: 7:29114dbae42b9f078cf2714dbe3a86bba8ec7453 -1:0000000000000000000000000000000000000000 
+  parents--debug: -1:0000000000000000000000000000000000000000 -1:0000000000000000000000000000000000000000 
+  parents--debug: 5:13207e5a10d9fd28ec424934298e176197f2c67f 4:32a18f097fcccf76ef282f62f8a85b3adf8d13c4 
+  parents--debug: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47 -1:0000000000000000000000000000000000000000 
+  parents--debug: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47 -1:0000000000000000000000000000000000000000 
+  parents--debug: 2:97054abb4ab824450e9164180baf491ae0078465 -1:0000000000000000000000000000000000000000 
+  parents--debug: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965 -1:0000000000000000000000000000000000000000 
+  parents--debug: 0:1e4e1b8f71e05681d422154f5421e385fec3454f -1:0000000000000000000000000000000000000000 
+  parents--debug: -1:0000000000000000000000000000000000000000 -1:0000000000000000000000000000000000000000 
+  rev: 8
+  rev: 7
+  rev: 6
+  rev: 5
+  rev: 4
+  rev: 3
+  rev: 2
+  rev: 1
+  rev: 0
+  rev--verbose: 8
+  rev--verbose: 7
+  rev--verbose: 6
+  rev--verbose: 5
+  rev--verbose: 4
+  rev--verbose: 3
+  rev--verbose: 2
+  rev--verbose: 1
+  rev--verbose: 0
+  rev--debug: 8
+  rev--debug: 7
+  rev--debug: 6
+  rev--debug: 5
+  rev--debug: 4
+  rev--debug: 3
+  rev--debug: 2
+  rev--debug: 1
+  rev--debug: 0
+  tags: tip
+  tags: 
+  tags: 
+  tags: 
+  tags: 
+  tags: 
+  tags: 
+  tags: 
+  tags: 
+  tags--verbose: tip
+  tags--verbose: 
+  tags--verbose: 
+  tags--verbose: 
+  tags--verbose: 
+  tags--verbose: 
+  tags--verbose: 
+  tags--verbose: 
+  tags--verbose: 
+  tags--debug: tip
+  tags--debug: 
+  tags--debug: 
+  tags--debug: 
+  tags--debug: 
+  tags--debug: 
+  tags--debug: 
+  tags--debug: 
+  tags--debug: 
+  diffstat: 3: +2/-1
+  diffstat: 1: +1/-0
+  diffstat: 0: +0/-0
+  diffstat: 1: +1/-0
+  diffstat: 0: +0/-0
+  diffstat: 1: +1/-0
+  diffstat: 1: +4/-0
+  diffstat: 1: +2/-0
+  diffstat: 1: +1/-0
+  diffstat--verbose: 3: +2/-1
+  diffstat--verbose: 1: +1/-0
+  diffstat--verbose: 0: +0/-0
+  diffstat--verbose: 1: +1/-0
+  diffstat--verbose: 0: +0/-0
+  diffstat--verbose: 1: +1/-0
+  diffstat--verbose: 1: +4/-0
+  diffstat--verbose: 1: +2/-0
+  diffstat--verbose: 1: +1/-0
+  diffstat--debug: 3: +2/-1
+  diffstat--debug: 1: +1/-0
+  diffstat--debug: 0: +0/-0
+  diffstat--debug: 1: +1/-0
+  diffstat--debug: 0: +0/-0
+  diffstat--debug: 1: +1/-0
+  diffstat--debug: 1: +4/-0
+  diffstat--debug: 1: +2/-0
+  diffstat--debug: 1: +1/-0
+  extras: branch=default
+  extras: branch=default
+  extras: branch=default
+  extras: branch=default
+  extras: branch=foo
+  extras: branch=default
+  extras: branch=default
+  extras: branch=default
+  extras: branch=default
+  extras--verbose: branch=default
+  extras--verbose: branch=default
+  extras--verbose: branch=default
+  extras--verbose: branch=default
+  extras--verbose: branch=foo
+  extras--verbose: branch=default
+  extras--verbose: branch=default
+  extras--verbose: branch=default
+  extras--verbose: branch=default
+  extras--debug: branch=default
+  extras--debug: branch=default
+  extras--debug: branch=default
+  extras--debug: branch=default
+  extras--debug: branch=foo
+  extras--debug: branch=default
+  extras--debug: branch=default
+  extras--debug: branch=default
+  extras--debug: branch=default
+
+
+Filters work:
+
+  $ hg log --template '{author|domain}\n'
+  
+  hostname
+  
+  
+  
+  
+  place
+  place
+  hostname
+
+  $ hg log --template '{author|person}\n'
+  test
+  User Name
+  person
+  person
+  person
+  person
+  other
+  A. N. Other
+  User Name
+
+  $ hg log --template '{author|user}\n'
+  test
+  user
+  person
+  person
+  person
+  person
+  other
+  other
+  user
+
+  $ hg log --template '{date|age}\n' > /dev/null || exit 1
+
+  $ hg log -l1 --template '{date|age}\n' 
+  in the future
+  $ hg log --template '{date|date}\n'
+  Wed Jan 01 10:01:00 2020 +0000
+  Mon Jan 12 13:46:40 1970 +0000
+  Sun Jan 18 08:40:01 1970 +0000
+  Sun Jan 18 08:40:00 1970 +0000
+  Sat Jan 17 04:53:20 1970 +0000
+  Fri Jan 16 01:06:40 1970 +0000
+  Wed Jan 14 21:20:00 1970 +0000
+  Tue Jan 13 17:33:20 1970 +0000
+  Mon Jan 12 13:46:40 1970 +0000
+
+  $ hg log --template '{date|isodate}\n'
+  2020-01-01 10:01 +0000
+  1970-01-12 13:46 +0000
+  1970-01-18 08:40 +0000
+  1970-01-18 08:40 +0000
+  1970-01-17 04:53 +0000
+  1970-01-16 01:06 +0000
+  1970-01-14 21:20 +0000
+  1970-01-13 17:33 +0000
+  1970-01-12 13:46 +0000
+
+  $ hg log --template '{date|isodatesec}\n'
+  2020-01-01 10:01:00 +0000
+  1970-01-12 13:46:40 +0000
+  1970-01-18 08:40:01 +0000
+  1970-01-18 08:40:00 +0000
+  1970-01-17 04:53:20 +0000
+  1970-01-16 01:06:40 +0000
+  1970-01-14 21:20:00 +0000
+  1970-01-13 17:33:20 +0000
+  1970-01-12 13:46:40 +0000
+
+  $ hg log --template '{date|rfc822date}\n'
+  Wed, 01 Jan 2020 10:01:00 +0000
+  Mon, 12 Jan 1970 13:46:40 +0000
+  Sun, 18 Jan 1970 08:40:01 +0000
+  Sun, 18 Jan 1970 08:40:00 +0000
+  Sat, 17 Jan 1970 04:53:20 +0000
+  Fri, 16 Jan 1970 01:06:40 +0000
+  Wed, 14 Jan 1970 21:20:00 +0000
+  Tue, 13 Jan 1970 17:33:20 +0000
+  Mon, 12 Jan 1970 13:46:40 +0000
+
+  $ hg log --template '{desc|firstline}\n'
+  third
+  second
+  merge
+  new head
+  new branch
+  no user, no domain
+  no person
+  other 1
+  line 1
+
+  $ hg log --template '{node|short}\n'
+  95c24699272e
+  29114dbae42b
+  c7b487c6c50e
+  13207e5a10d9
+  32a18f097fcc
+  10e46f2dcbf4
+  97054abb4ab8
+  b608e9d1a3f0
+  1e4e1b8f71e0
+
+  $ hg log --template '<changeset author="{author|xmlescape}"/>\n'
+  <changeset author="test"/>
+  <changeset author="User Name &lt;user@hostname&gt;"/>
+  <changeset author="person"/>
+  <changeset author="person"/>
+  <changeset author="person"/>
+  <changeset author="person"/>
+  <changeset author="other@place"/>
+  <changeset author="A. N. Other &lt;other@place&gt;"/>
+  <changeset author="User Name &lt;user@hostname&gt;"/>
+
+  $ hg log --template '{rev}: {children}\n'
+  8: 
+  7: 8:95c24699272e
+  6: 
+  5: 6:c7b487c6c50e
+  4: 6:c7b487c6c50e
+  3: 4:32a18f097fcc 5:13207e5a10d9
+  2: 3:10e46f2dcbf4
+  1: 2:97054abb4ab8
+  0: 1:b608e9d1a3f0
+
+Formatnode filter works:
+
+  $ hg -q log -r 0 --template '{node|formatnode}\n'
+  1e4e1b8f71e0
+
+  $ hg log -r 0 --template '{node|formatnode}\n'
+  1e4e1b8f71e0
+
+  $ hg -v log -r 0 --template '{node|formatnode}\n'
+  1e4e1b8f71e0
+
+  $ hg --debug log -r 0 --template '{node|formatnode}\n'
+  1e4e1b8f71e05681d422154f5421e385fec3454f
+
+Error on syntax:
+
+  $ echo 'x = "f' >> t
+  $ hg log
+  abort: t:3: unmatched quotes
+  [255]
+
+  $ cd ..
+
+
+latesttag:
+
+  $ hg init latesttag
+  $ cd latesttag
+
+  $ echo a > file
+  $ hg ci -Am a -d '0 0'
+  adding file
+
+  $ echo b >> file
+  $ hg ci -m b -d '1 0'
+
+  $ echo c >> head1
+  $ hg ci -Am h1c -d '2 0'
+  adding head1
+
+  $ hg update -q 1
+  $ echo d >> head2
+  $ hg ci -Am h2d -d '3 0'
+  adding head2
+  created new head
+
+  $ echo e >> head2
+  $ hg ci -m h2e -d '4 0'
+
+  $ hg merge -q
+  $ hg ci -m merge -d '5 0'
+
+No tag set:
+
+  $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
+  5: null+5
+  4: null+4
+  3: null+3
+  2: null+3
+  1: null+2
+  0: null+1
+
+One common tag: longuest path wins:
+
+  $ hg tag -r 1 -m t1 -d '6 0' t1
+  $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
+  6: t1+4
+  5: t1+3
+  4: t1+2
+  3: t1+1
+  2: t1+1
+  1: t1+0
+  0: null+1
+
+One ancestor tag: more recent wins:
+
+  $ hg tag -r 2 -m t2 -d '7 0' t2
+  $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
+  7: t2+3
+  6: t2+2
+  5: t2+1
+  4: t1+2
+  3: t1+1
+  2: t2+0
+  1: t1+0
+  0: null+1
+
+Two branch tags: more recent wins:
+
+  $ hg tag -r 3 -m t3 -d '8 0' t3
+  $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
+  8: t3+5
+  7: t3+4
+  6: t3+3
+  5: t3+2
+  4: t3+1
+  3: t3+0
+  2: t2+0
+  1: t1+0
+  0: null+1
+
+Merged tag overrides:
+
+  $ hg tag -r 5 -m t5 -d '9 0' t5
+  $ hg tag -r 3 -m at3 -d '10 0' at3
+  $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
+  10: t5+5
+  9: t5+4
+  8: t5+3
+  7: t5+2
+  6: t5+1
+  5: t5+0
+  4: at3:t3+1
+  3: at3:t3+0
+  2: t2+0
+  1: t1+0
+  0: null+1
+
+  $ cd ..
+
+
+Style path expansion (issue1948):
+
+  $ mkdir -p home/styles
+
+  $ cat > home/styles/teststyle <<EOF
+  > changeset = 'test {rev}:{node|short}\n'
+  > EOF
+
+  $ HOME=`pwd`/home; export HOME
+
+  $ cat > latesttag/.hg/hgrc <<EOF
+  > [ui]
+  > style = ~/styles/teststyle
+  > EOF
+
+  $ hg -R latesttag tip
+  test 10:dee8f28249af
+
+Test recursive showlist template (issue1989):
+
+  $ cat > style1989 <<EOF
+  > changeset = '{file_mods}{manifest}{extras}'
+  > file_mod  = 'M|{author|person}\n'
+  > manifest = '{rev},{author}\n'
+  > extra = '{key}: {author}\n'
+  > EOF
+
+  $ hg -R latesttag log -r tip --style=style1989
+  M|test
+  10,test
+  branch: test
+
--- a/tests/test-commit	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,126 +0,0 @@
-#!/bin/sh
-
-echo % commit date test
-hg init test
-cd test
-echo foo > foo
-hg add foo
-HGEDITOR=true hg commit -m ""
-hg commit -d '0 0' -m commit-1
-echo foo >> foo
-hg commit -d '1 4444444' -m commit-3
-hg commit -d '1	15.1' -m commit-4
-hg commit -d 'foo bar' -m commit-5
-hg commit -d ' 1 4444' -m commit-6
-hg commit -d '111111111111 0' -m commit-7
-
-echo % commit added file that has been deleted
-echo bar > bar
-hg add bar
-rm bar
-hg commit -d "1000000 0" -m commit-8
-hg commit -d "1000000 0" -m commit-8-2 bar
-
-hg -q revert -a --no-backup
-
-mkdir dir
-echo boo > dir/file
-hg add
-hg -v commit -m commit-9 dir
-
-echo > dir.file
-hg add
-hg commit -m commit-10 dir dir.file
-
-echo >> dir/file
-mkdir bleh
-mkdir dir2
-cd bleh
-hg commit -m commit-11 .
-hg commit -m commit-12 ../dir ../dir2
-hg -v commit -m commit-13 ../dir
-cd ..
-
-hg commit -m commit-14 does-not-exist
-ln -s foo baz
-hg commit -m commit-15 baz
-touch quux
-hg commit -m commit-16 quux
-echo >> dir/file
-hg -v commit -m commit-17 dir/file
-# An empty date was interpreted as epoch origin
-echo foo >> foo
-hg commit -d '' -m commit-no-date
-hg tip --template '{date|isodate}\n' | grep '1970'
-cd ..
-
-echo % partial subdir commit test
-hg init test2
-cd test2
-mkdir foo
-echo foo > foo/foo
-mkdir bar
-echo bar > bar/bar
-hg add
-hg ci -d '1000000 0' -m commit-subdir-1 foo
-hg ci -d '1000001 0' -m commit-subdir-2 bar
-echo % subdir log 1
-hg log -v foo
-echo % subdir log 2
-hg log -v bar
-echo % full log
-hg log -v
-cd ..
-
-echo % dot and subdir commit test
-hg init test3
-cd test3
-mkdir foo
-echo foo content > foo/plain-file
-hg add foo/plain-file
-hg ci -d '1000000 0' -m commit-foo-subdir foo
-echo modified foo content > foo/plain-file
-hg ci -d '2000000 0' -m commit-foo-dot .
-echo % full log
-hg log -v
-echo % subdir log
-cd foo
-hg log .
-cd ..
-cd ..
-
-cd ..
-hg init issue1049
-cd issue1049
-echo a > a
-hg ci -Ama
-echo a >> a
-hg ci -mb
-hg up 0
-echo b >> a
-hg ci -mc
-HGMERGE=true hg merge
-echo % should fail because we are specifying a file name
-hg ci -mmerge a
-echo % should fail because we are specifying a pattern
-hg ci -mmerge -I a
-echo % should succeed
-hg ci -mmerge
-cd ..
-
-
-echo % test commit message content
-hg init commitmsg
-cd commitmsg
-echo changed > changed
-echo removed > removed
-hg ci -qAm init
-
-hg rm removed
-echo changed >> changed
-echo added > added
-hg add added
-HGEDITOR=cat hg ci -A
-cd ..
-
-exit 0
--- a/tests/test-commit-copy	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-#!/bin/sh
-
-hg init dir
-cd dir
-echo bleh > bar
-hg add bar
-hg ci -m 'add bar'
-
-hg cp bar foo
-echo >> bar
-hg ci -m 'cp bar foo; change bar'
-
-hg debugrename foo
-hg debugindex .hg/store/data/bar.i
--- a/tests/test-commit-copy.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-foo renamed from bar:26d3ca0dfd18e44d796b564e38dd173c9668d3a9
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0       6      0       0 26d3ca0dfd18 000000000000 000000000000
-     1         6       7      1       1 d267bddd54f7 26d3ca0dfd18 000000000000
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-commit-copy.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,16 @@
+  $ hg init dir
+  $ cd dir
+  $ echo bleh > bar
+  $ hg add bar
+  $ hg ci -m 'add bar'
+
+  $ hg cp bar foo
+  $ echo >> bar
+  $ hg ci -m 'cp bar foo; change bar'
+
+  $ hg debugrename foo
+  foo renamed from bar:26d3ca0dfd18e44d796b564e38dd173c9668d3a9
+  $ hg debugindex .hg/store/data/bar.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0       6      0       0 26d3ca0dfd18 000000000000 000000000000
+       1         6       7      1       1 d267bddd54f7 26d3ca0dfd18 000000000000
--- a/tests/test-commit-unresolved	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-#!/bin/sh
-
-echo "[extensions]" >> $HGRCPATH
-echo "graphlog=" >> $HGRCPATH
-
-addcommit () {
-    echo $1 > $1
-    hg add $1
-    hg commit -d "${2} 0" -m $1
-}
-
-commit () {
-    hg commit -d "${2} 0" -m $1
-}
-
-hg init a
-cd a
-addcommit "A" 0
-addcommit "B" 1
-echo "C" >> A
-commit "C" 2
-
-hg update -C 0
-echo "D" >> A
-commit "D" 3
-
-echo
-echo "% Merging a conflict araises"
-hg merge
-
-echo
-echo "% Correct the conflict without marking the file as resolved"
-echo "ABCD" > A
-hg commit -m "Merged"
-
-echo
-echo "% Mark the conflict as resolved and commit"
-hg resolve -m A
-hg commit -m "Merged"
-
-exit 0
--- a/tests/test-commit-unresolved.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-created new head
-
-% Merging a conflict araises
-merging A
-warning: conflicts during merge.
-merging A failed!
-1 files updated, 0 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
-
-% Correct the conflict without marking the file as resolved
-abort: unresolved merge conflicts (see hg resolve)
-
-% Mark the conflict as resolved and commit
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-commit-unresolved.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,47 @@
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "graphlog=" >> $HGRCPATH
+
+  $ addcommit () {
+  >     echo $1 > $1
+  >     hg add $1
+  >     hg commit -d "${2} 0" -m $1
+  > }
+
+  $ commit () {
+  >     hg commit -d "${2} 0" -m $1
+  > }
+
+  $ hg init a
+  $ cd a
+  $ addcommit "A" 0
+  $ addcommit "B" 1
+  $ echo "C" >> A
+  $ commit "C" 2
+
+  $ hg update -C 0
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo "D" >> A
+  $ commit "D" 3
+  created new head
+
+Merging a conflict araises
+
+  $ hg merge
+  merging A
+  warning: conflicts during merge.
+  merging A failed!
+  1 files updated, 0 files merged, 0 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
+  [1]
+
+Correct the conflict without marking the file as resolved
+
+  $ echo "ABCD" > A
+  $ hg commit -m "Merged"
+  abort: unresolved merge conflicts (see hg resolve)
+  [255]
+
+Mark the conflict as resolved and commit
+
+  $ hg resolve -m A
+  $ hg commit -m "Merged"
--- a/tests/test-commit.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,117 +0,0 @@
-% commit date test
-abort: empty commit message
-abort: impossible time zone offset: 4444444
-abort: invalid date: '1\t15.1' 
-abort: invalid date: 'foo bar' 
-abort: date exceeds 32 bits: 111111111111
-% commit added file that has been deleted
-nothing changed
-abort: bar: file not found!
-adding dir/file
-dir/file
-committed changeset 2:d2a76177cb42
-adding dir.file
-abort: dir: no match under directory!
-abort: bleh: no match under directory!
-abort: dir2: no match under directory!
-dir/file
-committed changeset 3:1cd62a2d8db5
-abort: does-not-exist: No such file or directory
-abort: baz: file not tracked!
-abort: quux: file not tracked!
-dir/file
-committed changeset 4:49176991390e
-% partial subdir commit test
-adding bar/bar
-adding foo/foo
-% subdir log 1
-changeset:   0:6ef3cb06bb80
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-files:       foo/foo
-description:
-commit-subdir-1
-
-
-% subdir log 2
-changeset:   1:f2e51572cf5a
-tag:         tip
-user:        test
-date:        Mon Jan 12 13:46:41 1970 +0000
-files:       bar/bar
-description:
-commit-subdir-2
-
-
-% full log
-changeset:   1:f2e51572cf5a
-tag:         tip
-user:        test
-date:        Mon Jan 12 13:46:41 1970 +0000
-files:       bar/bar
-description:
-commit-subdir-2
-
-
-changeset:   0:6ef3cb06bb80
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-files:       foo/foo
-description:
-commit-subdir-1
-
-
-% dot and subdir commit test
-% full log
-changeset:   1:d9180e04fa8a
-tag:         tip
-user:        test
-date:        Sat Jan 24 03:33:20 1970 +0000
-files:       foo/plain-file
-description:
-commit-foo-dot
-
-
-changeset:   0:80b572aaf098
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-files:       foo/plain-file
-description:
-commit-foo-subdir
-
-
-% subdir log
-changeset:   1:d9180e04fa8a
-tag:         tip
-user:        test
-date:        Sat Jan 24 03:33:20 1970 +0000
-summary:     commit-foo-dot
-
-changeset:   0:80b572aaf098
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     commit-foo-subdir
-
-adding a
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-merging a
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-% should fail because we are specifying a file name
-abort: cannot partially commit a merge (do not specify files or patterns)
-% should fail because we are specifying a pattern
-abort: cannot partially commit a merge (do not specify files or patterns)
-% should succeed
-% test commit message content
-
-
-HG: Enter commit message.  Lines beginning with 'HG:' are removed.
-HG: Leave message empty to abort commit.
-HG: --
-HG: user: test
-HG: branch 'default'
-HG: added added
-HG: changed changed
-HG: removed removed
-abort: empty commit message
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-commit.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,267 @@
+commit date test
+
+  $ hg init test
+  $ cd test
+  $ echo foo > foo
+  $ hg add foo
+  $ HGEDITOR=true hg commit -m ""
+  abort: empty commit message
+  [255]
+  $ hg commit -d '0 0' -m commit-1
+  $ echo foo >> foo
+  $ hg commit -d '1 4444444' -m commit-3
+  abort: impossible time zone offset: 4444444
+  [255]
+  $ hg commit -d '1	15.1' -m commit-4
+  abort: invalid date: '1\t15.1'
+  [255]
+  $ hg commit -d 'foo bar' -m commit-5
+  abort: invalid date: 'foo bar'
+  [255]
+  $ hg commit -d ' 1 4444' -m commit-6
+  $ hg commit -d '111111111111 0' -m commit-7
+  abort: date exceeds 32 bits: 111111111111
+  [255]
+
+commit added file that has been deleted
+
+  $ echo bar > bar
+  $ hg add bar
+  $ rm bar
+  $ hg commit -m commit-8
+  nothing changed
+  [1]
+  $ hg commit -m commit-8-2 bar
+  abort: bar: file not found!
+  [255]
+
+  $ hg -q revert -a --no-backup
+
+  $ mkdir dir
+  $ echo boo > dir/file
+  $ hg add
+  adding dir/file
+  $ hg -v commit -m commit-9 dir
+  dir/file
+  committed changeset 2:d2a76177cb42
+
+  $ echo > dir.file
+  $ hg add
+  adding dir.file
+  $ hg commit -m commit-10 dir dir.file
+  abort: dir: no match under directory!
+  [255]
+
+  $ echo >> dir/file
+  $ mkdir bleh
+  $ mkdir dir2
+  $ cd bleh
+  $ hg commit -m commit-11 .
+  abort: bleh: no match under directory!
+  [255]
+  $ hg commit -m commit-12 ../dir ../dir2
+  abort: dir2: no match under directory!
+  [255]
+  $ hg -v commit -m commit-13 ../dir
+  dir/file
+  committed changeset 3:1cd62a2d8db5
+  $ cd ..
+
+  $ hg commit -m commit-14 does-not-exist
+  abort: does-not-exist: No such file or directory
+  [255]
+  $ ln -s foo baz
+  $ hg commit -m commit-15 baz
+  abort: baz: file not tracked!
+  [255]
+  $ touch quux
+  $ hg commit -m commit-16 quux
+  abort: quux: file not tracked!
+  [255]
+  $ echo >> dir/file
+  $ hg -v commit -m commit-17 dir/file
+  dir/file
+  committed changeset 4:49176991390e
+
+An empty date was interpreted as epoch origin
+
+  $ echo foo >> foo
+  $ hg commit -d '' -m commit-no-date
+  $ hg tip --template '{date|isodate}\n' | grep '1970'
+  [1]
+  $ cd ..
+
+
+partial subdir commit test
+
+  $ hg init test2
+  $ cd test2
+  $ mkdir foo
+  $ echo foo > foo/foo
+  $ mkdir bar
+  $ echo bar > bar/bar
+  $ hg add
+  adding bar/bar
+  adding foo/foo
+  $ hg ci -m commit-subdir-1 foo
+  $ hg ci -m commit-subdir-2 bar
+
+subdir log 1
+
+  $ hg log -v foo
+  changeset:   0:f97e73a25882
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files:       foo/foo
+  description:
+  commit-subdir-1
+  
+  
+
+subdir log 2
+
+  $ hg log -v bar
+  changeset:   1:aa809156d50d
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files:       bar/bar
+  description:
+  commit-subdir-2
+  
+  
+
+full log
+
+  $ hg log -v
+  changeset:   1:aa809156d50d
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files:       bar/bar
+  description:
+  commit-subdir-2
+  
+  
+  changeset:   0:f97e73a25882
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files:       foo/foo
+  description:
+  commit-subdir-1
+  
+  
+  $ cd ..
+
+
+dot and subdir commit test
+
+  $ hg init test3
+  $ cd test3
+  $ mkdir foo
+  $ echo foo content > foo/plain-file
+  $ hg add foo/plain-file
+  $ hg ci -m commit-foo-subdir foo
+  $ echo modified foo content > foo/plain-file
+  $ hg ci -m commit-foo-dot .
+
+full log
+
+  $ hg log -v
+  changeset:   1:95b38e3a5b2e
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files:       foo/plain-file
+  description:
+  commit-foo-dot
+  
+  
+  changeset:   0:65d4e9386227
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files:       foo/plain-file
+  description:
+  commit-foo-subdir
+  
+  
+
+subdir log
+
+  $ cd foo
+  $ hg log .
+  changeset:   1:95b38e3a5b2e
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     commit-foo-dot
+  
+  changeset:   0:65d4e9386227
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     commit-foo-subdir
+  
+  $ cd ..
+  $ cd ..
+
+  $ cd ..
+  $ hg init issue1049
+  $ cd issue1049
+  $ echo a > a
+  $ hg ci -Ama
+  adding a
+  $ echo a >> a
+  $ hg ci -mb
+  $ hg up 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo b >> a
+  $ hg ci -mc
+  created new head
+  $ HGMERGE=true hg merge
+  merging a
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+should fail because we are specifying a file name
+
+  $ hg ci -mmerge a
+  abort: cannot partially commit a merge (do not specify files or patterns)
+  [255]
+
+should fail because we are specifying a pattern
+
+  $ hg ci -mmerge -I a
+  abort: cannot partially commit a merge (do not specify files or patterns)
+  [255]
+
+should succeed
+
+  $ hg ci -mmerge
+  $ cd ..
+
+
+test commit message content
+
+  $ hg init commitmsg
+  $ cd commitmsg
+  $ echo changed > changed
+  $ echo removed > removed
+  $ hg ci -qAm init
+
+  $ hg rm removed
+  $ echo changed >> changed
+  $ echo added > added
+  $ hg add added
+  $ HGEDITOR=cat hg ci -A
+  
+  
+  HG: Enter commit message.  Lines beginning with 'HG:' are removed.
+  HG: Leave message empty to abort commit.
+  HG: --
+  HG: user: test
+  HG: branch 'default'
+  HG: added added
+  HG: changed changed
+  HG: removed removed
+  abort: empty commit message
+  [255]
--- a/tests/test-committer	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-#!/bin/sh
-
-unset HGUSER
-EMAIL="My Name <myname@example.com>"
-export EMAIL
-
-hg init test
-cd test
-touch asdf
-hg add asdf
-hg commit -d '1000000 0' -m commit-1
-hg tip
-
-unset EMAIL
-echo 1234 > asdf
-hg commit -d '1000000 0' -u "foo@bar.com" -m commit-1
-hg tip
-echo "[ui]" >> .hg/hgrc
-echo "username = foobar <foo@bar.com>" >> .hg/hgrc
-echo 12 > asdf
-hg commit -d '1000000 0' -m commit-1
-hg tip
-echo 1 > asdf
-hg commit -d '1000000 0' -u "foo@bar.com" -m commit-1
-hg tip
-echo 123 > asdf
-echo "[ui]" > .hg/hgrc
-echo "username = " >> .hg/hgrc
-hg commit -d '1000000 0' -m commit-1
-rm .hg/hgrc
-hg commit -d '1000000 0' -m commit-1 2>&1 | sed -e "s/'[^']*'/user@host/"
-
-echo space > asdf
-hg commit -d '1000000 0' -u ' ' -m commit-1
-
-true
--- a/tests/test-committer.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-changeset:   0:9426b370c206
-tag:         tip
-user:        My Name <myname@example.com>
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     commit-1
-
-changeset:   1:4997f15a1b24
-tag:         tip
-user:        foo@bar.com
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     commit-1
-
-changeset:   2:72b8012b424e
-tag:         tip
-user:        foobar <foo@bar.com>
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     commit-1
-
-changeset:   3:35ff3067bedd
-tag:         tip
-user:        foo@bar.com
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     commit-1
-
-abort: no username supplied (see "hg help config")
-No username found, using user@host instead
-transaction abort!
-rollback completed
-abort: empty username!
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-committer.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,63 @@
+  $ unset HGUSER
+  $ EMAIL="My Name <myname@example.com>"
+  $ export EMAIL
+
+  $ hg init test
+  $ cd test
+  $ touch asdf
+  $ hg add asdf
+  $ hg commit -m commit-1
+  $ hg tip
+  changeset:   0:53f268a58230
+  tag:         tip
+  user:        My Name <myname@example.com>
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     commit-1
+  
+
+  $ unset EMAIL
+  $ echo 1234 > asdf
+  $ hg commit -u "foo@bar.com" -m commit-1
+  $ hg tip
+  changeset:   1:3871b2a9e9bf
+  tag:         tip
+  user:        foo@bar.com
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     commit-1
+  
+  $ echo "[ui]" >> .hg/hgrc
+  $ echo "username = foobar <foo@bar.com>" >> .hg/hgrc
+  $ echo 12 > asdf
+  $ hg commit -m commit-1
+  $ hg tip
+  changeset:   2:8eeac6695c1c
+  tag:         tip
+  user:        foobar <foo@bar.com>
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     commit-1
+  
+  $ echo 1 > asdf
+  $ hg commit -u "foo@bar.com" -m commit-1
+  $ hg tip
+  changeset:   3:957606a725e4
+  tag:         tip
+  user:        foo@bar.com
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     commit-1
+  
+  $ echo 123 > asdf
+  $ echo "[ui]" > .hg/hgrc
+  $ echo "username = " >> .hg/hgrc
+  $ hg commit -m commit-1
+  abort: no username supplied (see "hg help config")
+  [255]
+  $ rm .hg/hgrc
+  $ hg commit -m commit-1 2>&1
+  No username found, using '[^']*' instead (re)
+
+  $ echo space > asdf
+  $ hg commit -u ' ' -m commit-1
+  transaction abort!
+  rollback completed
+  abort: empty username!
+  [255]
--- a/tests/test-config-case	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-echo '[Section]' >> $HGRCPATH
-echo 'KeY = Case Sensitive' >> $HGRCPATH
-echo 'key = lower case' >> $HGRCPATH
-
-hg showconfig Section
--- a/tests/test-config-case.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-Section.KeY=Case Sensitive
-Section.key=lower case
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-config-case.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,8 @@
+  $ echo '[Section]' >> $HGRCPATH
+  $ echo 'KeY = Case Sensitive' >> $HGRCPATH
+  $ echo 'key = lower case' >> $HGRCPATH
+
+  $ hg showconfig Section
+  Section.KeY=Case Sensitive
+  Section.key=lower case
+
--- a/tests/test-conflict	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-#!/bin/sh
-
-hg init
-echo "nothing" > a
-hg add a
-hg commit -m ancestor -d "1000000 0"
-echo "something" > a
-hg commit -m branch1 -d "1000000 0"
-hg co 0
-echo "something else" > a
-hg commit -m branch2 -d "1000000 0"
-hg merge 1
-hg id
-cat a
-hg status
--- a/tests/test-conflict.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-merging a
-warning: conflicts during merge.
-merging a failed!
-0 files updated, 0 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
-e7fe8eb3e180+0d24b7662d3e+ tip
-<<<<<<< local
-something else
-=======
-something
->>>>>>> other
-M a
-? a.orig
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-conflict.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,33 @@
+  $ hg init
+  $ echo "nothing" > a
+  $ hg add a
+  $ hg commit -m ancestor
+  $ echo "something" > a
+  $ hg commit -m branch1
+  $ hg co 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo "something else" > a
+  $ hg commit -m branch2
+  created new head
+
+  $ hg merge 1
+  merging a
+  warning: conflicts during merge.
+  merging a failed!
+  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
+  [1]
+
+  $ hg id
+  32e80765d7fe+75234512624c+ tip
+
+  $ cat a
+  <<<<<<< local
+  something else
+  =======
+  something
+  >>>>>>> other
+
+  $ hg status
+  M a
+  ? a.orig
--- a/tests/test-confused-revert	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-#!/bin/sh
-
-hg init
-echo foo > a
-hg add a
-hg commit -m "1" -d "1000000 0"
-
-echo bar > b
-hg add b
-hg remove a
-
-echo "%%% should show a removed and b added"
-hg status
-
-echo "reverting..."
-hg revert --all
-
-echo "%%% should show b unknown and a back to normal"
-hg status
-
-rm b
-
-hg co -C 0
-echo foo-a > a
-hg commit -m "2a" -d "1000000 0"
-
-hg co -C 0
-echo foo-b > a
-hg commit -m "2b" -d "1000000 0"
-
-HGMERGE=true hg merge 1
-
-echo "%%% should show foo-b"
-cat a
-
-echo bar > b
-hg add b
-rm a
-hg remove a
-
-echo "%%% should show a removed and b added"
-hg status
-
-echo "%%% revert should fail"
-hg revert --all
-
-echo "%%% revert should be ok now"
-hg revert -r2 --all
-
-echo "%%% should show b unknown and a marked modified (merged)"
-hg status
-
-echo "%%% should show foo-b"
-cat a
-
--- a/tests/test-confused-revert.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-%%% should show a removed and b added
-A b
-R a
-reverting...
-undeleting a
-forgetting b
-%%% should show b unknown and a back to normal
-? b
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-merging a
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-%%% should show foo-b
-foo-b
-%%% should show a removed and b added
-A b
-R a
-%%% revert should fail
-abort: uncommitted merge - please provide a specific revision
-%%% revert should be ok now
-undeleting a
-forgetting b
-%%% should show b unknown and a marked modified (merged)
-M a
-? b
-%%% should show foo-b
-foo-b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-confused-revert.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,81 @@
+  $ hg init
+  $ echo foo > a
+  $ hg add a
+  $ hg commit -m "1"
+
+  $ echo bar > b
+  $ hg add b
+  $ hg remove a
+
+Should show a removed and b added:
+
+  $ hg status
+  A b
+  R a
+
+  $ hg revert --all
+  undeleting a
+  forgetting b
+
+Should show b unknown and a back to normal:
+
+  $ hg status
+  ? b
+
+  $ rm b
+
+  $ hg co -C 0
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo foo-a > a
+  $ hg commit -m "2a"
+
+  $ hg co -C 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo foo-b > a
+  $ hg commit -m "2b"
+  created new head
+
+  $ HGMERGE=true hg merge 1
+  merging a
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+Should show foo-b:
+
+  $ cat a
+  foo-b
+
+  $ echo bar > b
+  $ hg add b
+  $ rm a
+  $ hg remove a
+
+Should show a removed and b added:
+
+  $ hg status
+  A b
+  R a
+
+Revert should fail:
+
+  $ hg revert --all
+  abort: uncommitted merge - please provide a specific revision
+  [255]
+
+Revert should be ok now:
+
+  $ hg revert -r2 --all
+  undeleting a
+  forgetting b
+
+Should show b unknown and a marked modified (merged):
+
+  $ hg status
+  M a
+  ? b
+
+Should show foo-b:
+
+  $ cat a
+  foo-b
+
--- a/tests/test-convert-filemap	Wed Sep 22 17:13:49 2010 -0500
+++ b/tests/test-convert-filemap	Wed Sep 22 18:29:41 2010 -0500
@@ -128,3 +128,14 @@
 hg --cwd source cat copied
 echo 'copied2:'
 hg --cwd renames.repo cat copied2
+
+echo % filemap errors
+cat > errors.fmap <<EOF
+include dir/ # beware that comments changes error line numbers!
+exclude /dir
+rename dir//dir /dir//dir/ "out of sync"
+include
+EOF
+hg -q convert --filemap errors.fmap source errors.repo
+
+true # happy ending
--- a/tests/test-convert-filemap.out	Wed Sep 22 17:13:49 2010 -0500
+++ b/tests/test-convert-filemap.out	Wed Sep 22 18:29:41 2010 -0500
@@ -157,3 +157,11 @@
 foo
 copied2:
 foo
+% filemap errors
+errors.fmap:1: superfluous / in exclude 'dir/'
+errors.fmap:3: superfluous / in include '/dir'
+errors.fmap:3: superfluous / in rename '/dir'
+errors.fmap:3: superfluous / in exclude 'dir//dir'
+errors.fmap:4: unknown directive 'out of sync'
+errors.fmap:5: path to exclude is missing
+abort: errors in filemap
--- a/tests/test-convert-hg-source	Wed Sep 22 17:13:49 2010 -0500
+++ b/tests/test-convert-hg-source	Wed Sep 22 18:29:41 2010 -0500
@@ -32,6 +32,10 @@
 chmod +x baz
 hg ci -m 'mark baz executable' -d '5 0'
 
+hg branch foo
+hg ci -m 'branch foo' -d '6 0'
+hg ci --close-branch -m 'close' -d '7 0'
+
 cd ..
 hg convert --datesort orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
 cd new
--- a/tests/test-convert-hg-source.out	Wed Sep 22 17:13:49 2010 -0500
+++ b/tests/test-convert-hg-source.out	Wed Sep 22 18:29:41 2010 -0500
@@ -7,16 +7,19 @@
 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
 (branch merge, don't forget to commit)
 created new head
+marked working directory as branch foo
 initializing destination new repository
 scanning source...
 sorting...
 converting...
-5 add foo bar
-4 change foo
-3 make bar and baz copies of foo
-2 merge local copy
-1 merge remote copy
-0 mark baz executable
+7 add foo bar
+6 change foo
+5 make bar and baz copies of foo
+4 merge local copy
+3 merge remote copy
+2 mark baz executable
+1 branch foo
+0 close
 comparing with ../orig
 searching for changes
 no changes found
--- a/tests/test-convert-hg-startrev	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-#!/bin/sh
-
-echo '[extensions]' >> $HGRCPATH
-echo 'graphlog =' >> $HGRCPATH
-echo 'convert =' >> $HGRCPATH
-
-glog()
-{
-    hg -R "$1" glog --template '{rev} "{desc}" files: {files}\n'
-}
-
-hg init source
-cd source
-
-echo a > a
-echo b > b
-hg ci -d '0 0' -qAm '0: add a b'
-echo c > c
-hg ci -d '1 0' -qAm '1: add c'
-hg copy a e
-echo b >> b
-hg ci -d '2 0' -qAm '2: copy e from a, change b'
-hg up -C 0
-echo a >> a
-hg ci -d '3 0' -qAm '3: change a'
-hg merge
-hg copy b d
-hg ci -d '4 0' -qAm '4: merge 2 and 3, copy d from b'
-echo a >> a
-hg ci -d '5 0' -qAm '5: change a'
-cd ..
-
-echo % convert from null revision
-hg convert --config convert.hg.startrev=null source empty
-glog empty
-
-echo % convert from zero revision
-hg convert --config convert.hg.startrev=0 source full
-glog full
-
-echo % convert from merge parent
-hg convert --config convert.hg.startrev=1 source conv1
-glog conv1
-cd conv1
-echo % check copy preservation
-hg log --follow --copies e
-echo % check copy removal on missing parent
-hg log --follow --copies d
-hg cat -r tip a b
-hg -q verify
-cd ..
-
-echo % convert from merge
-hg convert --config convert.hg.startrev=4 source conv4
-glog conv4
-cd conv4
-hg up -C
-hg cat -r tip a b
-hg -q verify
-cd ..
-
--- a/tests/test-convert-hg-startrev.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-1 files updated, 0 files merged, 2 files removed, 0 files unresolved
-merging a and e to e
-2 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-% convert from null revision
-initializing destination empty repository
-scanning source...
-sorting...
-converting...
-% convert from zero revision
-initializing destination full repository
-scanning source...
-sorting...
-converting...
-5 0: add a b
-4 1: add c
-3 2: copy e from a, change b
-2 3: change a
-1 4: merge 2 and 3, copy d from b
-0 5: change a
-o  5 "5: change a" files: a
-|
-o    4 "4: merge 2 and 3, copy d from b" files: d e
-|\
-| o  3 "3: change a" files: a
-| |
-o |  2 "2: copy e from a, change b" files: b e
-| |
-o |  1 "1: add c" files: c
-|/
-o  0 "0: add a b" files: a b
-
-% convert from merge parent
-initializing destination conv1 repository
-scanning source...
-sorting...
-converting...
-3 1: add c
-2 2: copy e from a, change b
-1 4: merge 2 and 3, copy d from b
-0 5: change a
-o  3 "5: change a" files: a
-|
-o  2 "4: merge 2 and 3, copy d from b" files: a d e
-|
-o  1 "2: copy e from a, change b" files: b e
-|
-o  0 "1: add c" files: a b c
-
-% check copy preservation
-changeset:   2:d67b1d48a835
-user:        test
-date:        Thu Jan 01 00:00:04 1970 +0000
-summary:     4: merge 2 and 3, copy d from b
-
-changeset:   1:462c431cf47d
-user:        test
-date:        Thu Jan 01 00:00:02 1970 +0000
-summary:     2: copy e from a, change b
-
-% check copy removal on missing parent
-changeset:   2:d67b1d48a835
-user:        test
-date:        Thu Jan 01 00:00:04 1970 +0000
-summary:     4: merge 2 and 3, copy d from b
-
-a
-a
-a
-b
-b
-% convert from merge
-initializing destination conv4 repository
-scanning source...
-sorting...
-converting...
-1 4: merge 2 and 3, copy d from b
-0 5: change a
-o  1 "5: change a" files: a
-|
-o  0 "4: merge 2 and 3, copy d from b" files: a b c d e
-
-5 files updated, 0 files merged, 0 files removed, 0 files unresolved
-a
-a
-a
-b
-b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-convert-hg-startrev.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,154 @@
+
+  $ cat > $HGRCPATH <<EOF
+  > [extensions]
+  > graphlog =
+  > convert =
+  > [convert]
+  > hg.saverev = yes
+  > EOF
+
+  $ glog()
+  > {
+  >     hg -R "$1" glog --template '{rev} "{desc}" files: {files}\n'
+  > }
+
+  $ hg init source
+  $ cd source
+
+  $ echo a > a
+  $ echo b > b
+  $ hg ci -d '0 0' -qAm '0: add a b'
+  $ echo c > c
+  $ hg ci -d '1 0' -qAm '1: add c'
+  $ hg copy a e
+  $ echo b >> b
+  $ hg ci -d '2 0' -qAm '2: copy e from a, change b'
+  $ hg up -C 0
+  1 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  $ echo a >> a
+  $ hg ci -d '3 0' -qAm '3: change a'
+  $ hg merge
+  merging a and e to e
+  2 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg copy b d
+  $ hg ci -d '4 0' -qAm '4: merge 2 and 3, copy d from b'
+  $ echo a >> a
+  $ hg ci -d '5 0' -qAm '5: change a'
+  $ cd ..
+
+Convert from null revision
+
+  $ hg convert --config convert.hg.startrev=null source empty
+  initializing destination empty repository
+  scanning source...
+  sorting...
+  converting...
+
+  $ glog empty
+
+Convert from zero revision
+
+  $ hg convert --config convert.hg.startrev=0 source full
+  initializing destination full repository
+  scanning source...
+  sorting...
+  converting...
+  5 0: add a b
+  4 1: add c
+  3 2: copy e from a, change b
+  2 3: change a
+  1 4: merge 2 and 3, copy d from b
+  0 5: change a
+
+  $ glog full
+  o  5 "5: change a" files: a
+  |
+  o    4 "4: merge 2 and 3, copy d from b" files: d e
+  |\
+  | o  3 "3: change a" files: a
+  | |
+  o |  2 "2: copy e from a, change b" files: b e
+  | |
+  o |  1 "1: add c" files: c
+  |/
+  o  0 "0: add a b" files: a b
+  
+Convert from merge parent
+
+  $ hg convert --config convert.hg.startrev=1 source conv1
+  initializing destination conv1 repository
+  scanning source...
+  sorting...
+  converting...
+  3 1: add c
+  2 2: copy e from a, change b
+  1 4: merge 2 and 3, copy d from b
+  0 5: change a
+
+  $ glog conv1
+  o  3 "5: change a" files: a
+  |
+  o  2 "4: merge 2 and 3, copy d from b" files: a d e
+  |
+  o  1 "2: copy e from a, change b" files: b e
+  |
+  o  0 "1: add c" files: a b c
+  
+  $ cd conv1
+
+Check copy preservation
+
+  $ hg log --follow --copies e
+  changeset:   2:79818a521a40
+  user:        test
+  date:        Thu Jan 01 00:00:04 1970 +0000
+  summary:     4: merge 2 and 3, copy d from b
+  
+  changeset:   1:3e6201832cce
+  user:        test
+  date:        Thu Jan 01 00:00:02 1970 +0000
+  summary:     2: copy e from a, change b
+  
+Check copy removal on missing parent
+
+  $ hg log --follow --copies d
+  changeset:   2:79818a521a40
+  user:        test
+  date:        Thu Jan 01 00:00:04 1970 +0000
+  summary:     4: merge 2 and 3, copy d from b
+  
+  $ hg cat -r tip a b
+  a
+  a
+  a
+  b
+  b
+  $ hg -q verify
+  $ cd ..
+
+Convert from merge
+
+  $ hg convert --config convert.hg.startrev=4 source conv4
+  initializing destination conv4 repository
+  scanning source...
+  sorting...
+  converting...
+  1 4: merge 2 and 3, copy d from b
+  0 5: change a
+  $ glog conv4
+  o  1 "5: change a" files: a
+  |
+  o  0 "4: merge 2 and 3, copy d from b" files: a b c d e
+  
+  $ cd conv4
+  $ hg up -C
+  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg cat -r tip a b
+  a
+  a
+  a
+  b
+  b
+  $ hg -q verify
+  $ cd ..
--- a/tests/test-convert-svn-branches	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-#!/bin/sh
-
-"$TESTDIR/hghave" svn svn-bindings || exit 80
-
-echo "[extensions]" >> $HGRCPATH
-echo "convert = " >> $HGRCPATH
-echo "graphlog =" >> $HGRCPATH
-
-svnadmin create svn-repo
-cat "$TESTDIR/svn/branches.svndump" | svnadmin load svn-repo > /dev/null
-
-echo % convert trunk and branches
-cat >branchmap <<EOF
-old3 newbranch
-EOF
-hg convert --branchmap=branchmap --datesort -r 10 svn-repo A-hg
-
-echo % convert again
-hg convert --branchmap=branchmap --datesort svn-repo A-hg
-
-cd A-hg
-hg glog --template 'branch={branches} {rev} {desc|firstline} files: {files}\n'
-hg branches | sed 's/:.*/:/'
-hg tags -q
-cd ..
-
-echo '% test hg failing to call itself'
-HG=foobar hg convert svn-repo B-hg 2>&1 | grep itself
-
--- a/tests/test-convert-svn-branches.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-% convert trunk and branches
-initializing destination A-hg repository
-scanning source...
-sorting...
-converting...
-10 init projA
-9 hello
-8 branch trunk, remove c and dir
-7 change a
-6 change b
-5 move and update c
-4 move and update c
-3 change b again
-2 move to old2
-1 move back to old
-0 last change to a
-% convert again
-scanning source...
-sorting...
-converting...
-0 branch trunk@1 into old3
-o  branch=newbranch 11 branch trunk@1 into old3 files:
-|
-| o  branch= 10 last change to a files: a
-| |
-| | o  branch=old 9 move back to old files:
-| | |
-| | o  branch=old2 8 move to old2 files:
-| | |
-| | o  branch=old 7 change b again files: b
-| | |
-| o |  branch= 6 move and update c files: b
-| | |
-| | o  branch=old 5 move and update c files: c
-| | |
-| | o  branch=old 4 change b files: b
-| | |
-| o |  branch= 3 change a files: a
-| | |
-| | o  branch=old 2 branch trunk, remove c and dir files: c
-| |/
-| o  branch= 1 hello files: a b c dir/e
-|/
-o  branch= 0 init projA files:
-
-newbranch                     11:
-default                       10:
-old                            9:
-old2                           8:
-tip
-% test hg failing to call itself
-abort: Mercurial failed to run itself, check hg executable is in PATH
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-convert-svn-branches.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,86 @@
+
+  $ "$TESTDIR/hghave" svn svn-bindings || exit 80
+
+  $ cat > $HGRCPATH <<EOF
+  > [extensions]
+  > convert = 
+  > graphlog =
+  > EOF
+
+  $ svnadmin create svn-repo
+  $ svnadmin load -q svn-repo < "$TESTDIR/svn/branches.svndump"
+
+Convert trunk and branches
+
+  $ cat > branchmap <<EOF
+  > old3 newbranch
+  > EOF
+  $ hg convert --branchmap=branchmap --datesort -r 10 svn-repo A-hg
+  initializing destination A-hg repository
+  scanning source...
+  sorting...
+  converting...
+  10 init projA
+  9 hello
+  8 branch trunk, remove c and dir
+  7 change a
+  6 change b
+  5 move and update c
+  4 move and update c
+  3 change b again
+  2 move to old2
+  1 move back to old
+  0 last change to a
+
+Convert again
+
+  $ hg convert --branchmap=branchmap --datesort svn-repo A-hg
+  scanning source...
+  sorting...
+  converting...
+  0 branch trunk@1 into old3
+
+  $ cd A-hg
+  $ hg glog --template 'branch={branches} {rev} {desc|firstline} files: {files}\n'
+  o  branch=newbranch 11 branch trunk@1 into old3 files:
+  |
+  | o  branch= 10 last change to a files: a
+  | |
+  | | o  branch=old 9 move back to old files:
+  | | |
+  | | o  branch=old2 8 move to old2 files:
+  | | |
+  | | o  branch=old 7 change b again files: b
+  | | |
+  | o |  branch= 6 move and update c files: b
+  | | |
+  | | o  branch=old 5 move and update c files: c
+  | | |
+  | | o  branch=old 4 change b files: b
+  | | |
+  | o |  branch= 3 change a files: a
+  | | |
+  | | o  branch=old 2 branch trunk, remove c and dir files: c
+  | |/
+  | o  branch= 1 hello files: a b c dir/e
+  |/
+  o  branch= 0 init projA files:
+  
+
+  $ hg branches
+  newbranch                     11:08fca3ff8634
+  default                       10:098988aa63ba
+  old                            9:b308f345079b
+  old2                           8:49f2336c7b8b (inactive)
+  $ hg tags -q
+  tip
+  $ cd ..
+
+Test hg failing to call itself
+
+  $ HG=foobar hg convert svn-repo B-hg
+  * (glob)
+  initializing destination B-hg repository
+  abort: Mercurial failed to run itself, check hg executable is in PATH
+  [255]
+
--- a/tests/test-convert-svn-encoding	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-#!/bin/sh
-
-"$TESTDIR/hghave" svn svn-bindings || exit 80
-
-echo "[extensions]" >> $HGRCPATH
-echo "convert = " >> $HGRCPATH
-
-svnadmin create svn-repo
-cat "$TESTDIR/svn/encoding.svndump" | svnadmin load svn-repo > /dev/null
-
-echo '% convert while testing all possible outputs'
-hg --debug convert svn-repo A-hg > /dev/null
-cd A-hg
-hg up
-echo '% check tags are in UTF-8'
-python -c "print '\n'.join([('%r' % l) for l in file('.hgtags', 'rb').readlines()])"
-cd ..
--- a/tests/test-convert-svn-encoding.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-% convert while testing all possible outputs
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% check tags are in UTF-8
-'221c3fdaf24df5f14c0a64c597581e2eacfb47bb branch\xc3\xa9e\n'
-'7a40952c2db29cf00d9e31df3749e98d8a4bdcbf branch\xc3\xa9\n'
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-convert-svn-encoding.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,135 @@
+
+  $ "$TESTDIR/hghave" svn svn-bindings || exit 80
+
+  $ cat > $HGRCPATH <<EOF
+  > [extensions]
+  > convert = 
+  > graphlog =
+  > EOF
+
+  $ svnadmin create svn-repo
+  $ svnadmin load -q svn-repo < "$TESTDIR/svn/encoding.svndump"
+
+Convert while testing all possible outputs
+
+  $ hg --debug convert svn-repo A-hg
+  initializing destination A-hg repository
+  reparent to file://*/test-convert-svn-encoding.t/svn-repo (glob)
+  run hg sink pre-conversion action
+  scanning source...
+  found trunk at 'trunk'
+  found tags at 'tags'
+  found branches at 'branches'
+  found branch branché at 5
+  found branch branchée at 6
+  scanning: 1 revisions
+  reparent to file://*/test-convert-svn-encoding.t/svn-repo/trunk (glob)
+  fetching revision log for "/trunk" from 4 to 0
+  parsing revision 4 (2 changes)
+  parsing revision 3 (4 changes)
+  parsing revision 2 (3 changes)
+  parsing revision 1 (3 changes)
+  no copyfrom path, don't know what to do.
+  '/branches' is not under '/trunk', ignoring
+  '/tags' is not under '/trunk', ignoring
+  scanning: 2 revisions
+  reparent to file://*/test-convert-svn-encoding.t/svn-repo/branches/branch%C3%A9 (glob)
+  fetching revision log for "/branches/branché" from 5 to 0
+  parsing revision 5 (1 changes)
+  reparent to file://*/test-convert-svn-encoding.t/svn-repo (glob)
+  reparent to file://*/test-convert-svn-encoding.t/svn-repo/branches/branch%C3%A9 (glob)
+  found parent of branch /branches/branché at 4: /trunk
+  scanning: 3 revisions
+  reparent to file://*/test-convert-svn-encoding.t/svn-repo/branches/branch%C3%A9e (glob)
+  fetching revision log for "/branches/branchée" from 6 to 0
+  parsing revision 6 (1 changes)
+  reparent to file://*/test-convert-svn-encoding.t/svn-repo (glob)
+  reparent to file://*/test-convert-svn-encoding.t/svn-repo/branches/branch%C3%A9e (glob)
+  found parent of branch /branches/branchée at 5: /branches/branché
+  scanning: 4 revisions
+  scanning: 5 revisions
+  scanning: 6 revisions
+  sorting...
+  converting...
+  5 init projA
+  source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/trunk@1
+  converting: 0/6 revisions (0.00%)
+  4 hello
+  source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/trunk@2
+  converting: 1/6 revisions (16.67%)
+  reparent to file://*/test-convert-svn-encoding.t/svn-repo/trunk (glob)
+  scanning paths: /trunk/à 0/3 (0.00%)
+  scanning paths: /trunk/à/eÌ 1/3 (33.33%)
+  scanning paths: /trunk/é 2/3 (66.67%)
+  à/eÌ
+  getting files: à/eÌ 1/2 (50.00%)
+  é
+  getting files: é 2/2 (100.00%)
+  3 copy files
+  source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/trunk@3
+  converting: 2/6 revisions (33.33%)
+  scanning paths: /trunk/à 0/4 (0.00%)
+  gone from -1
+  reparent to file://*/test-convert-svn-encoding.t/svn-repo (glob)
+  reparent to file://*/test-convert-svn-encoding.t/svn-repo/trunk (glob)
+  scanning paths: /trunk/è 1/4 (25.00%)
+  copied to è from é@2
+  scanning paths: /trunk/é 2/4 (50.00%)
+  gone from -1
+  reparent to file://*/test-convert-svn-encoding.t/svn-repo (glob)
+  reparent to file://*/test-convert-svn-encoding.t/svn-repo/trunk (glob)
+  scanning paths: /trunk/ù 3/4 (75.00%)
+  mark /trunk/ù came from à:2
+  à/eÌ
+  getting files: à/eÌ 1/4 (25.00%)
+  è
+  getting files: è 2/4 (50.00%)
+   è: copy é:6b67ccefd5ce6de77e7ead4f5292843a0255329f
+  é
+  getting files: é 3/4 (75.00%)
+  ù/eÌ
+  getting files: ù/eÌ 4/4 (100.00%)
+   ù/eÌ: copy à/eÌ:a9092a3d84a37b9993b5c73576f6de29b7ea50f6
+  2 remove files
+  source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/trunk@4
+  converting: 3/6 revisions (50.00%)
+  scanning paths: /trunk/è 0/2 (0.00%)
+  gone from -1
+  reparent to file://*/test-convert-svn-encoding.t/svn-repo (glob)
+  reparent to file://*/test-convert-svn-encoding.t/svn-repo/trunk (glob)
+  scanning paths: /trunk/ù 1/2 (50.00%)
+  gone from -1
+  reparent to file://*/test-convert-svn-encoding.t/svn-repo (glob)
+  reparent to file://*/test-convert-svn-encoding.t/svn-repo/trunk (glob)
+  è
+  getting files: è 1/2 (50.00%)
+  ù/eÌ
+  getting files: ù/eÌ 2/2 (100.00%)
+  1 branch to branch?
+  source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/branches/branch?@5
+  converting: 4/6 revisions (66.67%)
+  reparent to file://*/test-convert-svn-encoding.t/svn-repo/branches/branch%C3%A9 (glob)
+  scanning paths: /branches/branché 0/1 (0.00%)
+  0 branch to branch?e
+  source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/branches/branch?e@6
+  converting: 5/6 revisions (83.33%)
+  reparent to file://*/test-convert-svn-encoding.t/svn-repo/branches/branch%C3%A9e (glob)
+  scanning paths: /branches/branchée 0/1 (0.00%)
+  reparent to file://*/test-convert-svn-encoding.t/svn-repo (glob)
+  reparent to file://*/test-convert-svn-encoding.t/svn-repo/branches/branch%C3%A9e (glob)
+  reparent to file://*/test-convert-svn-encoding.t/svn-repo (glob)
+  reparent to file://*/test-convert-svn-encoding.t/svn-repo/branches/branch%C3%A9e (glob)
+  updating tags
+  .hgtags
+  run hg sink post-conversion action
+  $ cd A-hg
+  $ hg up
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+Check tags are in UTF-8
+
+  $ python -c "print '\n'.join([('%r' % l) for l in file('.hgtags', 'rb').readlines()])"
+  '221c3fdaf24df5f14c0a64c597581e2eacfb47bb branch\xc3\xa9e\n'
+  '7a40952c2db29cf00d9e31df3749e98d8a4bdcbf branch\xc3\xa9\n'
+
+  $ cd ..
--- a/tests/test-convert-svn-move	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-#!/bin/sh
-
-"$TESTDIR/hghave" svn svn-bindings || exit 80
-
-fix_path()
-{
-    tr '\\' /
-}
-
-echo "[extensions]" >> $HGRCPATH
-echo "convert = " >> $HGRCPATH
-echo "hgext.graphlog =" >> $HGRCPATH
-
-svnadmin create svn-repo
-cat "$TESTDIR/svn/move.svndump" | svnadmin load svn-repo > /dev/null
-
-svnpath=`pwd | fix_path`
-# SVN wants all paths to start with a slash. Unfortunately,
-# Windows ones don't. Handle that.
-expr "$svnpath" : "\/" > /dev/null
-if [ $? -ne 0 ]; then
-    svnpath="/$svnpath"
-fi
-svnurl="file://$svnpath/svn-repo"
-
-echo % convert trunk and branches
-hg convert --datesort "$svnurl"/subproject A-hg
-
-cd A-hg
-hg glog --template '{rev} {desc|firstline} files: {files}\n'
-echo '% check move copy records'
-hg st --rev 12:13 --copies
-echo '% check branches'
-hg branches | sed 's/:.*/:/'
-cd ..
-
-mkdir test-replace
-cd test-replace
-svnadmin create svn-repo
-cat "$TESTDIR/svn/replace.svndump" | svnadmin load svn-repo > /dev/null
-
-echo '% convert files being replaced by directories'
-hg convert svn-repo hg-repo
-cd hg-repo
-echo '% manifest before'
-hg -v manifest -r 1
-echo '% manifest after clobber1'
-hg -v manifest -r 2
-echo '% manifest after clobber2'
-hg -v manifest -r 3
-echo '% try updating'
-hg up -qC default
-cd ..
-
-echo '% test convert progress bar'
-
-echo "progress=" >> $HGRCPATH
-echo "[progress]" >> $HGRCPATH
-echo "assume-tty=1" >> $HGRCPATH
-echo "delay=0" >> $HGRCPATH
-echo "refresh=0" >> $HGRCPATH
-
-cat > filtercr.py <<EOF
-import sys, re
-for line in sys.stdin:
-    line = re.sub(r'\r+[^\n]', lambda m: '\n' + m.group()[-1:], line)
-    sys.stdout.write(line)
-EOF
-
-hg convert svn-repo hg-progress 2>&1 | python filtercr.py
--- a/tests/test-convert-svn-move.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,123 +0,0 @@
-% convert trunk and branches
-initializing destination A-hg repository
-scanning source...
-sorting...
-converting...
-13 createtrunk
-12 moved1
-11 moved1
-10 moved2
-9 changeb and rm d2
-8 changeb and rm d2
-7 moved1again
-6 moved1again
-5 copyfilefrompast
-4 copydirfrompast
-3 add d3
-2 copy dir and remove subdir
-1 add d4old
-0 rename d4old into d4new
-o  13 rename d4old into d4new files: d4new/g d4old/g
-|
-o  12 add d4old files: d4old/g
-|
-o  11 copy dir and remove subdir files: d3/d31/e d4/d31/e d4/f
-|
-o  10 add d3 files: d3/d31/e d3/f
-|
-o  9 copydirfrompast files: d2/d
-|
-o  8 copyfilefrompast files: d
-|
-o  7 moved1again files: d1/b d1/c
-|
-| o  6 moved1again files:
-| |
-o |  5 changeb and rm d2 files: d1/b d2/d
-| |
-| o  4 changeb and rm d2 files: b
-| |
-o |  3 moved2 files: d2/d
-| |
-o |  2 moved1 files: d1/b d1/c
-| |
-| o  1 moved1 files: b c
-|
-o  0 createtrunk files:
-
-% check move copy records
-A d4new/g
-  d4old/g
-R d4old/g
-% check branches
-default                       13:
-d1                             6:
-% convert files being replaced by directories
-initializing destination hg-repo repository
-scanning source...
-sorting...
-converting...
-3 initial
-2 clobber symlink
-1 clobber1
-0 clobber2
-% manifest before
-644   a
-644   d/b
-644 @ dlink
-644 @ dlink2
-644   dlink3
-% manifest after clobber1
-644   a/b
-644   d/b
-644   dlink/b
-644 @ dlink2
-644   dlink3
-% manifest after clobber2
-644   a/b
-644   d/b
-644   dlink/b
-644 @ dlink2
-644 @ dlink3
-% try updating
-% test convert progress bar
-
-scanning [ <=>                                                              ] 1
-scanning [  <=>                                                             ] 2
-scanning [   <=>                                                            ] 3
-scanning [    <=>                                                           ] 4
-                                                                                
-converting [                                                              ] 0/4
-getting files [==========>                                                ] 1/5
-getting files [======================>                                    ] 2/5
-getting files [==================================>                        ] 3/5
-getting files [==============================================>            ] 4/5
-getting files [==========================================================>] 5/5
-                                                                                
-converting [==============>                                               ] 1/4
-scanning paths [                                                          ] 0/1
-                                                                                
-getting files [==========================================================>] 1/1
-                                                                                
-converting [==============================>                               ] 2/4
-scanning paths [                                                          ] 0/2
-scanning paths [============================>                             ] 1/2
-                                                                                
-getting files [=============>                                             ] 1/4
-getting files [============================>                              ] 2/4
-getting files [===========================================>               ] 3/4
-getting files [==========================================================>] 4/4
-                                                                                
-converting [=============================================>                ] 3/4
-scanning paths [                                                          ] 0/1
-                                                                                
-getting files [==========================================================>] 1/1
-                                                                                
-initializing destination hg-progress repository
-scanning source...
-sorting...
-converting...
-3 initial
-2 clobber symlink
-1 clobber1
-0 clobber2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-convert-svn-move.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,202 @@
+
+  $ "$TESTDIR/hghave" svn svn-bindings || exit 80
+
+  $ fixpath()
+  > {
+  >     tr '\\' /
+  > }
+  $ cat > $HGRCPATH <<EOF
+  > [extensions]
+  > convert = 
+  > graphlog =
+  > EOF
+
+  $ svnadmin create svn-repo
+  $ svnadmin load -q svn-repo < "$TESTDIR/svn/move.svndump"
+  $ svnpath=`pwd | fixpath`
+
+SVN wants all paths to start with a slash. Unfortunately,
+Windows ones don't. Handle that.
+
+  $ expr "$svnpath" : "\/" > /dev/null
+  > if [ $? -ne 0 ]; then
+  >   svnpath="/$svnpath"
+  > fi
+  > svnurl="file://$svnpath/svn-repo"
+
+Convert trunk and branches
+
+  $ hg convert --datesort "$svnurl"/subproject A-hg
+  initializing destination A-hg repository
+  scanning source...
+  sorting...
+  converting...
+  13 createtrunk
+  12 moved1
+  11 moved1
+  10 moved2
+  9 changeb and rm d2
+  8 changeb and rm d2
+  7 moved1again
+  6 moved1again
+  5 copyfilefrompast
+  4 copydirfrompast
+  3 add d3
+  2 copy dir and remove subdir
+  1 add d4old
+  0 rename d4old into d4new
+
+  $ cd A-hg
+  $ hg glog --template '{rev} {desc|firstline} files: {files}\n'
+  o  13 rename d4old into d4new files: d4new/g d4old/g
+  |
+  o  12 add d4old files: d4old/g
+  |
+  o  11 copy dir and remove subdir files: d3/d31/e d4/d31/e d4/f
+  |
+  o  10 add d3 files: d3/d31/e d3/f
+  |
+  o  9 copydirfrompast files: d2/d
+  |
+  o  8 copyfilefrompast files: d
+  |
+  o  7 moved1again files: d1/b d1/c
+  |
+  | o  6 moved1again files:
+  | |
+  o |  5 changeb and rm d2 files: d1/b d2/d
+  | |
+  | o  4 changeb and rm d2 files: b
+  | |
+  o |  3 moved2 files: d2/d
+  | |
+  o |  2 moved1 files: d1/b d1/c
+  | |
+  | o  1 moved1 files: b c
+  |
+  o  0 createtrunk files:
+  
+
+Check move copy records
+
+  $ hg st --rev 12:13 --copies
+  A d4new/g
+    d4old/g
+  R d4old/g
+
+Check branches
+
+  $ hg branches
+  default                       13:* (glob)
+  d1                             6:* (glob)
+  $ cd ..
+
+  $ mkdir test-replace
+  $ cd test-replace
+  $ svnadmin create svn-repo
+  $ svnadmin load -q svn-repo < "$TESTDIR/svn/replace.svndump"
+
+Convert files being replaced by directories
+
+  $ hg convert svn-repo hg-repo
+  initializing destination hg-repo repository
+  scanning source...
+  sorting...
+  converting...
+  3 initial
+  2 clobber symlink
+  1 clobber1
+  0 clobber2
+
+  $ cd hg-repo
+
+Manifest before
+
+  $ hg -v manifest -r 1
+  644   a
+  644   d/b
+  644 @ dlink
+  644 @ dlink2
+  644   dlink3
+
+Manifest after clobber1
+
+  $ hg -v manifest -r 2
+  644   a/b
+  644   d/b
+  644   dlink/b
+  644 @ dlink2
+  644   dlink3
+
+Manifest after clobber2
+
+  $ hg -v manifest -r 3
+  644   a/b
+  644   d/b
+  644   dlink/b
+  644 @ dlink2
+  644 @ dlink3
+
+Try updating
+
+  $ hg up -qC default
+  $ cd ..
+
+Test convert progress bar'
+
+  $ cat >> $HGRCPATH <<EOF
+  > [extensions]
+  > progress = 
+  > [progress]
+  > assume-tty = 1
+  > delay = 0
+  > refresh = 0
+  > EOF
+  $ cat > filtercr.py <<EOF
+  > import sys, re
+  > for line in sys.stdin:
+  >     line = re.sub(r'\r+[^\n]', lambda m: '\n' + m.group()[-1:], line)
+  >     sys.stdout.write(line)
+  > EOF
+
+  $ hg convert svn-repo hg-progress 2>&1 | python filtercr.py
+  
+  scanning [ <=>                                                              ] 1
+  scanning [  <=>                                                             ] 2
+  scanning [   <=>                                                            ] 3
+  scanning [    <=>                                                           ] 4
+                                                                                  
+  converting [                                                              ] 0/4
+  getting files [==========>                                                ] 1/5
+  getting files [======================>                                    ] 2/5
+  getting files [==================================>                        ] 3/5
+  getting files [==============================================>            ] 4/5
+  getting files [==========================================================>] 5/5
+                                                                                  
+  converting [==============>                                               ] 1/4
+  scanning paths [                                                          ] 0/1
+                                                                                  
+  getting files [==========================================================>] 1/1
+                                                                                  
+  converting [==============================>                               ] 2/4
+  scanning paths [                                                          ] 0/2
+  scanning paths [============================>                             ] 1/2
+                                                                                  
+  getting files [=============>                                             ] 1/4
+  getting files [============================>                              ] 2/4
+  getting files [===========================================>               ] 3/4
+  getting files [==========================================================>] 4/4
+                                                                                  
+  converting [=============================================>                ] 3/4
+  scanning paths [                                                          ] 0/1
+                                                                                  
+  getting files [==========================================================>] 1/1
+                                                                                  
+  initializing destination hg-progress repository
+  scanning source...
+  sorting...
+  converting...
+  3 initial
+  2 clobber symlink
+  1 clobber1
+  0 clobber2
--- a/tests/test-convert-svn-sink	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,150 +0,0 @@
-#!/bin/sh
-
-"$TESTDIR/hghave" svn svn-bindings no-outer-repo || exit 80
-
-fixpath()
-{
-    tr '\\' /
-}
-
-svnupanddisplay()
-{
-    (
-       cd $1;
-       svn up;
-       svn st -v | fixpath | sed 's/  */ /g'
-       limit=''
-       if [ $2 -gt 0 ]; then
-           limit="--limit=$2"
-       fi
-       svn log --xml -v $limit | fixpath | sed 's,<date>.*,<date/>,' | grep -v 'kind="'
-    )
-}
-
-echo "[extensions]" >> $HGRCPATH
-echo "convert = " >> $HGRCPATH
-
-hg init a
-
-echo a > a/a
-mkdir -p a/d1/d2
-echo b > a/d1/d2/b
-ln -s a/missing a/link
-echo % add
-hg --cwd a ci -d '0 0' -A -m 'add a file'
-
-"$TESTDIR/svn-safe-append.py" a a/a
-echo % modify
-hg --cwd a ci -d '1 0' -m 'modify a file'
-hg --cwd a tip -q
-
-hg convert -d svn a
-svnupanddisplay a-hg-wc 2
-ls a a-hg-wc
-cmp a/a a-hg-wc/a && echo same || echo different
-
-hg --cwd a mv a b
-hg --cwd a mv link newlink
-echo % rename
-hg --cwd a ci -d '2 0' -m 'rename a file'
-hg --cwd a tip -q
-
-hg convert -d svn a
-svnupanddisplay a-hg-wc 1
-ls a a-hg-wc
-
-hg --cwd a cp b c
-echo % copy
-hg --cwd a ci -d '3 0' -m 'copy a file'
-hg --cwd a tip -q
-
-hg convert -d svn a
-svnupanddisplay a-hg-wc 1
-ls a a-hg-wc
-
-hg --cwd a rm b
-echo % remove
-hg --cwd a ci -d '4 0' -m 'remove a file'
-hg --cwd a tip -q
-
-hg convert -d svn a
-svnupanddisplay a-hg-wc 1
-ls a a-hg-wc
-
-chmod +x a/c
-echo % executable
-hg --cwd a ci -d '5 0' -m 'make a file executable'
-hg --cwd a tip -q
-
-hg convert -d svn a
-svnupanddisplay a-hg-wc 1
-test -x a-hg-wc/c && echo executable || echo not executable
-
-echo % executable in new directory
-
-rm -rf a a-hg a-hg-wc
-hg init a
-
-mkdir a/d1
-echo a > a/d1/a
-chmod +x a/d1/a
-hg --cwd a ci -d '0 0' -A -m 'add executable file in new directory'
-
-hg convert -d svn a
-svnupanddisplay a-hg-wc 1
-test -x a-hg-wc/d1/a && echo executable || echo not executable
-
-echo % copy to new directory
-
-mkdir a/d2
-hg --cwd a cp d1/a d2/a
-hg --cwd a ci -d '1 0' -A -m 'copy file to new directory'
-
-hg convert -d svn a
-svnupanddisplay a-hg-wc 1
-
-echo % branchy history
-
-hg init b
-echo base > b/b
-hg --cwd b ci -d '0 0' -Ambase
-
-"$TESTDIR/svn-safe-append.py" left-1 b/b
-echo left-1 > b/left-1
-hg --cwd b ci -d '1 0' -Amleft-1
-
-"$TESTDIR/svn-safe-append.py" left-2 b/b
-echo left-2 > b/left-2
-hg --cwd b ci -d '2 0' -Amleft-2
-
-hg --cwd b up 0
-
-"$TESTDIR/svn-safe-append.py" right-1 b/b
-echo right-1 > b/right-1
-hg --cwd b ci -d '3 0' -Amright-1
-
-"$TESTDIR/svn-safe-append.py" right-2 b/b
-echo right-2 > b/right-2
-hg --cwd b ci -d '4 0' -Amright-2
-
-hg --cwd b up -C 2
-hg --cwd b merge
-hg --cwd b revert -r 2 b
-hg resolve -m b
-hg --cwd b ci -d '5 0' -m 'merge'
-
-hg convert -d svn b
-echo % expect 4 changes
-svnupanddisplay b-hg-wc 0
-
-echo % tags are not supported, but must not break conversion
-
-rm -rf a a-hg a-hg-wc
-hg init a
-echo a > a/a
-hg --cwd a ci -d '0 0' -A -m 'Add file a'
-hg --cwd a tag -d '1 0' -m 'Tagged as v1.0' v1.0
-
-hg convert -d svn a
-svnupanddisplay a-hg-wc 2
-rm -rf a a-hg a-hg-wc
--- a/tests/test-convert-svn-sink.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,397 +0,0 @@
-% add
-adding a
-adding d1/d2/b
-adding link
-% modify
-1:8231f652da37
-assuming destination a-hg
-initializing svn repository 'a-hg'
-initializing svn working copy 'a-hg-wc'
-scanning source...
-sorting...
-converting...
-1 add a file
-0 modify a file
-At revision 2.
- 2 2 test .
- 2 2 test a
- 2 1 test d1
- 2 1 test d1/d2
- 2 1 test d1/d2/b
- 2 1 test link
-<?xml version="1.0"?>
-<log>
-<logentry
-   revision="2">
-<author>test</author>
-<date/>
-<paths>
-<path
-   action="M">/a</path>
-</paths>
-<msg>modify a file</msg>
-</logentry>
-<logentry
-   revision="1">
-<author>test</author>
-<date/>
-<paths>
-<path
-   action="A">/a</path>
-<path
-   action="A">/d1</path>
-<path
-   action="A">/d1/d2</path>
-<path
-   action="A">/d1/d2/b</path>
-<path
-   action="A">/link</path>
-</paths>
-<msg>add a file</msg>
-</logentry>
-</log>
-a:
-a
-d1
-link
-
-a-hg-wc:
-a
-d1
-link
-same
-% rename
-2:a67e26ccec09
-assuming destination a-hg
-initializing svn working copy 'a-hg-wc'
-scanning source...
-sorting...
-converting...
-0 rename a file
-At revision 3.
- 3 3 test .
- 3 3 test b
- 3 1 test d1
- 3 1 test d1/d2
- 3 1 test d1/d2/b
- 3 3 test newlink
-<?xml version="1.0"?>
-<log>
-<logentry
-   revision="3">
-<author>test</author>
-<date/>
-<paths>
-<path
-   action="D">/a</path>
-<path
-   copyfrom-path="/a"
-   copyfrom-rev="2"
-   action="A">/b</path>
-<path
-   copyfrom-path="/link"
-   copyfrom-rev="2"
-   action="A">/newlink</path>
-<path
-   action="D">/link</path>
-</paths>
-<msg>rename a file</msg>
-</logentry>
-</log>
-a:
-b
-d1
-newlink
-
-a-hg-wc:
-b
-d1
-newlink
-% copy
-3:0cf087b9ab02
-assuming destination a-hg
-initializing svn working copy 'a-hg-wc'
-scanning source...
-sorting...
-converting...
-0 copy a file
-At revision 4.
- 4 4 test .
- 4 3 test b
- 4 4 test c
- 4 1 test d1
- 4 1 test d1/d2
- 4 1 test d1/d2/b
- 4 3 test newlink
-<?xml version="1.0"?>
-<log>
-<logentry
-   revision="4">
-<author>test</author>
-<date/>
-<paths>
-<path
-   copyfrom-path="/b"
-   copyfrom-rev="3"
-   action="A">/c</path>
-</paths>
-<msg>copy a file</msg>
-</logentry>
-</log>
-a:
-b
-c
-d1
-newlink
-
-a-hg-wc:
-b
-c
-d1
-newlink
-% remove
-4:07b2e34a5b17
-assuming destination a-hg
-initializing svn working copy 'a-hg-wc'
-scanning source...
-sorting...
-converting...
-0 remove a file
-At revision 5.
- 5 5 test .
- 5 4 test c
- 5 1 test d1
- 5 1 test d1/d2
- 5 1 test d1/d2/b
- 5 3 test newlink
-<?xml version="1.0"?>
-<log>
-<logentry
-   revision="5">
-<author>test</author>
-<date/>
-<paths>
-<path
-   action="D">/b</path>
-</paths>
-<msg>remove a file</msg>
-</logentry>
-</log>
-a:
-c
-d1
-newlink
-
-a-hg-wc:
-c
-d1
-newlink
-% executable
-5:31093672760b
-assuming destination a-hg
-initializing svn working copy 'a-hg-wc'
-scanning source...
-sorting...
-converting...
-0 make a file executable
-At revision 6.
- 6 6 test .
- 6 6 test c
- 6 1 test d1
- 6 1 test d1/d2
- 6 1 test d1/d2/b
- 6 3 test newlink
-<?xml version="1.0"?>
-<log>
-<logentry
-   revision="6">
-<author>test</author>
-<date/>
-<paths>
-<path
-   action="M">/c</path>
-</paths>
-<msg>make a file executable</msg>
-</logentry>
-</log>
-executable
-% executable in new directory
-adding d1/a
-assuming destination a-hg
-initializing svn repository 'a-hg'
-initializing svn working copy 'a-hg-wc'
-scanning source...
-sorting...
-converting...
-0 add executable file in new directory
-At revision 1.
- 1 1 test .
- 1 1 test d1
- 1 1 test d1/a
-<?xml version="1.0"?>
-<log>
-<logentry
-   revision="1">
-<author>test</author>
-<date/>
-<paths>
-<path
-   action="A">/d1</path>
-<path
-   action="A">/d1/a</path>
-</paths>
-<msg>add executable file in new directory</msg>
-</logentry>
-</log>
-executable
-% copy to new directory
-assuming destination a-hg
-initializing svn working copy 'a-hg-wc'
-scanning source...
-sorting...
-converting...
-0 copy file to new directory
-At revision 2.
- 2 2 test .
- 2 1 test d1
- 2 1 test d1/a
- 2 2 test d2
- 2 2 test d2/a
-<?xml version="1.0"?>
-<log>
-<logentry
-   revision="2">
-<author>test</author>
-<date/>
-<paths>
-<path
-   action="A">/d2</path>
-<path
-   copyfrom-path="/d1/a"
-   copyfrom-rev="1"
-   action="A">/d2/a</path>
-</paths>
-<msg>copy file to new directory</msg>
-</logentry>
-</log>
-% branchy history
-adding b
-adding left-1
-adding left-2
-1 files updated, 0 files merged, 2 files removed, 0 files unresolved
-adding right-1
-created new head
-adding right-2
-3 files updated, 0 files merged, 2 files removed, 0 files unresolved
-merging b
-warning: conflicts during merge.
-merging b failed!
-2 files updated, 0 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
-assuming destination b-hg
-initializing svn repository 'b-hg'
-initializing svn working copy 'b-hg-wc'
-scanning source...
-sorting...
-converting...
-5 base
-4 left-1
-3 left-2
-2 right-1
-1 right-2
-0 merge
-% expect 4 changes
-At revision 4.
- 4 4 test .
- 4 3 test b
- 4 2 test left-1
- 4 3 test left-2
- 4 4 test right-1
- 4 4 test right-2
-<?xml version="1.0"?>
-<log>
-<logentry
-   revision="4">
-<author>test</author>
-<date/>
-<paths>
-<path
-   action="A">/right-1</path>
-<path
-   action="A">/right-2</path>
-</paths>
-<msg>merge</msg>
-</logentry>
-<logentry
-   revision="3">
-<author>test</author>
-<date/>
-<paths>
-<path
-   action="M">/b</path>
-<path
-   action="A">/left-2</path>
-</paths>
-<msg>left-2</msg>
-</logentry>
-<logentry
-   revision="2">
-<author>test</author>
-<date/>
-<paths>
-<path
-   action="M">/b</path>
-<path
-   action="A">/left-1</path>
-</paths>
-<msg>left-1</msg>
-</logentry>
-<logentry
-   revision="1">
-<author>test</author>
-<date/>
-<paths>
-<path
-   action="A">/b</path>
-</paths>
-<msg>base</msg>
-</logentry>
-</log>
-% tags are not supported, but must not break conversion
-adding a
-assuming destination a-hg
-initializing svn repository 'a-hg'
-initializing svn working copy 'a-hg-wc'
-scanning source...
-sorting...
-converting...
-1 Add file a
-0 Tagged as v1.0
-writing Subversion tags is not yet implemented
-At revision 2.
- 2 2 test .
- 2 1 test a
- 2 2 test .hgtags
-<?xml version="1.0"?>
-<log>
-<logentry
-   revision="2">
-<author>test</author>
-<date/>
-<paths>
-<path
-   action="A">/.hgtags</path>
-</paths>
-<msg>Tagged as v1.0</msg>
-</logentry>
-<logentry
-   revision="1">
-<author>test</author>
-<date/>
-<paths>
-<path
-   action="A">/a</path>
-</paths>
-<msg>Add file a</msg>
-</logentry>
-</log>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-convert-svn-sink.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,548 @@
+
+  $ "$TESTDIR/hghave" svn svn-bindings no-outer-repo || exit 80
+
+  $ fixpath()
+  > {
+  >     tr '\\' /
+  > }
+  $ svnupanddisplay()
+  > {
+  >     (
+  >        cd $1;
+  >        svn up;
+  >        svn st -v | fixpath | sed 's/  */ /g'
+  >        limit=''
+  >        if [ $2 -gt 0 ]; then
+  >            limit="--limit=$2"
+  >        fi
+  >        svn log --xml -v $limit \
+  >            | fixpath \
+  >            | sed 's,<date>.*,<date/>,' \
+  >            | grep -v 'kind="'
+  >     )
+  > }
+
+  $ cat > $HGRCPATH <<EOF
+  > [extensions]
+  > convert = 
+  > graphlog =
+  > EOF
+
+  $ hg init a
+
+Add
+
+  $ echo a > a/a
+  $ mkdir -p a/d1/d2
+  $ echo b > a/d1/d2/b
+  $ ln -s a/missing a/link
+  $ hg --cwd a ci -d '0 0' -A -m 'add a file'
+  adding a
+  adding d1/d2/b
+  adding link
+
+Modify
+
+  $ "$TESTDIR/svn-safe-append.py" a a/a
+  $ hg --cwd a ci -d '1 0' -m 'modify a file'
+  $ hg --cwd a tip -q
+  1:8231f652da37
+
+  $ hg convert -d svn a
+  assuming destination a-hg
+  initializing svn repository 'a-hg'
+  initializing svn working copy 'a-hg-wc'
+  scanning source...
+  sorting...
+  converting...
+  1 add a file
+  0 modify a file
+  $ svnupanddisplay a-hg-wc 2
+  At revision 2.
+   2 2 test .
+   2 2 test a
+   2 1 test d1
+   2 1 test d1/d2
+   2 1 test d1/d2/b
+   2 1 test link
+  <?xml version="1.0"?>
+  <log>
+  <logentry
+     revision="2">
+  <author>test</author>
+  <date/>
+  <paths>
+  <path
+     action="M">/a</path>
+  </paths>
+  <msg>modify a file</msg>
+  </logentry>
+  <logentry
+     revision="1">
+  <author>test</author>
+  <date/>
+  <paths>
+  <path
+     action="A">/a</path>
+  <path
+     action="A">/d1</path>
+  <path
+     action="A">/d1/d2</path>
+  <path
+     action="A">/d1/d2/b</path>
+  <path
+     action="A">/link</path>
+  </paths>
+  <msg>add a file</msg>
+  </logentry>
+  </log>
+  $ ls a a-hg-wc
+  a:
+  a
+  d1
+  link
+  
+  a-hg-wc:
+  a
+  d1
+  link
+  $ cmp a/a a-hg-wc/a
+
+Rename
+
+  $ hg --cwd a mv a b
+  $ hg --cwd a mv link newlink
+
+  $ hg --cwd a ci -d '2 0' -m 'rename a file'
+  $ hg --cwd a tip -q
+  2:a67e26ccec09
+
+  $ hg convert -d svn a
+  assuming destination a-hg
+  initializing svn working copy 'a-hg-wc'
+  scanning source...
+  sorting...
+  converting...
+  0 rename a file
+  $ svnupanddisplay a-hg-wc 1
+  At revision 3.
+   3 3 test .
+   3 3 test b
+   3 1 test d1
+   3 1 test d1/d2
+   3 1 test d1/d2/b
+   3 3 test newlink
+  <?xml version="1.0"?>
+  <log>
+  <logentry
+     revision="3">
+  <author>test</author>
+  <date/>
+  <paths>
+  <path
+     action="D">/a</path>
+  <path
+     copyfrom-path="/a"
+     copyfrom-rev="2"
+     action="A">/b</path>
+  <path
+     copyfrom-path="/link"
+     copyfrom-rev="2"
+     action="A">/newlink</path>
+  <path
+     action="D">/link</path>
+  </paths>
+  <msg>rename a file</msg>
+  </logentry>
+  </log>
+  $ ls a a-hg-wc
+  a:
+  b
+  d1
+  newlink
+  
+  a-hg-wc:
+  b
+  d1
+  newlink
+
+Copy
+
+  $ hg --cwd a cp b c
+
+  $ hg --cwd a ci -d '3 0' -m 'copy a file'
+  $ hg --cwd a tip -q
+  3:0cf087b9ab02
+
+  $ hg convert -d svn a
+  assuming destination a-hg
+  initializing svn working copy 'a-hg-wc'
+  scanning source...
+  sorting...
+  converting...
+  0 copy a file
+  $ svnupanddisplay a-hg-wc 1
+  At revision 4.
+   4 4 test .
+   4 3 test b
+   4 4 test c
+   4 1 test d1
+   4 1 test d1/d2
+   4 1 test d1/d2/b
+   4 3 test newlink
+  <?xml version="1.0"?>
+  <log>
+  <logentry
+     revision="4">
+  <author>test</author>
+  <date/>
+  <paths>
+  <path
+     copyfrom-path="/b"
+     copyfrom-rev="3"
+     action="A">/c</path>
+  </paths>
+  <msg>copy a file</msg>
+  </logentry>
+  </log>
+  $ ls a a-hg-wc
+  a:
+  b
+  c
+  d1
+  newlink
+  
+  a-hg-wc:
+  b
+  c
+  d1
+  newlink
+
+  $ hg --cwd a rm b
+  $ echo % remove
+  % remove
+  $ hg --cwd a ci -d '4 0' -m 'remove a file'
+  $ hg --cwd a tip -q
+  4:07b2e34a5b17
+
+  $ hg convert -d svn a
+  assuming destination a-hg
+  initializing svn working copy 'a-hg-wc'
+  scanning source...
+  sorting...
+  converting...
+  0 remove a file
+  $ svnupanddisplay a-hg-wc 1
+  At revision 5.
+   5 5 test .
+   5 4 test c
+   5 1 test d1
+   5 1 test d1/d2
+   5 1 test d1/d2/b
+   5 3 test newlink
+  <?xml version="1.0"?>
+  <log>
+  <logentry
+     revision="5">
+  <author>test</author>
+  <date/>
+  <paths>
+  <path
+     action="D">/b</path>
+  </paths>
+  <msg>remove a file</msg>
+  </logentry>
+  </log>
+  $ ls a a-hg-wc
+  a:
+  c
+  d1
+  newlink
+  
+  a-hg-wc:
+  c
+  d1
+  newlink
+
+Exectutable
+
+  $ chmod +x a/c
+  $ hg --cwd a ci -d '5 0' -m 'make a file executable'
+  $ hg --cwd a tip -q
+  5:31093672760b
+
+  $ hg convert -d svn a
+  assuming destination a-hg
+  initializing svn working copy 'a-hg-wc'
+  scanning source...
+  sorting...
+  converting...
+  0 make a file executable
+  $ svnupanddisplay a-hg-wc 1
+  At revision 6.
+   6 6 test .
+   6 6 test c
+   6 1 test d1
+   6 1 test d1/d2
+   6 1 test d1/d2/b
+   6 3 test newlink
+  <?xml version="1.0"?>
+  <log>
+  <logentry
+     revision="6">
+  <author>test</author>
+  <date/>
+  <paths>
+  <path
+     action="M">/c</path>
+  </paths>
+  <msg>make a file executable</msg>
+  </logentry>
+  </log>
+  $ test -x a-hg-wc/c
+
+Executable in new directory
+
+  $ rm -rf a a-hg a-hg-wc
+  $ hg init a
+
+  $ mkdir a/d1
+  $ echo a > a/d1/a
+  $ chmod +x a/d1/a
+  $ hg --cwd a ci -d '0 0' -A -m 'add executable file in new directory'
+  adding d1/a
+
+  $ hg convert -d svn a
+  assuming destination a-hg
+  initializing svn repository 'a-hg'
+  initializing svn working copy 'a-hg-wc'
+  scanning source...
+  sorting...
+  converting...
+  0 add executable file in new directory
+  $ svnupanddisplay a-hg-wc 1
+  At revision 1.
+   1 1 test .
+   1 1 test d1
+   1 1 test d1/a
+  <?xml version="1.0"?>
+  <log>
+  <logentry
+     revision="1">
+  <author>test</author>
+  <date/>
+  <paths>
+  <path
+     action="A">/d1</path>
+  <path
+     action="A">/d1/a</path>
+  </paths>
+  <msg>add executable file in new directory</msg>
+  </logentry>
+  </log>
+  $ test -x a-hg-wc/d1/a
+
+Copy to new directory
+
+  $ mkdir a/d2
+  $ hg --cwd a cp d1/a d2/a
+  $ hg --cwd a ci -d '1 0' -A -m 'copy file to new directory'
+
+  $ hg convert -d svn a
+  assuming destination a-hg
+  initializing svn working copy 'a-hg-wc'
+  scanning source...
+  sorting...
+  converting...
+  0 copy file to new directory
+  $ svnupanddisplay a-hg-wc 1
+  At revision 2.
+   2 2 test .
+   2 1 test d1
+   2 1 test d1/a
+   2 2 test d2
+   2 2 test d2/a
+  <?xml version="1.0"?>
+  <log>
+  <logentry
+     revision="2">
+  <author>test</author>
+  <date/>
+  <paths>
+  <path
+     action="A">/d2</path>
+  <path
+     copyfrom-path="/d1/a"
+     copyfrom-rev="1"
+     action="A">/d2/a</path>
+  </paths>
+  <msg>copy file to new directory</msg>
+  </logentry>
+  </log>
+
+Branchy history
+
+  $ hg init b
+  $ echo base > b/b
+  $ hg --cwd b ci -d '0 0' -Ambase
+  adding b
+
+  $ "$TESTDIR/svn-safe-append.py" left-1 b/b
+  $ echo left-1 > b/left-1
+  $ hg --cwd b ci -d '1 0' -Amleft-1
+  adding left-1
+
+  $ "$TESTDIR/svn-safe-append.py" left-2 b/b
+  $ echo left-2 > b/left-2
+  $ hg --cwd b ci -d '2 0' -Amleft-2
+  adding left-2
+
+  $ hg --cwd b up 0
+  1 files updated, 0 files merged, 2 files removed, 0 files unresolved
+
+  $ "$TESTDIR/svn-safe-append.py" right-1 b/b
+  $ echo right-1 > b/right-1
+  $ hg --cwd b ci -d '3 0' -Amright-1
+  adding right-1
+  created new head
+
+  $ "$TESTDIR/svn-safe-append.py" right-2 b/b
+  $ echo right-2 > b/right-2
+  $ hg --cwd b ci -d '4 0' -Amright-2
+  adding right-2
+
+  $ hg --cwd b up -C 2
+  3 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  $ hg --cwd b merge
+  merging b
+  warning: conflicts during merge.
+  merging b failed!
+  2 files updated, 0 files merged, 0 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
+  [1]
+  $ hg --cwd b revert -r 2 b
+  $ hg resolve -m b
+  $ hg --cwd b ci -d '5 0' -m 'merge'
+
+Expect 4 changes
+
+  $ hg convert -d svn b
+  assuming destination b-hg
+  initializing svn repository 'b-hg'
+  initializing svn working copy 'b-hg-wc'
+  scanning source...
+  sorting...
+  converting...
+  5 base
+  4 left-1
+  3 left-2
+  2 right-1
+  1 right-2
+  0 merge
+
+  $ svnupanddisplay b-hg-wc 0
+  At revision 4.
+   4 4 test .
+   4 3 test b
+   4 2 test left-1
+   4 3 test left-2
+   4 4 test right-1
+   4 4 test right-2
+  <?xml version="1.0"?>
+  <log>
+  <logentry
+     revision="4">
+  <author>test</author>
+  <date/>
+  <paths>
+  <path
+     action="A">/right-1</path>
+  <path
+     action="A">/right-2</path>
+  </paths>
+  <msg>merge</msg>
+  </logentry>
+  <logentry
+     revision="3">
+  <author>test</author>
+  <date/>
+  <paths>
+  <path
+     action="M">/b</path>
+  <path
+     action="A">/left-2</path>
+  </paths>
+  <msg>left-2</msg>
+  </logentry>
+  <logentry
+     revision="2">
+  <author>test</author>
+  <date/>
+  <paths>
+  <path
+     action="M">/b</path>
+  <path
+     action="A">/left-1</path>
+  </paths>
+  <msg>left-1</msg>
+  </logentry>
+  <logentry
+     revision="1">
+  <author>test</author>
+  <date/>
+  <paths>
+  <path
+     action="A">/b</path>
+  </paths>
+  <msg>base</msg>
+  </logentry>
+  </log>
+
+Tags are not supported, but must not break conversion
+
+  $ rm -rf a a-hg a-hg-wc
+  $ hg init a
+  $ echo a > a/a
+  $ hg --cwd a ci -d '0 0' -A -m 'Add file a'
+  adding a
+  $ hg --cwd a tag -d '1 0' -m 'Tagged as v1.0' v1.0
+
+  $ hg convert -d svn a
+  assuming destination a-hg
+  initializing svn repository 'a-hg'
+  initializing svn working copy 'a-hg-wc'
+  scanning source...
+  sorting...
+  converting...
+  1 Add file a
+  0 Tagged as v1.0
+  writing Subversion tags is not yet implemented
+  $ svnupanddisplay a-hg-wc 2
+  At revision 2.
+   2 2 test .
+   2 1 test a
+   2 2 test .hgtags
+  <?xml version="1.0"?>
+  <log>
+  <logentry
+     revision="2">
+  <author>test</author>
+  <date/>
+  <paths>
+  <path
+     action="A">/.hgtags</path>
+  </paths>
+  <msg>Tagged as v1.0</msg>
+  </logentry>
+  <logentry
+     revision="1">
+  <author>test</author>
+  <date/>
+  <paths>
+  <path
+     action="A">/a</path>
+  </paths>
+  <msg>Add file a</msg>
+  </logentry>
+  </log>
+  $ rm -rf a a-hg a-hg-wc
--- a/tests/test-convert-svn-source	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +0,0 @@
-#!/bin/sh
-
-"$TESTDIR/hghave" svn svn-bindings || exit 80
-
-fix_path()
-{
-    tr '\\' /
-}
-
-echo "[extensions]" >> $HGRCPATH
-echo "convert = " >> $HGRCPATH
-echo 'graphlog =' >> $HGRCPATH
-
-svnadmin create svn-repo
-
-svnpath=`pwd | fix_path`
-# SVN wants all paths to start with a slash. Unfortunately,
-# Windows ones don't. Handle that.
-expr "$svnpath" : "\/" > /dev/null
-if [ $? -ne 0 ]; then
-    svnpath="/$svnpath"
-fi
-
-echo "# now tests that it works with trunk/tags layout, but no branches yet"
-echo
-echo % initial svn import
-mkdir projB
-cd projB
-mkdir trunk
-mkdir tags
-cd ..
-
-svnurl="file://$svnpath/svn-repo/proj%20B"
-svn import -m "init projB" projB "$svnurl" | fix_path
-
-
-echo % update svn repository
-svn co "$svnurl"/trunk B | fix_path
-cd B
-echo hello > 'letter .txt'
-svn add 'letter .txt'
-svn ci -m hello
-
-"$TESTDIR/svn-safe-append.py" world 'letter .txt'
-svn ci -m world
-
-svn copy -m "tag v0.1" "$svnurl"/trunk "$svnurl"/tags/v0.1
-
-"$TESTDIR/svn-safe-append.py" 'nice day today!' 'letter .txt'
-svn ci -m "nice day"
-cd ..
-
-echo % convert to hg once
-hg convert "$svnurl" B-hg
-
-echo % update svn repository again
-cd B
-"$TESTDIR/svn-safe-append.py" "see second letter" 'letter .txt'
-echo "nice to meet you" > letter2.txt
-svn add letter2.txt
-svn ci -m "second letter"
-
-svn copy -m "tag v0.2" "$svnurl"/trunk "$svnurl"/tags/v0.2
-
-"$TESTDIR/svn-safe-append.py" "blah-blah-blah" letter2.txt
-svn ci -m "work in progress"
-cd ..
-
-########################################
-
-echo % test incremental conversion
-hg convert "$svnurl" B-hg
-
-cd B-hg
-hg glog --template '{rev} {desc|firstline} files: {files}\n'
-hg tags -q
-cd ..
-
-echo % test filemap
-echo 'include letter2.txt' > filemap
-hg convert --filemap filemap "$svnurl"/trunk fmap
-hg glog -R fmap --template '{rev} {desc|firstline} files: {files}\n'
-
-echo % test stop revision
-hg convert --rev 1 "$svnurl"/trunk stoprev
-# Check convert_revision extra-records.
-# This is also the only place testing more than one extra field
-# in a revision.
-hg --cwd stoprev tip --debug | grep extra | sed 's/=.*/=/'
--- a/tests/test-convert-svn-source.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,91 +0,0 @@
-# now tests that it works with trunk/tags layout, but no branches yet
-
-% initial svn import
-Adding         projB/trunk
-Adding         projB/tags
-
-Committed revision 1.
-% update svn repository
-Checked out revision 1.
-A         letter .txt
-Adding         letter .txt
-Transmitting file data .
-Committed revision 2.
-Sending        letter .txt
-Transmitting file data .
-Committed revision 3.
-
-Committed revision 4.
-Sending        letter .txt
-Transmitting file data .
-Committed revision 5.
-% convert to hg once
-initializing destination B-hg repository
-scanning source...
-sorting...
-converting...
-3 init projB
-2 hello
-1 world
-0 nice day
-updating tags
-% update svn repository again
-A         letter2.txt
-Sending        letter .txt
-Adding         letter2.txt
-Transmitting file data ..
-Committed revision 6.
-
-Committed revision 7.
-Sending        letter2.txt
-Transmitting file data .
-Committed revision 8.
-% test incremental conversion
-scanning source...
-sorting...
-converting...
-1 second letter
-0 work in progress
-updating tags
-o  7 update tags files: .hgtags
-|
-o  6 work in progress files: letter2.txt
-|
-o  5 second letter files: letter .txt letter2.txt
-|
-o  4 update tags files: .hgtags
-|
-o  3 nice day files: letter .txt
-|
-o  2 world files: letter .txt
-|
-o  1 hello files: letter .txt
-|
-o  0 init projB files:
-
-tip
-v0.2
-v0.1
-% test filemap
-initializing destination fmap repository
-scanning source...
-sorting...
-converting...
-5 init projB
-4 hello
-3 world
-2 nice day
-1 second letter
-0 work in progress
-o  1 work in progress files: letter2.txt
-|
-o  0 second letter files: letter2.txt
-
-% test stop revision
-initializing destination stoprev repository
-scanning source...
-sorting...
-converting...
-0 init projB
-extra:       branch=
-extra:       convert_revision=
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-convert-svn-source.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,178 @@
+
+  $ "$TESTDIR/hghave" svn svn-bindings || exit 80
+
+  $ fixpath()
+  > {
+  >     tr '\\' /
+  > }
+  $ cat > $HGRCPATH <<EOF
+  > [extensions]
+  > convert = 
+  > graphlog =
+  > EOF
+
+  $ svnadmin create svn-repo
+  $ svnpath=`pwd | fixpath`
+
+
+  $ expr "$svnpath" : "\/" > /dev/null
+  > if [ $? -ne 0 ]; then
+  >   svnpath="/$svnpath"
+  > fi
+  > svnurl="file://$svnpath/svn-repo"
+
+Now test that it works with trunk/tags layout, but no branches yet.
+
+Initial svn import
+
+  $ mkdir projB
+  $ cd projB
+  $ mkdir trunk
+  $ mkdir tags
+  $ cd ..
+
+  $ svnurl="file://$svnpath/svn-repo/proj%20B"
+  $ svn import -m "init projB" projB "$svnurl" | fixpath
+  Adding         projB/trunk
+  Adding         projB/tags
+  
+  Committed revision 1.
+
+Update svn repository
+
+  $ svn co "$svnurl"/trunk B | fixpath
+  Checked out revision 1.
+  $ cd B
+  $ echo hello > 'letter .txt'
+  $ svn add 'letter .txt'
+  A         letter .txt
+  $ svn ci -m hello
+  Adding         letter .txt
+  Transmitting file data .
+  Committed revision 2.
+
+  $ "$TESTDIR/svn-safe-append.py" world 'letter .txt'
+  $ svn ci -m world
+  Sending        letter .txt
+  Transmitting file data .
+  Committed revision 3.
+
+  $ svn copy -m "tag v0.1" "$svnurl"/trunk "$svnurl"/tags/v0.1
+  
+  Committed revision 4.
+
+  $ "$TESTDIR/svn-safe-append.py" 'nice day today!' 'letter .txt'
+  $ svn ci -m "nice day"
+  Sending        letter .txt
+  Transmitting file data .
+  Committed revision 5.
+  $ cd ..
+
+Convert to hg once
+
+  $ hg convert "$svnurl" B-hg
+  initializing destination B-hg repository
+  scanning source...
+  sorting...
+  converting...
+  3 init projB
+  2 hello
+  1 world
+  0 nice day
+  updating tags
+
+Update svn repository again
+
+  $ cd B
+  $ "$TESTDIR/svn-safe-append.py" "see second letter" 'letter .txt'
+  $ echo "nice to meet you" > letter2.txt
+  $ svn add letter2.txt
+  A         letter2.txt
+  $ svn ci -m "second letter"
+  Sending        letter .txt
+  Adding         letter2.txt
+  Transmitting file data ..
+  Committed revision 6.
+
+  $ svn copy -m "tag v0.2" "$svnurl"/trunk "$svnurl"/tags/v0.2
+  
+  Committed revision 7.
+
+  $ "$TESTDIR/svn-safe-append.py" "blah-blah-blah" letter2.txt
+  $ svn ci -m "work in progress"
+  Sending        letter2.txt
+  Transmitting file data .
+  Committed revision 8.
+  $ cd ..
+
+########################################
+
+Test incremental conversion
+
+  $ hg convert "$svnurl" B-hg
+  scanning source...
+  sorting...
+  converting...
+  1 second letter
+  0 work in progress
+  updating tags
+
+  $ cd B-hg
+  $ hg glog --template '{rev} {desc|firstline} files: {files}\n'
+  o  7 update tags files: .hgtags
+  |
+  o  6 work in progress files: letter2.txt
+  |
+  o  5 second letter files: letter .txt letter2.txt
+  |
+  o  4 update tags files: .hgtags
+  |
+  o  3 nice day files: letter .txt
+  |
+  o  2 world files: letter .txt
+  |
+  o  1 hello files: letter .txt
+  |
+  o  0 init projB files:
+  
+  $ hg tags -q
+  tip
+  v0.2
+  v0.1
+  $ cd ..
+
+Test filemap
+  $ echo 'include letter2.txt' > filemap
+  $ hg convert --filemap filemap "$svnurl"/trunk fmap
+  initializing destination fmap repository
+  scanning source...
+  sorting...
+  converting...
+  5 init projB
+  4 hello
+  3 world
+  2 nice day
+  1 second letter
+  0 work in progress
+  $ hg glog -R fmap --template '{rev} {desc|firstline} files: {files}\n'
+  o  1 work in progress files: letter2.txt
+  |
+  o  0 second letter files: letter2.txt
+  
+
+Test stop revision
+  $ hg convert --rev 1 "$svnurl"/trunk stoprev
+  initializing destination stoprev repository
+  scanning source...
+  sorting...
+  converting...
+  0 init projB
+
+Check convert_revision extra-records.
+This is also the only place testing more than one extra field in a revision.
+
+  $ cd stoprev
+  $ hg tip --debug | grep extra
+  extra:       branch=default
+  extra:       convert_revision=svn:........-....-....-....-............/proj B/trunk@1 (re)
+  $ cd ..
--- a/tests/test-convert-svn-startrev	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-#!/bin/sh
-
-"$TESTDIR/hghave" svn svn-bindings || exit 80
-
-echo "[extensions]" >> $HGRCPATH
-echo "convert = " >> $HGRCPATH
-echo "graphlog =" >> $HGRCPATH
-
-svnadmin create svn-repo
-cat "$TESTDIR/svn/startrev.svndump" | svnadmin load svn-repo > /dev/null
-
-convert()
-{
-    startrev=$1
-    repopath=A-r$startrev-hg
-    hg convert --config convert.svn.startrev=$startrev \
-        --config convert.svn.trunk=branches/branch1 \
-        --config convert.svn.branches="  " \
-        --config convert.svn.tags= \
-        --datesort svn-repo $repopath
-    hg -R $repopath glog --template '{rev} {desc|firstline} files: {files}\n'
-    echo
-}
-
-echo % convert before branching point
-convert 3
-echo % convert before branching point
-convert 4
-echo % convert at branching point
-convert 5
-echo % convert last revision only
-convert 6
--- a/tests/test-convert-svn-startrev.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-% convert before branching point
-initializing destination A-r3-hg repository
-scanning source...
-sorting...
-converting...
-3 removeb
-2 changeaa
-1 branch, changeaaa
-0 addc,changeaaaa
-o  3 addc,changeaaaa files: a c
-|
-o  2 branch, changeaaa files: a
-|
-o  1 changeaa files: a
-|
-o  0 removeb files: a
-
-
-% convert before branching point
-initializing destination A-r4-hg repository
-scanning source...
-sorting...
-converting...
-2 changeaa
-1 branch, changeaaa
-0 addc,changeaaaa
-o  2 addc,changeaaaa files: a c
-|
-o  1 branch, changeaaa files: a
-|
-o  0 changeaa files: a
-
-
-% convert at branching point
-initializing destination A-r5-hg repository
-scanning source...
-sorting...
-converting...
-1 branch, changeaaa
-0 addc,changeaaaa
-o  1 addc,changeaaaa files: a c
-|
-o  0 branch, changeaaa files: a
-
-
-% convert last revision only
-initializing destination A-r6-hg repository
-scanning source...
-sorting...
-converting...
-0 addc,changeaaaa
-o  0 addc,changeaaaa files: a c
-
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-convert-svn-startrev.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,90 @@
+
+  $ "$TESTDIR/hghave" svn svn-bindings || exit 80
+
+  $ cat > $HGRCPATH <<EOF
+  > [extensions]
+  > convert = 
+  > graphlog =
+  > EOF
+  $ convert()
+  > {
+  >     startrev=$1
+  >     repopath=A-r$startrev-hg
+  >     hg convert --config convert.svn.startrev=$startrev \
+  >         --config convert.svn.trunk=branches/branch1 \
+  >         --config convert.svn.branches="  " \
+  >         --config convert.svn.tags= \
+  >         --datesort svn-repo $repopath
+  >     hg -R $repopath glog \
+  >         --template '{rev} {desc|firstline} files: {files}\n'
+  >     echo
+  > }
+
+  $ svnadmin create svn-repo
+  $ svnadmin load -q svn-repo < "$TESTDIR/svn/startrev.svndump"
+
+Convert before branching point
+
+  $ convert 3
+  initializing destination A-r3-hg repository
+  scanning source...
+  sorting...
+  converting...
+  3 removeb
+  2 changeaa
+  1 branch, changeaaa
+  0 addc,changeaaaa
+  o  3 addc,changeaaaa files: a c
+  |
+  o  2 branch, changeaaa files: a
+  |
+  o  1 changeaa files: a
+  |
+  o  0 removeb files: a
+  
+  
+
+Convert before branching point
+
+  $ convert 4
+  initializing destination A-r4-hg repository
+  scanning source...
+  sorting...
+  converting...
+  2 changeaa
+  1 branch, changeaaa
+  0 addc,changeaaaa
+  o  2 addc,changeaaaa files: a c
+  |
+  o  1 branch, changeaaa files: a
+  |
+  o  0 changeaa files: a
+  
+  
+
+Convert at branching point
+
+  $ convert 5
+  initializing destination A-r5-hg repository
+  scanning source...
+  sorting...
+  converting...
+  1 branch, changeaaa
+  0 addc,changeaaaa
+  o  1 addc,changeaaaa files: a c
+  |
+  o  0 branch, changeaaa files: a
+  
+  
+
+Convert last revision only
+
+  $ convert 6
+  initializing destination A-r6-hg repository
+  scanning source...
+  sorting...
+  converting...
+  0 addc,changeaaaa
+  o  0 addc,changeaaaa files: a c
+  
+  
--- a/tests/test-convert-svn-tags	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-#!/bin/sh
-
-"$TESTDIR/hghave" svn svn-bindings || exit 80
-
-echo "[extensions]" >> $HGRCPATH
-echo "convert = " >> $HGRCPATH
-echo "graphlog =" >> $HGRCPATH
-
-svnadmin create svn-repo
-cat "$TESTDIR/svn/tags.svndump" | svnadmin load svn-repo > /dev/null
-
-echo % convert
-hg convert --datesort svn-repo A-hg
-
-cd A-hg
-hg glog --template '{rev} {desc|firstline} tags: {tags}\n'
-hg tags | sed 's/:.*/:/'
-cd ..
-
-echo % convert without tags
-hg convert --datesort --config convert.svn.tags= svn-repo A-notags-hg
-hg -R A-notags-hg tags -q
-
--- a/tests/test-convert-svn-tags.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-% convert
-initializing destination A-hg repository
-scanning source...
-sorting...
-converting...
-5 init projA
-4 adda
-3 changea
-2 changea2
-1 changea3
-0 changea
-updating tags
-o  6 update tags tags: tip
-|
-o  5 changea tags: trunk.goodtag
-|
-o  4 changea3 tags:
-|
-o  3 changea2 tags: trunk.v1
-|
-o  2 changea tags:
-|
-o  1 adda tags:
-|
-o  0 init projA tags:
-
-tip                                6:
-trunk.goodtag                      5:
-trunk.v1                           3:
-% convert without tags
-initializing destination A-notags-hg repository
-scanning source...
-sorting...
-converting...
-5 init projA
-4 adda
-3 changea
-2 changea2
-1 changea3
-0 changea
-tip
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-convert-svn-tags.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,67 @@
+
+  $ "$TESTDIR/hghave" svn svn-bindings || exit 80
+
+  $ cat > $HGRCPATH <<EOF
+  > [extensions]
+  > convert = 
+  > graphlog =
+  > EOF
+
+  $ svnadmin create svn-repo
+  $ svnadmin load -q svn-repo < "$TESTDIR/svn/tags.svndump"
+
+Convert
+  $ hg convert --datesort svn-repo A-hg
+  initializing destination A-hg repository
+  scanning source...
+  sorting...
+  converting...
+  5 init projA
+  4 adda
+  3 changea
+  2 changea2
+  1 changea3
+  0 changea
+  updating tags
+
+  $ cd A-hg
+  $ hg glog --template '{rev} {desc|firstline} tags: {tags}\n'
+  o  6 update tags tags: tip
+  |
+  o  5 changea tags: trunk.goodtag
+  |
+  o  4 changea3 tags:
+  |
+  o  3 changea2 tags: trunk.v1
+  |
+  o  2 changea tags:
+  |
+  o  1 adda tags:
+  |
+  o  0 init projA tags:
+  
+
+  $ hg tags -q
+  tip
+  trunk.goodtag
+  trunk.v1
+
+  $ cd ..
+
+Convert without tags
+
+  $ hg convert --datesort --config convert.svn.tags= svn-repo A-notags-hg
+  initializing destination A-notags-hg repository
+  scanning source...
+  sorting...
+  converting...
+  5 init projA
+  4 adda
+  3 changea
+  2 changea2
+  1 changea3
+  0 changea
+
+  $ hg -R A-notags-hg tags -q
+  tip
+
--- a/tests/test-convert.out	Wed Sep 22 17:13:49 2010 -0500
+++ b/tests/test-convert.out	Wed Sep 22 18:29:41 2010 -0500
@@ -51,10 +51,10 @@
     each commit copied, so "hg convert" can be interrupted and can be run
     repeatedly to copy new commits.
 
-    The username mapping file is a simple text file that maps each source
-    commit author to a destination commit author. It is handy for source SCMs
-    that use unix logins to identify authors (eg: CVS). One line per author
-    mapping and the line format is:
+    The authormap is a simple text file that maps each source commit author to
+    a destination commit author. It is handy for source SCMs that use unix
+    logins to identify authors (eg: CVS). One line per author mapping and the
+    line format is:
 
       source author = destination author
 
@@ -69,7 +69,7 @@
 
       rename path/to/source path/to/destination
 
-    Comment lines start with "#". A specificed path matches if it equals the
+    Comment lines start with "#". A specified path matches if it equals the
     full relative name of a file or one of its parent directories. The
     "include" or "exclude" directive with the longest matching path applies,
     so line order does not matter.
@@ -78,7 +78,7 @@
     be included in the destination repository, and the exclusion of all other
     files and directories not explicitly included. The "exclude" directive
     causes files or directories to be omitted. The "rename" directive renames
-    a file or directory if is converted. To rename from a subdirectory into
+    a file or directory if it is converted. To rename from a subdirectory into
     the root of the repository, use "." as the path to rename to.
 
     The splicemap is a file that allows insertion of synthetic history,
@@ -236,11 +236,11 @@
 
 options:
 
- -A --authors FILE      username mapping filename
+ -s --source-type TYPE  source repository type
  -d --dest-type TYPE    destination repository type
+ -r --rev REV           import up to target revision REV
+ -A --authormap FILE    remap usernames using this file
     --filemap FILE      remap file names using contents of file
- -r --rev REV           import up to target revision REV
- -s --source-type TYPE  source repository type
     --splicemap FILE    splice synthesized history into place
     --branchmap FILE    change branch names while converting
     --branchsort        try to sort changesets by branches
--- a/tests/test-copy	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-#!/bin/sh
-
-hg init
-echo a > a
-hg add a
-hg commit -m "1" -d "1000000 0"
-hg status
-hg copy a b
-hg status
-hg sum
-hg --debug commit -m "2" -d "1000000 0"
-echo "we should see two history entries"
-hg history -v
-echo "we should see one log entry for a"
-hg log a
-echo "this should show a revision linked to changeset 0"
-hg debugindex .hg/store/data/a.i
-echo "we should see one log entry for b"
-hg log b
-echo "this should show a revision linked to changeset 1"
-hg debugindex .hg/store/data/b.i
-
-echo "this should show the rename information in the metadata"
-hg debugdata .hg/store/data/b.d 0 | head -3 | tail -2
-
-$TESTDIR/md5sum.py .hg/store/data/b.i
-hg cat b > bsum
-$TESTDIR/md5sum.py bsum
-hg cat a > asum
-$TESTDIR/md5sum.py asum
-hg verify
--- a/tests/test-copy-move-merge	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-#!/bin/sh
-
-mkdir t
-cd t
-hg init
-
-echo 1 > a
-hg ci -qAm "first" -d "1000000 0"
-
-hg cp a b
-hg mv a c
-echo 2 >> b
-echo 2 >> c
-
-hg ci -qAm "second" -d "1000000 0"
-
-hg co -C 0
-
-echo 0 > a
-echo 1 >> a
-
-hg ci -qAm "other" -d "1000000 0"
-
-hg merge --debug
-
-echo "-- b --"
-cat b
-
-echo "-- c --"
-cat c
--- a/tests/test-copy-move-merge.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-1 files updated, 0 files merged, 2 files removed, 0 files unresolved
-  searching for copies back to rev 1
-  unmatched files in other:
-   b
-   c
-  all copies found (* = to merge, ! = divergent):
-   c -> a *
-   b -> a *
-  checking for directory renames
-resolving manifests
- overwrite None partial False
- ancestor 583c7b748052 local fb3948d97f07+ remote 7f1309517659
- a: remote moved to c -> m
- a: remote moved to b -> m
-preserving a for resolve of b
-preserving a for resolve of c
-removing a
-updating: a 1/2 files (50.00%)
-picked tool 'internal:merge' for b (binary False symlink False)
-merging a and b to b
-my b@fb3948d97f07+ other b@7f1309517659 ancestor a@583c7b748052
- premerge successful
-updating: a 2/2 files (100.00%)
-picked tool 'internal:merge' for c (binary False symlink False)
-merging a and c to c
-my c@fb3948d97f07+ other c@7f1309517659 ancestor a@583c7b748052
- premerge successful
-0 files updated, 2 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
--- b --
-0
-1
-2
--- c --
-0
-1
-2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-copy-move-merge.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,63 @@
+  $ mkdir t
+  $ cd t
+  $ hg init
+
+  $ echo 1 > a
+  $ hg ci -qAm "first"
+
+  $ hg cp a b
+  $ hg mv a c
+  $ echo 2 >> b
+  $ echo 2 >> c
+
+  $ hg ci -qAm "second"
+
+  $ hg co -C 0
+  1 files updated, 0 files merged, 2 files removed, 0 files unresolved
+
+  $ echo 0 > a
+  $ echo 1 >> a
+
+  $ hg ci -qAm "other"
+
+  $ hg merge --debug
+    searching for copies back to rev 1
+    unmatched files in other:
+     b
+     c
+    all copies found (* = to merge, ! = divergent):
+     c -> a *
+     b -> a *
+    checking for directory renames
+  resolving manifests
+   overwrite None partial False
+   ancestor b8bf91eeebbc local add3f11052fa+ remote 17c05bb7fcb6
+   a: remote moved to c -> m
+   a: remote moved to b -> m
+  preserving a for resolve of b
+  preserving a for resolve of c
+  removing a
+  updating: a 1/2 files (50.00%)
+  picked tool 'internal:merge' for b (binary False symlink False)
+  merging a and b to b
+  my b@add3f11052fa+ other b@17c05bb7fcb6 ancestor a@b8bf91eeebbc
+   premerge successful
+  updating: a 2/2 files (100.00%)
+  picked tool 'internal:merge' for c (binary False symlink False)
+  merging a and c to c
+  my c@add3f11052fa+ other c@17c05bb7fcb6 ancestor a@b8bf91eeebbc
+   premerge successful
+  0 files updated, 2 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+file b
+  $ cat b
+  0
+  1
+  2
+
+file c
+  $ cat c
+  0
+  1
+  2
--- a/tests/test-copy.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-A b
-parent: 0:33aaa84a386b tip
- 1
-branch: default
-commit: 1 copied
-update: (current)
-b
- b: copy a:b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3
-committed changeset 1:76973b01f66a012648546c979ea4c41de9e7d8cd
-we should see two history entries
-changeset:   1:76973b01f66a
-tag:         tip
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-files:       b
-description:
-2
-
-
-changeset:   0:33aaa84a386b
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-files:       a
-description:
-1
-
-
-we should see one log entry for a
-changeset:   0:33aaa84a386b
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     1
-
-this should show a revision linked to changeset 0
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0       3      0       0 b789fdd96dc2 000000000000 000000000000
-we should see one log entry for b
-changeset:   1:76973b01f66a
-tag:         tip
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     2
-
-this should show a revision linked to changeset 1
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0      65      0       1 37d9b5d994ea 000000000000 000000000000
-this should show the rename information in the metadata
-copy: a
-copyrev: b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3
-4999f120a3b88713bbefddd195cf5133  .hg/store/data/b.i
-60b725f10c9c85c70d97880dfe8191b3  bsum
-60b725f10c9c85c70d97880dfe8191b3  asum
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-2 files, 2 changesets, 2 total revisions
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-copy.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,91 @@
+  $ hg init
+  $ echo a > a
+  $ hg add a
+  $ hg commit -m "1"
+  $ hg status
+  $ hg copy a b
+  $ hg status
+  A b
+  $ hg sum
+  parent: 0:c19d34741b0a tip
+   1
+  branch: default
+  commit: 1 copied
+  update: (current)
+  $ hg --debug commit -m "2"
+  b
+   b: copy a:b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3
+  committed changeset 1:93580a2c28a50a56f63526fb305067e6fbf739c4
+
+we should see two history entries
+
+  $ hg history -v
+  changeset:   1:93580a2c28a5
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files:       b
+  description:
+  2
+  
+  
+  changeset:   0:c19d34741b0a
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files:       a
+  description:
+  1
+  
+  
+
+we should see one log entry for a
+
+  $ hg log a
+  changeset:   0:c19d34741b0a
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     1
+  
+
+this should show a revision linked to changeset 0
+
+  $ hg debugindex .hg/store/data/a.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0       3      0       0 b789fdd96dc2 000000000000 000000000000
+
+we should see one log entry for b
+
+  $ hg log b
+  changeset:   1:93580a2c28a5
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     2
+  
+
+this should show a revision linked to changeset 1
+
+  $ hg debugindex .hg/store/data/b.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0      65      0       1 37d9b5d994ea 000000000000 000000000000
+
+this should show the rename information in the metadata
+
+  $ hg debugdata .hg/store/data/b.d 0 | head -3 | tail -2
+  copy: a
+  copyrev: b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3
+
+  $ $TESTDIR/md5sum.py .hg/store/data/b.i
+  4999f120a3b88713bbefddd195cf5133  .hg/store/data/b.i
+  $ hg cat b > bsum
+  $ $TESTDIR/md5sum.py bsum
+  60b725f10c9c85c70d97880dfe8191b3  bsum
+  $ hg cat a > asum
+  $ $TESTDIR/md5sum.py asum
+  60b725f10c9c85c70d97880dfe8191b3  asum
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  2 files, 2 changesets, 2 total revisions
--- a/tests/test-copy2	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-#!/bin/sh
-
-hg init
-echo foo > foo
-echo "# should fail - foo is not managed"
-hg mv foo bar
-hg st -A
-hg add foo
-echo "# dry-run; print a warning that this is not a real copy; foo is added"
-hg mv --dry-run foo bar
-hg st -A
-echo "# should print a warning that this is not a real copy; bar is added"
-hg mv foo bar
-hg st -A
-echo "# should print a warning that this is not a real copy; foo is added"
-hg cp bar foo
-hg rm -f bar
-rm bar
-hg st -A
-hg commit -m1
-
-echo "# copy --after to a nonexistant target filename"
-hg cp -A foo dummy
-
-echo "# dry-run; should show that foo is clean"
-hg copy --dry-run foo bar
-hg st -A
-echo "# should show copy"
-hg copy foo bar
-hg st -C
-
-echo "# shouldn't show copy"
-hg commit -m2
-hg st -C
-
-echo "# should match"
-hg debugindex .hg/store/data/foo.i
-hg debugrename bar
-
-echo bleah > foo
-echo quux > bar
-hg commit -m3
-
-echo "# should not be renamed"
-hg debugrename bar
-
-hg copy -f foo bar
-echo "# should show copy"
-hg st -C
-hg commit -m3
-
-echo "# should show no parents for tip"
-hg debugindex .hg/store/data/bar.i
-echo "# should match"
-hg debugindex .hg/store/data/foo.i
-hg debugrename bar
-
-echo "# should show no copies"
-hg st -C
-
-echo "# copy --after on an added file"
-cp bar baz
-hg add baz
-hg cp -A bar baz
-hg st -C
-
-echo "# foo was clean:"
-hg st -AC foo
-echo "# but it's considered modified after a copy --after --force"
-hg copy -Af bar foo
-hg st -AC foo
-
-exit 0
--- a/tests/test-copy2.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-# should fail - foo is not managed
-foo: not copying - file is not managed
-abort: no files to copy
-? foo
-# dry-run; print a warning that this is not a real copy; foo is added
-foo has not been committed yet, so no copy data will be stored for bar.
-A foo
-# should print a warning that this is not a real copy; bar is added
-foo has not been committed yet, so no copy data will be stored for bar.
-A bar
-# should print a warning that this is not a real copy; foo is added
-bar has not been committed yet, so no copy data will be stored for foo.
-A foo
-# copy --after to a nonexistant target filename
-foo: not recording copy - dummy does not exist
-# dry-run; should show that foo is clean
-C foo
-# should show copy
-A bar
-  foo
-# shouldn't show copy
-# should match
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0       5      0       0 2ed2a3912a0b 000000000000 000000000000
-bar renamed from foo:2ed2a3912a0b24502043eae84ee4b279c18b90dd
-# should not be renamed
-bar not renamed
-# should show copy
-M bar
-  foo
-# should show no parents for tip
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0      69      0       1 7711d36246cc 000000000000 000000000000
-     1        69       6      1       2 bdf70a2b8d03 7711d36246cc 000000000000
-     2        75      81      1       3 b2558327ea8d 000000000000 000000000000
-# should match
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0       5      0       0 2ed2a3912a0b 000000000000 000000000000
-     1         5       7      1       2 dd12c926cf16 2ed2a3912a0b 000000000000
-bar renamed from foo:dd12c926cf165e3eb4cf87b084955cb617221c17
-# should show no copies
-# copy --after on an added file
-A baz
-  bar
-# foo was clean:
-C foo
-# but it's considered modified after a copy --after --force
-M foo
-  bar
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-copy2.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,102 @@
+  $ hg init
+  $ echo foo > foo
+should fail - foo is not managed
+  $ hg mv foo bar
+  foo: not copying - file is not managed
+  abort: no files to copy
+  [255]
+  $ hg st -A
+  ? foo
+  $ hg add foo
+dry-run; print a warning that this is not a real copy; foo is added
+  $ hg mv --dry-run foo bar
+  foo has not been committed yet, so no copy data will be stored for bar.
+  $ hg st -A
+  A foo
+should print a warning that this is not a real copy; bar is added
+  $ hg mv foo bar
+  foo has not been committed yet, so no copy data will be stored for bar.
+  $ hg st -A
+  A bar
+should print a warning that this is not a real copy; foo is added
+  $ hg cp bar foo
+  bar has not been committed yet, so no copy data will be stored for foo.
+  $ hg rm -f bar
+  $ rm bar
+  $ hg st -A
+  A foo
+  $ hg commit -m1
+
+copy --after to a nonexistant target filename
+  $ hg cp -A foo dummy
+  foo: not recording copy - dummy does not exist
+
+dry-run; should show that foo is clean
+  $ hg copy --dry-run foo bar
+  $ hg st -A
+  C foo
+should show copy
+  $ hg copy foo bar
+  $ hg st -C
+  A bar
+    foo
+
+shouldn't show copy
+  $ hg commit -m2
+  $ hg st -C
+
+should match
+  $ hg debugindex .hg/store/data/foo.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0       5      0       0 2ed2a3912a0b 000000000000 000000000000
+  $ hg debugrename bar
+  bar renamed from foo:2ed2a3912a0b24502043eae84ee4b279c18b90dd
+
+  $ echo bleah > foo
+  $ echo quux > bar
+  $ hg commit -m3
+
+should not be renamed
+  $ hg debugrename bar
+  bar not renamed
+
+  $ hg copy -f foo bar
+should show copy
+  $ hg st -C
+  M bar
+    foo
+  $ hg commit -m3
+
+should show no parents for tip
+  $ hg debugindex .hg/store/data/bar.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0      69      0       1 7711d36246cc 000000000000 000000000000
+       1        69       6      1       2 bdf70a2b8d03 7711d36246cc 000000000000
+       2        75      81      1       3 b2558327ea8d 000000000000 000000000000
+should match
+  $ hg debugindex .hg/store/data/foo.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0       5      0       0 2ed2a3912a0b 000000000000 000000000000
+       1         5       7      1       2 dd12c926cf16 2ed2a3912a0b 000000000000
+  $ hg debugrename bar
+  bar renamed from foo:dd12c926cf165e3eb4cf87b084955cb617221c17
+
+should show no copies
+  $ hg st -C
+
+copy --after on an added file
+  $ cp bar baz
+  $ hg add baz
+  $ hg cp -A bar baz
+  $ hg st -C
+  A baz
+    bar
+
+foo was clean:
+  $  hg st -AC foo
+  C foo
+but it's considered modified after a copy --after --force
+  $ hg copy -Af bar foo
+  $ hg st -AC foo
+  M foo
+    bar
--- a/tests/test-custom-filters	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-#!/bin/sh
-
-hg init
-
-cat > .hg/hgrc <<EOF
-[extensions]
-prefixfilter = prefix.py
-[encode]
-*.txt = stripprefix: Copyright 2046, The Masters
-[decode]
-*.txt = insertprefix: Copyright 2046, The Masters
-EOF
-
-cat > prefix.py <<EOF
-from mercurial import util
-def stripprefix(s, cmd, filename, **kwargs):
-    header = '%s\n' % cmd
-    if s[:len(header)] != header:
-        raise util.Abort('missing header "%s" in %s' % (cmd, filename))
-    return s[len(header):]
-def insertprefix(s, cmd):
-    return '%s\n%s' % (cmd, s)
-def reposetup(ui, repo):
-    repo.adddatafilter('stripprefix:', stripprefix)
-    repo.adddatafilter('insertprefix:', insertprefix)
-EOF
-
-cat > .hgignore <<EOF
-.hgignore
-prefix.py
-prefix.pyc
-EOF
-
-cat > stuff.txt <<EOF
-Copyright 2046, The Masters
-Some stuff to ponder very carefully.
-EOF
-hg add stuff.txt
-hg ci -m stuff
-
-echo '% Repository data:'
-hg cat stuff.txt
-
-echo '% Fresh checkout:'
-rm stuff.txt
-hg up -C
-cat stuff.txt
-echo >> stuff.txt <<EOF
-Very very carefully.
-EOF
-hg stat
-
-cat > morestuff.txt <<EOF
-Unauthorized material subject to destruction.
-EOF
-
-echo '% Problem encoding:'
-hg add morestuff.txt
-hg ci -m morestuff
-hg stat
--- a/tests/test-custom-filters.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-% Repository data:
-Some stuff to ponder very carefully.
-% Fresh checkout:
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-Copyright 2046, The Masters
-Some stuff to ponder very carefully.
-M stuff.txt
-% Problem encoding:
-abort: missing header "Copyright 2046, The Masters" in morestuff.txt
-M stuff.txt
-A morestuff.txt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-custom-filters.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,66 @@
+  $ hg init
+
+  $ cat > .hg/hgrc <<EOF
+  > [extensions]
+  > prefixfilter = prefix.py
+  > [encode]
+  > *.txt = stripprefix: Copyright 2046, The Masters
+  > [decode]
+  > *.txt = insertprefix: Copyright 2046, The Masters
+  > EOF
+
+  $ cat > prefix.py <<EOF
+  > from mercurial import util
+  > def stripprefix(s, cmd, filename, **kwargs):
+  >     header = '%s\n' % cmd
+  >     if s[:len(header)] != header:
+  >         raise util.Abort('missing header "%s" in %s' % (cmd, filename))
+  >     return s[len(header):]
+  > def insertprefix(s, cmd):
+  >     return '%s\n%s' % (cmd, s)
+  > def reposetup(ui, repo):
+  >     repo.adddatafilter('stripprefix:', stripprefix)
+  >     repo.adddatafilter('insertprefix:', insertprefix)
+  > EOF
+
+  $ cat > .hgignore <<EOF
+  > .hgignore
+  > prefix.py
+  > prefix.pyc
+  > EOF
+
+  $ cat > stuff.txt <<EOF
+  > Copyright 2046, The Masters
+  > Some stuff to ponder very carefully.
+  > EOF
+  $ hg add stuff.txt
+  $ hg ci -m stuff
+
+Repository data:
+
+  $ hg cat stuff.txt
+  Some stuff to ponder very carefully.
+
+Fresh checkout:
+
+  $ rm stuff.txt
+  $ hg up -C
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cat stuff.txt
+  Copyright 2046, The Masters
+  Some stuff to ponder very carefully.
+  $ echo "Very very carefully." >> stuff.txt
+  $ hg stat
+  M stuff.txt
+
+  $ echo "Unauthorized material subject to destruction." > morestuff.txt
+
+Problem encoding:
+
+  $ hg add morestuff.txt
+  $ hg ci -m morestuff
+  abort: missing header "Copyright 2046, The Masters" in morestuff.txt
+  [255]
+  $ hg stat
+  M stuff.txt
+  A morestuff.txt
--- a/tests/test-debugbuilddag	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-#! /bin/sh
-
-echo "[extensions]" >> $HGRCPATH
-echo "graphlog=" >> $HGRCPATH
-
-
-
-echo ---- overwritten and appended files
-
-rm -rf repo
-hg init repo
-cd repo
-hg debugbuilddag '+2:f +3:p2 @temp <f+4 @default /p2 +2' -q -oa
-echo -- dag
-hg debugdag -t -b
-echo -- glog
-hg glog --template '{rev}: {desc} [{branches}] @ {date}\n'
-echo -- glog of
-hg glog --template '{rev}: {desc} [{branches}]\n' of
-echo -- glog af
-hg glog --template '{rev}: {desc} [{branches}]\n' af
-echo -- tags
-hg tags -v
-echo -- cat of
-hg cat of
-echo -- cat af
-hg cat af
-cd ..
-
-echo ---- new and mergeable files
-
-rm -rf repo
-hg init repo
-cd repo
-hg debugbuilddag '+2:f +3:p2 @temp <f+4 @default /p2 +2' -q -mn
-echo -- dag
-hg debugdag -t -b
-echo -- glog
-hg glog --template '{rev}: {desc} [{branches}] @ {date}\n'
-echo -- glog mf
-hg glog --template '{rev}: {desc} [{branches}]\n' mf
-
-echo -- man r4
-hg manifest -r4
-echo -- cat r4 mf
-hg cat -r4 mf
-echo -- man r8
-hg manifest -r8
-echo -- cat r8 mf
-hg cat -r8 mf
-echo -- man
-hg manifest
-echo -- cat mf
-hg cat mf
-cd ..
-
-echo ---- command
-
-rm -rf repo
-hg init repo
-cd repo
-hg debugbuilddag '+2 !"touch X" +2' -q -o
-echo -- dag
-hg debugdag -t -b
-echo -- glog
-hg glog --template '{rev}: {desc} [{branches}]\n'
-echo -- glog X
-hg glog --template '{rev}: {desc} [{branches}]\n' X
-cd ..
-
--- a/tests/test-debugbuilddag.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,272 +0,0 @@
----- overwritten and appended files
--- dag
-+2:f
-+3:p2
-@temp*f+3
-@default*/p2+2:tip
--- glog
-@  11: r11 [] @ 11.00
-|
-o  10: r10 [] @ 10.00
-|
-o    9: r9 [] @ 9.00
-|\
-| o  8: r8 [temp] @ 8.00
-| |
-| o  7: r7 [temp] @ 7.00
-| |
-| o  6: r6 [temp] @ 6.00
-| |
-| o  5: r5 [temp] @ 5.00
-| |
-o |  4: r4 [] @ 4.00
-| |
-o |  3: r3 [] @ 3.00
-| |
-o |  2: r2 [] @ 2.00
-|/
-o  1: r1 [] @ 1.00
-|
-o  0: r0 [] @ 0.00
-
--- glog of
-@  11: r11 []
-|
-o  10: r10 []
-|
-o    9: r9 []
-|\
-| o  8: r8 [temp]
-| |
-| o  7: r7 [temp]
-| |
-| o  6: r6 [temp]
-| |
-| o  5: r5 [temp]
-| |
-o |  4: r4 []
-| |
-o |  3: r3 []
-| |
-o |  2: r2 []
-|/
-o  1: r1 []
-|
-o  0: r0 []
-
--- glog af
-@  11: r11 []
-|
-o  10: r10 []
-|
-o    9: r9 []
-|\
-| o  8: r8 [temp]
-| |
-| o  7: r7 [temp]
-| |
-| o  6: r6 [temp]
-| |
-| o  5: r5 [temp]
-| |
-o |  4: r4 []
-| |
-o |  3: r3 []
-| |
-o |  2: r2 []
-|/
-o  1: r1 []
-|
-o  0: r0 []
-
--- tags
-tip                               11:f96e381c614c
-p2                                 4:d9d6db981b55 local
-f                                  1:73253def624e local
--- cat of
-r11
--- cat af
-r0
-r1
-r5
-r6
-r7
-r8
-r9
-r10
-r11
----- new and mergeable files
--- dag
-+2:f
-+3:p2
-@temp*f+3
-@default*/p2+2:tip
--- glog
-@  11: r11 [] @ 11.00
-|
-o  10: r10 [] @ 10.00
-|
-o    9: r9 [] @ 9.00
-|\
-| o  8: r8 [temp] @ 8.00
-| |
-| o  7: r7 [temp] @ 7.00
-| |
-| o  6: r6 [temp] @ 6.00
-| |
-| o  5: r5 [temp] @ 5.00
-| |
-o |  4: r4 [] @ 4.00
-| |
-o |  3: r3 [] @ 3.00
-| |
-o |  2: r2 [] @ 2.00
-|/
-o  1: r1 [] @ 1.00
-|
-o  0: r0 [] @ 0.00
-
--- glog mf
-@  11: r11 []
-|
-o  10: r10 []
-|
-o    9: r9 []
-|\
-| o  8: r8 [temp]
-| |
-| o  7: r7 [temp]
-| |
-| o  6: r6 [temp]
-| |
-| o  5: r5 [temp]
-| |
-o |  4: r4 []
-| |
-o |  3: r3 []
-| |
-o |  2: r2 []
-|/
-o  1: r1 []
-|
-o  0: r0 []
-
--- man r4
-mf
-nf0
-nf1
-nf2
-nf3
-nf4
--- cat r4 mf
-0 r0
-1
-2 r1
-3
-4 r2
-5
-6 r3
-7
-8 r4
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
--- man r8
-mf
-nf0
-nf1
-nf5
-nf6
-nf7
-nf8
--- cat r8 mf
-0 r0
-1
-2 r1
-3
-4
-5
-6
-7
-8
-9
-10 r5
-11
-12 r6
-13
-14 r7
-15
-16 r8
-17
-18
-19
-20
-21
-22
-23
--- man
-mf
-nf0
-nf1
-nf10
-nf11
-nf2
-nf3
-nf4
-nf5
-nf6
-nf7
-nf8
-nf9
--- cat mf
-0 r0
-1
-2 r1
-3
-4 r2
-5
-6 r3
-7
-8 r4
-9
-10 r5
-11
-12 r6
-13
-14 r7
-15
-16 r8
-17
-18 r9
-19
-20 r10
-21
-22 r11
-23
----- command
--- dag
-+4:tip
--- glog
-@  3: r3 []
-|
-o  2: r2 []
-|
-o  1: r1 []
-|
-o  0: r0 []
-
--- glog X
-o  2: r2 []
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-debugbuilddag.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,321 @@
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "graphlog=" >> $HGRCPATH
+
+overwritten and appended files
+
+  $ rm -rf repo
+  $ hg init repo
+  $ cd repo
+  $ hg debugbuilddag '+2:f +3:p2 @temp <f+4 @default /p2 +2' -q -oa
+dag
+  $ hg debugdag -t -b
+  +2:f
+  +3:p2
+  @temp*f+3
+  @default*/p2+2:tip
+tip
+  $ hg id
+  f96e381c614c tip
+glog
+  $ hg glog --template '{rev}: {desc} [{branches}] @ {date}\n'
+  @  11: r11 [] @ 11.00
+  |
+  o  10: r10 [] @ 10.00
+  |
+  o    9: r9 [] @ 9.00
+  |\
+  | o  8: r8 [temp] @ 8.00
+  | |
+  | o  7: r7 [temp] @ 7.00
+  | |
+  | o  6: r6 [temp] @ 6.00
+  | |
+  | o  5: r5 [temp] @ 5.00
+  | |
+  o |  4: r4 [] @ 4.00
+  | |
+  o |  3: r3 [] @ 3.00
+  | |
+  o |  2: r2 [] @ 2.00
+  |/
+  o  1: r1 [] @ 1.00
+  |
+  o  0: r0 [] @ 0.00
+  
+glog of
+  $ hg glog --template '{rev}: {desc} [{branches}]\n' of
+  @  11: r11 []
+  |
+  o  10: r10 []
+  |
+  o    9: r9 []
+  |\
+  | o  8: r8 [temp]
+  | |
+  | o  7: r7 [temp]
+  | |
+  | o  6: r6 [temp]
+  | |
+  | o  5: r5 [temp]
+  | |
+  o |  4: r4 []
+  | |
+  o |  3: r3 []
+  | |
+  o |  2: r2 []
+  |/
+  o  1: r1 []
+  |
+  o  0: r0 []
+  
+glog af
+  $ hg glog --template '{rev}: {desc} [{branches}]\n' af
+  @  11: r11 []
+  |
+  o  10: r10 []
+  |
+  o    9: r9 []
+  |\
+  | o  8: r8 [temp]
+  | |
+  | o  7: r7 [temp]
+  | |
+  | o  6: r6 [temp]
+  | |
+  | o  5: r5 [temp]
+  | |
+  o |  4: r4 []
+  | |
+  o |  3: r3 []
+  | |
+  o |  2: r2 []
+  |/
+  o  1: r1 []
+  |
+  o  0: r0 []
+  
+tags
+  $ hg tags -v
+  tip                               11:f96e381c614c
+  p2                                 4:d9d6db981b55 local
+  f                                  1:73253def624e local
+cat of
+  $ hg cat of
+  r11
+cat af
+  $ hg cat af
+  r0
+  r1
+  r5
+  r6
+  r7
+  r8
+  r9
+  r10
+  r11
+  $ cd ..
+
+new and mergeable files
+
+  $ rm -rf repo
+  $ hg init repo
+  $ cd repo
+  $ hg debugbuilddag '+2:f +3:p2 @temp <f+4 @default /p2 +2' -q -mn
+dag
+  $ hg debugdag -t -b
+  +2:f
+  +3:p2
+  @temp*f+3
+  @default*/p2+2:tip
+tip
+  $ hg id
+  9c5ce9b70771 tip
+glog
+  $ hg glog --template '{rev}: {desc} [{branches}] @ {date}\n'
+  @  11: r11 [] @ 11.00
+  |
+  o  10: r10 [] @ 10.00
+  |
+  o    9: r9 [] @ 9.00
+  |\
+  | o  8: r8 [temp] @ 8.00
+  | |
+  | o  7: r7 [temp] @ 7.00
+  | |
+  | o  6: r6 [temp] @ 6.00
+  | |
+  | o  5: r5 [temp] @ 5.00
+  | |
+  o |  4: r4 [] @ 4.00
+  | |
+  o |  3: r3 [] @ 3.00
+  | |
+  o |  2: r2 [] @ 2.00
+  |/
+  o  1: r1 [] @ 1.00
+  |
+  o  0: r0 [] @ 0.00
+  
+glog mf
+  $ hg glog --template '{rev}: {desc} [{branches}]\n' mf
+  @  11: r11 []
+  |
+  o  10: r10 []
+  |
+  o    9: r9 []
+  |\
+  | o  8: r8 [temp]
+  | |
+  | o  7: r7 [temp]
+  | |
+  | o  6: r6 [temp]
+  | |
+  | o  5: r5 [temp]
+  | |
+  o |  4: r4 []
+  | |
+  o |  3: r3 []
+  | |
+  o |  2: r2 []
+  |/
+  o  1: r1 []
+  |
+  o  0: r0 []
+  
+
+man r4
+  $ hg manifest -r4
+  mf
+  nf0
+  nf1
+  nf2
+  nf3
+  nf4
+cat r4 mf
+  $ hg cat -r4 mf
+  0 r0
+  1
+  2 r1
+  3
+  4 r2
+  5
+  6 r3
+  7
+  8 r4
+  9
+  10
+  11
+  12
+  13
+  14
+  15
+  16
+  17
+  18
+  19
+  20
+  21
+  22
+  23
+man r8
+  $ hg manifest -r8
+  mf
+  nf0
+  nf1
+  nf5
+  nf6
+  nf7
+  nf8
+cat r8 mf
+  $ hg cat -r8 mf
+  0 r0
+  1
+  2 r1
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+  10 r5
+  11
+  12 r6
+  13
+  14 r7
+  15
+  16 r8
+  17
+  18
+  19
+  20
+  21
+  22
+  23
+man
+  $ hg manifest
+  mf
+  nf0
+  nf1
+  nf10
+  nf11
+  nf2
+  nf3
+  nf4
+  nf5
+  nf6
+  nf7
+  nf8
+  nf9
+cat mf
+  $ hg cat mf
+  0 r0
+  1
+  2 r1
+  3
+  4 r2
+  5
+  6 r3
+  7
+  8 r4
+  9
+  10 r5
+  11
+  12 r6
+  13
+  14 r7
+  15
+  16 r8
+  17
+  18 r9
+  19
+  20 r10
+  21
+  22 r11
+  23
+  $ cd ..
+
+command
+
+  $ rm -rf repo
+  $ hg init repo
+  $ cd repo
+  $ hg debugbuilddag '+2 !"touch X" +2' -q -o
+dag
+  $ hg debugdag -t -b
+  +4:tip
+glog
+  $ hg glog --template '{rev}: {desc} [{branches}]\n'
+  @  3: r3 []
+  |
+  o  2: r2 []
+  |
+  o  1: r1 []
+  |
+  o  0: r0 []
+  
+glog X
+  $ hg glog --template '{rev}: {desc} [{branches}]\n' X
+  o  2: r2 []
+  
+  $ cd ..
--- a/tests/test-debugcomplete	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-#!/bin/sh
-
-echo '% Show all commands except debug commands'
-hg debugcomplete
-
-echo
-echo '% Show all commands that start with "a"'
-hg debugcomplete a
-
-echo
-echo '% Do not show debug commands if there are other candidates'
-hg debugcomplete d
-
-echo
-echo '% Show debug commands if there are no other candidates'
-hg debugcomplete debug
-
-echo
-echo '% Do not show the alias of a debug command if there are other candidates'
-echo '% (this should hide rawcommit)'
-hg debugcomplete r
-
-echo
-echo '% Show the alias of a debug command if there are no other candidates'
-hg debugcomplete rawc
-
-echo
-echo '% Show the global options'
-hg debugcomplete --options | sort
-
-echo
-echo '% Show the options for the "serve" command'
-hg debugcomplete --options serve | sort
-
-echo
-echo '% Show an error if we use --options with an ambiguous abbreviation'
-hg debugcomplete --options s
-
-echo
-echo '% Show all commands + options'
-hg debugcommands
-
-exit 0
--- a/tests/test-debugcomplete.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,239 +0,0 @@
-% Show all commands except debug commands
-add
-addremove
-annotate
-archive
-backout
-bisect
-branch
-branches
-bundle
-cat
-clone
-commit
-copy
-diff
-export
-forget
-grep
-heads
-help
-identify
-import
-incoming
-init
-locate
-log
-manifest
-merge
-outgoing
-parents
-paths
-pull
-push
-recover
-remove
-rename
-resolve
-revert
-rollback
-root
-serve
-showconfig
-status
-summary
-tag
-tags
-tip
-unbundle
-update
-verify
-version
-
-% Show all commands that start with "a"
-add
-addremove
-annotate
-archive
-
-% Do not show debug commands if there are other candidates
-diff
-
-% Show debug commands if there are no other candidates
-debugancestor
-debugbuilddag
-debugcheckstate
-debugcommands
-debugcomplete
-debugconfig
-debugdag
-debugdata
-debugdate
-debugfsinfo
-debugindex
-debugindexdot
-debuginstall
-debugpushkey
-debugrebuildstate
-debugrename
-debugrevspec
-debugsetparents
-debugstate
-debugsub
-debugwalk
-
-% Do not show the alias of a debug command if there are other candidates
-% (this should hide rawcommit)
-recover
-remove
-rename
-resolve
-revert
-rollback
-root
-
-% Show the alias of a debug command if there are no other candidates
-
-
-% Show the global options
---config
---cwd
---debug
---debugger
---encoding
---encodingmode
---help
---noninteractive
---profile
---quiet
---repository
---time
---traceback
---verbose
---version
--R
--h
--q
--v
--y
-
-% Show the options for the "serve" command
---accesslog
---address
---certificate
---config
---cwd
---daemon
---daemon-pipefds
---debug
---debugger
---encoding
---encodingmode
---errorlog
---help
---ipv6
---name
---noninteractive
---pid-file
---port
---prefix
---profile
---quiet
---repository
---stdio
---style
---templates
---time
---traceback
---verbose
---version
---web-conf
--6
--A
--E
--R
--a
--d
--h
--n
--p
--q
--t
--v
--y
-
-% Show an error if we use --options with an ambiguous abbreviation
-hg: command 's' is ambiguous:
-    serve showconfig status summary
-
-% Show all commands + options
-add: include, exclude, dry-run
-annotate: rev, follow, no-follow, text, user, file, date, number, changeset, line-number, include, exclude
-clone: noupdate, updaterev, rev, branch, pull, uncompressed, ssh, remotecmd
-commit: addremove, close-branch, include, exclude, message, logfile, date, user
-diff: rev, change, text, git, nodates, show-function, reverse, ignore-all-space, ignore-space-change, ignore-blank-lines, unified, stat, include, exclude
-export: output, switch-parent, rev, text, git, nodates
-forget: include, exclude
-init: ssh, remotecmd
-log: follow, follow-first, date, copies, keyword, rev, removed, only-merges, user, only-branch, branch, prune, patch, git, limit, no-merges, stat, style, template, include, exclude
-merge: force, rev, preview
-pull: update, force, rev, branch, ssh, remotecmd
-push: force, rev, branch, new-branch, ssh, remotecmd
-remove: after, force, include, exclude
-serve: accesslog, daemon, daemon-pipefds, errorlog, port, address, prefix, name, web-conf, webdir-conf, pid-file, stdio, templates, style, ipv6, certificate
-status: all, modified, added, removed, deleted, clean, unknown, ignored, no-status, copies, print0, rev, change, include, exclude
-summary: remote
-update: clean, check, date, rev
-addremove: similarity, include, exclude, dry-run
-archive: no-decode, prefix, rev, type, include, exclude
-backout: merge, parent, rev, include, exclude, message, logfile, date, user
-bisect: reset, good, bad, skip, command, noupdate
-branch: force, clean
-branches: active, closed
-bundle: force, rev, branch, base, all, type, ssh, remotecmd
-cat: output, rev, decode, include, exclude
-copy: after, force, include, exclude, dry-run
-debugancestor: 
-debugbuilddag: mergeable-file, appended-file, overwritten-file, new-file
-debugcheckstate: 
-debugcommands: 
-debugcomplete: options
-debugdag: tags, branches, dots, spaces
-debugdata: 
-debugdate: extended
-debugfsinfo: 
-debugindex: 
-debugindexdot: 
-debuginstall: 
-debugpushkey: 
-debugrebuildstate: rev
-debugrename: rev
-debugrevspec: 
-debugsetparents: 
-debugstate: nodates
-debugsub: rev
-debugwalk: include, exclude
-grep: print0, all, follow, ignore-case, files-with-matches, line-number, rev, user, date, include, exclude
-heads: rev, topo, active, closed, style, template
-help: 
-identify: rev, num, id, branch, tags
-import: strip, base, force, no-commit, exact, import-branch, message, logfile, date, user, similarity
-incoming: force, newest-first, bundle, rev, branch, patch, git, limit, no-merges, stat, style, template, ssh, remotecmd
-locate: rev, print0, fullpath, include, exclude
-manifest: rev
-outgoing: force, rev, newest-first, branch, patch, git, limit, no-merges, stat, style, template, ssh, remotecmd
-parents: rev, style, template
-paths: 
-recover: 
-rename: after, force, include, exclude, dry-run
-resolve: all, list, mark, unmark, no-status, include, exclude
-revert: all, date, rev, no-backup, include, exclude, dry-run
-rollback: dry-run
-root: 
-showconfig: untrusted
-tag: force, local, rev, remove, edit, message, date, user
-tags: 
-tip: patch, git, style, template
-unbundle: update
-verify: 
-version: 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-debugcomplete.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,249 @@
+Show all commands except debug commands
+  $ hg debugcomplete
+  add
+  addremove
+  annotate
+  archive
+  backout
+  bisect
+  branch
+  branches
+  bundle
+  cat
+  clone
+  commit
+  copy
+  diff
+  export
+  forget
+  grep
+  heads
+  help
+  identify
+  import
+  incoming
+  init
+  locate
+  log
+  manifest
+  merge
+  outgoing
+  parents
+  paths
+  pull
+  push
+  recover
+  remove
+  rename
+  resolve
+  revert
+  rollback
+  root
+  serve
+  showconfig
+  status
+  summary
+  tag
+  tags
+  tip
+  unbundle
+  update
+  verify
+  version
+
+Show all commands that start with "a"
+  $ hg debugcomplete a
+  add
+  addremove
+  annotate
+  archive
+
+Do not show debug commands if there are other candidates
+  $ hg debugcomplete d
+  diff
+
+Show debug commands if there are no other candidates
+  $ hg debugcomplete debug
+  debugancestor
+  debugbuilddag
+  debugcheckstate
+  debugcommands
+  debugcomplete
+  debugconfig
+  debugdag
+  debugdata
+  debugdate
+  debugfsinfo
+  debugindex
+  debugindexdot
+  debuginstall
+  debugpushkey
+  debugrebuildstate
+  debugrename
+  debugrevspec
+  debugsetparents
+  debugstate
+  debugsub
+  debugwalk
+
+Do not show the alias of a debug command if there are other candidates
+(this should hide rawcommit)
+  $ hg debugcomplete r
+  recover
+  remove
+  rename
+  resolve
+  revert
+  rollback
+  root
+Show the alias of a debug command if there are no other candidates
+  $ hg debugcomplete rawc
+  
+
+Show the global options
+  $ hg debugcomplete --options | sort
+  --config
+  --cwd
+  --debug
+  --debugger
+  --encoding
+  --encodingmode
+  --help
+  --noninteractive
+  --profile
+  --quiet
+  --repository
+  --time
+  --traceback
+  --verbose
+  --version
+  -R
+  -h
+  -q
+  -v
+  -y
+
+Show the options for the "serve" command
+  $ hg debugcomplete --options serve | sort
+  --accesslog
+  --address
+  --certificate
+  --config
+  --cwd
+  --daemon
+  --daemon-pipefds
+  --debug
+  --debugger
+  --encoding
+  --encodingmode
+  --errorlog
+  --help
+  --ipv6
+  --name
+  --noninteractive
+  --pid-file
+  --port
+  --prefix
+  --profile
+  --quiet
+  --repository
+  --stdio
+  --style
+  --templates
+  --time
+  --traceback
+  --verbose
+  --version
+  --web-conf
+  -6
+  -A
+  -E
+  -R
+  -a
+  -d
+  -h
+  -n
+  -p
+  -q
+  -t
+  -v
+  -y
+
+Show an error if we use --options with an ambiguous abbreviation
+  $ hg debugcomplete --options s
+  hg: command 's' is ambiguous:
+      serve showconfig status summary
+  [255]
+
+Show all commands + options
+  $ hg debugcommands
+  add: include, exclude, subrepos, dry-run
+  annotate: rev, follow, no-follow, text, user, file, date, number, changeset, line-number, include, exclude
+  clone: noupdate, updaterev, rev, branch, pull, uncompressed, ssh, remotecmd
+  commit: addremove, close-branch, include, exclude, message, logfile, date, user
+  diff: rev, change, text, git, nodates, show-function, reverse, ignore-all-space, ignore-space-change, ignore-blank-lines, unified, stat, include, exclude, subrepos
+  export: output, switch-parent, rev, text, git, nodates
+  forget: include, exclude
+  init: ssh, remotecmd
+  log: follow, follow-first, date, copies, keyword, rev, removed, only-merges, user, only-branch, branch, prune, patch, git, limit, no-merges, stat, style, template, include, exclude
+  merge: force, rev, preview
+  pull: update, force, rev, branch, ssh, remotecmd
+  push: force, rev, branch, new-branch, ssh, remotecmd
+  remove: after, force, include, exclude
+  serve: accesslog, daemon, daemon-pipefds, errorlog, port, address, prefix, name, web-conf, webdir-conf, pid-file, stdio, templates, style, ipv6, certificate
+  status: all, modified, added, removed, deleted, clean, unknown, ignored, no-status, copies, print0, rev, change, include, exclude, subrepos
+  summary: remote
+  update: clean, check, date, rev
+  addremove: similarity, include, exclude, dry-run
+  archive: no-decode, prefix, rev, type, subrepos, include, exclude
+  backout: merge, parent, rev, include, exclude, message, logfile, date, user
+  bisect: reset, good, bad, skip, command, noupdate
+  branch: force, clean
+  branches: active, closed
+  bundle: force, rev, branch, base, all, type, ssh, remotecmd
+  cat: output, rev, decode, include, exclude
+  copy: after, force, include, exclude, dry-run
+  debugancestor: 
+  debugbuilddag: mergeable-file, appended-file, overwritten-file, new-file
+  debugcheckstate: 
+  debugcommands: 
+  debugcomplete: options
+  debugdag: tags, branches, dots, spaces
+  debugdata: 
+  debugdate: extended
+  debugfsinfo: 
+  debugindex: 
+  debugindexdot: 
+  debuginstall: 
+  debugpushkey: 
+  debugrebuildstate: rev
+  debugrename: rev
+  debugrevspec: 
+  debugsetparents: 
+  debugstate: nodates
+  debugsub: rev
+  debugwalk: include, exclude
+  grep: print0, all, follow, ignore-case, files-with-matches, line-number, rev, user, date, include, exclude
+  heads: rev, topo, active, closed, style, template
+  help: 
+  identify: rev, num, id, branch, tags
+  import: strip, base, force, no-commit, exact, import-branch, message, logfile, date, user, similarity
+  incoming: force, newest-first, bundle, rev, branch, patch, git, limit, no-merges, stat, style, template, ssh, remotecmd, subrepos
+  locate: rev, print0, fullpath, include, exclude
+  manifest: rev
+  outgoing: force, rev, newest-first, branch, patch, git, limit, no-merges, stat, style, template, ssh, remotecmd, subrepos
+  parents: rev, style, template
+  paths: 
+  recover: 
+  rename: after, force, include, exclude, dry-run
+  resolve: all, list, mark, unmark, no-status, include, exclude
+  revert: all, date, rev, no-backup, include, exclude, dry-run
+  rollback: dry-run
+  root: 
+  showconfig: untrusted
+  tag: force, local, rev, remove, edit, message, date, user
+  tags: 
+  tip: patch, git, style, template
+  unbundle: update
+  verify: 
+  version: 
--- a/tests/test-debugindexdot	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-#!/bin/sh
-
-# Just exercize debugindexdot
-# Create a short file history including a merge.
-hg init t
-cd t
-echo a > a
-hg ci -qAm t1 -d '0 0'
-echo a >> a
-hg ci -m t2 -d '1 0'
-hg up -qC 0
-echo b >> a
-hg ci -m t3 -d '2 0'
-HGMERGE=true hg merge -q
-hg ci -m merge -d '3 0'
-
-hg debugindexdot .hg/store/data/a.i
--- a/tests/test-debugindexdot.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-created new head
-digraph G {
-	-1 -> 0
-	0 -> 1
-	0 -> 2
-	2 -> 3
-	1 -> 3
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-debugindexdot.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,23 @@
+Just exercize debugindexdot
+Create a short file history including a merge.
+  $ hg init t
+  $ cd t
+  $ echo a > a
+  $ hg ci -qAm t1 -d '0 0'
+  $ echo a >> a
+  $ hg ci -m t2 -d '1 0'
+  $ hg up -qC 0
+  $ echo b >> a
+  $ hg ci -m t3 -d '2 0'
+  created new head
+  $ HGMERGE=true hg merge -q
+  $ hg ci -m merge -d '3 0'
+
+  $ hg debugindexdot .hg/store/data/a.i
+  digraph G {
+  	-1 -> 0
+  	0 -> 1
+  	0 -> 2
+  	2 -> 3
+  	1 -> 3
+  }
--- a/tests/test-debugrename	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-#!/bin/sh
-
-hg init
-echo a > a
-hg ci -Am t
-
-hg mv a b
-hg ci -Am t1
-hg debugrename b
-
-hg mv b a
-hg ci -Am t2
-hg debugrename a
-
-echo % test with --rev
-hg debugrename --rev 1 b
-
--- a/tests/test-debugrename.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-adding a
-b renamed from a:b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3
-a renamed from b:37d9b5d994eab34eda9c16b195ace52c7b129980
-% test with --rev
-b renamed from a:b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-debugrename.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,18 @@
+  $ hg init
+  $ echo a > a
+  $ hg ci -Am t
+  adding a
+
+  $ hg mv a b
+  $ hg ci -Am t1
+  $ hg debugrename b
+  b renamed from a:b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3
+
+  $ hg mv b a
+  $ hg ci -Am t2
+  $ hg debugrename a
+  a renamed from b:37d9b5d994eab34eda9c16b195ace52c7b129980
+
+  $ hg debugrename --rev 1 b
+  b renamed from a:b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3
+
--- a/tests/test-default-push	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-#!/bin/sh
-
-hg init a
-echo a > a/a
-hg --cwd a ci -Ama
-
-hg clone a c
-
-hg clone a b
-echo b >> b/a
-hg --cwd b ci -mb
-
-echo % push should push to default when default-push not set
-hg --cwd b push | sed 's/pushing to.*/pushing/'
-
-echo % push should push to default-push when set
-echo 'default-push = ../c' >> b/.hg/hgrc
-hg --cwd b push | sed 's/pushing to.*/pushing/'
--- a/tests/test-default-push.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-adding a
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% push should push to default when default-push not set
-pushing
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-% push should push to default-push when set
-pushing
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-default-push.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,38 @@
+  $ hg init a
+
+  $ echo a > a/a
+  $ hg --cwd a ci -Ama
+  adding a
+
+  $ hg clone a c
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ hg clone a b
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ echo b >> b/a
+  $ hg --cwd b ci -mb
+
+Push should push to 'default' when 'default-push' not set:
+
+  $ hg --cwd b push
+  pushing to */a (glob)
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+
+Push should push to 'default-push' when set:
+
+  $ echo 'default-push = ../c' >> b/.hg/hgrc
+  $ hg --cwd b push
+  pushing to */c (glob)
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+
--- a/tests/test-diff-binary-file	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-#!/bin/sh
-
-hg init a
-cd a
-cp $TESTDIR/binfile.bin .
-hg add binfile.bin
-hg ci -m 'add binfile.bin'
-
-echo >> binfile.bin
-hg ci -m 'change binfile.bin'
-
-hg revert -r 0 binfile.bin
-hg ci -m 'revert binfile.bin'
-
-echo % diff -r 0 -r 1
-hg diff --nodates -r 0 -r 1
-
-echo % diff -r 0 -r 2
-hg diff --nodates -r 0 -r 2
-
-echo % diff --git -r 0 -r 1
-hg diff --git -r 0 -r 1
-
-echo % diff --git -r 0 -r 2
-hg diff --git -r 0 -r 2
--- a/tests/test-diff-binary-file.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-% diff -r 0 -r 1
-diff -r 48b371597640 -r acea2ab458c8 binfile.bin
-Binary file binfile.bin has changed
-% diff -r 0 -r 2
-% diff --git -r 0 -r 1
-diff --git a/binfile.bin b/binfile.bin
-index 37ba3d1c6f17137d9c5f5776fa040caf5fe73ff9..58dc31a9e2f40f74ff3b45903f7d620b8e5b7356
-GIT binary patch
-literal 594
-zc$@)J0<HatP)<h;3K|Lk000e1NJLTq000mG000mO0ssI2kdbIM00009a7bBm000XU
-z000XU0RWnu7ytkO2XskIMF-Uh9TW;VpMjwv0005-Nkl<ZD9@FWPs=e;7{<>W$NUkd
-zX$nnYLt$-$V!?uy+1V%`z&Eh=ah|duER<4|QWhju3gb^nF*8iYobxWG-qqXl=2~5M
-z*IoDB)sG^CfNuoBmqLTVU^<;@nwHP!1wrWd`{(mHo6VNXWtyh{alzqmsH*yYzpvLT
-zLdY<T=ks|woh-`&01!ej#(xbV1f|pI*=%;d-%F*E*X#ZH`4I%6SS+$EJDE&ct=8po
-ziN#{?_j|kD%Cd|oiqds`xm@;oJ-^?NG3Gdqrs?5u*zI;{nogxsx~^|Fn^Y?Gdc6<;
-zfMJ+iF1J`LMx&A2?dEwNW8ClebzPTbIh{@$hS6*`kH@1d%Lo7fA#}N1)oN7`gm$~V
-z+wDx#)OFqMcE{s!JN0-xhG8ItAjVkJwEcb`3WWlJfU2r?;Pd%dmR+q@mSri5q9_W-
-zaR2~ECX?B2w+zELozC0s*6Z~|QG^f{3I#<`?)Q7U-JZ|q5W;9Q8i_=pBuSzunx=U;
-z9C)5jBoYw9^?EHyQl(M}1OlQcCX>lXB*ODN003Z&P17_@)3Pi=i0wb04<W?v-u}7K
-zXmmQA+wDgE!qR9o8jr`%=ab_&uh(l?R=r;Tjiqon91I2-hIu?57~@*4h7h9uORK#=
-gQItJW-{SoTm)8|5##k|m00000NkvXXu0mjf3JwksH2?qr
-
-% diff --git -r 0 -r 2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-diff-binary-file.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,39 @@
+  $ hg init a
+  $ cd a
+  $ cp $TESTDIR/binfile.bin .
+  $ hg add binfile.bin
+  $ hg ci -m 'add binfile.bin'
+
+  $ echo >> binfile.bin
+  $ hg ci -m 'change binfile.bin'
+
+  $ hg revert -r 0 binfile.bin
+  $ hg ci -m 'revert binfile.bin'
+
+  $ hg diff --nodates -r 0 -r 1
+  diff -r 48b371597640 -r acea2ab458c8 binfile.bin
+  Binary file binfile.bin has changed
+
+  $ hg diff --nodates -r 0 -r 2
+
+  $ hg diff --git -r 0 -r 1
+  diff --git a/binfile.bin b/binfile.bin
+  index 37ba3d1c6f17137d9c5f5776fa040caf5fe73ff9..58dc31a9e2f40f74ff3b45903f7d620b8e5b7356
+  GIT binary patch
+  literal 594
+  zc$@)J0<HatP)<h;3K|Lk000e1NJLTq000mG000mO0ssI2kdbIM00009a7bBm000XU
+  z000XU0RWnu7ytkO2XskIMF-Uh9TW;VpMjwv0005-Nkl<ZD9@FWPs=e;7{<>W$NUkd
+  zX$nnYLt$-$V!?uy+1V%`z&Eh=ah|duER<4|QWhju3gb^nF*8iYobxWG-qqXl=2~5M
+  z*IoDB)sG^CfNuoBmqLTVU^<;@nwHP!1wrWd`{(mHo6VNXWtyh{alzqmsH*yYzpvLT
+  zLdY<T=ks|woh-`&01!ej#(xbV1f|pI*=%;d-%F*E*X#ZH`4I%6SS+$EJDE&ct=8po
+  ziN#{?_j|kD%Cd|oiqds`xm@;oJ-^?NG3Gdqrs?5u*zI;{nogxsx~^|Fn^Y?Gdc6<;
+  zfMJ+iF1J`LMx&A2?dEwNW8ClebzPTbIh{@$hS6*`kH@1d%Lo7fA#}N1)oN7`gm$~V
+  z+wDx#)OFqMcE{s!JN0-xhG8ItAjVkJwEcb`3WWlJfU2r?;Pd%dmR+q@mSri5q9_W-
+  zaR2~ECX?B2w+zELozC0s*6Z~|QG^f{3I#<`?)Q7U-JZ|q5W;9Q8i_=pBuSzunx=U;
+  z9C)5jBoYw9^?EHyQl(M}1OlQcCX>lXB*ODN003Z&P17_@)3Pi=i0wb04<W?v-u}7K
+  zXmmQA+wDgE!qR9o8jr`%=ab_&uh(l?R=r;Tjiqon91I2-hIu?57~@*4h7h9uORK#=
+  gQItJW-{SoTm)8|5##k|m00000NkvXXu0mjf3JwksH2?qr
+  
+
+  $ hg diff --git -r 0 -r 2
+
--- a/tests/test-diff-change	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-#!/bin/sh -e
-
-# test of hg diff --change
-
-set -e
-
-ec() {
-	echo "invoking $@:"
-	"$@"
-}
-
-hg init a
-cd a
-
-echo "first" > file.txt
-hg add file.txt
-hg commit -m 'first commit' # 0
-
-echo "second" > file.txt
-hg commit -m 'second commit' # 1
-
-echo "third" > file.txt
-hg commit -m 'third commit' # 2
-
-ec hg diff --nodates --change 1
-
-echo
-
-#rev=$(hg log -r 1 --template '{node|short}')
-rev=e9b286083166
-ec hg diff --nodates --change "$rev"
-
-##
-# Testing diff -c when merge
-
-for i in 1 2 3 4 5 6 7 8 9 10; do
-    echo $i >> file.txt
-done
-hg commit -m "lots of text" # 3
-
-sed -e 's,^2$,x,' file.txt > file.txt.tmp
-mv file.txt.tmp file.txt
-hg commit -m "changed 2 to x" # 4
-
-hg up -r 3 > /dev/null 2>&1 # updated, merged, removed, unresolved
-sed -e 's,^8$,y,' file.txt > file.txt.tmp
-mv file.txt.tmp file.txt
-hg commit -m "change 8 to y" > /dev/null 2>&1 # 5 # created new head
-
-hg up -C -r 4 > /dev/null 2>&1 # updated, merged, removed, unresolved
-hg merge -r 5 > /dev/null 2>&1 # updated, merged, removed, unresolved
-hg commit -m "merging 8 to y" # 6
-
-echo
-ec hg diff --nodates --change 6 # must be similar to hg diff --nodates --change 5
-
-#echo
-#hg log
-
-echo
-echo "EOF"
-
-# vim: set ts=4 sw=4 et:
--- a/tests/test-diff-change.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-invoking hg diff --nodates --change 1:
-diff -r 4bb65dda5db4 -r e9b286083166 file.txt
---- a/file.txt
-+++ b/file.txt
-@@ -1,1 +1,1 @@
--first
-+second
-
-invoking hg diff --nodates --change e9b286083166:
-diff -r 4bb65dda5db4 -r e9b286083166 file.txt
---- a/file.txt
-+++ b/file.txt
-@@ -1,1 +1,1 @@
--first
-+second
-
-invoking hg diff --nodates --change 6:
-diff -r e8a0797e73a6 -r aa9873050139 file.txt
---- a/file.txt
-+++ b/file.txt
-@@ -6,6 +6,6 @@
- 5
- 6
- 7
--8
-+y
- 9
- 10
-
-EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-diff-change.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,86 @@
+Testing diff --change
+
+  $ hg init a
+  $ cd a
+
+  $ echo "first" > file.txt
+  $ hg add file.txt
+  $ hg commit -m 'first commit' # 0
+
+  $ echo "second" > file.txt
+  $ hg commit -m 'second commit' # 1
+
+  $ echo "third" > file.txt
+  $ hg commit -m 'third commit' # 2
+
+  $ hg diff --nodates --change 1
+  diff -r 4bb65dda5db4 -r e9b286083166 file.txt
+  --- a/file.txt
+  +++ b/file.txt
+  @@ -1,1 +1,1 @@
+  -first
+  +second
+
+  $ hg diff --change e9b286083166
+  diff -r 4bb65dda5db4 -r e9b286083166 file.txt
+  --- a/file.txt	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/file.txt	Thu Jan 01 00:00:00 1970 +0000
+  @@ -1,1 +1,1 @@
+  -first
+  +second
+
+
+Testing diff --change when merge:
+
+  $ for i in 1 2 3 4 5 6 7 8 9 10; do
+  $    echo $i >> file.txt
+  $ done
+  $ hg commit -m "lots of text" # 3
+
+  $ sed -e 's,^2$,x,' file.txt > file.txt.tmp
+  $ mv file.txt.tmp file.txt
+  $ hg commit -m "change 2 to x" # 4
+
+  $ hg up -r 3
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ sed -e 's,^8$,y,' file.txt > file.txt.tmp
+  $ mv file.txt.tmp file.txt
+  $ hg commit -m "change 8 to y"
+  created new head
+
+  $ hg up -C -r 4
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg merge -r 5
+  merging file.txt
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg commit -m "merge 8 to y" # 6
+
+  $ hg diff --change 5
+  diff -r ae119d680c82 -r 9085c5c02e52 file.txt
+  --- a/file.txt	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/file.txt	Thu Jan 01 00:00:00 1970 +0000
+  @@ -6,6 +6,6 @@
+   5
+   6
+   7
+  -8
+  +y
+   9
+   10
+
+must be similar to 'hg diff --change 5':
+
+  $ hg diff -c 6
+  diff -r 273b50f17c6d -r 979ca961fd2e file.txt
+  --- a/file.txt	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/file.txt	Thu Jan 01 00:00:00 1970 +0000
+  @@ -6,6 +6,6 @@
+   5
+   6
+   7
+  -8
+  +y
+   9
+   10
+
--- a/tests/test-diff-color.out	Wed Sep 22 17:13:49 2010 -0500
+++ b/tests/test-diff-color.out	Wed Sep 22 18:29:41 2010 -0500
@@ -30,7 +30,7 @@
 diff --git a/a b/a
 old mode 100644
 new mode 100755
-1 hunks, 2 lines changed
+1 hunks, 1 lines changed
 examine changes to 'a'? [Ynsfdaq?] 
 @@ -2,7 +2,7 @@
  c
@@ -48,7 +48,7 @@
 diff --git a/a b/a
 old mode 100644
 new mode 100755
-1 hunks, 2 lines changed
+1 hunks, 1 lines changed
 examine changes to 'a'? [Ynsfdaq?] 
 @@ -2,7 +2,7 @@
  c
--- a/tests/test-diff-copy-depth	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-#!/bin/sh
-
-for i in aaa zzz; do
-    hg init t
-    cd t
-
-    echo "-- With $i"
-
-    touch file
-    hg add file
-    hg ci -m "Add"
-
-    hg cp file $i
-    hg ci -m "a -> $i"
-
-    hg cp $i other-file
-    echo "different" >> $i
-    hg ci -m "$i -> other-file"
-
-    hg cp other-file somename
-
-    echo "Status":
-    hg st -C
-    echo
-    echo "Diff:"
-    hg diff -g
-    echo
-
-    cd ..
-    rm -rf t
-done
--- a/tests/test-diff-copy-depth.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
--- With aaa
-Status:
-A somename
-  other-file
-
-Diff:
-diff --git a/other-file b/somename
-copy from other-file
-copy to somename
-
--- With zzz
-Status:
-A somename
-  other-file
-
-Diff:
-diff --git a/other-file b/somename
-copy from other-file
-copy to somename
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-diff-copy-depth.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,51 @@
+  $ for i in aaa zzz; do
+  >     hg init t
+  >     cd t
+  > 
+  >     echo
+  >     echo "-- With $i"
+  > 
+  >     touch file
+  >     hg add file
+  >     hg ci -m "Add"
+  > 
+  >     hg cp file $i
+  >     hg ci -m "a -> $i"
+  > 
+  >     hg cp $i other-file
+  >     echo "different" >> $i
+  >     hg ci -m "$i -> other-file"
+  > 
+  >     hg cp other-file somename
+  > 
+  >     echo "Status":
+  >     hg st -C
+  >     echo
+  >     echo "Diff:"
+  >     hg diff -g
+  > 
+  >     cd ..
+  >     rm -rf t
+  > done
+  
+  -- With aaa
+  Status:
+  A somename
+    other-file
+  
+  Diff:
+  diff --git a/other-file b/somename
+  copy from other-file
+  copy to somename
+  
+  -- With zzz
+  Status:
+  A somename
+    other-file
+  
+  Diff:
+  diff --git a/other-file b/somename
+  copy from other-file
+  copy to somename
+
+
--- a/tests/test-diff-hashes	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-#!/bin/sh
-
-hg init a
-cd a
-hg diff not found
-echo bar > foo
-hg add foo
-hg ci -m 'add foo' -d '1000000 0'
-
-echo foobar > foo
-hg ci -m 'change foo' -d '1000001 0'
-
-echo 'quiet:'
-hg --quiet diff -r 0 -r 1
-echo
-
-echo 'normal:'
-hg diff -r 0 -r 1
-echo
-
-echo 'verbose:'
-hg --verbose diff -r 0 -r 1
-echo
-
-echo 'debug:'
-hg --debug diff -r 0 -r 1
-echo
--- a/tests/test-diff-hashes.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-found: No such file or directory
-not: No such file or directory
-quiet:
---- a/foo	Mon Jan 12 13:46:40 1970 +0000
-+++ b/foo	Mon Jan 12 13:46:41 1970 +0000
-@@ -1,1 +1,1 @@
--bar
-+foobar
-
-normal:
-diff -r 74de3f1392e2 -r b8b5f023a6ad foo
---- a/foo	Mon Jan 12 13:46:40 1970 +0000
-+++ b/foo	Mon Jan 12 13:46:41 1970 +0000
-@@ -1,1 +1,1 @@
--bar
-+foobar
-
-verbose:
-diff -r 74de3f1392e2 -r b8b5f023a6ad foo
---- a/foo	Mon Jan 12 13:46:40 1970 +0000
-+++ b/foo	Mon Jan 12 13:46:41 1970 +0000
-@@ -1,1 +1,1 @@
--bar
-+foobar
-
-debug:
-diff -r 74de3f1392e2d67856fb155963441f2610494e1a -r b8b5f023a6ad77fc378bd95cf3fa00cd1414d107 foo
---- a/foo	Mon Jan 12 13:46:40 1970 +0000
-+++ b/foo	Mon Jan 12 13:46:41 1970 +0000
-@@ -1,1 +1,1 @@
--bar
-+foobar
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-diff-hashes.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,45 @@
+  $ hg init a
+  $ cd a
+
+  $ hg diff inexistent1 inexistent2
+  inexistent1: No such file or directory
+  inexistent2: No such file or directory
+
+  $ echo bar > foo
+  $ hg add foo
+  $ hg ci -m 'add foo'
+
+  $ echo foobar > foo
+  $ hg ci -m 'change foo'
+
+  $ hg --quiet diff -r 0 -r 1
+  --- a/foo	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/foo	Thu Jan 01 00:00:00 1970 +0000
+  @@ -1,1 +1,1 @@
+  -bar
+  +foobar
+
+  $ hg diff -r 0 -r 1
+  diff -r a99fb63adac3 -r 9b8568d3af2f foo
+  --- a/foo	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/foo	Thu Jan 01 00:00:00 1970 +0000
+  @@ -1,1 +1,1 @@
+  -bar
+  +foobar
+
+  $ hg --verbose diff -r 0 -r 1
+  diff -r a99fb63adac3 -r 9b8568d3af2f foo
+  --- a/foo	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/foo	Thu Jan 01 00:00:00 1970 +0000
+  @@ -1,1 +1,1 @@
+  -bar
+  +foobar
+
+  $ hg --debug diff -r 0 -r 1
+  diff -r a99fb63adac3f31816a22f665bc3b7a7655b30f4 -r 9b8568d3af2f1749445eef03aede868a6f39f210 foo
+  --- a/foo	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/foo	Thu Jan 01 00:00:00 1970 +0000
+  @@ -1,1 +1,1 @@
+  -bar
+  +foobar
+
--- a/tests/test-diff-ignore-whitespace	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,121 +0,0 @@
-#!/bin/sh
-
-# GNU diff is the reference for all of these results.
-
-hgdiff() {
-    echo hg diff $@
-    hg diff --nodates "$@"
-}
-
-test_added_blank_lines() {
-    printf '\nhello world\n\ngoodbye world\n\n' >foo
-
-    echo '>>> two diffs showing three added lines <<<'
-    hgdiff
-    hgdiff -b
-
-    echo '>>> no diffs <<<'
-    hgdiff -B
-    hgdiff -Bb
-}
-
-test_added_horizontal_space_first_on_a_line() {
-    printf '\t hello world\ngoodbye world\n' >foo
-
-    echo '>>> four diffs showing added space first on the first line <<<'
-    hgdiff
-    hgdiff -b
-    hgdiff -B
-    hgdiff -Bb
-}
-
-test_added_horizontal_space_last_on_a_line() {
-    printf 'hello world\t \ngoodbye world\n' >foo
-
-    echo '>>> two diffs showing space appended to the first line <<<'
-    hgdiff
-    hgdiff -B
-
-    echo '>>> no diffs <<<'
-    hgdiff -b
-    hgdiff -Bb
-}
-
-test_added_horizontal_space_in_the_middle_of_a_word() {
-    printf 'hello world\ngood bye world\n' >foo
-
-    echo '>>> four diffs showing space inserted into "goodbye" <<<'
-    hgdiff
-    hgdiff -B
-    hgdiff -b
-    hgdiff -Bb
-}
-
-test_increased_horizontal_whitespace_amount() {
-    printf 'hello world\ngoodbye\t\t  \tworld\n' >foo
-
-    echo '>>> two diffs showing changed whitespace amount in the last line <<<'
-    hgdiff
-    hgdiff -B
-
-    echo '>>> no diffs <<<'
-    hgdiff -b
-    hgdiff -Bb
-}
-
-test_added_blank_line_with_horizontal_whitespace() {
-    printf 'hello world\n \t\ngoodbye world\n' >foo
-
-    echo '>>> four diffs showing added blank line w/horizontal space <<<'
-    hgdiff
-    hgdiff -B
-    hgdiff -b
-    hgdiff -Bb
-}
-
-test_added_blank_line_with_other_whitespace() {
-    printf 'hello  world\n \t\ngoodbye world \n' >foo
-
-    echo '>>> three diffs showing added blank line w/other space <<<'
-    hgdiff
-    hgdiff -B
-    hgdiff -b
-    hgdiff -Bb
-}
-
-test_whitespace_changes() {
-    printf 'helloworld\ngoodbye\tworld \n' >foo
-
-    echo '>>> four diffs showing changed whitespace <<<'
-    hgdiff
-    hgdiff -B
-    hgdiff -b
-    hgdiff -Bb
-    hgdiff -w
-}
-
-test_whitespace_changes_and_blank_lines() {
-    printf 'helloworld\n\n\n\ngoodbye\tworld \n' >foo
-
-    echo '>>> five diffs showing changed whitespace <<<'
-    hgdiff
-    hgdiff -B
-    hgdiff -b
-    hgdiff -Bb
-    hgdiff -w
-    hgdiff -wB
-}
-
-hg init
-printf 'hello world\ngoodbye world\n' >foo
-hg ci -Amfoo -ufoo
-
-test_added_blank_lines
-test_added_horizontal_space_first_on_a_line
-test_added_horizontal_space_last_on_a_line
-test_added_horizontal_space_in_the_middle_of_a_word
-test_increased_horizontal_whitespace_amount
-test_added_blank_line_with_horizontal_whitespace
-test_added_blank_line_with_other_whitespace
-test_whitespace_changes
-test_whitespace_changes_and_blank_lines
--- a/tests/test-diff-ignore-whitespace.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,281 +0,0 @@
-adding foo
->>> two diffs showing three added lines <<<
-hg diff
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,5 @@
-+
- hello world
-+
- goodbye world
-+
-hg diff -b
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,5 @@
-+
- hello world
-+
- goodbye world
-+
->>> no diffs <<<
-hg diff -B
-hg diff -Bb
->>> four diffs showing added space first on the first line <<<
-hg diff
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,2 @@
--hello world
-+	 hello world
- goodbye world
-hg diff -b
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,2 @@
--hello world
-+	 hello world
- goodbye world
-hg diff -B
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,2 @@
--hello world
-+	 hello world
- goodbye world
-hg diff -Bb
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,2 @@
--hello world
-+	 hello world
- goodbye world
->>> two diffs showing space appended to the first line <<<
-hg diff
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,2 @@
--hello world
-+hello world	 
- goodbye world
-hg diff -B
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,2 @@
--hello world
-+hello world	 
- goodbye world
->>> no diffs <<<
-hg diff -b
-hg diff -Bb
->>> four diffs showing space inserted into "goodbye" <<<
-hg diff
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,2 @@
- hello world
--goodbye world
-+good bye world
-hg diff -B
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,2 @@
- hello world
--goodbye world
-+good bye world
-hg diff -b
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,2 @@
- hello world
--goodbye world
-+good bye world
-hg diff -Bb
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,2 @@
- hello world
--goodbye world
-+good bye world
->>> two diffs showing changed whitespace amount in the last line <<<
-hg diff
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,2 @@
- hello world
--goodbye world
-+goodbye		  	world
-hg diff -B
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,2 @@
- hello world
--goodbye world
-+goodbye		  	world
->>> no diffs <<<
-hg diff -b
-hg diff -Bb
->>> four diffs showing added blank line w/horizontal space <<<
-hg diff
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,3 @@
- hello world
-+ 	
- goodbye world
-hg diff -B
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,3 @@
- hello world
-+ 	
- goodbye world
-hg diff -b
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,3 @@
- hello world
-+ 	
- goodbye world
-hg diff -Bb
->>> three diffs showing added blank line w/other space <<<
-hg diff
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,3 @@
--hello world
--goodbye world
-+hello  world
-+ 	
-+goodbye world 
-hg diff -B
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,3 @@
--hello world
--goodbye world
-+hello  world
-+ 	
-+goodbye world 
-hg diff -b
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,3 @@
- hello world
-+ 	
- goodbye world
-hg diff -Bb
->>> four diffs showing changed whitespace <<<
-hg diff
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,2 @@
--hello world
--goodbye world
-+helloworld
-+goodbye	world 
-hg diff -B
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,2 @@
--hello world
--goodbye world
-+helloworld
-+goodbye	world 
-hg diff -b
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,2 @@
--hello world
-+helloworld
- goodbye world
-hg diff -Bb
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,2 @@
--hello world
-+helloworld
- goodbye world
-hg diff -w
->>> five diffs showing changed whitespace <<<
-hg diff
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,5 @@
--hello world
--goodbye world
-+helloworld
-+
-+
-+
-+goodbye	world 
-hg diff -B
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,5 @@
--hello world
--goodbye world
-+helloworld
-+
-+
-+
-+goodbye	world 
-hg diff -b
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,5 @@
--hello world
-+helloworld
-+
-+
-+
- goodbye world
-hg diff -Bb
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,5 @@
--hello world
-+helloworld
-+
-+
-+
- goodbye world
-hg diff -w
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,5 @@
- hello world
-+
-+
-+
- goodbye world
-hg diff -wB
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-diff-ignore-whitespace.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,392 @@
+GNU diff is the reference for all of these results.
+
+Prepare tests:
+
+  $ echo '[alias]' >> $HGRCPATH
+  $ echo 'ndiff = diff --nodates' >> $HGRCPATH
+
+  $ hg init
+  $ printf 'hello world\ngoodbye world\n' >foo
+  $ hg ci -Amfoo -ufoo
+  adding foo
+
+
+Test added blank lines:
+
+  $ printf '\nhello world\n\ngoodbye world\n\n' >foo
+
+>>> two diffs showing three added lines <<<
+
+  $ hg ndiff
+  diff -r 540c40a65b78 foo
+  --- a/foo
+  +++ b/foo
+  @@ -1,2 +1,5 @@
+  +
+   hello world
+  +
+   goodbye world
+  +
+  $ hg ndiff -b
+  diff -r 540c40a65b78 foo
+  --- a/foo
+  +++ b/foo
+  @@ -1,2 +1,5 @@
+  +
+   hello world
+  +
+   goodbye world
+  +
+
+>>> no diffs <<<
+
+  $ hg ndiff -B
+  $ hg ndiff -Bb
+
+
+Test added horizontal space first on a line():
+
+  $ printf '\t hello world\ngoodbye world\n' >foo
+
+>>> four diffs showing added space first on the first line <<<
+
+  $ hg ndiff
+  diff -r 540c40a65b78 foo
+  --- a/foo
+  +++ b/foo
+  @@ -1,2 +1,2 @@
+  -hello world
+  +	 hello world
+   goodbye world
+
+  $ hg ndiff -b
+  diff -r 540c40a65b78 foo
+  --- a/foo
+  +++ b/foo
+  @@ -1,2 +1,2 @@
+  -hello world
+  +	 hello world
+   goodbye world
+
+  $ hg ndiff -B
+  diff -r 540c40a65b78 foo
+  --- a/foo
+  +++ b/foo
+  @@ -1,2 +1,2 @@
+  -hello world
+  +	 hello world
+   goodbye world
+
+  $ hg ndiff -Bb
+  diff -r 540c40a65b78 foo
+  --- a/foo
+  +++ b/foo
+  @@ -1,2 +1,2 @@
+  -hello world
+  +	 hello world
+   goodbye world
+
+
+Test added horizontal space last on a line:
+
+  $ printf 'hello world\t \ngoodbye world\n' >foo
+
+>>> two diffs showing space appended to the first line <<<
+
+  $ hg ndiff
+  diff -r 540c40a65b78 foo
+  --- a/foo
+  +++ b/foo
+  @@ -1,2 +1,2 @@
+  -hello world
+  +hello world	 
+   goodbye world
+
+  $ hg ndiff -B
+  diff -r 540c40a65b78 foo
+  --- a/foo
+  +++ b/foo
+  @@ -1,2 +1,2 @@
+  -hello world
+  +hello world	 
+   goodbye world
+
+>>> no diffs <<<
+
+  $ hg ndiff -b
+  $ hg ndiff -Bb
+
+
+Test added horizontal space in the middle of a word:
+
+  $ printf 'hello world\ngood bye world\n' >foo
+
+>>> four diffs showing space inserted into "goodbye" <<<
+
+  $ hg ndiff
+  diff -r 540c40a65b78 foo
+  --- a/foo
+  +++ b/foo
+  @@ -1,2 +1,2 @@
+   hello world
+  -goodbye world
+  +good bye world
+
+  $ hg ndiff -B
+  diff -r 540c40a65b78 foo
+  --- a/foo
+  +++ b/foo
+  @@ -1,2 +1,2 @@
+   hello world
+  -goodbye world
+  +good bye world
+
+  $ hg ndiff -b
+  diff -r 540c40a65b78 foo
+  --- a/foo
+  +++ b/foo
+  @@ -1,2 +1,2 @@
+   hello world
+  -goodbye world
+  +good bye world
+
+  $ hg ndiff -Bb
+  diff -r 540c40a65b78 foo
+  --- a/foo
+  +++ b/foo
+  @@ -1,2 +1,2 @@
+   hello world
+  -goodbye world
+  +good bye world
+
+
+Test increased horizontal whitespace amount:
+
+  $ printf 'hello world\ngoodbye\t\t  \tworld\n' >foo
+
+>>> two diffs showing changed whitespace amount in the last line <<<
+
+  $ hg ndiff
+  diff -r 540c40a65b78 foo
+  --- a/foo
+  +++ b/foo
+  @@ -1,2 +1,2 @@
+   hello world
+  -goodbye world
+  +goodbye		  	world
+
+  $ hg ndiff -B
+  diff -r 540c40a65b78 foo
+  --- a/foo
+  +++ b/foo
+  @@ -1,2 +1,2 @@
+   hello world
+  -goodbye world
+  +goodbye		  	world
+
+>>> no diffs <<<
+
+  $ hg ndiff -b
+  $ hg ndiff -Bb
+
+
+Test added blank line with horizontal whitespace:
+
+  $ printf 'hello world\n \t\ngoodbye world\n' >foo
+
+>>> three diffs showing added blank line with horizontal space <<<
+
+  $ hg ndiff
+  diff -r 540c40a65b78 foo
+  --- a/foo
+  +++ b/foo
+  @@ -1,2 +1,3 @@
+   hello world
+  + 	
+   goodbye world
+
+  $ hg ndiff -B
+  diff -r 540c40a65b78 foo
+  --- a/foo
+  +++ b/foo
+  @@ -1,2 +1,3 @@
+   hello world
+  + 	
+   goodbye world
+
+  $ hg ndiff -b
+  diff -r 540c40a65b78 foo
+  --- a/foo
+  +++ b/foo
+  @@ -1,2 +1,3 @@
+   hello world
+  + 	
+   goodbye world
+
+>>> no diffs <<<
+
+  $ hg ndiff -Bb
+
+
+Test added blank line with other whitespace:
+
+  $ printf 'hello  world\n \t\ngoodbye world \n' >foo
+
+>>> three diffs showing added blank line with other space <<<
+
+  $ hg ndiff
+  diff -r 540c40a65b78 foo
+  --- a/foo
+  +++ b/foo
+  @@ -1,2 +1,3 @@
+  -hello world
+  -goodbye world
+  +hello  world
+  + 	
+  +goodbye world 
+
+  $ hg ndiff -B
+  diff -r 540c40a65b78 foo
+  --- a/foo
+  +++ b/foo
+  @@ -1,2 +1,3 @@
+  -hello world
+  -goodbye world
+  +hello  world
+  + 	
+  +goodbye world 
+
+  $ hg ndiff -b
+  diff -r 540c40a65b78 foo
+  --- a/foo
+  +++ b/foo
+  @@ -1,2 +1,3 @@
+   hello world
+  + 	
+   goodbye world
+
+>>> no diffs <<<
+
+  $ hg ndiff -Bb
+
+
+Test whitespace changes:
+
+  $ printf 'helloworld\ngoodbye\tworld \n' >foo
+
+>>> four diffs showing changed whitespace <<<
+
+  $ hg ndiff
+  diff -r 540c40a65b78 foo
+  --- a/foo
+  +++ b/foo
+  @@ -1,2 +1,2 @@
+  -hello world
+  -goodbye world
+  +helloworld
+  +goodbye	world 
+
+  $ hg ndiff -B
+  diff -r 540c40a65b78 foo
+  --- a/foo
+  +++ b/foo
+  @@ -1,2 +1,2 @@
+  -hello world
+  -goodbye world
+  +helloworld
+  +goodbye	world 
+
+  $ hg ndiff -b
+  diff -r 540c40a65b78 foo
+  --- a/foo
+  +++ b/foo
+  @@ -1,2 +1,2 @@
+  -hello world
+  +helloworld
+   goodbye world
+
+  $ hg ndiff -Bb
+  diff -r 540c40a65b78 foo
+  --- a/foo
+  +++ b/foo
+  @@ -1,2 +1,2 @@
+  -hello world
+  +helloworld
+   goodbye world
+
+>>> no diffs <<<
+
+  $ hg ndiff -w
+
+
+Test whitespace changes and blank lines:
+
+  $ printf 'helloworld\n\n\n\ngoodbye\tworld \n' >foo
+
+>>> five diffs showing changed whitespace <<<
+
+  $ hg ndiff
+  diff -r 540c40a65b78 foo
+  --- a/foo
+  +++ b/foo
+  @@ -1,2 +1,5 @@
+  -hello world
+  -goodbye world
+  +helloworld
+  +
+  +
+  +
+  +goodbye	world 
+
+  $ hg ndiff -B
+  diff -r 540c40a65b78 foo
+  --- a/foo
+  +++ b/foo
+  @@ -1,2 +1,5 @@
+  -hello world
+  -goodbye world
+  +helloworld
+  +
+  +
+  +
+  +goodbye	world 
+
+  $ hg ndiff -b
+  diff -r 540c40a65b78 foo
+  --- a/foo
+  +++ b/foo
+  @@ -1,2 +1,5 @@
+  -hello world
+  +helloworld
+  +
+  +
+  +
+   goodbye world
+
+  $ hg ndiff -Bb
+  diff -r 540c40a65b78 foo
+  --- a/foo
+  +++ b/foo
+  @@ -1,2 +1,5 @@
+  -hello world
+  +helloworld
+  +
+  +
+  +
+   goodbye world
+
+  $ hg ndiff -w
+  diff -r 540c40a65b78 foo
+  --- a/foo
+  +++ b/foo
+  @@ -1,2 +1,5 @@
+   hello world
+  +
+  +
+  +
+   goodbye world
+
+>>> no diffs <<<
+
+  $ hg ndiff -wB
+
--- a/tests/test-diff-newlines	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-hg init
-python -c 'print "confuse str.splitlines\nembedded\rnewline"' > a
-hg ci -Ama -d '1 0'
-echo clean diff >> a
-hg ci -mb -d '2 0'
-hg diff -r0 -r1
--- a/tests/test-diff-newlines.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-adding a
-diff -r 107ba6f817b5 -r 310ce7989cdc a
---- a/a	Thu Jan 01 00:00:01 1970 +0000
-+++ b/a	Thu Jan 01 00:00:02 1970 +0000
-@@ -1,2 +1,3 @@
- confuse str.splitlines
- embedded
newline
-+clean diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-diff-newlines.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,18 @@
+  $ hg init
+
+  $ python -c 'print "confuse str.splitlines\nembedded\rnewline"' > a
+  $ hg ci -Ama -d '1 0'
+  adding a
+
+  $ echo clean diff >> a
+  $ hg ci -mb -d '2 0'
+
+  $ hg diff -r0 -r1
+  diff -r 107ba6f817b5 -r 310ce7989cdc a
+  --- a/a	Thu Jan 01 00:00:01 1970 +0000
+  +++ b/a	Thu Jan 01 00:00:02 1970 +0000
+  @@ -1,2 +1,3 @@
+   confuse str.splitlines
+   embedded
newline
+  +clean diff
+
--- a/tests/test-diff-reverse	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-#!/bin/sh
-
-hg init
-cat > a <<EOF
-a
-b
-c
-EOF
-hg ci -Am adda
-
-cat > a <<EOF
-d
-e
-f
-EOF
-hg ci -m moda
-
-hg diff --reverse -r0 -r1
-
-cat >> a <<EOF
-g
-h
-EOF
-hg diff --reverse --nodates
--- a/tests/test-diff-reverse.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-adding a
-diff -r 2855cdcfcbb7 -r 8e1805a3cf6e a
---- a/a	Thu Jan 01 00:00:00 1970 +0000
-+++ b/a	Thu Jan 01 00:00:00 1970 +0000
-@@ -1,3 +1,3 @@
--d
--e
--f
-+a
-+b
-+c
-diff -r 2855cdcfcbb7 a
---- a/a
-+++ b/a
-@@ -1,5 +1,3 @@
- d
- e
- f
--g
--h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-diff-reverse.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,44 @@
+  $ hg init
+
+  $ cat > a <<EOF
+  > a
+  > b
+  > c
+  > EOF
+  $ hg ci -Am adda
+  adding a
+
+  $ cat > a <<EOF
+  > d
+  > e
+  > f
+  > EOF
+  $ hg ci -m moda
+
+  $ hg diff --reverse -r0 -r1
+  diff -r 2855cdcfcbb7 -r 8e1805a3cf6e a
+  --- a/a	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/a	Thu Jan 01 00:00:00 1970 +0000
+  @@ -1,3 +1,3 @@
+  -d
+  -e
+  -f
+  +a
+  +b
+  +c
+
+  $ cat >> a <<EOF
+  > g
+  > h
+  > EOF
+  $ hg diff --reverse --nodates
+  diff -r 2855cdcfcbb7 a
+  --- a/a
+  +++ b/a
+  @@ -1,5 +1,3 @@
+   d
+   e
+   f
+  -g
+  -h
+
--- a/tests/test-diff-subdir	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-#!/bin/sh
-
-hg init
-
-mkdir alpha
-touch alpha/one
-mkdir beta
-touch beta/two
-
-hg add alpha/one beta/two
-hg ci -m "start" -d "1000000 0"
-
-echo 1 > alpha/one
-echo 2 > beta/two
-
-echo EVERYTHING
-hg diff --nodates
-
-echo BETA ONLY
-hg diff --nodates beta
-
-echo INSIDE BETA
-cd beta
-hg diff --nodates .
--- a/tests/test-diff-subdir.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-EVERYTHING
-diff -r ec612a6291f1 alpha/one
---- a/alpha/one
-+++ b/alpha/one
-@@ -0,0 +1,1 @@
-+1
-diff -r ec612a6291f1 beta/two
---- a/beta/two
-+++ b/beta/two
-@@ -0,0 +1,1 @@
-+2
-BETA ONLY
-diff -r ec612a6291f1 beta/two
---- a/beta/two
-+++ b/beta/two
-@@ -0,0 +1,1 @@
-+2
-INSIDE BETA
-diff -r ec612a6291f1 beta/two
---- a/beta/two
-+++ b/beta/two
-@@ -0,0 +1,1 @@
-+2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-diff-subdir.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,46 @@
+  $ hg init
+
+  $ mkdir alpha
+  $ touch alpha/one
+  $ mkdir beta
+  $ touch beta/two
+
+  $ hg add alpha/one beta/two
+  $ hg ci -m "start"
+
+  $ echo 1 > alpha/one
+  $ echo 2 > beta/two
+
+everything
+
+  $ hg diff --nodates
+  diff -r 7d5ef1aea329 alpha/one
+  --- a/alpha/one
+  +++ b/alpha/one
+  @@ -0,0 +1,1 @@
+  +1
+  diff -r 7d5ef1aea329 beta/two
+  --- a/beta/two
+  +++ b/beta/two
+  @@ -0,0 +1,1 @@
+  +2
+
+beta only
+
+  $ hg diff --nodates beta
+  diff -r 7d5ef1aea329 beta/two
+  --- a/beta/two
+  +++ b/beta/two
+  @@ -0,0 +1,1 @@
+  +2
+
+inside beta
+
+  $ cd beta
+  $ hg diff --nodates .
+  diff -r 7d5ef1aea329 beta/two
+  --- a/beta/two
+  +++ b/beta/two
+  @@ -0,0 +1,1 @@
+  +2
+
--- a/tests/test-diff-unified	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-#!/bin/sh
-
-hg init repo
-cd repo
-cat > a <<EOF
-c
-c
-a
-a
-b
-a
-a
-c
-c
-EOF
-hg ci -Am adda
-cat > a <<EOF
-c
-c
-a
-a
-dd
-a
-a
-c
-c
-EOF
-
-echo '% default context'
-hg diff --nodates
-
-echo '% invalid --unified'
-hg diff --nodates -U foo
-
-echo '% --unified=2'
-hg diff --nodates -U 2
-
-echo '% diff.unified=2'
-hg --config diff.unified=2 diff --nodates
-
-echo '% diff.unified=2 --unified=1'
-hg diff --nodates -U 1
-
-echo '% invalid diff.unified'
-hg --config diff.unified=foo diff --nodates
-
-echo % test off-by-one error with diff -p
-hg init diffp
-cd diffp
-echo a > a
-hg ci -Ama
-rm a
-echo b > a
-echo a >> a
-echo c >> a
-hg diff -U0 -p --nodates
-
-exit 0
--- a/tests/test-diff-unified.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-adding a
-% default context
-diff -r cf9f4ba66af2 a
---- a/a
-+++ b/a
-@@ -2,7 +2,7 @@
- c
- a
- a
--b
-+dd
- a
- a
- c
-% invalid --unified
-abort: diff context lines count must be an integer, not 'foo'
-% --unified=2
-diff -r cf9f4ba66af2 a
---- a/a
-+++ b/a
-@@ -3,5 +3,5 @@
- a
- a
--b
-+dd
- a
- a
-% diff.unified=2
-diff -r cf9f4ba66af2 a
---- a/a
-+++ b/a
-@@ -3,5 +3,5 @@
- a
- a
--b
-+dd
- a
- a
-% diff.unified=2 --unified=1
-diff -r cf9f4ba66af2 a
---- a/a
-+++ b/a
-@@ -4,3 +4,3 @@
- a
--b
-+dd
- a
-% invalid diff.unified
-abort: diff context lines count must be an integer, not 'foo'
-% test off-by-one error with diff -p
-adding a
-diff -r cb9a9f314b8b a
---- a/a
-+++ b/a
-@@ -1,0 +1,1 @@
-+b
-@@ -2,0 +3,1 @@ a
-+c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-diff-unified.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,111 @@
+  $ hg init repo
+  $ cd repo
+  $ cat > a <<EOF
+  > c
+  > c
+  > a
+  > a
+  > b
+  > a
+  > a
+  > c
+  > c
+  > EOF
+  $ hg ci -Am adda
+  adding a
+
+  $ cat > a <<EOF
+  > c
+  > c
+  > a
+  > a
+  > dd
+  > a
+  > a
+  > c
+  > c
+  > EOF
+
+default context
+
+  $ hg diff --nodates
+  diff -r cf9f4ba66af2 a
+  --- a/a
+  +++ b/a
+  @@ -2,7 +2,7 @@
+   c
+   a
+   a
+  -b
+  +dd
+   a
+   a
+   c
+
+invalid --unified
+
+  $ hg diff --nodates -U foo
+  abort: diff context lines count must be an integer, not 'foo'
+  [255]
+
+
+  $ hg diff --nodates -U 2
+  diff -r cf9f4ba66af2 a
+  --- a/a
+  +++ b/a
+  @@ -3,5 +3,5 @@
+   a
+   a
+  -b
+  +dd
+   a
+   a
+
+  $ hg --config diff.unified=2 diff --nodates
+  diff -r cf9f4ba66af2 a
+  --- a/a
+  +++ b/a
+  @@ -3,5 +3,5 @@
+   a
+   a
+  -b
+  +dd
+   a
+   a
+
+  $ hg diff --nodates -U 1
+  diff -r cf9f4ba66af2 a
+  --- a/a
+  +++ b/a
+  @@ -4,3 +4,3 @@
+   a
+  -b
+  +dd
+   a
+
+invalid diff.unified
+
+  $ hg --config diff.unified=foo diff --nodates
+  abort: diff context lines count must be an integer, not 'foo'
+  [255]
+
+test off-by-one error with diff -p
+
+  $ hg init diffp
+  $ cd diffp
+  $ echo a > a
+  $ hg ci -Ama
+  adding a
+  $ rm a
+  $ echo b > a
+  $ echo a >> a
+  $ echo c >> a
+  $ hg diff -U0 -p --nodates
+  diff -r cb9a9f314b8b a
+  --- a/a
+  +++ b/a
+  @@ -1,0 +1,1 @@
+  +b
+  @@ -2,0 +3,1 @@ a
+  +c
+
--- a/tests/test-diff-upgrade	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-#!/bin/sh
-
-echo "[extensions]" >> $HGRCPATH
-echo "autodiff=$TESTDIR/autodiff.py" >> $HGRCPATH
-echo "[diff]" >> $HGRCPATH
-echo "nodates=1" >> $HGRCPATH
-
-hg init repo
-cd repo
-echo '% make a combination of new, changed and deleted file'
-echo regular > regular
-echo rmregular > rmregular
-touch rmempty
-echo exec > exec
-chmod +x exec
-echo rmexec > rmexec
-chmod +x rmexec
-echo setexec > setexec
-echo unsetexec > unsetexec
-chmod +x unsetexec
-echo binary > binary
-python -c "file('rmbinary', 'wb').write('\0')"
-hg ci -Am addfiles
-echo regular >> regular
-echo newregular >> newregular
-rm rmempty
-touch newempty
-rm rmregular
-echo exec >> exec
-echo newexec > newexec
-chmod +x newexec
-rm rmexec
-chmod +x setexec
-chmod -x unsetexec
-python -c "file('binary', 'wb').write('\0\0')"
-python -c "file('newbinary', 'wb').write('\0')"
-rm rmbinary
-hg addremove
-
-echo '% git=no: regular diff for all files'
-hg autodiff --git=no
-
-echo '% git=no: git diff for single regular file'
-hg autodiff --git=yes regular
-
-echo '% git=auto: regular diff for regular files and removals'
-hg autodiff --git=auto regular newregular rmregular rmbinary rmexec
-
-for f in exec newexec setexec unsetexec binary newbinary newempty rmempty; do
-    echo '% git=auto: git diff for' $f
-    hg autodiff --git=auto $f
-done
-
-echo '% git=warn: regular diff with data loss warnings'
-hg autodiff --git=warn
-
-echo '% git=abort: fail on execute bit change'
-hg autodiff --git=abort regular setexec
-
-echo '% git=abort: succeed on regular file'
-hg autodiff --git=abort regular
-
-cd ..
--- a/tests/test-diff-upgrade.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,186 +0,0 @@
-% make a combination of new, changed and deleted file
-adding binary
-adding exec
-adding regular
-adding rmbinary
-adding rmempty
-adding rmexec
-adding rmregular
-adding setexec
-adding unsetexec
-adding newbinary
-adding newempty
-adding newexec
-adding newregular
-removing rmbinary
-removing rmempty
-removing rmexec
-removing rmregular
-% git=no: regular diff for all files
-diff -r b3f053cd7c7f binary
-Binary file binary has changed
-diff -r b3f053cd7c7f exec
---- a/exec
-+++ b/exec
-@@ -1,1 +1,2 @@
- exec
-+exec
-diff -r b3f053cd7c7f newbinary
-Binary file newbinary has changed
-diff -r b3f053cd7c7f newexec
---- /dev/null
-+++ b/newexec
-@@ -0,0 +1,1 @@
-+newexec
-diff -r b3f053cd7c7f newregular
---- /dev/null
-+++ b/newregular
-@@ -0,0 +1,1 @@
-+newregular
-diff -r b3f053cd7c7f regular
---- a/regular
-+++ b/regular
-@@ -1,1 +1,2 @@
- regular
-+regular
-diff -r b3f053cd7c7f rmbinary
-Binary file rmbinary has changed
-diff -r b3f053cd7c7f rmexec
---- a/rmexec
-+++ /dev/null
-@@ -1,1 +0,0 @@
--rmexec
-diff -r b3f053cd7c7f rmregular
---- a/rmregular
-+++ /dev/null
-@@ -1,1 +0,0 @@
--rmregular
-% git=no: git diff for single regular file
-diff --git a/regular b/regular
---- a/regular
-+++ b/regular
-@@ -1,1 +1,2 @@
- regular
-+regular
-% git=auto: regular diff for regular files and removals
-diff -r b3f053cd7c7f newregular
---- /dev/null
-+++ b/newregular
-@@ -0,0 +1,1 @@
-+newregular
-diff -r b3f053cd7c7f regular
---- a/regular
-+++ b/regular
-@@ -1,1 +1,2 @@
- regular
-+regular
-diff -r b3f053cd7c7f rmbinary
-Binary file rmbinary has changed
-diff -r b3f053cd7c7f rmexec
---- a/rmexec
-+++ /dev/null
-@@ -1,1 +0,0 @@
--rmexec
-diff -r b3f053cd7c7f rmregular
---- a/rmregular
-+++ /dev/null
-@@ -1,1 +0,0 @@
--rmregular
-% git=auto: git diff for exec
-diff -r b3f053cd7c7f exec
---- a/exec
-+++ b/exec
-@@ -1,1 +1,2 @@
- exec
-+exec
-% git=auto: git diff for newexec
-diff --git a/newexec b/newexec
-new file mode 100755
---- /dev/null
-+++ b/newexec
-@@ -0,0 +1,1 @@
-+newexec
-% git=auto: git diff for setexec
-diff --git a/setexec b/setexec
-old mode 100644
-new mode 100755
-% git=auto: git diff for unsetexec
-diff --git a/unsetexec b/unsetexec
-old mode 100755
-new mode 100644
-% git=auto: git diff for binary
-diff --git a/binary b/binary
-index a9128c283485202893f5af379dd9beccb6e79486..09f370e38f498a462e1ca0faa724559b6630c04f
-GIT binary patch
-literal 2
-Jc${Nk0000200961
-
-% git=auto: git diff for newbinary
-diff --git a/newbinary b/newbinary
-new file mode 100644
-index 0000000000000000000000000000000000000000..f76dd238ade08917e6712764a16a22005a50573d
-GIT binary patch
-literal 1
-Ic${MZ000310RR91
-
-% git=auto: git diff for newempty
-diff --git a/newempty b/newempty
-new file mode 100644
-% git=auto: git diff for rmempty
-diff --git a/rmempty b/rmempty
-deleted file mode 100644
-% git=warn: regular diff with data loss warnings
-diff -r b3f053cd7c7f binary
-Binary file binary has changed
-diff -r b3f053cd7c7f exec
---- a/exec
-+++ b/exec
-@@ -1,1 +1,2 @@
- exec
-+exec
-diff -r b3f053cd7c7f newbinary
-Binary file newbinary has changed
-diff -r b3f053cd7c7f newexec
---- /dev/null
-+++ b/newexec
-@@ -0,0 +1,1 @@
-+newexec
-diff -r b3f053cd7c7f newregular
---- /dev/null
-+++ b/newregular
-@@ -0,0 +1,1 @@
-+newregular
-diff -r b3f053cd7c7f regular
---- a/regular
-+++ b/regular
-@@ -1,1 +1,2 @@
- regular
-+regular
-diff -r b3f053cd7c7f rmbinary
-Binary file rmbinary has changed
-diff -r b3f053cd7c7f rmexec
---- a/rmexec
-+++ /dev/null
-@@ -1,1 +0,0 @@
--rmexec
-diff -r b3f053cd7c7f rmregular
---- a/rmregular
-+++ /dev/null
-@@ -1,1 +0,0 @@
--rmregular
-data lost for: binary
-data lost for: newbinary
-data lost for: newempty
-data lost for: newexec
-data lost for: rmempty
-data lost for: setexec
-data lost for: unsetexec
-% git=abort: fail on execute bit change
-abort: losing data for setexec
-% git=abort: succeed on regular file
-diff -r b3f053cd7c7f regular
---- a/regular
-+++ b/regular
-@@ -1,1 +1,2 @@
- regular
-+regular
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-diff-upgrade.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,260 @@
+
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "autodiff=$TESTDIR/autodiff.py" >> $HGRCPATH
+  $ echo "[diff]" >> $HGRCPATH
+  $ echo "nodates=1" >> $HGRCPATH
+
+  $ hg init repo
+  $ cd repo
+
+make a combination of new, changed and deleted file
+
+  $ echo regular > regular
+  $ echo rmregular > rmregular
+  $ touch rmempty
+  $ echo exec > exec
+  $ chmod +x exec
+  $ echo rmexec > rmexec
+  $ chmod +x rmexec
+  $ echo setexec > setexec
+  $ echo unsetexec > unsetexec
+  $ chmod +x unsetexec
+  $ echo binary > binary
+  $ python -c "file('rmbinary', 'wb').write('\0')"
+  $ hg ci -Am addfiles
+  adding binary
+  adding exec
+  adding regular
+  adding rmbinary
+  adding rmempty
+  adding rmexec
+  adding rmregular
+  adding setexec
+  adding unsetexec
+  $ echo regular >> regular
+  $ echo newregular >> newregular
+  $ rm rmempty
+  $ touch newempty
+  $ rm rmregular
+  $ echo exec >> exec
+  $ echo newexec > newexec
+  $ chmod +x newexec
+  $ rm rmexec
+  $ chmod +x setexec
+  $ chmod -x unsetexec
+  $ python -c "file('binary', 'wb').write('\0\0')"
+  $ python -c "file('newbinary', 'wb').write('\0')"
+  $ rm rmbinary
+  $ hg addremove -s 0
+  adding newbinary
+  adding newempty
+  adding newexec
+  adding newregular
+  removing rmbinary
+  removing rmempty
+  removing rmexec
+  removing rmregular
+
+git=no: regular diff for all files
+
+  $ hg autodiff --git=no
+  diff -r b3f053cd7c7f binary
+  Binary file binary has changed
+  diff -r b3f053cd7c7f exec
+  --- a/exec
+  +++ b/exec
+  @@ -1,1 +1,2 @@
+   exec
+  +exec
+  diff -r b3f053cd7c7f newbinary
+  Binary file newbinary has changed
+  diff -r b3f053cd7c7f newexec
+  --- /dev/null
+  +++ b/newexec
+  @@ -0,0 +1,1 @@
+  +newexec
+  diff -r b3f053cd7c7f newregular
+  --- /dev/null
+  +++ b/newregular
+  @@ -0,0 +1,1 @@
+  +newregular
+  diff -r b3f053cd7c7f regular
+  --- a/regular
+  +++ b/regular
+  @@ -1,1 +1,2 @@
+   regular
+  +regular
+  diff -r b3f053cd7c7f rmbinary
+  Binary file rmbinary has changed
+  diff -r b3f053cd7c7f rmexec
+  --- a/rmexec
+  +++ /dev/null
+  @@ -1,1 +0,0 @@
+  -rmexec
+  diff -r b3f053cd7c7f rmregular
+  --- a/rmregular
+  +++ /dev/null
+  @@ -1,1 +0,0 @@
+  -rmregular
+
+git=yes: git diff for single regular file
+
+  $ hg autodiff --git=yes regular
+  diff --git a/regular b/regular
+  --- a/regular
+  +++ b/regular
+  @@ -1,1 +1,2 @@
+   regular
+  +regular
+
+git=auto: regular diff for regular files and removals
+
+  $ hg autodiff --git=auto regular newregular rmregular rmbinary rmexec
+  diff -r b3f053cd7c7f newregular
+  --- /dev/null
+  +++ b/newregular
+  @@ -0,0 +1,1 @@
+  +newregular
+  diff -r b3f053cd7c7f regular
+  --- a/regular
+  +++ b/regular
+  @@ -1,1 +1,2 @@
+   regular
+  +regular
+  diff -r b3f053cd7c7f rmbinary
+  Binary file rmbinary has changed
+  diff -r b3f053cd7c7f rmexec
+  --- a/rmexec
+  +++ /dev/null
+  @@ -1,1 +0,0 @@
+  -rmexec
+  diff -r b3f053cd7c7f rmregular
+  --- a/rmregular
+  +++ /dev/null
+  @@ -1,1 +0,0 @@
+  -rmregular
+
+  $ for f in exec newexec setexec unsetexec binary newbinary newempty rmempty; do
+  >     echo
+  >     echo '% git=auto: git diff for' $f
+  >     hg autodiff --git=auto $f
+  > done
+  
+  % git=auto: git diff for exec
+  diff -r b3f053cd7c7f exec
+  --- a/exec
+  +++ b/exec
+  @@ -1,1 +1,2 @@
+   exec
+  +exec
+  
+  % git=auto: git diff for newexec
+  diff --git a/newexec b/newexec
+  new file mode 100755
+  --- /dev/null
+  +++ b/newexec
+  @@ -0,0 +1,1 @@
+  +newexec
+  
+  % git=auto: git diff for setexec
+  diff --git a/setexec b/setexec
+  old mode 100644
+  new mode 100755
+  
+  % git=auto: git diff for unsetexec
+  diff --git a/unsetexec b/unsetexec
+  old mode 100755
+  new mode 100644
+  
+  % git=auto: git diff for binary
+  diff --git a/binary b/binary
+  index a9128c283485202893f5af379dd9beccb6e79486..09f370e38f498a462e1ca0faa724559b6630c04f
+  GIT binary patch
+  literal 2
+  Jc${Nk0000200961
+  
+  
+  % git=auto: git diff for newbinary
+  diff --git a/newbinary b/newbinary
+  new file mode 100644
+  index 0000000000000000000000000000000000000000..f76dd238ade08917e6712764a16a22005a50573d
+  GIT binary patch
+  literal 1
+  Ic${MZ000310RR91
+  
+  
+  % git=auto: git diff for newempty
+  diff --git a/newempty b/newempty
+  new file mode 100644
+  
+  % git=auto: git diff for rmempty
+  diff --git a/rmempty b/rmempty
+  deleted file mode 100644
+
+git=warn: regular diff with data loss warnings
+
+  $ hg autodiff --git=warn
+  diff -r b3f053cd7c7f binary
+  Binary file binary has changed
+  diff -r b3f053cd7c7f exec
+  --- a/exec
+  +++ b/exec
+  @@ -1,1 +1,2 @@
+   exec
+  +exec
+  diff -r b3f053cd7c7f newbinary
+  Binary file newbinary has changed
+  diff -r b3f053cd7c7f newexec
+  --- /dev/null
+  +++ b/newexec
+  @@ -0,0 +1,1 @@
+  +newexec
+  diff -r b3f053cd7c7f newregular
+  --- /dev/null
+  +++ b/newregular
+  @@ -0,0 +1,1 @@
+  +newregular
+  diff -r b3f053cd7c7f regular
+  --- a/regular
+  +++ b/regular
+  @@ -1,1 +1,2 @@
+   regular
+  +regular
+  diff -r b3f053cd7c7f rmbinary
+  Binary file rmbinary has changed
+  diff -r b3f053cd7c7f rmexec
+  --- a/rmexec
+  +++ /dev/null
+  @@ -1,1 +0,0 @@
+  -rmexec
+  diff -r b3f053cd7c7f rmregular
+  --- a/rmregular
+  +++ /dev/null
+  @@ -1,1 +0,0 @@
+  -rmregular
+  data lost for: binary
+  data lost for: newbinary
+  data lost for: newempty
+  data lost for: newexec
+  data lost for: rmempty
+  data lost for: setexec
+  data lost for: unsetexec
+
+git=abort: fail on execute bit change
+
+  $ hg autodiff --git=abort regular setexec
+  abort: losing data for setexec
+  [255]
+
+git=abort: succeed on regular file
+
+  $ hg autodiff --git=abort regular
+  diff -r b3f053cd7c7f regular
+  --- a/regular
+  +++ b/regular
+  @@ -1,1 +1,2 @@
+   regular
+  +regular
+
+  $ cd ..
+
--- a/tests/test-diffdir	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-#!/bin/sh
-
-hg init
-touch a
-hg add a
-hg ci -m "a" -d "1000000 0"
-
-echo 123 > b
-hg add b
-hg diff --nodates
-
-hg diff --nodates -r tip
-
-echo foo > a
-hg diff --nodates
-
-hg diff -r ""
-hg diff -r tip -r ""
-
-true
--- a/tests/test-diffdir.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-diff -r acd8075edac9 b
---- /dev/null
-+++ b/b
-@@ -0,0 +1,1 @@
-+123
-diff -r acd8075edac9 b
---- /dev/null
-+++ b/b
-@@ -0,0 +1,1 @@
-+123
-diff -r acd8075edac9 a
---- a/a
-+++ b/a
-@@ -0,0 +1,1 @@
-+foo
-diff -r acd8075edac9 b
---- /dev/null
-+++ b/b
-@@ -0,0 +1,1 @@
-+123
-abort: 00changelog.i@: ambiguous identifier!
-abort: 00changelog.i@: ambiguous identifier!
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-diffdir.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,40 @@
+  $ hg init
+  $ touch a
+  $ hg add a
+  $ hg ci -m "a"
+
+  $ echo 123 > b
+  $ hg add b
+  $ hg diff --nodates
+  diff -r 3903775176ed b
+  --- /dev/null
+  +++ b/b
+  @@ -0,0 +1,1 @@
+  +123
+
+  $ hg diff --nodates -r tip
+  diff -r 3903775176ed b
+  --- /dev/null
+  +++ b/b
+  @@ -0,0 +1,1 @@
+  +123
+
+  $ echo foo > a
+  $ hg diff --nodates
+  diff -r 3903775176ed a
+  --- a/a
+  +++ b/a
+  @@ -0,0 +1,1 @@
+  +foo
+  diff -r 3903775176ed b
+  --- /dev/null
+  +++ b/b
+  @@ -0,0 +1,1 @@
+  +123
+
+  $ hg diff -r ""
+  abort: 00changelog.i@: ambiguous identifier!
+  [255]
+  $ hg diff -r tip -r ""
+  abort: 00changelog.i@: ambiguous identifier!
+  [255]
--- a/tests/test-diffstat	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-#!/bin/sh
-
-hg init repo
-cd repo
-i=0; while [ "$i" -lt 213 ]; do echo a >> a; i=`expr $i + 1`; done
-hg add a
-
-echo '% wide diffstat'
-hg diff --stat
-
-echo '% diffstat width'
-COLUMNS=24 hg diff --config ui.interactive=true --stat
-
-hg ci -m adda
-
-cat >> a <<EOF
-a
-a
-a
-EOF
-
-echo '% narrow diffstat'
-hg diff --stat
-
-hg ci -m appenda
-
-printf '\0' > b
-hg add b
-
-echo '% binary diffstat'
-hg diff --stat
-
-echo '% binary git diffstat'
-hg diff --stat --git
--- a/tests/test-diffstat.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-% wide diffstat
- a |  213 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 1 files changed, 213 insertions(+), 0 deletions(-)
-% diffstat width
- a |  213 ++++++++++++++
- 1 files changed, 213 insertions(+), 0 deletions(-)
-% narrow diffstat
- a |  3 +++
- 1 files changed, 3 insertions(+), 0 deletions(-)
-% binary diffstat
- b |    0 
- 1 files changed, 0 insertions(+), 0 deletions(-)
-% binary git diffstat
- b |  Bin 
- 1 files changed, 0 insertions(+), 0 deletions(-)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-diffstat.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,48 @@
+  $ hg init repo
+  $ cd repo
+  $ i=0; while [ "$i" -lt 213 ]; do echo a >> a; i=`expr $i + 1`; done
+  $ hg add a
+
+Wide diffstat:
+
+  $ hg diff --stat
+   a |  213 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+   1 files changed, 213 insertions(+), 0 deletions(-)
+
+diffstat width:
+
+  $ COLUMNS=24 hg diff --config ui.interactive=true --stat
+   a |  213 ++++++++++++++
+   1 files changed, 213 insertions(+), 0 deletions(-)
+
+  $ hg ci -m adda
+
+  $ cat >> a <<EOF
+  > a
+  > a
+  > a
+  > EOF
+
+Narrow diffstat:
+
+  $ hg diff --stat
+   a |  3 +++
+   1 files changed, 3 insertions(+), 0 deletions(-)
+
+  $ hg ci -m appenda
+
+  $ printf '\0' > b
+  $ hg add b
+
+Binary diffstat:
+
+  $ hg diff --stat
+   b |    0 
+   1 files changed, 0 insertions(+), 0 deletions(-)
+
+Binary git diffstat:
+
+  $ hg diff --stat --git
+   b |  Bin 
+   1 files changed, 0 insertions(+), 0 deletions(-)
+
--- a/tests/test-dirstate-future	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-#!/bin/sh
-
-hg init
-echo a > a
-hg add
-hg ci -m1
-
-# set mtime of a into the future
-touch -t 202101011200 a
-
-# status must not set a's entry to unset (issue1790)
-hg status
-hg debugstate
--- a/tests/test-dirstate-future.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-adding a
-n 644          2 2021-01-01 12:00:00 a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-dirstate-race.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,33 @@
+  $ hg init
+  $ echo a > a
+  $ hg add a
+  $ hg commit -m test
+
+Do we ever miss a sub-second change?:
+
+  $ for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do
+  >     hg co -qC 0
+  >     echo b > a
+  >     hg st
+  > done
+  M a
+  M a
+  M a
+  M a
+  M a
+  M a
+  M a
+  M a
+  M a
+  M a
+  M a
+  M a
+  M a
+  M a
+  M a
+  M a
+  M a
+  M a
+  M a
+  M a
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-dirstate.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,40 @@
+------ Test dirstate._dirs refcounting
+
+  $ hg init t
+  $ cd t
+  $ mkdir -p a/b/c/d
+  $ touch a/b/c/d/x
+  $ touch a/b/c/d/y
+  $ touch a/b/c/d/z
+  $ hg ci -Am m
+  adding a/b/c/d/x
+  adding a/b/c/d/y
+  adding a/b/c/d/z
+  $ hg mv a z
+  moving a/b/c/d/x to z/b/c/d/x
+  moving a/b/c/d/y to z/b/c/d/y
+  moving a/b/c/d/z to z/b/c/d/z
+  $ cd ..
+
+------ issue1790
+
+Prepare test repo:
+
+  $ hg init u
+  $ cd u
+  $ echo a > a
+  $ hg add
+  adding a
+  $ hg ci -m1
+
+Set mtime of a into the future:
+
+  $ touch -t 202101011200 a
+
+Status must not set a's entry to unset (issue1790):
+
+  $ hg status
+  $ hg debugstate
+  n 644          2 2021-01-01 12:00:00 a
+  $ cd ..
+
--- a/tests/test-dirstatedirs	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-# test dirstate._dirs refcounting
-hg init t
-cd t
-mkdir -p a/b/c/d
-touch a/b/c/d/x
-touch a/b/c/d/y
-touch a/b/c/d/z
-hg ci -Am m
-hg mv a z
--- a/tests/test-dirstatedirs.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-adding a/b/c/d/x
-adding a/b/c/d/y
-adding a/b/c/d/z
-moving a/b/c/d/x to z/b/c/d/x
-moving a/b/c/d/y to z/b/c/d/y
-moving a/b/c/d/z to z/b/c/d/z
--- a/tests/test-dispatch	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-#!/bin/sh
-# test command parsing and dispatch
-
-"$TESTDIR/hghave" no-outer-repo || exit 80
-
-dir=`pwd`
-
-hg init a
-cd a
-echo a > a
-hg ci -Ama
-
-echo "# missing arg"
-hg cat
-
-echo '% [defaults]'
-hg cat a
-cat >> $HGRCPATH <<EOF
-[defaults]
-cat = -r null
-EOF
-hg cat a
-
-echo '% no repo'
-cd $dir
-hg cat
-
-exit 0
-
--- a/tests/test-dispatch.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-adding a
-# missing arg
-hg cat: invalid arguments
-hg cat [OPTION]... FILE...
-
-output the current or given revision of files
-
-    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.
-
-    Output may be to a file, in which case the name of the file is given using
-    a format string. The formatting rules are the same as for the export
-    command, with the following additions:
-
-    "%s"  basename of file being printed
-    "%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 FORMAT        print output to file with formatted name
- -r --rev REV              print the given revision
-    --decode               apply any matching decode filter
- -I --include PATTERN [+]  include names matching the given patterns
- -X --exclude PATTERN [+]  exclude names matching the given patterns
-
-[+] marked option can be specified multiple times
-
-use "hg -v help cat" to show global options
-% [defaults]
-a
-a: no such file in rev 000000000000
-% no repo
-abort: There is no Mercurial repository here (.hg not found)!
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-dispatch.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,66 @@
+test command parsing and dispatch
+
+  $ "$TESTDIR/hghave" no-outer-repo || exit 80
+
+  $ dir=`pwd`
+
+  $ hg init a
+  $ cd a
+  $ echo a > a
+  $ hg ci -Ama
+  adding a
+
+Missing arg:
+
+  $ hg cat
+  hg cat: invalid arguments
+  hg cat [OPTION]... FILE...
+  
+  output the current or given revision of files
+  
+      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.
+  
+      Output may be to a file, in which case the name of the file is given using
+      a format string. The formatting rules are the same as for the export
+      command, with the following additions:
+  
+      "%s"  basename of file being printed
+      "%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 FORMAT        print output to file with formatted name
+   -r --rev REV              print the given revision
+      --decode               apply any matching decode filter
+   -I --include PATTERN [+]  include names matching the given patterns
+   -X --exclude PATTERN [+]  exclude names matching the given patterns
+  
+  [+] marked option can be specified multiple times
+  
+  use "hg -v help cat" to show global options
+  [255]
+
+[defaults]
+
+  $ hg cat a
+  a
+  $ cat >> $HGRCPATH <<EOF
+  > [defaults]
+  > cat = -r null
+  > EOF
+  $ hg cat a
+  a: no such file in rev 000000000000
+  [1]
+
+No repo:
+
+  $ cd $dir
+  $ hg cat
+  abort: There is no Mercurial repository here (.hg not found)!
+  [255]
+
--- a/tests/test-doctest.py	Wed Sep 22 17:13:49 2010 -0500
+++ b/tests/test-doctest.py	Wed Sep 22 18:29:41 2010 -0500
@@ -15,6 +15,9 @@
 import mercurial.util
 doctest.testmod(mercurial.util)
 
+import mercurial.match
+doctest.testmod(mercurial.match)
+
 import mercurial.dagparser
 doctest.testmod(mercurial.dagparser, optionflags=doctest.NORMALIZE_WHITESPACE)
 
--- a/tests/test-double-merge	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-#!/bin/sh
-
-hg init repo
-cd repo
-
-echo line 1 > foo
-hg ci -qAm 'add foo' -d "1000000 0"
-
-# copy foo to bar and change both files
-hg cp foo bar
-echo line 2-1 >> foo
-echo line 2-2 >> bar
-hg ci -m 'cp foo bar; change both' -d "1000000 0"
-
-# in another branch, change foo in a way that doesn't conflict with
-# the other changes
-hg up -qC 0
-echo line 0 > foo
-hg cat foo >> foo
-hg ci -m 'change foo' -d "1000000 0"
-
-# we get conflicts that shouldn't be there
-hg merge -P
-hg merge --debug
-
-echo "-- foo --"
-cat foo
-
-echo "-- bar --"
-cat bar
-
--- a/tests/test-double-merge.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-created new head
-changeset:   1:d9da848d0adf
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     cp foo bar; change both
-
-  searching for copies back to rev 1
-  unmatched files in other:
-   bar
-  all copies found (* = to merge, ! = divergent):
-   bar -> foo *
-  checking for directory renames
-resolving manifests
- overwrite None partial False
- ancestor 310fd17130da local 2092631ce82b+ remote d9da848d0adf
- foo: versions differ -> m
- foo: remote copied to bar -> m
-preserving foo for resolve of bar
-preserving foo for resolve of foo
-updating: foo 1/2 files (50.00%)
-picked tool 'internal:merge' for bar (binary False symlink False)
-merging foo and bar to bar
-my bar@2092631ce82b+ other bar@d9da848d0adf ancestor foo@310fd17130da
- premerge successful
-updating: foo 2/2 files (100.00%)
-picked tool 'internal:merge' for foo (binary False symlink False)
-merging foo
-my foo@2092631ce82b+ other foo@d9da848d0adf ancestor foo@310fd17130da
- premerge successful
-0 files updated, 2 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
--- foo --
-line 0
-line 1
-line 2-1
--- bar --
-line 0
-line 1
-line 2-2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-double-merge.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,65 @@
+  $ hg init repo
+  $ cd repo
+
+  $ echo line 1 > foo
+  $ hg ci -qAm 'add foo'
+
+copy foo to bar and change both files
+  $ hg cp foo bar
+  $ echo line 2-1 >> foo
+  $ echo line 2-2 >> bar
+  $ hg ci -m 'cp foo bar; change both'
+
+in another branch, change foo in a way that doesn't conflict with
+the other changes
+  $ hg up -qC 0
+  $ echo line 0 > foo
+  $ hg cat foo >> foo
+  $ hg ci -m 'change foo'
+  created new head
+
+we get conflicts that shouldn't be there
+  $ hg merge -P
+  changeset:   1:484bf6903104
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     cp foo bar; change both
+  
+  $ hg merge --debug
+    searching for copies back to rev 1
+    unmatched files in other:
+     bar
+    all copies found (* = to merge, ! = divergent):
+     bar -> foo *
+    checking for directory renames
+  resolving manifests
+   overwrite None partial False
+   ancestor e6dc8efe11cc local 6a0df1dad128+ remote 484bf6903104
+   foo: versions differ -> m
+   foo: remote copied to bar -> m
+  preserving foo for resolve of bar
+  preserving foo for resolve of foo
+  updating: foo 1/2 files (50.00%)
+  picked tool 'internal:merge' for bar (binary False symlink False)
+  merging foo and bar to bar
+  my bar@6a0df1dad128+ other bar@484bf6903104 ancestor foo@e6dc8efe11cc
+   premerge successful
+  updating: foo 2/2 files (100.00%)
+  picked tool 'internal:merge' for foo (binary False symlink False)
+  merging foo
+  my foo@6a0df1dad128+ other foo@484bf6903104 ancestor foo@e6dc8efe11cc
+   premerge successful
+  0 files updated, 2 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+contents of foo
+  $ cat foo
+  line 0
+  line 1
+  line 2-1
+
+contents of bar
+  $ cat bar
+  line 0
+  line 1
+  line 2-2
--- a/tests/test-dumprevlog	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-#!/bin/sh
-
-CONTRIBDIR=$TESTDIR/../contrib
-
-echo % prepare repo-a
-mkdir repo-a
-cd repo-a
-hg init
-
-echo this is file a > a
-hg add a
-hg commit -m first
-
-echo adding to file a >> a
-hg commit -m second
-
-echo adding more to file a >> a
-hg commit -m third
-
-hg verify
-
-echo
-echo % dumping revlog of file a to stdout
-python $CONTRIBDIR/dumprevlog .hg/store/data/a.i
-echo % dumprevlog done
-
-echo
-echo % dump all revlogs to file repo.dump
-find .hg/store -name "*.i" | sort | xargs python $CONTRIBDIR/dumprevlog > ../repo.dump
-
-cd ..
-
-mkdir repo-b
-cd repo-b
-hg init
-
-echo
-echo % undumping into repo-b
-python $CONTRIBDIR/undumprevlog < ../repo.dump
-echo % undumping done
-
-cd ..
-
-echo
-echo % clone --pull repo-b repo-c  to rebuild fncache
-hg clone --pull -U repo-b repo-c
-
-cd repo-c
-
-echo
-echo % verify repo-c
-hg verify
-
-cd ..
-
-echo
-echo % comparing repos
-hg -R repo-c incoming repo-a
-hg -R repo-a incoming repo-c
-
-exit 0
--- a/tests/test-dumprevlog.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-% prepare repo-a
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 3 changesets, 3 total revisions
-
-% dumping revlog of file a to stdout
-file: .hg/store/data/a.i
-node: 183d2312b35066fb6b3b449b84efc370d50993d0
-linkrev: 0
-parents: 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
-length: 15
--start-
-this is file a
-
--end-
-node: b1047953b6e6b633c0d8197eaa5116fbdfd3095b
-linkrev: 1
-parents: 183d2312b35066fb6b3b449b84efc370d50993d0 0000000000000000000000000000000000000000
-length: 32
--start-
-this is file a
-adding to file a
-
--end-
-node: 8c4fd1f7129b8cdec6c7f58bf48fb5237a4030c1
-linkrev: 2
-parents: b1047953b6e6b633c0d8197eaa5116fbdfd3095b 0000000000000000000000000000000000000000
-length: 54
--start-
-this is file a
-adding to file a
-adding more to file a
-
--end-
-% dumprevlog done
-
-% dump all revlogs to file repo.dump
-
-% undumping into repo-b
-.hg/store/00changelog.i
-.hg/store/00manifest.i
-.hg/store/data/a.i
-% undumping done
-
-% clone --pull repo-b repo-c to rebuild fncache
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 3 changesets with 3 changes to 1 files
-
-% verify repo-c
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 3 changesets, 3 total revisions
-
-% comparing repos
-comparing with repo-a
-searching for changes
-no changes found
-comparing with repo-c
-searching for changes
-no changes found
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-dumprevlog.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,107 @@
+Set vars:
+
+  $ CONTRIBDIR=$TESTDIR/../contrib
+
+Prepare repo-a:
+
+  $ mkdir repo-a
+  $ cd repo-a
+  $ hg init
+
+  $ echo this is file a > a
+  $ hg add a
+  $ hg commit -m first
+
+  $ echo adding to file a >> a
+  $ hg commit -m second
+
+  $ echo adding more to file a >> a
+  $ hg commit -m third
+
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 3 changesets, 3 total revisions
+
+Dumping revlog of file a to stdout:
+
+  $ python $CONTRIBDIR/dumprevlog .hg/store/data/a.i
+  file: .hg/store/data/a.i
+  node: 183d2312b35066fb6b3b449b84efc370d50993d0
+  linkrev: 0
+  parents: 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
+  length: 15
+  -start-
+  this is file a
+  
+  -end-
+  node: b1047953b6e6b633c0d8197eaa5116fbdfd3095b
+  linkrev: 1
+  parents: 183d2312b35066fb6b3b449b84efc370d50993d0 0000000000000000000000000000000000000000
+  length: 32
+  -start-
+  this is file a
+  adding to file a
+  
+  -end-
+  node: 8c4fd1f7129b8cdec6c7f58bf48fb5237a4030c1
+  linkrev: 2
+  parents: b1047953b6e6b633c0d8197eaa5116fbdfd3095b 0000000000000000000000000000000000000000
+  length: 54
+  -start-
+  this is file a
+  adding to file a
+  adding more to file a
+  
+  -end-
+
+Dump all revlogs to file repo.dump:
+
+  $ find .hg/store -name "*.i" | sort | xargs python $CONTRIBDIR/dumprevlog > ../repo.dump
+  $ cd ..
+
+Undumping into repo-b:
+
+  $ mkdir repo-b
+  $ cd repo-b
+  $ hg init
+  $ python $CONTRIBDIR/undumprevlog < ../repo.dump
+  .hg/store/00changelog.i
+  .hg/store/00manifest.i
+  .hg/store/data/a.i
+  $ cd ..
+
+Rebuild fncache with clone --pull:
+
+  $ hg clone --pull -U repo-b repo-c
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 3 changesets with 3 changes to 1 files
+
+Verify:
+
+  $ hg -R repo-c verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 3 changesets, 3 total revisions
+
+Compare repos:
+
+  $ hg -R repo-c incoming repo-a
+  comparing with repo-a
+  searching for changes
+  no changes found
+  [1]
+
+  $ hg -R repo-a incoming repo-c
+  comparing with repo-c
+  searching for changes
+  no changes found
+  [1]
+
--- a/tests/test-empty	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-#!/bin/sh
-
-hg init a
-cd a
-hg log
-hg grep wah
-hg manifest
-hg verify
-ls .hg
-ls .hg/store
-
-cd ..
-hg clone a b
-cd b
-hg verify
-ls .hg
-ls .hg/store
--- a/tests/test-empty-dir	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-#!/bin/sh
-
-hg init
-echo 123 > a
-hg add a
-hg commit -m "first" -d "1000000 0" a
-mkdir sub
-echo 321 > sub/b
-hg add sub/b
-hg commit -m "second" -d "1000000 0" sub/b
-cat sub/b
-hg co 0
-cat sub/b 2>/dev/null || echo "sub/b not present"
-test -d sub || echo "sub not present"
-
-true
--- a/tests/test-empty-dir.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-321
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-sub/b not present
-sub not present
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-empty-dir.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,23 @@
+  $ hg init
+
+  $ echo 123 > a
+  $ hg add a
+  $ hg commit -m "first" a
+
+  $ mkdir sub
+  $ echo 321 > sub/b
+  $ hg add sub/b
+  $ hg commit -m "second" sub/b
+
+  $ cat sub/b
+  321
+
+  $ hg co 0
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+  $ cat sub/b 2>/dev/null || echo "sub/b not present"
+  sub/b not present
+
+  $ test -d sub || echo "sub not present"
+  sub not present
+
--- a/tests/test-empty-file	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-#!/bin/sh
-
-hg init a
-cd a
-touch empty1
-hg add empty1
-hg commit -m 'add empty1' -d '1000000 0'
-
-touch empty2
-hg add empty2
-hg commit -m 'add empty2' -d '1000000 0'
-
-hg up -C 0
-touch empty3
-hg add empty3
-hg commit -m 'add empty3' -d '1000000 0'
-
-hg heads
-
-hg merge 1
-# before changeset 05257fd28591, we didn't notice the
-# empty file that came from rev 1.
-hg status
-hg commit -m merge -d '1000000 0'
-hg manifest --debug tip
--- a/tests/test-empty-file.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-created new head
-changeset:   2:62ec0e86d1e5
-tag:         tip
-parent:      0:567dde5e6e98
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     add empty3
-
-changeset:   1:41ab7b321727
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     add empty2
-
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-M empty2
-b80de5d138758541c5f05265ad144ab9fa86d1db 644   empty1
-b80de5d138758541c5f05265ad144ab9fa86d1db 644   empty2
-b80de5d138758541c5f05265ad144ab9fa86d1db 644   empty3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-empty-file.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,46 @@
+  $ hg init a
+  $ cd a
+  $ touch empty1
+  $ hg add empty1
+  $ hg commit -m 'add empty1'
+
+  $ touch empty2
+  $ hg add empty2
+  $ hg commit -m 'add empty2'
+
+  $ hg up -C 0
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ touch empty3
+  $ hg add empty3
+  $ hg commit -m 'add empty3'
+  created new head
+
+  $ hg heads
+  changeset:   2:a1cb177e0d44
+  tag:         tip
+  parent:      0:1e1d9c4e5b64
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add empty3
+  
+  changeset:   1:097d2b0e17f6
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add empty2
+  
+
+  $ hg merge 1
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+Before changeset 05257fd28591, we didn't notice the
+empty file that came from rev 1:
+
+  $ hg status
+  M empty2
+  $ hg commit -m merge
+  $ hg manifest --debug tip
+  b80de5d138758541c5f05265ad144ab9fa86d1db 644   empty1
+  b80de5d138758541c5f05265ad144ab9fa86d1db 644   empty2
+  b80de5d138758541c5f05265ad144ab9fa86d1db 644   empty3
+
--- a/tests/test-empty-group	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-#!/bin/sh
-#
-#  A          B
-#
-#  3  4       3
-#  |\/|       |\
-#  |/\|       | \
-#  1  2       1  2
-#  \ /        \ /
-#   0          0
-#
-# if the result of the merge of 1 and 2
-# is the same in 3 and 4, no new manifest
-# will be created and the manifest group
-# will be empty during the pull
-#
-# (plus we test a failure where outgoing
-# wrongly reported the number of csets)
-#
-
-hg init a
-cd a
-touch init
-hg ci -A -m 0 -d "1000000 0"
-touch x y
-hg ci -A -m 1 -d "1000000 0"
-hg update 0
-touch x y
-hg ci -A -m 2 -d "1000000 0"
-hg merge 1
-hg ci -A -m m1 -d "1000000 0"
-#hg log
-#hg debugindex .hg/store/00manifest.i
-hg update -C 1
-hg merge 2
-hg ci -A -m m2 -d "1000000 0"
-#hg log
-#hg debugindex .hg/store/00manifest.i
-
-cd ..
-hg clone -r 3 a b
-hg clone -r 4 a c
-hg -R a outgoing b
-hg -R a outgoing c
-hg -R b outgoing c
-hg -R c outgoing b
-
-hg -R b pull a
-hg -R c pull a
--- a/tests/test-empty-group.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-adding init
-adding x
-adding y
-0 files updated, 0 files merged, 2 files removed, 0 files unresolved
-adding x
-adding y
-created new head
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-created new head
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 4 changesets with 3 changes to 3 files
-updating to branch default
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 4 changesets with 3 changes to 3 files
-updating to branch default
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-comparing with b
-searching for changes
-changeset:   4:fdb3c546e859
-tag:         tip
-parent:      1:1f703b3fcbc6
-parent:      2:de997049e034
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     m2
-
-comparing with c
-searching for changes
-changeset:   3:f40f830c0024
-parent:      2:de997049e034
-parent:      1:1f703b3fcbc6
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     m1
-
-comparing with c
-searching for changes
-changeset:   3:f40f830c0024
-tag:         tip
-parent:      2:de997049e034
-parent:      1:1f703b3fcbc6
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     m1
-
-comparing with b
-searching for changes
-changeset:   3:fdb3c546e859
-tag:         tip
-parent:      1:1f703b3fcbc6
-parent:      2:de997049e034
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     m2
-
-pulling from a
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 0 changes to 0 files (+1 heads)
-(run 'hg heads' to see heads, 'hg merge' to merge)
-pulling from a
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 0 changes to 0 files (+1 heads)
-(run 'hg heads' to see heads, 'hg merge' to merge)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-empty-group.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,129 @@
+#  A          B
+#
+#  3  4       3
+#  |\/|       |\
+#  |/\|       | \
+#  1  2       1  2
+#  \ /        \ /
+#   0          0
+#
+# if the result of the merge of 1 and 2
+# is the same in 3 and 4, no new manifest
+# will be created and the manifest group
+# will be empty during the pull
+#
+# (plus we test a failure where outgoing
+# wrongly reported the number of csets)
+
+  $ hg init a
+  $ cd a
+  $ touch init
+  $ hg ci -A -m 0
+  adding init
+  $ touch x y
+  $ hg ci -A -m 1
+  adding x
+  adding y
+
+  $ hg update 0
+  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  $ touch x y
+  $ hg ci -A -m 2
+  adding x
+  adding y
+  created new head
+
+  $ hg merge 1
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg ci -A -m m1
+
+  $ hg update -C 1
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg merge 2
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg ci -A -m m2
+  created new head
+
+  $ cd ..
+
+  $ hg clone -r 3 a b
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 4 changesets with 3 changes to 3 files
+  updating to branch default
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ hg clone -r 4 a c
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 4 changesets with 3 changes to 3 files
+  updating to branch default
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ hg -R a outgoing b
+  comparing with b
+  searching for changes
+  changeset:   4:119caaef4ed1
+  tag:         tip
+  parent:      1:79f9e10cd04e
+  parent:      2:8e1bb01c1a24
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     m2
+  
+  $ hg -R a outgoing c
+  comparing with c
+  searching for changes
+  changeset:   3:cbb48b367d1b
+  parent:      2:8e1bb01c1a24
+  parent:      1:79f9e10cd04e
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     m1
+  
+  $ hg -R b outgoing c
+  comparing with c
+  searching for changes
+  changeset:   3:cbb48b367d1b
+  tag:         tip
+  parent:      2:8e1bb01c1a24
+  parent:      1:79f9e10cd04e
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     m1
+  
+  $ hg -R c outgoing b
+  comparing with b
+  searching for changes
+  changeset:   3:119caaef4ed1
+  tag:         tip
+  parent:      1:79f9e10cd04e
+  parent:      2:8e1bb01c1a24
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     m2
+  
+
+  $ hg -R b pull a
+  pulling from a
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 0 changes to 0 files (+1 heads)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+
+  $ hg -R c pull a
+  pulling from a
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 0 changes to 0 files (+1 heads)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
--- a/tests/test-empty.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-0 files, 0 changesets, 0 total revisions
-00changelog.i
-requires
-store
-updating to branch default
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-0 files, 0 changesets, 0 total revisions
-00changelog.i
-branch
-dirstate
-hgrc
-requires
-store
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-empty.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,53 @@
+Create an empty repo:
+
+  $ hg init a
+  $ cd a
+
+Try some commands:
+
+  $ hg log
+  $ hg grep wah
+  [1]
+  $ hg manifest
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  0 files, 0 changesets, 0 total revisions
+
+Check the basic files created:
+
+  $ ls .hg
+  00changelog.i
+  requires
+  store
+
+Should be empty:
+
+  $ ls .hg/store
+
+Poke at a clone:
+
+  $ cd ..
+  $ hg clone a b
+  updating to branch default
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd b
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  0 files, 0 changesets, 0 total revisions
+  $ ls .hg
+  00changelog.i
+  branch
+  dirstate
+  hgrc
+  requires
+  store
+
+Should be empty:
+
+  $ ls .hg/store
--- a/tests/test-encode	Wed Sep 22 17:13:49 2010 -0500
+++ b/tests/test-encode	Wed Sep 22 18:29:41 2010 -0500
@@ -16,7 +16,7 @@
 echo "this is a test" | gzip > a.gz
 echo "this is a test" > not.gz
 hg add *
-hg ci -m "test" -d "1000000 0"
+hg ci -m "test"
 echo %% no changes
 hg status
 touch *
--- a/tests/test-encoding	Wed Sep 22 17:13:49 2010 -0500
+++ b/tests/test-encoding	Wed Sep 22 18:29:41 2010 -0500
@@ -16,17 +16,17 @@
 echo % should fail with encoding error
 echo "plain old ascii" > a
 hg st
-HGENCODING=ascii hg ci -l latin-1 -d "1000000 0"
+HGENCODING=ascii hg ci -l latin-1
 
 echo % these should work
 echo "latin-1" > a
-HGENCODING=latin-1 hg ci -l latin-1 -d "1000000 0"
+HGENCODING=latin-1 hg ci -l latin-1
 echo "utf-8" > a
-HGENCODING=utf-8 hg ci -l utf-8 -d "1000000 0"
+HGENCODING=utf-8 hg ci -l utf-8
 
-HGENCODING=latin-1 hg tag -d "1000000 0" `cat latin-1-tag`
+HGENCODING=latin-1 hg tag `cat latin-1-tag`
 HGENCODING=latin-1 hg branch `cat latin-1-tag`
-HGENCODING=latin-1 hg ci -d "1000000 0" -m 'latin1 branch'
+HGENCODING=latin-1 hg ci -m 'latin1 branch'
 rm .hg/branch
 
 echo "% hg log (ascii)"
@@ -58,5 +58,5 @@
 
 HGENCODING=ascii hg branch `cat latin-1-tag`
 cp latin-1-tag .hg/branch
-HGENCODING=latin-1 hg ci -d "1000000 0" -m 'should fail'
+HGENCODING=latin-1 hg ci -m 'should fail'
 exit 0
--- a/tests/test-encoding-align	Wed Sep 22 17:13:49 2010 -0500
+++ b/tests/test-encoding-align	Wed Sep 22 18:29:41 2010 -0500
@@ -78,21 +78,21 @@
 echo 'first line(1)' >> s; cp s $S
 echo 'first line(2)' >> m; cp m $M
 echo 'first line(3)' >> l; cp l $L
-hg commit -m 'first commit' -u $S -d "1000000 0"
+hg commit -m 'first commit' -u $S
 
 #### commit(2)
 
 echo 'second line(1)' >> s; cp s $S
 echo 'second line(2)' >> m; cp m $M
 echo 'second line(3)' >> l; cp l $L
-hg commit -m 'second commit' -u $M -d "1000000 0"
+hg commit -m 'second commit' -u $M
 
 #### commit(3)
 
 echo 'third line(1)' >> s; cp s $S
 echo 'third line(2)' >> m; cp m $M
 echo 'third line(3)' >> l; cp l $L
-hg commit -m 'third commit' -u $L -d "1000000 0"
+hg commit -m 'third commit' -u $L
 
 #### check
 
@@ -109,11 +109,11 @@
 #### add branches/tags
 
 hg branch $S
-hg tag -d "1000000 0" $S
+hg tag $S
 hg branch $M
-hg tag -d "1000000 0" $M
+hg tag $M
 hg branch $L
-hg tag -d "1000000 0" $L
+hg tag $L
 
 #### check
 
--- a/tests/test-encoding-align.out	Wed Sep 22 17:13:49 2010 -0500
+++ b/tests/test-encoding-align.out	Wed Sep 22 18:29:41 2010 -0500
@@ -23,12 +23,12 @@
 marked working directory as branch MIDDLE_
 marked working directory as branch é•·ã„é•·ã„åå‰
 % check alignment of branches
-tip                                5:afc60d8eed19
-é•·ã„é•·ã„åå‰                       4:19fe74d09ba0
-MIDDLE_                            3:8a20997d2281
-çŸ­å                               2:0cc06ffa3461
+tip                                5:d745ff46155b
+é•·ã„é•·ã„åå‰                       4:9259be597f19
+MIDDLE_                            3:b06c5b6def9e
+çŸ­å                               2:64a70663cee8
 % check alignment of tags
-tip                                5:afc60d8eed19
-é•·ã„é•·ã„åå‰                       4:19fe74d09ba0
-MIDDLE_                            3:8a20997d2281
-çŸ­å                               2:0cc06ffa3461
+tip                                5:d745ff46155b
+é•·ã„é•·ã„åå‰                       4:9259be597f19
+MIDDLE_                            3:b06c5b6def9e
+çŸ­å                               2:64a70663cee8
--- a/tests/test-encoding.out	Wed Sep 22 17:13:49 2010 -0500
+++ b/tests/test-encoding.out	Wed Sep 22 18:29:41 2010 -0500
@@ -15,27 +15,27 @@
 % these should work
 marked working directory as branch é
 % hg log (ascii)
-changeset:   5:db5520b4645f
+changeset:   5:093c6077d1c8
 branch:      ?
 tag:         tip
 user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
+date:        Thu Jan 01 00:00:00 1970 +0000
 summary:     latin1 branch
 
-changeset:   4:9cff3c980b58
+changeset:   4:94db611b4196
 user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     Added tag ? for changeset 770b9b11621d
+date:        Thu Jan 01 00:00:00 1970 +0000
+summary:     Added tag ? for changeset ca661e7520de
 
-changeset:   3:770b9b11621d
+changeset:   3:ca661e7520de
 tag:         ?
 user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
+date:        Thu Jan 01 00:00:00 1970 +0000
 summary:     utf-8 e' encoded: ?
 
-changeset:   2:0572af48b948
+changeset:   2:650c6f3d55dd
 user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
+date:        Thu Jan 01 00:00:00 1970 +0000
 summary:     latin-1 e' encoded: ?
 
 changeset:   1:0e5b7e3f9c4a
@@ -49,27 +49,27 @@
 summary:     latin-1 e': ? = u'\xe9'
 
 % hg log (latin-1)
-changeset:   5:db5520b4645f
+changeset:   5:093c6077d1c8
 branch:      é
 tag:         tip
 user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
+date:        Thu Jan 01 00:00:00 1970 +0000
 summary:     latin1 branch
 
-changeset:   4:9cff3c980b58
+changeset:   4:94db611b4196
 user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     Added tag é for changeset 770b9b11621d
+date:        Thu Jan 01 00:00:00 1970 +0000
+summary:     Added tag é for changeset ca661e7520de
 
-changeset:   3:770b9b11621d
+changeset:   3:ca661e7520de
 tag:         é
 user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
+date:        Thu Jan 01 00:00:00 1970 +0000
 summary:     utf-8 e' encoded: é
 
-changeset:   2:0572af48b948
+changeset:   2:650c6f3d55dd
 user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
+date:        Thu Jan 01 00:00:00 1970 +0000
 summary:     latin-1 e' encoded: é
 
 changeset:   1:0e5b7e3f9c4a
@@ -83,27 +83,27 @@
 summary:     latin-1 e': é = u'\xe9'
 
 % hg log (utf-8)
-changeset:   5:db5520b4645f
+changeset:   5:093c6077d1c8
 branch:      é
 tag:         tip
 user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
+date:        Thu Jan 01 00:00:00 1970 +0000
 summary:     latin1 branch
 
-changeset:   4:9cff3c980b58
+changeset:   4:94db611b4196
 user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     Added tag é for changeset 770b9b11621d
+date:        Thu Jan 01 00:00:00 1970 +0000
+summary:     Added tag é for changeset ca661e7520de
 
-changeset:   3:770b9b11621d
+changeset:   3:ca661e7520de
 tag:         é
 user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
+date:        Thu Jan 01 00:00:00 1970 +0000
 summary:     utf-8 e' encoded: é
 
-changeset:   2:0572af48b948
+changeset:   2:650c6f3d55dd
 user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
+date:        Thu Jan 01 00:00:00 1970 +0000
 summary:     latin-1 e' encoded: é
 
 changeset:   1:0e5b7e3f9c4a
@@ -117,45 +117,45 @@
 summary:     latin-1 e': é = u'\xe9'
 
 % hg tags (ascii)
-tip                                5:db5520b4645f
-?                                  3:770b9b11621d
+tip                                5:093c6077d1c8
+?                                  3:ca661e7520de
 % hg tags (latin-1)
-tip                                5:db5520b4645f
-é                                 3:770b9b11621d
+tip                                5:093c6077d1c8
+é                                 3:ca661e7520de
 % hg tags (utf-8)
-tip                                5:db5520b4645f
-é                                 3:770b9b11621d
+tip                                5:093c6077d1c8
+é                                 3:ca661e7520de
 % hg branches (ascii)
-?                              5:db5520b4645f
-default                        4:9cff3c980b58 (inactive)
+?                              5:093c6077d1c8
+default                        4:94db611b4196 (inactive)
 % hg branches (latin-1)
-é                             5:db5520b4645f
-default                        4:9cff3c980b58 (inactive)
+é                             5:093c6077d1c8
+default                        4:94db611b4196 (inactive)
 % hg branches (utf-8)
-é                             5:db5520b4645f
-default                        4:9cff3c980b58 (inactive)
+é                             5:093c6077d1c8
+default                        4:94db611b4196 (inactive)
 % hg log (utf-8)
-changeset:   5:db5520b4645f
+changeset:   5:093c6077d1c8
 branch:      é
 tag:         tip
 user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
+date:        Thu Jan 01 00:00:00 1970 +0000
 summary:     latin1 branch
 
-changeset:   4:9cff3c980b58
+changeset:   4:94db611b4196
 user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     Added tag é for changeset 770b9b11621d
+date:        Thu Jan 01 00:00:00 1970 +0000
+summary:     Added tag é for changeset ca661e7520de
 
-changeset:   3:770b9b11621d
+changeset:   3:ca661e7520de
 tag:         é
 user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
+date:        Thu Jan 01 00:00:00 1970 +0000
 summary:     utf-8 e' encoded: é
 
-changeset:   2:0572af48b948
+changeset:   2:650c6f3d55dd
 user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
+date:        Thu Jan 01 00:00:00 1970 +0000
 summary:     latin-1 e' encoded: é
 
 changeset:   1:0e5b7e3f9c4a
--- a/tests/test-excessive-merge	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-#!/bin/sh
-
-hg init
-
-echo foo > a
-echo foo > b
-hg add a b
-
-hg ci -m "test" -d "1000000 0"
-
-echo blah > a
-
-hg ci -m "branch a" -d "1000000 0"
-
-hg co 0
-
-echo blah > b
-
-hg ci -m "branch b" -d "1000000 0"
-HGMERGE=true hg merge 1
-
-hg ci -m "merge b/a -> blah" -d "1000000 0"
-
-hg co 1
-HGMERGE=true hg merge 2
-hg ci -m "merge a/b -> blah" -d "1000000 0"
-
-hg log
-hg debugindex .hg/store/00changelog.i
-
-echo
-
-echo 1
-hg manifest --debug 1
-echo 2
-hg manifest --debug 2
-echo 3
-hg manifest --debug 3
-echo 4
-hg manifest --debug 4
-
-echo
-
-hg debugindex .hg/store/data/a.i
-
-hg verify
--- a/tests/test-excessive-merge.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-created new head
-changeset:   4:f6c172c6198c
-tag:         tip
-parent:      1:448a8c5e42f1
-parent:      2:7c5dc2e857f2
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     merge a/b -> blah
-
-changeset:   3:13d875a22764
-parent:      2:7c5dc2e857f2
-parent:      1:448a8c5e42f1
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     merge b/a -> blah
-
-changeset:   2:7c5dc2e857f2
-parent:      0:dc1751ec2e9d
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     branch b
-
-changeset:   1:448a8c5e42f1
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     branch a
-
-changeset:   0:dc1751ec2e9d
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     test
-
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0      64      0       0 dc1751ec2e9d 000000000000 000000000000
-     1        64      68      1       1 448a8c5e42f1 dc1751ec2e9d 000000000000
-     2       132      68      2       2 7c5dc2e857f2 dc1751ec2e9d 000000000000
-     3       200      75      3       3 13d875a22764 7c5dc2e857f2 448a8c5e42f1
-     4       275      29      3       4 f6c172c6198c 448a8c5e42f1 7c5dc2e857f2
-
-1
-79d7492df40aa0fa093ec4209be78043c181f094 644   a
-2ed2a3912a0b24502043eae84ee4b279c18b90dd 644   b
-2
-2ed2a3912a0b24502043eae84ee4b279c18b90dd 644   a
-79d7492df40aa0fa093ec4209be78043c181f094 644   b
-3
-79d7492df40aa0fa093ec4209be78043c181f094 644   a
-79d7492df40aa0fa093ec4209be78043c181f094 644   b
-4
-79d7492df40aa0fa093ec4209be78043c181f094 644   a
-79d7492df40aa0fa093ec4209be78043c181f094 644   b
-
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0       5      0       0 2ed2a3912a0b 000000000000 000000000000
-     1         5       6      1       1 79d7492df40a 2ed2a3912a0b 000000000000
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-2 files, 5 changesets, 4 total revisions
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-excessive-merge.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,101 @@
+  $ hg init
+
+  $ echo foo > a
+  $ echo foo > b
+  $ hg add a b
+
+  $ hg ci -m "test"
+
+  $ echo blah > a
+
+  $ hg ci -m "branch a"
+
+  $ hg co 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ echo blah > b
+
+  $ hg ci -m "branch b"
+  created new head
+  $ HGMERGE=true hg merge 1
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+  $ hg ci -m "merge b/a -> blah"
+
+  $ hg co 1
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ HGMERGE=true hg merge 2
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg ci -m "merge a/b -> blah"
+  created new head
+
+  $ hg log
+  changeset:   4:2ee31f665a86
+  tag:         tip
+  parent:      1:96155394af80
+  parent:      2:92cc4c306b19
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     merge a/b -> blah
+  
+  changeset:   3:e16a66a37edd
+  parent:      2:92cc4c306b19
+  parent:      1:96155394af80
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     merge b/a -> blah
+  
+  changeset:   2:92cc4c306b19
+  parent:      0:5e0375449e74
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     branch b
+  
+  changeset:   1:96155394af80
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     branch a
+  
+  changeset:   0:5e0375449e74
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     test
+  
+  $ hg debugindex .hg/store/00changelog.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0      60      0       0 5e0375449e74 000000000000 000000000000
+       1        60      62      1       1 96155394af80 5e0375449e74 000000000000
+       2       122      62      2       2 92cc4c306b19 5e0375449e74 000000000000
+       3       184      69      3       3 e16a66a37edd 92cc4c306b19 96155394af80
+       4       253      29      3       4 2ee31f665a86 96155394af80 92cc4c306b19
+
+revision 1
+  $ hg manifest --debug 1
+  79d7492df40aa0fa093ec4209be78043c181f094 644   a
+  2ed2a3912a0b24502043eae84ee4b279c18b90dd 644   b
+revision 2
+  $ hg manifest --debug 2
+  2ed2a3912a0b24502043eae84ee4b279c18b90dd 644   a
+  79d7492df40aa0fa093ec4209be78043c181f094 644   b
+revision 3
+  $ hg manifest --debug 3
+  79d7492df40aa0fa093ec4209be78043c181f094 644   a
+  79d7492df40aa0fa093ec4209be78043c181f094 644   b
+revision 4
+  $ hg manifest --debug 4
+  79d7492df40aa0fa093ec4209be78043c181f094 644   a
+  79d7492df40aa0fa093ec4209be78043c181f094 644   b
+
+  $ hg debugindex .hg/store/data/a.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0       5      0       0 2ed2a3912a0b 000000000000 000000000000
+       1         5       6      1       1 79d7492df40a 2ed2a3912a0b 000000000000
+
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  2 files, 5 changesets, 4 total revisions
--- a/tests/test-execute-bit	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-#!/bin/sh
-
-"$TESTDIR/hghave" execbit || exit 80
-
-hg init
-echo a > a
-hg ci -Am'not executable'
-
-chmod +x a
-hg ci -m'executable'
-hg id
-
-echo '% make sure we notice the change of mode if the cached size == -1'
-hg rm a
-hg revert -r 0 a
-hg debugstate
-hg st
-
-hg up 0
-hg id
-test -x a && echo executable -- eek || echo not executable -- whew
--- a/tests/test-execute-bit.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-adding a
-79abf14474dc tip
-% make sure we notice the change of mode if the cached size == -1
-n   0         -1 unset               a
-M a
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-d69afc33ff8a
-not executable -- whew
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-execute-bit.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,28 @@
+  $ "$TESTDIR/hghave" execbit || exit 80
+
+  $ hg init
+  $ echo a > a
+  $ hg ci -Am'not executable'
+  adding a
+
+  $ chmod +x a
+  $ hg ci -m'executable'
+  $ hg id
+  79abf14474dc tip
+
+Make sure we notice the change of mode if the cached size == -1:
+
+  $ hg rm a
+  $ hg revert -r 0 a
+  $ hg debugstate
+  n   0         -1 unset               a
+  $ hg status
+  M a
+
+  $ hg up 0
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg id
+  d69afc33ff8a
+  $ test -x a && echo executable -- bad || echo not executable -- good
+  not executable -- good
+
--- a/tests/test-export	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-#!/bin/sh
-
-hg init repo
-cd repo
-touch foo
-hg add foo
-for i in 0 1 2 3 4 5 6 7 8 9 10 11; do
-    echo "foo-$i" >> foo
-    hg ci -m "foo-$i"
-done
-
-for out in "%nof%N" "%%%H" "%b-%R" "%h" "%r"; do
-    echo "# foo-$out.patch"
-    hg export -v -o "foo-$out.patch" 2:tip
-done
-
-echo "# exporting 4 changesets to a file"
-hg export -o export_internal 1 2 3 4
-grep HG export_internal | wc -l | sed -e 's/^ *//'
-echo "# exporting 4 changesets to a file"
-hg export 1 2 3 4 | grep HG | wc -l | sed -e 's/^ *//'
-echo "# exporting revision -2 to a file"
-hg export -- -2
--- a/tests/test-export.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-# foo-%nof%N.patch
-exporting patches:
-foo-01of10.patch
-foo-02of10.patch
-foo-03of10.patch
-foo-04of10.patch
-foo-05of10.patch
-foo-06of10.patch
-foo-07of10.patch
-foo-08of10.patch
-foo-09of10.patch
-foo-10of10.patch
-# foo-%%%H.patch
-exporting patches:
-foo-%617188a1c80f869a7b66c85134da88a6fb145f67.patch
-foo-%dd41a5ff707a5225204105611ba49cc5c229d55f.patch
-foo-%f95a5410f8664b6e1490a4af654e4b7d41a7b321.patch
-foo-%4346bcfde53b4d9042489078bcfa9c3e28201db2.patch
-foo-%afda8c3a009cc99449a05ad8aa4655648c4ecd34.patch
-foo-%35284ce2b6b99c9d2ac66268fe99e68e1974e1aa.patch
-foo-%9688c41894e6931305fa7165a37f6568050b4e9b.patch
-foo-%747d3c68f8ec44bb35816bfcd59aeb50b9654c2f.patch
-foo-%5f17a83f5fbd9414006a5e563eab4c8a00729efd.patch
-foo-%f3acbafac161ec68f1598af38f794f28847ca5d3.patch
-# foo-%b-%R.patch
-exporting patches:
-foo-repo-2.patch
-foo-repo-3.patch
-foo-repo-4.patch
-foo-repo-5.patch
-foo-repo-6.patch
-foo-repo-7.patch
-foo-repo-8.patch
-foo-repo-9.patch
-foo-repo-10.patch
-foo-repo-11.patch
-# foo-%h.patch
-exporting patches:
-foo-617188a1c80f.patch
-foo-dd41a5ff707a.patch
-foo-f95a5410f866.patch
-foo-4346bcfde53b.patch
-foo-afda8c3a009c.patch
-foo-35284ce2b6b9.patch
-foo-9688c41894e6.patch
-foo-747d3c68f8ec.patch
-foo-5f17a83f5fbd.patch
-foo-f3acbafac161.patch
-# foo-%r.patch
-exporting patches:
-foo-02.patch
-foo-03.patch
-foo-04.patch
-foo-05.patch
-foo-06.patch
-foo-07.patch
-foo-08.patch
-foo-09.patch
-foo-10.patch
-foo-11.patch
-# exporting 4 changesets to a file
-4
-# exporting 4 changesets to a file
-4
-# exporting revision -2 to a file
-# HG changeset patch
-# User test
-# Date 0 0
-# Node ID 5f17a83f5fbd9414006a5e563eab4c8a00729efd
-# Parent  747d3c68f8ec44bb35816bfcd59aeb50b9654c2f
-foo-10
-
-diff -r 747d3c68f8ec -r 5f17a83f5fbd foo
---- a/foo	Thu Jan 01 00:00:00 1970 +0000
-+++ b/foo	Thu Jan 01 00:00:00 1970 +0000
-@@ -8,3 +8,4 @@
- foo-7
- foo-8
- foo-9
-+foo-10
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-export.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,110 @@
+  $ hg init repo
+  $ cd repo
+  $ touch foo
+  $ hg add foo
+  $ for i in 0 1 2 3 4 5 6 7 8 9 10 11; do
+  >    echo "foo-$i" >> foo
+  >    hg ci -m "foo-$i"
+  > done
+
+  $ for out in "%nof%N" "%%%H" "%b-%R" "%h" "%r"; do
+  >    echo
+  >    echo "# foo-$out.patch"
+  >    hg export -v -o "foo-$out.patch" 2:tip
+  > done
+  
+  # foo-%nof%N.patch
+  exporting patches:
+  foo-01of10.patch
+  foo-02of10.patch
+  foo-03of10.patch
+  foo-04of10.patch
+  foo-05of10.patch
+  foo-06of10.patch
+  foo-07of10.patch
+  foo-08of10.patch
+  foo-09of10.patch
+  foo-10of10.patch
+  
+  # foo-%%%H.patch
+  exporting patches:
+  foo-%617188a1c80f869a7b66c85134da88a6fb145f67.patch
+  foo-%dd41a5ff707a5225204105611ba49cc5c229d55f.patch
+  foo-%f95a5410f8664b6e1490a4af654e4b7d41a7b321.patch
+  foo-%4346bcfde53b4d9042489078bcfa9c3e28201db2.patch
+  foo-%afda8c3a009cc99449a05ad8aa4655648c4ecd34.patch
+  foo-%35284ce2b6b99c9d2ac66268fe99e68e1974e1aa.patch
+  foo-%9688c41894e6931305fa7165a37f6568050b4e9b.patch
+  foo-%747d3c68f8ec44bb35816bfcd59aeb50b9654c2f.patch
+  foo-%5f17a83f5fbd9414006a5e563eab4c8a00729efd.patch
+  foo-%f3acbafac161ec68f1598af38f794f28847ca5d3.patch
+  
+  # foo-%b-%R.patch
+  exporting patches:
+  foo-repo-2.patch
+  foo-repo-3.patch
+  foo-repo-4.patch
+  foo-repo-5.patch
+  foo-repo-6.patch
+  foo-repo-7.patch
+  foo-repo-8.patch
+  foo-repo-9.patch
+  foo-repo-10.patch
+  foo-repo-11.patch
+  
+  # foo-%h.patch
+  exporting patches:
+  foo-617188a1c80f.patch
+  foo-dd41a5ff707a.patch
+  foo-f95a5410f866.patch
+  foo-4346bcfde53b.patch
+  foo-afda8c3a009c.patch
+  foo-35284ce2b6b9.patch
+  foo-9688c41894e6.patch
+  foo-747d3c68f8ec.patch
+  foo-5f17a83f5fbd.patch
+  foo-f3acbafac161.patch
+  
+  # foo-%r.patch
+  exporting patches:
+  foo-02.patch
+  foo-03.patch
+  foo-04.patch
+  foo-05.patch
+  foo-06.patch
+  foo-07.patch
+  foo-08.patch
+  foo-09.patch
+  foo-10.patch
+  foo-11.patch
+
+Exporting 4 changesets to a file:
+
+  $ hg export -o export_internal 1 2 3 4
+  $ grep HG export_internal | wc -l
+  \s*4 (re)
+
+Exporting 4 changesets to a file:
+
+  $ hg export 1 2 3 4 | grep HG | wc -l
+  \s*4 (re)
+
+Exporting revision -2 to a file:
+
+  $ hg export -- -2
+  # HG changeset patch
+  # User test
+  # Date 0 0
+  # Node ID 5f17a83f5fbd9414006a5e563eab4c8a00729efd
+  # Parent  747d3c68f8ec44bb35816bfcd59aeb50b9654c2f
+  foo-10
+  
+  diff -r 747d3c68f8ec -r 5f17a83f5fbd foo
+  --- a/foo	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/foo	Thu Jan 01 00:00:00 1970 +0000
+  @@ -8,3 +8,4 @@
+   foo-7
+   foo-8
+   foo-9
+  +foo-10
+
--- a/tests/test-extdiff	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-#!/bin/sh
-
-echo "[extensions]" >> $HGRCPATH
-echo "extdiff=" >> $HGRCPATH
-
-hg init a
-cd a
-echo a > a
-echo b > b
-hg add
-# should diff cloned directories
-hg extdiff -o -r $opt
-
-echo "[extdiff]" >> $HGRCPATH
-echo "cmd.falabala=echo" >> $HGRCPATH
-echo "opts.falabala=diffing" >> $HGRCPATH
-
-hg falabala
-
-hg help falabala
-
-hg ci -d '0 0' -mtest1
-
-echo b >> a
-hg ci -d '1 0' -mtest2
-
-# should diff cloned files directly
-hg falabala -r 0:1
-
-# test diff during merge
-hg update -C 0
-echo c >> c
-hg add c
-hg ci -m "new branch" -d '1 0'
-hg merge 1
-# should diff cloned file against wc file
-hg falabala > out
-# cleanup the output since the wc is a tmp directory
-sed  's:\(diffing [^ ]* \).*\(\/test-extdiff\):\1[tmp]\2:' out
-# test --change option
-hg ci -d '2 0' -mtest3
-hg falabala -c 1
-# check diff are made from the first parent
-hg falabala -c 3 || echo "diff-like tools yield a non-zero exit code"
-#hg log
-
-echo
-echo '% test extdiff of multiple files in tmp dir:'
-hg update -C 0 > /dev/null
-echo changed > a
-echo changed > b
-chmod +x b
-echo '% diff in working directory, before'
-hg diff --git
-echo '% edit with extdiff -p'
-# prepare custom diff/edit tool
-cat > 'diff tool.py' << EOT
-#!/usr/bin/env python
-import time
-time.sleep(1) # avoid unchanged-timestamp problems
-file('a/a', 'ab').write('edited\n')
-file('a/b', 'ab').write('edited\n')
-EOT
-chmod +x 'diff tool.py'
-hg extdiff -p "`pwd`/diff tool.py" # will change to /tmp/extdiff.TMP and populate directories a.TMP and a and start tool
-echo '% diff in working directory, after'
-hg diff --git
-
-echo
-echo % test extdiff with --option
-hg extdiff -p echo -o this -c 1
-hg falabala -o this -c 1
-echo
--- a/tests/test-extdiff.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-adding a
-adding b
-Only in a: a
-Only in a: b
-diffing a.000000000000 a
-hg falabala [OPTION]... [FILE]...
-
-use 'echo' to diff repository (or selected files)
-
-    Show differences between revisions for the specified files, using the
-    'echo' program.
-
-    When two revision arguments are given, then changes are shown between
-    those revisions. If only one revision is specified then that revision is
-    compared to the working directory, and, when no revisions are specified,
-    the working directory files are compared to its parent.
-
-options:
-
- -o --option OPT [+]       pass option to comparison program
- -r --rev REV [+]          revision
- -c --change REV           change made by revision
- -I --include PATTERN [+]  include names matching the given patterns
- -X --exclude PATTERN [+]  exclude names matching the given patterns
-
-[+] marked option can be specified multiple times
-
-use "hg -v help falabala" to show global options
-diffing a.8a5febb7f867/a a.34eed99112ab/a
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-diffing a.2a13a4d2da36/a [tmp]/test-extdiff/a/a
-diffing a.8a5febb7f867/a a.34eed99112ab/a
-diffing a.2a13a4d2da36/a a.46c0e4daeb72/a
-diff-like tools yield a non-zero exit code
-
-% test extdiff of multiple files in tmp dir:
-% diff in working directory, before
-diff --git a/a b/a
---- a/a
-+++ b/a
-@@ -1,1 +1,1 @@
--a
-+changed
-diff --git a/b b/b
-old mode 100644
-new mode 100755
---- a/b
-+++ b/b
-@@ -1,1 +1,1 @@
--b
-+changed
-% edit with extdiff -p
-% diff in working directory, after
-diff --git a/a b/a
---- a/a
-+++ b/a
-@@ -1,1 +1,2 @@
--a
-+changed
-+edited
-diff --git a/b b/b
-old mode 100644
-new mode 100755
---- a/b
-+++ b/b
-@@ -1,1 +1,2 @@
--b
-+changed
-+edited
-
-% test extdiff with --option
-this a.8a5febb7f867/a a.34eed99112ab/a
-diffing this a.8a5febb7f867/a a.34eed99112ab/a
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-extdiff.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,173 @@
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "extdiff=" >> $HGRCPATH
+
+  $ hg init a
+  $ cd a
+  $ echo a > a
+  $ echo b > b
+  $ hg add
+  adding a
+  adding b
+
+Should diff cloned directories:
+
+  $ hg extdiff -o -r $opt
+  Only in a: a
+  Only in a: b
+  [1]
+
+  $ echo "[extdiff]" >> $HGRCPATH
+  $ echo "cmd.falabala=echo" >> $HGRCPATH
+  $ echo "opts.falabala=diffing" >> $HGRCPATH
+
+  $ hg falabala
+  diffing a.000000000000 a
+  [1]
+
+  $ hg help falabala
+  hg falabala [OPTION]... [FILE]...
+  
+  use 'echo' to diff repository (or selected files)
+  
+      Show differences between revisions for the specified files, using the
+      'echo' program.
+  
+      When two revision arguments are given, then changes are shown between
+      those revisions. If only one revision is specified then that revision is
+      compared to the working directory, and, when no revisions are specified,
+      the working directory files are compared to its parent.
+  
+  options:
+  
+   -o --option OPT [+]       pass option to comparison program
+   -r --rev REV [+]          revision
+   -c --change REV           change made by revision
+   -I --include PATTERN [+]  include names matching the given patterns
+   -X --exclude PATTERN [+]  exclude names matching the given patterns
+  
+  [+] marked option can be specified multiple times
+  
+  use "hg -v help falabala" to show global options
+
+  $ hg ci -d '0 0' -mtest1
+
+  $ echo b >> a
+  $ hg ci -d '1 0' -mtest2
+
+Should diff cloned files directly:
+
+  $ hg falabala -r 0:1
+  diffing a.8a5febb7f867/a a.34eed99112ab/a
+  [1]
+
+Test diff during merge:
+
+  $ hg update -C 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo c >> c
+  $ hg add c
+  $ hg ci -m "new branch" -d '1 0'
+  created new head
+  $ hg merge 1
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+Should diff cloned file against wc file:
+
+  $ hg falabala > out
+  [1]
+
+Cleanup the output since the wc is a tmp directory:
+
+  $ sed  's:\(diffing [^ ]* \).*\(\/test-extdiff\):\1[tmp]\2:' out
+  diffing a.2a13a4d2da36/a [tmp]/test-extdiff.t/a/a
+
+Test --change option:
+
+  $ hg ci -d '2 0' -mtest3
+  $ hg falabala -c 1
+  diffing a.8a5febb7f867/a a.34eed99112ab/a
+  [1]
+
+Check diff are made from the first parent:
+
+  $ hg falabala -c 3 || echo "diff-like tools yield a non-zero exit code"
+  diffing a.2a13a4d2da36/a a.46c0e4daeb72/a
+  diff-like tools yield a non-zero exit code
+
+Test extdiff of multiple files in tmp dir:
+
+  $ hg update -C 0 > /dev/null
+  $ echo changed > a
+  $ echo changed > b
+  $ chmod +x b
+
+Diff in working directory, before:
+
+  $ hg diff --git
+  diff --git a/a b/a
+  --- a/a
+  +++ b/a
+  @@ -1,1 +1,1 @@
+  -a
+  +changed
+  diff --git a/b b/b
+  old mode 100644
+  new mode 100755
+  --- a/b
+  +++ b/b
+  @@ -1,1 +1,1 @@
+  -b
+  +changed
+
+
+Edit with extdiff -p:
+
+Prepare custom diff/edit tool:
+
+  $ cat > 'diff tool.py' << EOT
+  > #!/usr/bin/env python
+  > import time
+  > time.sleep(1) # avoid unchanged-timestamp problems
+  > file('a/a', 'ab').write('edited\n')
+  > file('a/b', 'ab').write('edited\n')
+  > EOT
+
+  $ chmod +x 'diff tool.py'
+
+will change to /tmp/extdiff.TMP and populate directories a.TMP and a
+and start tool
+
+  $ hg extdiff -p "`pwd`/diff tool.py"
+  [1]
+
+Diff in working directory, after:
+
+  $ hg diff --git
+  diff --git a/a b/a
+  --- a/a
+  +++ b/a
+  @@ -1,1 +1,2 @@
+  -a
+  +changed
+  +edited
+  diff --git a/b b/b
+  old mode 100644
+  new mode 100755
+  --- a/b
+  +++ b/b
+  @@ -1,1 +1,2 @@
+  -b
+  +changed
+  +edited
+
+Test extdiff with --option:
+
+  $ hg extdiff -p echo -o this -c 1
+  this a.8a5febb7f867/a a.34eed99112ab/a
+  [1]
+
+  $ hg falabala -o this -c 1
+  diffing this a.8a5febb7f867/a a.34eed99112ab/a
+  [1]
+
--- a/tests/test-extension	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,181 +0,0 @@
-#!/bin/sh
-# Test basic extension support
-
-"$TESTDIR/hghave" no-outer-repo || exit 80
-
-cat > foobar.py <<EOF
-import os
-from mercurial import commands
-
-def uisetup(ui):
-    ui.write("uisetup called\\n")
-
-def reposetup(ui, repo):
-    ui.write("reposetup called for %s\\n" % os.path.basename(repo.root))
-    ui.write("ui %s= repo.ui\\n" % (ui == repo.ui and "=" or "!"))
-
-def foo(ui, *args, **kwargs):
-    ui.write("Foo\\n")
-
-def bar(ui, *args, **kwargs):
-    ui.write("Bar\\n")
-
-cmdtable = {
-    "foo": (foo, [], "hg foo"),
-    "bar": (bar, [], "hg bar"),
-}
-
-commands.norepo += ' bar'
-EOF
-abspath=`pwd`/foobar.py
-
-mkdir barfoo
-cp foobar.py barfoo/__init__.py
-barfoopath=`pwd`/barfoo
-
-hg init a
-cd a
-echo foo > file
-hg add file
-hg commit -m 'add file'
-
-echo '[extensions]' >> $HGRCPATH
-echo "foobar = $abspath" >> $HGRCPATH
-hg foo
-
-cd ..
-hg clone a b
-
-hg bar
-echo 'foobar = !' >> $HGRCPATH
-
-echo '% module/__init__.py-style'
-echo "barfoo = $barfoopath" >> $HGRCPATH
-cd a
-hg foo
-echo 'barfoo = !' >> $HGRCPATH
-
-# check that extensions are loaded in phases
-cat > foo.py <<EOF
-import os
-name = os.path.basename(__file__).rsplit('.', 1)[0]
-print "1) %s imported" % name
-def uisetup(ui):
-    print "2) %s uisetup" % name
-def extsetup():
-    print "3) %s extsetup" % name
-def reposetup(ui, repo):
-    print "4) %s reposetup" % name
-EOF
-
-cp foo.py bar.py
-echo 'foo = foo.py' >> $HGRCPATH
-echo 'bar = bar.py' >> $HGRCPATH
-
-# command with no output, we just want to see the extensions loaded
-hg paths
-
-# check hgweb's load order
-echo '% hgweb.cgi'
-cat > hgweb.cgi <<EOF
-#!/usr/bin/env python
-from mercurial import demandimport; demandimport.enable()
-from mercurial.hgweb import hgweb
-from mercurial.hgweb import wsgicgi
-
-application = hgweb('.', 'test repo')
-wsgicgi.launch(application)
-EOF
-SCRIPT_NAME='/' SERVER_PORT='80' SERVER_NAME='localhost' python hgweb.cgi \
-    | grep '^[0-9]) ' # ignores HTML output
-
-echo 'foo = !' >> $HGRCPATH
-echo 'bar = !' >> $HGRCPATH
-
-cd ..
-cat > empty.py <<EOF
-'''empty cmdtable
-'''
-cmdtable = {}
-EOF
-emptypath=`pwd`/empty.py
-echo "empty = $emptypath" >> $HGRCPATH
-hg help empty
-echo 'empty = !' >> $HGRCPATH
-
-cat > debugextension.py <<EOF
-'''only debugcommands
-'''
-def debugfoobar(ui, repo, *args, **opts):
-    "yet another debug command"
-    pass
-
-def foo(ui, repo, *args, **opts):
-    """yet another foo command
-
-    This command has been DEPRECATED since forever.
-    """
-    pass
-
-cmdtable = {
-    "debugfoobar": (debugfoobar, (), "hg debugfoobar"),
-    "foo": (foo, (), "hg foo")
-}
-EOF
-debugpath=`pwd`/debugextension.py
-echo "debugextension = $debugpath" >> $HGRCPATH
-echo "% hg help"
-hg help debugextension
-echo "% hg help --verbose"
-hg --verbose help debugextension
-echo "% hg help --debug"
-hg --debug help debugextension
-echo 'debugextension = !' >> $HGRCPATH
-
-echo % issue811
-debugpath=`pwd`/debugissue811.py
-cat > debugissue811.py <<EOF
-'''show all loaded extensions
-'''
-from mercurial import extensions, commands
-
-def debugextensions(ui):
-    "yet another debug command"
-    ui.write("%s\n" % '\n'.join([x for x, y in extensions.extensions()]))
-
-cmdtable = {"debugextensions": (debugextensions, (), "hg debugextensions")}
-commands.norepo += " debugextensions"
-EOF
-echo "debugissue811 = $debugpath" >> $HGRCPATH
-echo "mq=" >> $HGRCPATH
-echo "hgext.mq=" >> $HGRCPATH
-echo "hgext/mq=" >> $HGRCPATH
-
-echo % show extensions
-hg debugextensions
-
-echo '% disabled extension commands'
-HGRCPATH=
-export HGRCPATH
-hg help email
-hg qdel
-hg churn
-echo '% disabled extensions'
-hg help churn
-hg help patchbomb
-echo '% broken disabled extension and command'
-mkdir hgext
-echo > hgext/__init__.py
-cat > hgext/broken.py <<EOF
-"broken extension'
-EOF
-cat > path.py <<EOF
-import os, sys
-sys.path.insert(0, os.environ['HGEXTPATH'])
-EOF
-HGEXTPATH=`pwd`
-export HGEXTPATH
-hg --config extensions.path=./path.py help broken
-hg --config extensions.path=./path.py help foo > /dev/null
-
-exit 0
--- a/tests/test-extension.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,134 +0,0 @@
-uisetup called
-reposetup called for a
-ui == repo.ui
-Foo
-uisetup called
-reposetup called for a
-ui == repo.ui
-reposetup called for b
-ui == repo.ui
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-uisetup called
-Bar
-% module/__init__.py-style
-uisetup called
-reposetup called for a
-ui == repo.ui
-Foo
-1) foo imported
-1) bar imported
-2) foo uisetup
-2) bar uisetup
-3) foo extsetup
-3) bar extsetup
-4) foo reposetup
-4) bar reposetup
-% hgweb.cgi
-1) foo imported
-1) bar imported
-2) foo uisetup
-2) bar uisetup
-3) foo extsetup
-3) bar extsetup
-4) foo reposetup
-4) bar reposetup
-4) foo reposetup
-4) bar reposetup
-empty extension - empty cmdtable
-
-no commands defined
-% hg help
-debugextension extension - only debugcommands
-
-no commands defined
-% hg help --verbose
-debugextension extension - only debugcommands
-
-list of commands:
-
- foo:
-      yet another foo command
-
-global options:
- -R --repository REPO    repository root directory or name of overlay bundle
-                         file
-    --cwd DIR            change working directory
- -y --noninteractive     do not prompt, assume 'yes' for any required answers
- -q --quiet              suppress output
- -v --verbose            enable additional output
-    --config CONFIG [+]  set/override config option (use 'section.name=value')
-    --debug              enable debugging output
-    --debugger           start debugger
-    --encoding ENCODE    set the charset encoding (default: ascii)
-    --encodingmode MODE  set the charset encoding mode (default: strict)
-    --traceback          always print a traceback on exception
-    --time               time how long the command takes
-    --profile            print command execution profile
-    --version            output version information and exit
- -h --help               display help and exit
-
-[+] marked option can be specified multiple times
-% hg help --debug
-debugextension extension - only debugcommands
-
-list of commands:
-
- debugfoobar:
-      yet another debug command
- foo:
-      yet another foo command
-
-global options:
- -R --repository REPO    repository root directory or name of overlay bundle
-                         file
-    --cwd DIR            change working directory
- -y --noninteractive     do not prompt, assume 'yes' for any required answers
- -q --quiet              suppress output
- -v --verbose            enable additional output
-    --config CONFIG [+]  set/override config option (use 'section.name=value')
-    --debug              enable debugging output
-    --debugger           start debugger
-    --encoding ENCODE    set the charset encoding (default: ascii)
-    --encodingmode MODE  set the charset encoding mode (default: strict)
-    --traceback          always print a traceback on exception
-    --time               time how long the command takes
-    --profile            print command execution profile
-    --version            output version information and exit
- -h --help               display help and exit
-
-[+] marked option can be specified multiple times
-% issue811
-% show extensions
-debugissue811
-mq
-% disabled extension commands
-'email' is provided by the following extension:
-
-    patchbomb  command to send changesets as (a series of) patch emails
-
-use "hg help extensions" for information on enabling extensions
-hg: unknown command 'qdel'
-'qdelete' is provided by the following extension:
-
-    mq  manage a stack of patches
-
-use "hg help extensions" for information on enabling extensions
-hg: unknown command 'churn'
-'churn' is provided by the following extension:
-
-    churn  command to display statistics about repository history
-
-use "hg help extensions" for information on enabling extensions
-% disabled extensions
-churn extension - command to display statistics about repository history
-
-use "hg help extensions" for information on enabling extensions
-patchbomb extension - command to send changesets as (a series of) patch emails
-
-use "hg help extensions" for information on enabling extensions
-% broken disabled extension and command
-broken extension - (no help text available)
-
-use "hg help extensions" for information on enabling extensions
-hg: unknown command 'foo'
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-extension.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,320 @@
+Test basic extension support
+
+  $ "$TESTDIR/hghave" no-outer-repo || exit 80
+
+  $ cat > foobar.py <<EOF
+  > import os
+  > from mercurial import commands
+  > 
+  > def uisetup(ui):
+  >     ui.write("uisetup called\\n")
+  > 
+  > def reposetup(ui, repo):
+  >     ui.write("reposetup called for %s\\n" % os.path.basename(repo.root))
+  >     ui.write("ui %s= repo.ui\\n" % (ui == repo.ui and "=" or "!"))
+  > 
+  > def foo(ui, *args, **kwargs):
+  >     ui.write("Foo\\n")
+  > 
+  > def bar(ui, *args, **kwargs):
+  >     ui.write("Bar\\n")
+  > 
+  > cmdtable = {
+  >    "foo": (foo, [], "hg foo"),
+  >    "bar": (bar, [], "hg bar"),
+  > }
+  > 
+  > commands.norepo += ' bar'
+  > EOF
+  $ abspath=`pwd`/foobar.py
+
+  $ mkdir barfoo
+  $ cp foobar.py barfoo/__init__.py
+  $ barfoopath=`pwd`/barfoo
+
+  $ hg init a
+  $ cd a
+  $ echo foo > file
+  $ hg add file
+  $ hg commit -m 'add file'
+
+  $ echo '[extensions]' >> $HGRCPATH
+  $ echo "foobar = $abspath" >> $HGRCPATH
+  $ hg foo
+  uisetup called
+  reposetup called for a
+  ui == repo.ui
+  Foo
+
+  $ cd ..
+  $ hg clone a b
+  uisetup called
+  reposetup called for a
+  ui == repo.ui
+  reposetup called for b
+  ui == repo.ui
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ hg bar
+  uisetup called
+  Bar
+  $ echo 'foobar = !' >> $HGRCPATH
+
+module/__init__.py-style
+
+  $ echo "barfoo = $barfoopath" >> $HGRCPATH
+  $ cd a
+  $ hg foo
+  uisetup called
+  reposetup called for a
+  ui == repo.ui
+  Foo
+  $ echo 'barfoo = !' >> $HGRCPATH
+
+Check that extensions are loaded in phases:
+
+  $ cat > foo.py <<EOF
+  > import os
+  > name = os.path.basename(__file__).rsplit('.', 1)[0]
+  > print "1) %s imported" % name
+  > def uisetup(ui):
+  >     print "2) %s uisetup" % name
+  > def extsetup():
+  >     print "3) %s extsetup" % name
+  > def reposetup(ui, repo):
+  >    print "4) %s reposetup" % name
+  > EOF
+
+  $ cp foo.py bar.py
+  $ echo 'foo = foo.py' >> $HGRCPATH
+  $ echo 'bar = bar.py' >> $HGRCPATH
+
+Command with no output, we just want to see the extensions loaded:
+
+  $ hg paths
+  1) foo imported
+  1) bar imported
+  2) foo uisetup
+  2) bar uisetup
+  3) foo extsetup
+  3) bar extsetup
+  4) foo reposetup
+  4) bar reposetup
+
+Check hgweb's load order:
+
+  $ cat > hgweb.cgi <<EOF
+  > #!/usr/bin/env python
+  > from mercurial import demandimport; demandimport.enable()
+  > from mercurial.hgweb import hgweb
+  > from mercurial.hgweb import wsgicgi
+  > 
+  > application = hgweb('.', 'test repo')
+  > wsgicgi.launch(application)
+  > EOF
+
+  $ SCRIPT_NAME='/' SERVER_PORT='80' SERVER_NAME='localhost' python hgweb.cgi \
+  >    | grep '^[0-9]) ' # ignores HTML output
+  1) foo imported
+  1) bar imported
+  2) foo uisetup
+  2) bar uisetup
+  3) foo extsetup
+  3) bar extsetup
+  4) foo reposetup
+  4) bar reposetup
+  4) foo reposetup
+  4) bar reposetup
+
+  $ echo 'foo = !' >> $HGRCPATH
+  $ echo 'bar = !' >> $HGRCPATH
+
+  $ cd ..
+
+  $ cat > empty.py <<EOF
+  > '''empty cmdtable
+  > '''
+  > cmdtable = {}
+  > EOF
+  $ emptypath=`pwd`/empty.py
+  $ echo "empty = $emptypath" >> $HGRCPATH
+  $ hg help empty
+  empty extension - empty cmdtable
+  
+  no commands defined
+
+  $ echo 'empty = !' >> $HGRCPATH
+
+  $ cat > debugextension.py <<EOF
+  > '''only debugcommands
+  > '''
+  > def debugfoobar(ui, repo, *args, **opts):
+  >     "yet another debug command"
+  >     pass
+  > 
+  > def foo(ui, repo, *args, **opts):
+  >     """yet another foo command
+  > 
+  >     This command has been DEPRECATED since forever.
+  >     """
+  >     pass
+  > 
+  > cmdtable = {
+  >    "debugfoobar": (debugfoobar, (), "hg debugfoobar"),
+  >    "foo": (foo, (), "hg foo")
+  > }
+  > EOF
+  $ debugpath=`pwd`/debugextension.py
+  $ echo "debugextension = $debugpath" >> $HGRCPATH
+
+  $ hg help debugextension
+  debugextension extension - only debugcommands
+  
+  no commands defined
+
+  $ hg --verbose help debugextension
+  debugextension extension - only debugcommands
+  
+  list of commands:
+  
+   foo:
+        yet another foo command
+  
+  global options:
+   -R --repository REPO    repository root directory or name of overlay bundle
+                           file
+      --cwd DIR            change working directory
+   -y --noninteractive     do not prompt, assume 'yes' for any required answers
+   -q --quiet              suppress output
+   -v --verbose            enable additional output
+      --config CONFIG [+]  set/override config option (use 'section.name=value')
+      --debug              enable debugging output
+      --debugger           start debugger
+      --encoding ENCODE    set the charset encoding (default: ascii)
+      --encodingmode MODE  set the charset encoding mode (default: strict)
+      --traceback          always print a traceback on exception
+      --time               time how long the command takes
+      --profile            print command execution profile
+      --version            output version information and exit
+   -h --help               display help and exit
+  
+  [+] marked option can be specified multiple times
+
+  $ hg --debug help debugextension
+  debugextension extension - only debugcommands
+  
+  list of commands:
+  
+   debugfoobar:
+        yet another debug command
+   foo:
+        yet another foo command
+  
+  global options:
+   -R --repository REPO    repository root directory or name of overlay bundle
+                           file
+      --cwd DIR            change working directory
+   -y --noninteractive     do not prompt, assume 'yes' for any required answers
+   -q --quiet              suppress output
+   -v --verbose            enable additional output
+      --config CONFIG [+]  set/override config option (use 'section.name=value')
+      --debug              enable debugging output
+      --debugger           start debugger
+      --encoding ENCODE    set the charset encoding (default: ascii)
+      --encodingmode MODE  set the charset encoding mode (default: strict)
+      --traceback          always print a traceback on exception
+      --time               time how long the command takes
+      --profile            print command execution profile
+      --version            output version information and exit
+   -h --help               display help and exit
+  
+  [+] marked option can be specified multiple times
+  $ echo 'debugextension = !' >> $HGRCPATH
+
+Issue811:
+
+  $ debugpath=`pwd`/debugissue811.py
+  $ cat > debugissue811.py <<EOF
+  > '''show all loaded extensions
+  > '''
+  > from mercurial import extensions, commands
+  > 
+  > def debugextensions(ui):
+  >     "yet another debug command"
+  >     ui.write("%s\n" % '\n'.join([x for x, y in extensions.extensions()]))
+  > 
+  > cmdtable = {"debugextensions": (debugextensions, (), "hg debugextensions")}
+  > commands.norepo += " debugextensions"
+  > EOF
+  $ echo "debugissue811 = $debugpath" >> $HGRCPATH
+  $ echo "mq=" >> $HGRCPATH
+  $ echo "hgext.mq=" >> $HGRCPATH
+  $ echo "hgext/mq=" >> $HGRCPATH
+
+Show extensions:
+
+  $ hg debugextensions
+  debugissue811
+  mq
+
+Disabled extension commands:
+
+  $ HGRCPATH=
+  $ export HGRCPATH
+  $ hg help email
+  'email' is provided by the following extension:
+  
+      patchbomb  command to send changesets as (a series of) patch emails
+  
+  use "hg help extensions" for information on enabling extensions
+  $ hg qdel
+  hg: unknown command 'qdel'
+  'qdelete' is provided by the following extension:
+  
+      mq  manage a stack of patches
+  
+  use "hg help extensions" for information on enabling extensions
+  [255]
+  $ hg churn
+  hg: unknown command 'churn'
+  'churn' is provided by the following extension:
+  
+      churn  command to display statistics about repository history
+  
+  use "hg help extensions" for information on enabling extensions
+  [255]
+
+Disabled extensions:
+
+  $ hg help churn
+  churn extension - command to display statistics about repository history
+  
+  use "hg help extensions" for information on enabling extensions
+  $ hg help patchbomb
+  patchbomb extension - command to send changesets as (a series of) patch emails
+  
+  use "hg help extensions" for information on enabling extensions
+
+Broken disabled extension and command:
+
+  $ mkdir hgext
+  $ echo > hgext/__init__.py
+  $ cat > hgext/broken.py <<EOF
+  > "broken extension'
+  > EOF
+  $ cat > path.py <<EOF
+  > import os, sys
+  > sys.path.insert(0, os.environ['HGEXTPATH'])
+  > EOF
+  $ HGEXTPATH=`pwd`
+  $ export HGEXTPATH
+
+  $ hg --config extensions.path=./path.py help broken
+  broken extension - (no help text available)
+  
+  use "hg help extensions" for information on enabling extensions
+
+  $ hg --config extensions.path=./path.py help foo > /dev/null
+  hg: unknown command 'foo'
+  [255]
--- a/tests/test-extra-filelog-entry	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-#!/bin/sh
-#
-# test for issue351
-
-# Environement setup for MQ
-echo "[extensions]" >> $HGRCPATH
-echo "mq=" >> $HGRCPATH
-
-#Repo init
-hg init
-hg qinit
-
-echo b > b
-hg ci -A -m foo
-echo cc > b
-hg qnew -f foo.diff
-echo b > b
-hg qrefresh
-hg debugindex .hg/store/data/b.i
--- a/tests/test-extra-filelog-entry.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-adding b
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0       3      0       0 1e88685f5dde 000000000000 000000000000
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-extra-filelog-entry.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,21 @@
+test for issue351
+
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "mq=" >> $HGRCPATH
+
+  $ hg init
+  $ hg qinit
+
+  $ echo b > b
+  $ hg ci -A -m foo
+  adding b
+
+  $ echo cc > b
+  $ hg qnew -f foo.diff
+  $ echo b > b
+  $ hg qrefresh
+
+  $ hg debugindex .hg/store/data/b.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0       3      0       0 1e88685f5dde 000000000000 000000000000
+
--- a/tests/test-filebranch	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-#!/bin/sh
-
-# This test makes sure that we don't mark a file as merged with its ancestor
-# when we do a merge.
-
-cat <<EOF > merge
-import sys, os
-print "merging for", os.path.basename(sys.argv[1])
-EOF
-HGMERGE="python ../merge"; export HGMERGE
-
-echo creating base
-hg init a
-cd a
-echo 1 > foo
-echo 1 > bar
-echo 1 > baz
-echo 1 > quux
-hg add foo bar baz quux
-hg commit -m "base" -d "1000000 0"
-
-cd ..
-hg clone a b
-
-echo creating branch a
-cd a
-echo 2a > foo
-echo 2a > bar
-hg commit -m "branch a" -d "1000000 0"
-
-echo creating branch b
-
-cd ..
-cd b
-echo 2b > foo
-echo 2b > baz
-hg commit -m "branch b" -d "1000000 0"
-
-echo "we shouldn't have anything but n state here"
-hg debugstate --nodates | grep -v "^n"
-
-echo merging
-hg pull ../a
-hg merge -v
-
-echo 2m > foo
-echo 2b > baz
-echo new > quux
-
-echo "we shouldn't have anything but foo in merge state here"
-hg debugstate --nodates | grep "^m"
-
-hg ci -m "merge" -d "1000000 0"
-
-echo "main: we should have a merge here"
-hg debugindex .hg/store/00changelog.i
-
-echo "log should show foo and quux changed"
-hg log -v -r tip
-
-echo "foo: we should have a merge here"
-hg debugindex .hg/store/data/foo.i
-
-echo "bar: we shouldn't have a merge here"
-hg debugindex .hg/store/data/bar.i
-
-echo "baz: we shouldn't have a merge here"
-hg debugindex .hg/store/data/baz.i
-
-echo "quux: we shouldn't have a merge here"
-hg debugindex .hg/store/data/quux.i
-
-echo "manifest entries should match tips of all files"
-hg manifest --debug
-
-echo "everything should be clean now"
-hg status
-
-hg verify
--- a/tests/test-filebranch.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-creating base
-updating to branch default
-4 files updated, 0 files merged, 0 files removed, 0 files unresolved
-creating branch a
-creating branch b
-we shouldn't have anything but n state here
-merging
-pulling from ../a
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 2 changes to 2 files (+1 heads)
-(run 'hg heads' to see heads, 'hg merge' to merge)
-merging for foo
-resolving manifests
-getting bar
-merging foo
-1 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-we shouldn't have anything but foo in merge state here
-m 644          3 foo
-main: we should have a merge here
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0      77      0       0 c36078bec30d 000000000000 000000000000
-     1        77      73      1       1 182b283965f1 c36078bec30d 000000000000
-     2       150      71      2       2 a6aef98656b7 c36078bec30d 000000000000
-     3       221      72      3       3 0c2cc6fc80e2 182b283965f1 a6aef98656b7
-log should show foo and quux changed
-changeset:   3:0c2cc6fc80e2
-tag:         tip
-parent:      1:182b283965f1
-parent:      2:a6aef98656b7
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-files:       foo quux
-description:
-merge
-
-
-foo: we should have a merge here
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0       3      0       0 b8e02f643373 000000000000 000000000000
-     1         3       4      1       1 2ffeddde1b65 b8e02f643373 000000000000
-     2         7       4      2       2 33d1fb69067a b8e02f643373 000000000000
-     3        11       4      3       3 aa27919ee430 2ffeddde1b65 33d1fb69067a
-bar: we shouldn't have a merge here
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0       3      0       0 b8e02f643373 000000000000 000000000000
-     1         3       4      1       2 33d1fb69067a b8e02f643373 000000000000
-baz: we shouldn't have a merge here
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0       3      0       0 b8e02f643373 000000000000 000000000000
-     1         3       4      1       1 2ffeddde1b65 b8e02f643373 000000000000
-quux: we shouldn't have a merge here
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0       3      0       0 b8e02f643373 000000000000 000000000000
-     1         3       5      1       3 6128c0f33108 b8e02f643373 000000000000
-manifest entries should match tips of all files
-33d1fb69067a0139622a3fa3b7ba1cdb1367972e 644   bar
-2ffeddde1b65b4827f6746174a145474129fa2ce 644   baz
-aa27919ee4303cfd575e1fb932dd64d75aa08be4 644   foo
-6128c0f33108e8cfbb4e0824d13ae48b466d7280 644   quux
-everything should be clean now
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-4 files, 4 changesets, 10 total revisions
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-filebranch.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,148 @@
+This test makes sure that we don't mark a file as merged with its ancestor
+when we do a merge.
+
+  $ cat <<EOF > merge
+  > import sys, os
+  > print "merging for", os.path.basename(sys.argv[1])
+  > EOF
+  $ HGMERGE="python ../merge"; export HGMERGE
+
+Creating base:
+
+  $ hg init a
+  $ cd a
+  $ echo 1 > foo
+  $ echo 1 > bar
+  $ echo 1 > baz
+  $ echo 1 > quux
+  $ hg add foo bar baz quux
+  $ hg commit -m "base"
+
+  $ cd ..
+  $ hg clone a b
+  updating to branch default
+  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+Creating branch a:
+
+  $ cd a
+  $ echo 2a > foo
+  $ echo 2a > bar
+  $ hg commit -m "branch a"
+
+Creating branch b:
+
+  $ cd ..
+  $ cd b
+  $ echo 2b > foo
+  $ echo 2b > baz
+  $ hg commit -m "branch b"
+
+We shouldn't have anything but n state here:
+
+  $ hg debugstate --nodates | grep -v "^n"
+  [1]
+
+Merging:
+
+  $ hg pull ../a
+  pulling from ../a
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 2 changes to 2 files (+1 heads)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+
+  $ hg merge -v
+  merging for foo
+  resolving manifests
+  getting bar
+  merging foo
+  1 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+  $ echo 2m > foo
+  $ echo 2b > baz
+  $ echo new > quux
+
+We shouldn't have anything but foo in merge state here:
+
+  $ hg debugstate --nodates | grep "^m"
+  m 644          3 foo
+
+  $ hg ci -m "merge"
+
+main: we should have a merge here:
+
+  $ hg debugindex .hg/store/00changelog.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0      73      0       0 cdca01651b96 000000000000 000000000000
+       1        73      68      1       1 f6718a9cb7f3 cdca01651b96 000000000000
+       2       141      68      2       2 bdd988058d16 cdca01651b96 000000000000
+       3       209      66      3       3 d8a521142a3c f6718a9cb7f3 bdd988058d16
+
+log should show foo and quux changed:
+
+  $ hg log -v -r tip
+  changeset:   3:d8a521142a3c
+  tag:         tip
+  parent:      1:f6718a9cb7f3
+  parent:      2:bdd988058d16
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files:       foo quux
+  description:
+  merge
+  
+  
+
+foo: we should have a merge here:
+
+  $ hg debugindex .hg/store/data/foo.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0       3      0       0 b8e02f643373 000000000000 000000000000
+       1         3       4      1       1 2ffeddde1b65 b8e02f643373 000000000000
+       2         7       4      2       2 33d1fb69067a b8e02f643373 000000000000
+       3        11       4      3       3 aa27919ee430 2ffeddde1b65 33d1fb69067a
+
+bar: we should not have a merge here:
+
+  $ hg debugindex .hg/store/data/bar.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0       3      0       0 b8e02f643373 000000000000 000000000000
+       1         3       4      1       2 33d1fb69067a b8e02f643373 000000000000
+
+baz: we should not have a merge here:
+
+  $ hg debugindex .hg/store/data/baz.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0       3      0       0 b8e02f643373 000000000000 000000000000
+       1         3       4      1       1 2ffeddde1b65 b8e02f643373 000000000000
+
+quux: we should not have a merge here:
+
+  $ hg debugindex .hg/store/data/quux.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0       3      0       0 b8e02f643373 000000000000 000000000000
+       1         3       5      1       3 6128c0f33108 b8e02f643373 000000000000
+
+Manifest entries should match tips of all files:
+
+  $ hg manifest --debug
+  33d1fb69067a0139622a3fa3b7ba1cdb1367972e 644   bar
+  2ffeddde1b65b4827f6746174a145474129fa2ce 644   baz
+  aa27919ee4303cfd575e1fb932dd64d75aa08be4 644   foo
+  6128c0f33108e8cfbb4e0824d13ae48b466d7280 644   quux
+
+Everything should be clean now:
+
+  $ hg status
+
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  4 files, 4 changesets, 10 total revisions
+
--- a/tests/test-flags	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-#!/bin/sh -e
-
-umask 027
-mkdir test1
-cd test1
-
-hg init
-touch a b
-hg add a b
-hg ci -m "added a b" -d "1000000 0"
-
-cd ..
-hg clone test1 test3
-mkdir test2
-cd test2
-
-hg init
-hg pull ../test1
-hg co
-chmod +x a
-hg ci -m "chmod +x a" -d "1000000 0"
-echo % the changelog should mention file a:
-hg tip --template '{files}\n'
-
-cd ../test1
-echo 123 >>a
-hg ci -m "a updated" -d "1000000 0"
-
-hg pull ../test2
-hg heads
-hg history
-
-hg -v merge
-
-cd ../test3
-echo 123 >>b
-hg ci -m "b updated" -d "1000000 0"
-
-hg pull ../test2
-hg heads
-hg history
-
-hg -v merge
-
-ls -l ../test[123]/a > foo
-cut -b 1-10 < foo
-
-hg debugindex .hg/store/data/a.i
-hg debugindex ../test2/.hg/store/data/a.i
-hg debugindex ../test1/.hg/store/data/a.i
--- a/tests/test-flags.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,100 +0,0 @@
-updating to branch default
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-pulling from ../test1
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 2 changes to 2 files
-(run 'hg update' to get a working copy)
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% the changelog should mention file a:
-a
-pulling from ../test2
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 0 changes to 0 files (+1 heads)
-(run 'hg heads' to see heads, 'hg merge' to merge)
-changeset:   2:37dccb76c058
-tag:         tip
-parent:      0:4536b1c2ca69
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     chmod +x a
-
-changeset:   1:a187cb361a5a
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     a updated
-
-changeset:   2:37dccb76c058
-tag:         tip
-parent:      0:4536b1c2ca69
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     chmod +x a
-
-changeset:   1:a187cb361a5a
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     a updated
-
-changeset:   0:4536b1c2ca69
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     added a b
-
-resolving manifests
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-pulling from ../test2
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 0 changes to 0 files (+1 heads)
-(run 'hg heads' to see heads, 'hg merge' to merge)
-changeset:   2:37dccb76c058
-tag:         tip
-parent:      0:4536b1c2ca69
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     chmod +x a
-
-changeset:   1:d54568174d8e
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     b updated
-
-changeset:   2:37dccb76c058
-tag:         tip
-parent:      0:4536b1c2ca69
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     chmod +x a
-
-changeset:   1:d54568174d8e
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     b updated
-
-changeset:   0:4536b1c2ca69
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     added a b
-
-resolving manifests
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
--rwxr-x---
--rwxr-x---
--rwxr-x---
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0       0      0       0 b80de5d13875 000000000000 000000000000
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0       0      0       0 b80de5d13875 000000000000 000000000000
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0       0      0       0 b80de5d13875 000000000000 000000000000
-     1         0       5      1       1 7fe919cc0336 b80de5d13875 000000000000
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-flags.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,149 @@
+  $ umask 027
+  $ mkdir test1
+  $ cd test1
+
+  $ hg init
+  $ touch a b
+  $ hg add a b
+  $ hg ci -m "added a b"
+
+  $ cd ..
+  $ hg clone test1 test3
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ mkdir test2
+  $ cd test2
+
+  $ hg init
+  $ hg pull ../test1
+  pulling from ../test1
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 2 changes to 2 files
+  (run 'hg update' to get a working copy)
+  $ hg co
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ chmod +x a
+  $ hg ci -m "chmod +x a"
+
+the changelog should mention file a:
+
+  $ hg tip --template '{files}\n'
+  a
+
+  $ cd ../test1
+  $ echo 123 >>a
+  $ hg ci -m "a updated"
+
+  $ hg pull ../test2
+  pulling from ../test2
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 0 changes to 0 files (+1 heads)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+  $ hg heads
+  changeset:   2:7f4313b42a34
+  tag:         tip
+  parent:      0:22a449e20da5
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     chmod +x a
+  
+  changeset:   1:c6ecefc45368
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     a updated
+  
+  $ hg history
+  changeset:   2:7f4313b42a34
+  tag:         tip
+  parent:      0:22a449e20da5
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     chmod +x a
+  
+  changeset:   1:c6ecefc45368
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     a updated
+  
+  changeset:   0:22a449e20da5
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     added a b
+  
+
+  $ hg -v merge
+  resolving manifests
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+  $ cd ../test3
+  $ echo 123 >>b
+  $ hg ci -m "b updated"
+
+  $ hg pull ../test2
+  pulling from ../test2
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 0 changes to 0 files (+1 heads)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+  $ hg heads
+  changeset:   2:7f4313b42a34
+  tag:         tip
+  parent:      0:22a449e20da5
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     chmod +x a
+  
+  changeset:   1:dc57ead75f79
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     b updated
+  
+  $ hg history
+  changeset:   2:7f4313b42a34
+  tag:         tip
+  parent:      0:22a449e20da5
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     chmod +x a
+  
+  changeset:   1:dc57ead75f79
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     b updated
+  
+  changeset:   0:22a449e20da5
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     added a b
+  
+
+  $ hg -v merge
+  resolving manifests
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+  $ ls -l ../test[123]/a > foo
+  $ cut -b 1-10 < foo
+  -rwxr-x---
+  -rwxr-x---
+  -rwxr-x---
+
+  $ hg debugindex .hg/store/data/a.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0       0      0       0 b80de5d13875 000000000000 000000000000
+  $ hg debugindex ../test2/.hg/store/data/a.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0       0      0       0 b80de5d13875 000000000000 000000000000
+  $ hg debugindex ../test1/.hg/store/data/a.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0       0      0       0 b80de5d13875 000000000000 000000000000
+       1         0       5      1       1 7fe919cc0336 b80de5d13875 000000000000
--- a/tests/test-fncache	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-#!/bin/sh
-
-echo "% init repo1"
-hg init repo1
-cd repo1
-
-echo
-echo "% add a; ci"
-echo "some text" > a
-hg add
-hg ci -m first
-
-echo
-echo "% cat .hg/store/fncache"
-cat .hg/store/fncache
-
-echo
-echo "% add a.i/b; ci"
-mkdir a.i
-echo "some other text" > a.i/b
-hg add
-hg ci -m second
-
-echo
-echo "% cat .hg/store/fncache"
-cat .hg/store/fncache
-
-echo
-echo "% add a.i.hg/c; ci"
-mkdir a.i.hg
-echo "yet another text" > a.i.hg/c
-hg add
-hg ci -m third
-
-echo
-echo "% cat .hg/store/fncache"
-cat .hg/store/fncache
-
-echo
-echo "% hg verify"
-hg verify
-
-echo
-echo "% rm .hg/store/fncache"
-rm .hg/store/fncache
-
-echo
-echo "% hg verify"
-hg verify
-
-# try non store repo encoding
-cd ..
-echo % non store repo
-hg --config format.usestore=False init foo
-cd foo
-mkdir tst.d
-echo foo > tst.d/foo
-hg ci -Amfoo
-find .hg | sort
-
-cd ..
-echo % non fncache repo
-hg --config format.usefncache=False init bar
-cd bar
-mkdir tst.d
-echo foo > tst.d/Foo
-hg ci -Amfoo
-find .hg | sort
-
-exit 0
--- a/tests/test-fncache.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-% init repo1
-
-% add a; ci
-adding a
-
-% cat .hg/store/fncache
-data/a.i
-
-% add a.i/b; ci
-adding a.i/b
-
-% cat .hg/store/fncache
-data/a.i
-data/a.i.hg/b.i
-
-% add a.i.hg/c; ci
-adding a.i.hg/c
-
-% cat .hg/store/fncache
-data/a.i
-data/a.i.hg/b.i
-data/a.i.hg.hg/c.i
-
-% hg verify
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-3 files, 3 changesets, 3 total revisions
-
-% rm .hg/store/fncache
-
-% hg verify
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
- data/a.i@0: missing revlog!
- data/a.i.hg/c.i@2: missing revlog!
- data/a.i/b.i@1: missing revlog!
-3 files, 3 changesets, 3 total revisions
-3 integrity errors encountered!
-(first damaged changeset appears to be 0)
-% non store repo
-adding tst.d/foo
-.hg
-.hg/00changelog.i
-.hg/00manifest.i
-.hg/data
-.hg/data/tst.d.hg
-.hg/data/tst.d.hg/foo.i
-.hg/dirstate
-.hg/last-message.txt
-.hg/requires
-.hg/undo
-.hg/undo.branch
-.hg/undo.desc
-.hg/undo.dirstate
-% non fncache repo
-adding tst.d/Foo
-.hg
-.hg/00changelog.i
-.hg/dirstate
-.hg/last-message.txt
-.hg/requires
-.hg/store
-.hg/store/00changelog.i
-.hg/store/00manifest.i
-.hg/store/data
-.hg/store/data/tst.d.hg
-.hg/store/data/tst.d.hg/_foo.i
-.hg/store/undo
-.hg/undo.branch
-.hg/undo.desc
-.hg/undo.dirstate
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-fncache.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,109 @@
+Init repo1:
+
+  $ hg init repo1
+  $ cd repo1
+  $ echo "some text" > a
+  $ hg add
+  adding a
+  $ hg ci -m first
+  $ cat .hg/store/fncache
+  data/a.i
+
+Testing a.i/b:
+
+  $ mkdir a.i
+  $ echo "some other text" > a.i/b
+  $ hg add
+  adding a.i/b
+  $ hg ci -m second
+  $ cat .hg/store/fncache
+  data/a.i
+  data/a.i.hg/b.i
+
+Testing a.i.hg/c:
+
+  $ mkdir a.i.hg
+  $ echo "yet another text" > a.i.hg/c
+  $ hg add
+  adding a.i.hg/c
+  $ hg ci -m third
+  $ cat .hg/store/fncache
+  data/a.i
+  data/a.i.hg/b.i
+  data/a.i.hg.hg/c.i
+
+Testing verify:
+
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  3 files, 3 changesets, 3 total revisions
+
+  $ rm .hg/store/fncache
+
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+   data/a.i@0: missing revlog!
+   data/a.i.hg/c.i@2: missing revlog!
+   data/a.i/b.i@1: missing revlog!
+  3 files, 3 changesets, 3 total revisions
+  3 integrity errors encountered!
+  (first damaged changeset appears to be 0)
+  [1]
+  $ cd ..
+
+Non store repo:
+
+  $ hg --config format.usestore=False init foo
+  $ cd foo
+  $ mkdir tst.d
+  $ echo foo > tst.d/foo
+  $ hg ci -Amfoo
+  adding tst.d/foo
+  $ find .hg | sort
+  .hg
+  .hg/00changelog.i
+  .hg/00manifest.i
+  .hg/data
+  .hg/data/tst.d.hg
+  .hg/data/tst.d.hg/foo.i
+  .hg/dirstate
+  .hg/last-message.txt
+  .hg/requires
+  .hg/undo
+  .hg/undo.branch
+  .hg/undo.desc
+  .hg/undo.dirstate
+  $ cd ..
+
+Non fncache repo:
+
+  $ hg --config format.usefncache=False init bar
+  $ cd bar
+  $ mkdir tst.d
+  $ echo foo > tst.d/Foo
+  $ hg ci -Amfoo
+  adding tst.d/Foo
+  $ find .hg | sort
+  .hg
+  .hg/00changelog.i
+  .hg/dirstate
+  .hg/last-message.txt
+  .hg/requires
+  .hg/store
+  .hg/store/00changelog.i
+  .hg/store/00manifest.i
+  .hg/store/data
+  .hg/store/data/tst.d.hg
+  .hg/store/data/tst.d.hg/_foo.i
+  .hg/store/undo
+  .hg/undo.branch
+  .hg/undo.desc
+  .hg/undo.dirstate
+  $ cd ..
+
--- a/tests/test-gendoc.out	Wed Sep 22 17:13:49 2010 -0500
+++ b/tests/test-gendoc.out	Wed Sep 22 18:29:41 2010 -0500
@@ -23,6 +23,9 @@
 % extracting documentation from pt_BR
 checking for parse errors
 
+% extracting documentation from ro
+checking for parse errors
+
 % extracting documentation from sv
 checking for parse errors
 
--- a/tests/test-git-export	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,158 +0,0 @@
-#!/bin/sh
-
-hg init a
-cd a
-
-echo start > start
-hg ci -Amstart
-echo new > new
-hg ci -Amnew
-echo '% new file'
-hg diff --git -r 0
-
-hg cp new copy
-hg ci -mcopy
-echo '% copy'
-hg diff --git -r 1:tip
-
-hg mv copy rename
-hg ci -mrename
-echo '% rename'
-hg diff --git -r 2:tip
-
-hg rm rename
-hg ci -mdelete
-echo '% delete'
-hg diff --git -r 3:tip
-
-cat > src <<EOF
-1
-2
-3
-4
-5
-EOF
-hg ci -Amsrc
-chmod +x src
-hg ci -munexec
-echo '% chmod 644'
-hg diff --git -r 5:tip
-
-hg mv src dst
-chmod -x dst
-echo a >> dst
-hg ci -mrenamemod
-echo '% rename+mod+chmod'
-hg diff --git -r 6:tip
-
-echo '% nonexistent in tip+chmod'
-hg diff --git -r 5:6
-
-echo '% binary diff'
-cp $TESTDIR/binfile.bin .
-hg add binfile.bin
-hg diff --git > b.diff
-cat b.diff
-
-echo '% import binary diff'
-hg revert binfile.bin
-rm binfile.bin
-hg import -mfoo b.diff
-cmp binfile.bin $TESTDIR/binfile.bin
-
-echo
-echo '% rename binary file'
-hg mv binfile.bin renamed.bin
-hg diff --git
-
-echo
-echo '% diff across many revisions'
-hg mv dst dst2
-hg ci -m 'mv dst dst2'
-
-echo >> start
-hg ci -m 'change start'
-
-hg revert -r -2 start
-hg mv dst2 dst3
-hg ci -m 'mv dst2 dst3; revert start'
-
-hg diff --git -r 9:11
-echo '%  reversed'
-hg diff --git -r 11:9
-
-echo a >> foo
-hg add foo
-hg ci -m 'add foo'
-echo b >> foo
-hg ci -m 'change foo'
-hg mv foo bar
-hg ci -m 'mv foo bar'
-echo c >> bar
-hg ci -m 'change bar'
-
-echo
-echo '% file created before r1 and renamed before r2'
-hg diff --git -r -3:-1
-echo '%  reversed'
-hg diff --git -r -1:-3
-echo
-echo '% file created in r1 and renamed before r2'
-hg diff --git -r -4:-1
-echo '%  reversed'
-hg diff --git -r -1:-4
-echo
-echo '% file created after r1 and renamed before r2'
-hg diff --git -r -5:-1
-echo '%  reversed'
-hg diff --git -r -1:-5
-
-echo
-echo '% comparing with the working dir'
-echo >> start
-hg ci -m 'change start again'
-
-echo > created
-hg add created
-hg ci -m 'add created'
-
-hg mv created created2
-hg ci -m 'mv created created2'
-
-hg mv created2 created3
-echo "% there's a copy in the working dir..."
-hg diff --git
-echo
-echo "% ...but there's another copy between the original rev and the wd"
-hg diff --git -r -2
-echo
-echo "% ...but the source of the copy was created after the original rev"
-hg diff --git -r -3
-hg ci -m 'mv created2 created3'
-
-echo > brand-new
-hg add brand-new
-hg ci -m 'add brand-new'
-hg mv brand-new brand-new2
-echo '% created in parent of wd; renamed in the wd'
-hg diff --git
-
-echo
-echo '% created between r1 and parent of wd; renamed in the wd'
-hg diff --git -r -2
-hg ci -m 'mv brand-new brand-new2'
-
-echo '% one file is copied to many destinations and removed'
-hg cp brand-new2 brand-new3
-hg mv brand-new2 brand-new3-2
-hg ci -m 'multiple renames/copies'
-hg diff --git -r -2 -r -1
-echo '%  reversed'
-hg diff --git -r -1 -r -2
-
-echo '% there should be a trailing TAB if there are spaces in the file name'
-echo foo > 'with spaces'
-hg add 'with spaces'
-hg diff --git
-hg ci -m 'add filename with spaces'
-
--- a/tests/test-git-export.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,197 +0,0 @@
-adding start
-adding new
-% new file
-diff --git a/new b/new
-new file mode 100644
---- /dev/null
-+++ b/new
-@@ -0,0 +1,1 @@
-+new
-% copy
-diff --git a/new b/copy
-copy from new
-copy to copy
-% rename
-diff --git a/copy b/rename
-rename from copy
-rename to rename
-% delete
-diff --git a/rename b/rename
-deleted file mode 100644
---- a/rename
-+++ /dev/null
-@@ -1,1 +0,0 @@
--new
-adding src
-% chmod 644
-diff --git a/src b/src
-old mode 100644
-new mode 100755
-% rename+mod+chmod
-diff --git a/src b/dst
-old mode 100755
-new mode 100644
-rename from src
-rename to dst
---- a/src
-+++ b/dst
-@@ -3,3 +3,4 @@
- 3
- 4
- 5
-+a
-% nonexistent in tip+chmod
-diff --git a/src b/src
-old mode 100644
-new mode 100755
-% binary diff
-diff --git a/binfile.bin b/binfile.bin
-new file mode 100644
-index 0000000000000000000000000000000000000000..37ba3d1c6f17137d9c5f5776fa040caf5fe73ff9
-GIT binary patch
-literal 593
-zc$@)I0<QguP)<h;3K|Lk000e1NJLTq000mG000mO0ssI2kdbIM00009a7bBm000XU
-z000XU0RWnu7ytkO2XskIMF-Uh9TW;VpMjwv0005-Nkl<ZD9@FWPs=e;7{<>W$NUkd
-zX$nnYLt$-$V!?uy+1V%`z&Eh=ah|duER<4|QWhju3gb^nF*8iYobxWG-qqXl=2~5M
-z*IoDB)sG^CfNuoBmqLTVU^<;@nwHP!1wrWd`{(mHo6VNXWtyh{alzqmsH*yYzpvLT
-zLdY<T=ks|woh-`&01!ej#(xbV1f|pI*=%;d-%F*E*X#ZH`4I%6SS+$EJDE&ct=8po
-ziN#{?_j|kD%Cd|oiqds`xm@;oJ-^?NG3Gdqrs?5u*zI;{nogxsx~^|Fn^Y?Gdc6<;
-zfMJ+iF1J`LMx&A2?dEwNW8ClebzPTbIh{@$hS6*`kH@1d%Lo7fA#}N1)oN7`gm$~V
-z+wDx#)OFqMcE{s!JN0-xhG8ItAjVkJwEcb`3WWlJfU2r?;Pd%dmR+q@mSri5q9_W-
-zaR2~ECX?B2w+zELozC0s*6Z~|QG^f{3I#<`?)Q7U-JZ|q5W;9Q8i_=pBuSzunx=U;
-z9C)5jBoYw9^?EHyQl(M}1OlQcCX>lXB*ODN003Z&P17_@)3Pi=i0wb04<W?v-u}7K
-zXmmQA+wDgE!qR9o8jr`%=ab_&uh(l?R=r;Tjiqon91I2-hIu?57~@*4h7h9uORK#=
-fQItJW-{SoTm)8|5##k|m00000NkvXXu0mjf{mKw4
-
-% import binary diff
-applying b.diff
-
-% rename binary file
-diff --git a/binfile.bin b/renamed.bin
-rename from binfile.bin
-rename to renamed.bin
-
-% diff across many revisions
-diff --git a/dst2 b/dst3
-rename from dst2
-rename to dst3
-%  reversed
-diff --git a/dst3 b/dst2
-rename from dst3
-rename to dst2
-
-% file created before r1 and renamed before r2
-diff --git a/foo b/bar
-rename from foo
-rename to bar
---- a/foo
-+++ b/bar
-@@ -1,2 +1,3 @@
- a
- b
-+c
-%  reversed
-diff --git a/bar b/foo
-rename from bar
-rename to foo
---- a/bar
-+++ b/foo
-@@ -1,3 +1,2 @@
- a
- b
--c
-
-% file created in r1 and renamed before r2
-diff --git a/foo b/bar
-rename from foo
-rename to bar
---- a/foo
-+++ b/bar
-@@ -1,1 +1,3 @@
- a
-+b
-+c
-%  reversed
-diff --git a/bar b/foo
-rename from bar
-rename to foo
---- a/bar
-+++ b/foo
-@@ -1,3 +1,1 @@
- a
--b
--c
-
-% file created after r1 and renamed before r2
-diff --git a/bar b/bar
-new file mode 100644
---- /dev/null
-+++ b/bar
-@@ -0,0 +1,3 @@
-+a
-+b
-+c
-%  reversed
-diff --git a/bar b/bar
-deleted file mode 100644
---- a/bar
-+++ /dev/null
-@@ -1,3 +0,0 @@
--a
--b
--c
-
-% comparing with the working dir
-% there's a copy in the working dir...
-diff --git a/created2 b/created3
-rename from created2
-rename to created3
-
-% ...but there's another copy between the original rev and the wd
-diff --git a/created b/created3
-rename from created
-rename to created3
-
-% ...but the source of the copy was created after the original rev
-diff --git a/created3 b/created3
-new file mode 100644
---- /dev/null
-+++ b/created3
-@@ -0,0 +1,1 @@
-+
-% created in parent of wd; renamed in the wd
-diff --git a/brand-new b/brand-new2
-rename from brand-new
-rename to brand-new2
-
-% created between r1 and parent of wd; renamed in the wd
-diff --git a/brand-new2 b/brand-new2
-new file mode 100644
---- /dev/null
-+++ b/brand-new2
-@@ -0,0 +1,1 @@
-+
-% one file is copied to many destinations and removed
-diff --git a/brand-new2 b/brand-new3
-rename from brand-new2
-rename to brand-new3
-diff --git a/brand-new2 b/brand-new3-2
-copy from brand-new2
-copy to brand-new3-2
-%  reversed
-diff --git a/brand-new3 b/brand-new2
-rename from brand-new3
-rename to brand-new2
-diff --git a/brand-new3-2 b/brand-new3-2
-deleted file mode 100644
---- a/brand-new3-2
-+++ /dev/null
-@@ -1,1 +0,0 @@
--
-% there should be a trailing TAB if there are spaces in the file name
-diff --git a/with spaces b/with spaces
-new file mode 100644
---- /dev/null
-+++ b/with spaces	
-@@ -0,0 +1,1 @@
-+foo
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-git-export.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,349 @@
+  $ hg init
+  $ echo start > start
+  $ hg ci -Amstart
+  adding start
+
+New file:
+
+  $ echo new > new
+  $ hg ci -Amnew
+  adding new
+  $ hg diff --git -r 0
+  diff --git a/new b/new
+  new file mode 100644
+  --- /dev/null
+  +++ b/new
+  @@ -0,0 +1,1 @@
+  +new
+
+Copy:
+
+  $ hg cp new copy
+  $ hg ci -mcopy
+  $ hg diff --git -r 1:tip
+  diff --git a/new b/copy
+  copy from new
+  copy to copy
+
+Rename:
+
+  $ hg mv copy rename
+  $ hg ci -mrename
+  $ hg diff --git -r 2:tip
+  diff --git a/copy b/rename
+  rename from copy
+  rename to rename
+
+Delete:
+
+  $ hg rm rename
+  $ hg ci -mdelete
+  $ hg diff --git -r 3:tip
+  diff --git a/rename b/rename
+  deleted file mode 100644
+  --- a/rename
+  +++ /dev/null
+  @@ -1,1 +0,0 @@
+  -new
+
+  $ cat > src <<EOF
+  > 1
+  > 2
+  > 3
+  > 4
+  > 5
+  > EOF
+  $ hg ci -Amsrc
+  adding src
+
+chmod 644:
+
+  $ chmod +x src
+  $ hg ci -munexec
+  $ hg diff --git -r 5:tip
+  diff --git a/src b/src
+  old mode 100644
+  new mode 100755
+
+Rename+mod+chmod:
+
+  $ hg mv src dst
+  $ chmod -x dst
+  $ echo a >> dst
+  $ hg ci -mrenamemod
+  $ hg diff --git -r 6:tip
+  diff --git a/src b/dst
+  old mode 100755
+  new mode 100644
+  rename from src
+  rename to dst
+  --- a/src
+  +++ b/dst
+  @@ -3,3 +3,4 @@
+   3
+   4
+   5
+  +a
+
+Nonexistent in tip+chmod:
+
+  $ hg diff --git -r 5:6
+  diff --git a/src b/src
+  old mode 100644
+  new mode 100755
+
+Binary diff:
+
+  $ cp $TESTDIR/binfile.bin .
+  $ hg add binfile.bin
+  $ hg diff --git > b.diff
+  $ cat b.diff
+  diff --git a/binfile.bin b/binfile.bin
+  new file mode 100644
+  index 0000000000000000000000000000000000000000..37ba3d1c6f17137d9c5f5776fa040caf5fe73ff9
+  GIT binary patch
+  literal 593
+  zc$@)I0<QguP)<h;3K|Lk000e1NJLTq000mG000mO0ssI2kdbIM00009a7bBm000XU
+  z000XU0RWnu7ytkO2XskIMF-Uh9TW;VpMjwv0005-Nkl<ZD9@FWPs=e;7{<>W$NUkd
+  zX$nnYLt$-$V!?uy+1V%`z&Eh=ah|duER<4|QWhju3gb^nF*8iYobxWG-qqXl=2~5M
+  z*IoDB)sG^CfNuoBmqLTVU^<;@nwHP!1wrWd`{(mHo6VNXWtyh{alzqmsH*yYzpvLT
+  zLdY<T=ks|woh-`&01!ej#(xbV1f|pI*=%;d-%F*E*X#ZH`4I%6SS+$EJDE&ct=8po
+  ziN#{?_j|kD%Cd|oiqds`xm@;oJ-^?NG3Gdqrs?5u*zI;{nogxsx~^|Fn^Y?Gdc6<;
+  zfMJ+iF1J`LMx&A2?dEwNW8ClebzPTbIh{@$hS6*`kH@1d%Lo7fA#}N1)oN7`gm$~V
+  z+wDx#)OFqMcE{s!JN0-xhG8ItAjVkJwEcb`3WWlJfU2r?;Pd%dmR+q@mSri5q9_W-
+  zaR2~ECX?B2w+zELozC0s*6Z~|QG^f{3I#<`?)Q7U-JZ|q5W;9Q8i_=pBuSzunx=U;
+  z9C)5jBoYw9^?EHyQl(M}1OlQcCX>lXB*ODN003Z&P17_@)3Pi=i0wb04<W?v-u}7K
+  zXmmQA+wDgE!qR9o8jr`%=ab_&uh(l?R=r;Tjiqon91I2-hIu?57~@*4h7h9uORK#=
+  fQItJW-{SoTm)8|5##k|m00000NkvXXu0mjf{mKw4
+  
+
+Import binary diff:
+
+  $ hg revert binfile.bin
+  $ rm binfile.bin
+  $ hg import -mfoo b.diff
+  applying b.diff
+  $ cmp binfile.bin $TESTDIR/binfile.bin
+
+Rename binary file:
+
+  $ hg mv binfile.bin renamed.bin
+  $ hg diff --git
+  diff --git a/binfile.bin b/renamed.bin
+  rename from binfile.bin
+  rename to renamed.bin
+
+Diff across many revisions:
+
+  $ hg mv dst dst2
+  $ hg ci -m 'mv dst dst2'
+
+  $ echo >> start
+  $ hg ci -m 'change start'
+
+  $ hg revert -r -2 start
+  $ hg mv dst2 dst3
+  $ hg ci -m 'mv dst2 dst3; revert start'
+
+  $ hg diff --git -r 9:11
+  diff --git a/dst2 b/dst3
+  rename from dst2
+  rename to dst3
+
+Reversed:
+
+  $ hg diff --git -r 11:9
+  diff --git a/dst3 b/dst2
+  rename from dst3
+  rename to dst2
+
+
+  $ echo a >> foo
+  $ hg add foo
+  $ hg ci -m 'add foo'
+  $ echo b >> foo
+  $ hg ci -m 'change foo'
+  $ hg mv foo bar
+  $ hg ci -m 'mv foo bar'
+  $ echo c >> bar
+  $ hg ci -m 'change bar'
+
+File created before r1 and renamed before r2:
+
+  $ hg diff --git -r -3:-1
+  diff --git a/foo b/bar
+  rename from foo
+  rename to bar
+  --- a/foo
+  +++ b/bar
+  @@ -1,2 +1,3 @@
+   a
+   b
+  +c
+
+Reversed:
+
+  $ hg diff --git -r -1:-3
+  diff --git a/bar b/foo
+  rename from bar
+  rename to foo
+  --- a/bar
+  +++ b/foo
+  @@ -1,3 +1,2 @@
+   a
+   b
+  -c
+
+File created in r1 and renamed before r2:
+
+  $ hg diff --git -r -4:-1
+  diff --git a/foo b/bar
+  rename from foo
+  rename to bar
+  --- a/foo
+  +++ b/bar
+  @@ -1,1 +1,3 @@
+   a
+  +b
+  +c
+
+Reversed:
+
+  $ hg diff --git -r -1:-4
+  diff --git a/bar b/foo
+  rename from bar
+  rename to foo
+  --- a/bar
+  +++ b/foo
+  @@ -1,3 +1,1 @@
+   a
+  -b
+  -c
+
+File created after r1 and renamed before r2:
+
+  $ hg diff --git -r -5:-1
+  diff --git a/bar b/bar
+  new file mode 100644
+  --- /dev/null
+  +++ b/bar
+  @@ -0,0 +1,3 @@
+  +a
+  +b
+  +c
+
+Reversed:
+
+  $ hg diff --git -r -1:-5
+  diff --git a/bar b/bar
+  deleted file mode 100644
+  --- a/bar
+  +++ /dev/null
+  @@ -1,3 +0,0 @@
+  -a
+  -b
+  -c
+
+
+Comparing with the working dir:
+
+  $ echo >> start
+  $ hg ci -m 'change start again'
+
+  $ echo > created
+  $ hg add created
+  $ hg ci -m 'add created'
+
+  $ hg mv created created2
+  $ hg ci -m 'mv created created2'
+
+  $ hg mv created2 created3
+
+There's a copy in the working dir:
+
+  $ hg diff --git
+  diff --git a/created2 b/created3
+  rename from created2
+  rename to created3
+
+There's another copy between the original rev and the wd:
+
+  $ hg diff --git -r -2
+  diff --git a/created b/created3
+  rename from created
+  rename to created3
+
+The source of the copy was created after the original rev:
+
+  $ hg diff --git -r -3
+  diff --git a/created3 b/created3
+  new file mode 100644
+  --- /dev/null
+  +++ b/created3
+  @@ -0,0 +1,1 @@
+  +
+  $ hg ci -m 'mv created2 created3'
+
+
+  $ echo > brand-new
+  $ hg add brand-new
+  $ hg ci -m 'add brand-new'
+  $ hg mv brand-new brand-new2
+
+Created in parent of wd; renamed in the wd:
+
+  $ hg diff --git
+  diff --git a/brand-new b/brand-new2
+  rename from brand-new
+  rename to brand-new2
+
+Created between r1 and parent of wd; renamed in the wd:
+
+  $ hg diff --git -r -2
+  diff --git a/brand-new2 b/brand-new2
+  new file mode 100644
+  --- /dev/null
+  +++ b/brand-new2
+  @@ -0,0 +1,1 @@
+  +
+  $ hg ci -m 'mv brand-new brand-new2'
+
+One file is copied to many destinations and removed:
+
+  $ hg cp brand-new2 brand-new3
+  $ hg mv brand-new2 brand-new3-2
+  $ hg ci -m 'multiple renames/copies'
+  $ hg diff --git -r -2 -r -1
+  diff --git a/brand-new2 b/brand-new3
+  rename from brand-new2
+  rename to brand-new3
+  diff --git a/brand-new2 b/brand-new3-2
+  copy from brand-new2
+  copy to brand-new3-2
+
+Reversed:
+
+  $ hg diff --git -r -1 -r -2
+  diff --git a/brand-new3 b/brand-new2
+  rename from brand-new3
+  rename to brand-new2
+  diff --git a/brand-new3-2 b/brand-new3-2
+  deleted file mode 100644
+  --- a/brand-new3-2
+  +++ /dev/null
+  @@ -1,1 +0,0 @@
+  -
+
+There should be a trailing TAB if there are spaces in the file name:
+
+  $ echo foo > 'with spaces'
+  $ hg add 'with spaces'
+  $ hg diff --git
+  diff --git a/with spaces b/with spaces
+  new file mode 100644
+  --- /dev/null
+  +++ b/with spaces	
+  @@ -0,0 +1,1 @@
+  +foo
+  $ hg ci -m 'add filename with spaces'
+
--- a/tests/test-git-import	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,230 +0,0 @@
-#!/bin/sh
-
-hg init a
-cd a
-
-echo % new file
-hg import -d "1000000 0" -mnew - <<EOF
-diff --git a/new b/new
-new file mode 100644
-index 0000000..7898192
---- /dev/null
-+++ b/new
-@@ -0,0 +1 @@
-+a
-EOF
-hg tip -q
-
-echo % new empty file
-hg import -d "1000000 0" -mempty - <<EOF
-diff --git a/empty b/empty
-new file mode 100644
-EOF
-hg tip -q
-hg locate empty
-
-echo % chmod +x
-hg import -d "1000000 0" -msetx - <<EOF
-diff --git a/new b/new
-old mode 100644
-new mode 100755
-EOF
-hg tip -q
-
-test -x new || echo failed
-
-echo % copy
-hg import -d "1000000 0" -mcopy - <<EOF
-diff --git a/new b/copy
-old mode 100755
-new mode 100644
-similarity index 100%
-copy from new
-copy to copy
-diff --git a/new b/copyx
-similarity index 100%
-copy from new
-copy to copyx
-EOF
-hg tip -q
-
-if "$TESTDIR/hghave" -q execbit; then
-    test -f copy -a ! -x copy || echo failed
-    test -x copyx || echo failed
-else
-    test -f copy || echo failed
-fi
-cat copy
-hg cat copy
-
-echo % rename
-hg import -d "1000000 0" -mrename - <<EOF
-diff --git a/copy b/rename
-similarity index 100%
-rename from copy
-rename to rename
-EOF
-hg tip -q
-
-hg locate
-
-echo % delete
-hg import -d "1000000 0" -mdelete - <<EOF
-diff --git a/copyx b/copyx
-deleted file mode 100755
-index 7898192..0000000
---- a/copyx
-+++ /dev/null
-@@ -1 +0,0 @@
--a
-EOF
-hg tip -q
-
-hg locate
-test -f copyx && echo failed || true
-
-echo % regular diff
-hg import -d "1000000 0" -mregular - <<EOF
-diff --git a/rename b/rename
-index 7898192..72e1fe3 100644
---- a/rename
-+++ b/rename
-@@ -1 +1,5 @@
- a
-+a
-+a
-+a
-+a
-EOF
-hg tip -q
-
-echo % copy and modify
-hg import -d "1000000 0" -mcopymod - <<EOF
-diff --git a/rename b/copy2
-similarity index 80%
-copy from rename
-copy to copy2
-index 72e1fe3..b53c148 100644
---- a/rename
-+++ b/copy2
-@@ -1,5 +1,5 @@
- a
- a
--a
-+b
- a
- a
-EOF
-hg tip -q
-
-hg cat copy2
-
-echo % rename and modify
-hg import -d "1000000 0" -mrenamemod - <<EOF
-diff --git a/copy2 b/rename2
-similarity index 80%
-rename from copy2
-rename to rename2
-index b53c148..8f81e29 100644
---- a/copy2
-+++ b/rename2
-@@ -1,5 +1,5 @@
- a
- a
- b
--a
-+c
- a
-EOF
-hg tip -q
-
-hg locate copy2
-hg cat rename2
-
-echo % one file renamed multiple times
-hg import -d "1000000 0" -mmultirenames - <<EOF
-diff --git a/rename2 b/rename3
-rename from rename2
-rename to rename3
-diff --git a/rename2 b/rename3-2
-rename from rename2
-rename to rename3-2
-EOF
-hg tip -q
-hg log -vr. --template '{rev} {files} / {file_copies}\n'
-
-hg locate rename2 rename3 rename3-2
-hg cat rename3
-echo
-hg cat rename3-2
-
-echo foo > foo
-hg add foo
-hg ci -m 'add foo'
-echo % binary files and regular patch hunks
-hg import -d "1000000 0" -m binaryregular - <<EOF
-diff --git a/binary b/binary
-new file mode 100644
-index 0000000000000000000000000000000000000000..593f4708db84ac8fd0f5cc47c634f38c013fe9e4
-GIT binary patch
-literal 4
-Lc\${NkU|;|M00aO5
-
-diff --git a/foo b/foo2
-rename from foo
-rename to foo2
-EOF
-hg tip -q
-cat foo2
-hg manifest --debug | grep binary
-
-echo % many binary files
-hg import -d "1000000 0" -m multibinary - <<EOF
-diff --git a/mbinary1 b/mbinary1
-new file mode 100644
-index 0000000000000000000000000000000000000000..593f4708db84ac8fd0f5cc47c634f38c013fe9e4
-GIT binary patch
-literal 4
-Lc\${NkU|;|M00aO5
-
-diff --git a/mbinary2 b/mbinary2
-new file mode 100644
-index 0000000000000000000000000000000000000000..112363ac1917b417ffbd7f376ca786a1e5fa7490
-GIT binary patch
-literal 5
-Mc\${NkU|\`?^000jF3jhEB
-
-EOF
-hg tip -q
-hg manifest --debug | grep mbinary
-
-echo % filenames with spaces
-hg import -d "1000000 0" -m spaces - <<EOF
-diff --git a/foo bar b/foo bar
-new file mode 100644
-index 0000000..257cc56
---- /dev/null
-+++ b/foo bar	
-@@ -0,0 +1 @@
-+foo
-EOF
-hg tip -q
-cat "foo bar"
-
-echo % copy then modify the original file
-hg import -d "1000000 0" -m copy-mod-orig - <<EOF
-diff --git a/foo2 b/foo2
-index 257cc56..fe08ec6 100644
---- a/foo2
-+++ b/foo2
-@@ -1 +1,2 @@
- foo
-+new line
-diff --git a/foo2 b/foo3
-similarity index 100%
-copy from foo2
-copy to foo3
-EOF
-hg tip -q
-
-cat foo3
--- a/tests/test-git-import.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-% new file
-applying patch from stdin
-0:ae3ee40d2079
-% new empty file
-applying patch from stdin
-1:ab199dc869b5
-empty
-% chmod +x
-applying patch from stdin
-2:3a34410f282e
-% copy
-applying patch from stdin
-3:37bacb7ca14d
-a
-a
-% rename
-applying patch from stdin
-4:47b81a94361d
-copyx
-empty
-new
-rename
-% delete
-applying patch from stdin
-5:d9b001d98336
-empty
-new
-rename
-% regular diff
-applying patch from stdin
-6:ebe901e7576b
-% copy and modify
-applying patch from stdin
-7:18f368958ecd
-a
-a
-b
-a
-a
-% rename and modify
-applying patch from stdin
-8:c32b0d7e6f44
-a
-a
-b
-c
-a
-% one file renamed multiple times
-applying patch from stdin
-9:034a6bf95330
-9 rename2 rename3 rename3-2 / rename3 (rename2)rename3-2 (rename2)
-rename3
-rename3-2
-a
-a
-b
-c
-a
-
-a
-a
-b
-c
-a
-% binary files and regular patch hunks
-applying patch from stdin
-11:c39bce63e786
-foo
-045c85ba38952325e126c70962cc0f9d9077bc67 644   binary
-% many binary files
-applying patch from stdin
-12:30b530085242
-045c85ba38952325e126c70962cc0f9d9077bc67 644   mbinary1
-a874b471193996e7cb034bb301cac7bdaf3e3f46 644   mbinary2
-% filenames with spaces
-applying patch from stdin
-13:04750ef42fb3
-foo
-% copy then modify the original file
-applying patch from stdin
-14:c4cd9cdeaa74
-foo
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-git-import.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,337 @@
+
+  $ hg init
+
+New file:
+
+  $ hg import -d "1000000 0" -mnew - <<EOF
+  > diff --git a/new b/new
+  > new file mode 100644
+  > index 0000000..7898192
+  > --- /dev/null
+  > +++ b/new
+  > @@ -0,0 +1 @@
+  > +a
+  > EOF
+  applying patch from stdin
+
+  $ hg tip -q
+  0:ae3ee40d2079
+
+New empty file:
+
+  $ hg import -d "1000000 0" -mempty - <<EOF
+  > diff --git a/empty b/empty
+  > new file mode 100644
+  > EOF
+  applying patch from stdin
+
+  $ hg tip -q
+  1:ab199dc869b5
+
+  $ hg locate empty
+  empty
+
+chmod +x:
+
+  $ hg import -d "1000000 0" -msetx - <<EOF
+  > diff --git a/new b/new
+  > old mode 100644
+  > new mode 100755
+  > EOF
+  applying patch from stdin
+
+  $ hg tip -q
+  2:3a34410f282e
+
+  $ test -x new
+
+Copy:
+
+  $ hg import -d "1000000 0" -mcopy - <<EOF
+  > diff --git a/new b/copy
+  > old mode 100755
+  > new mode 100644
+  > similarity index 100%
+  > copy from new
+  > copy to copy
+  > diff --git a/new b/copyx
+  > similarity index 100%
+  > copy from new
+  > copy to copyx
+  > EOF
+  applying patch from stdin
+
+  $ hg tip -q
+  3:37bacb7ca14d
+
+  $ if "$TESTDIR/hghave" -q execbit; then
+  >     test -f copy -a ! -x copy || echo bad
+  >     test -x copyx || echo bad
+  > else
+  >     test -f copy || echo bad
+  > fi
+
+  $ cat copy
+  a
+
+  $ hg cat copy
+  a
+
+Rename:
+
+  $ hg import -d "1000000 0" -mrename - <<EOF
+  > diff --git a/copy b/rename
+  > similarity index 100%
+  > rename from copy
+  > rename to rename
+  > EOF
+  applying patch from stdin
+
+  $ hg tip -q
+  4:47b81a94361d
+
+  $ hg locate
+  copyx
+  empty
+  new
+  rename
+
+Delete:
+
+  $ hg import -d "1000000 0" -mdelete - <<EOF
+  > diff --git a/copyx b/copyx
+  > deleted file mode 100755
+  > index 7898192..0000000
+  > --- a/copyx
+  > +++ /dev/null
+  > @@ -1 +0,0 @@
+  > -a
+  > EOF
+  applying patch from stdin
+
+  $ hg tip -q
+  5:d9b001d98336
+
+  $ hg locate
+  empty
+  new
+  rename
+
+  $ test -f copyx
+  [1]
+
+Regular diff:
+
+  $ hg import -d "1000000 0" -mregular - <<EOF
+  > diff --git a/rename b/rename
+  > index 7898192..72e1fe3 100644
+  > --- a/rename
+  > +++ b/rename
+  > @@ -1 +1,5 @@
+  >  a
+  > +a
+  > +a
+  > +a
+  > +a
+  > EOF
+  applying patch from stdin
+
+  $ hg tip -q
+  6:ebe901e7576b
+
+Copy and modify:
+
+  $ hg import -d "1000000 0" -mcopymod - <<EOF
+  > diff --git a/rename b/copy2
+  > similarity index 80%
+  > copy from rename
+  > copy to copy2
+  > index 72e1fe3..b53c148 100644
+  > --- a/rename
+  > +++ b/copy2
+  > @@ -1,5 +1,5 @@
+  >  a
+  >  a
+  > -a
+  > +b
+  >  a
+  >  a
+  > EOF
+  applying patch from stdin
+
+  $ hg tip -q
+  7:18f368958ecd
+
+  $ hg cat copy2
+  a
+  a
+  b
+  a
+  a
+
+Rename and modify:
+
+  $ hg import -d "1000000 0" -mrenamemod - <<EOF
+  > diff --git a/copy2 b/rename2
+  > similarity index 80%
+  > rename from copy2
+  > rename to rename2
+  > index b53c148..8f81e29 100644
+  > --- a/copy2
+  > +++ b/rename2
+  > @@ -1,5 +1,5 @@
+  >  a
+  >  a
+  >  b
+  > -a
+  > +c
+  >  a
+  > EOF
+  applying patch from stdin
+
+  $ hg tip -q
+  8:c32b0d7e6f44
+
+  $ hg locate copy2
+  [1]
+  $ hg cat rename2
+  a
+  a
+  b
+  c
+  a
+
+One file renamed multiple times:
+
+  $ hg import -d "1000000 0" -mmultirenames - <<EOF
+  > diff --git a/rename2 b/rename3
+  > rename from rename2
+  > rename to rename3
+  > diff --git a/rename2 b/rename3-2
+  > rename from rename2
+  > rename to rename3-2
+  > EOF
+  applying patch from stdin
+
+  $ hg tip -q
+  9:034a6bf95330
+
+  $ hg log -vr. --template '{rev} {files} / {file_copies}\n'
+  9 rename2 rename3 rename3-2 / rename3 (rename2)rename3-2 (rename2)
+
+  $ hg locate rename2 rename3 rename3-2
+  rename3
+  rename3-2
+
+  $ hg cat rename3
+  a
+  a
+  b
+  c
+  a
+
+  $ hg cat rename3-2
+  a
+  a
+  b
+  c
+  a
+
+  $ echo foo > foo
+  $ hg add foo
+  $ hg ci -m 'add foo'
+
+Binary files and regular patch hunks:
+
+  $ hg import -d "1000000 0" -m binaryregular - <<EOF
+  > diff --git a/binary b/binary
+  > new file mode 100644
+  > index 0000000000000000000000000000000000000000..593f4708db84ac8fd0f5cc47c634f38c013fe9e4
+  > GIT binary patch
+  > literal 4
+  > Lc\${NkU|;|M00aO5
+  > 
+  > diff --git a/foo b/foo2
+  > rename from foo
+  > rename to foo2
+  > EOF
+  applying patch from stdin
+
+  $ hg tip -q
+  11:c39bce63e786
+
+  $ cat foo2
+  foo
+
+  $ hg manifest --debug | grep binary
+  045c85ba38952325e126c70962cc0f9d9077bc67 644   binary
+
+Multiple binary files:
+
+  $ hg import -d "1000000 0" -m multibinary - <<EOF
+  > diff --git a/mbinary1 b/mbinary1
+  > new file mode 100644
+  > index 0000000000000000000000000000000000000000..593f4708db84ac8fd0f5cc47c634f38c013fe9e4
+  > GIT binary patch
+  > literal 4
+  > Lc\${NkU|;|M00aO5
+  > 
+  > diff --git a/mbinary2 b/mbinary2
+  > new file mode 100644
+  > index 0000000000000000000000000000000000000000..112363ac1917b417ffbd7f376ca786a1e5fa7490
+  > GIT binary patch
+  > literal 5
+  > Mc\${NkU|\`?^000jF3jhEB
+  > 
+  > EOF
+  applying patch from stdin
+
+  $ hg tip -q
+  12:30b530085242
+
+  $ hg manifest --debug | grep mbinary
+  045c85ba38952325e126c70962cc0f9d9077bc67 644   mbinary1
+  a874b471193996e7cb034bb301cac7bdaf3e3f46 644   mbinary2
+
+Filenames with spaces:
+
+  $ hg import -d "1000000 0" -m spaces - <<EOF
+  > diff --git a/foo bar b/foo bar
+  > new file mode 100644
+  > index 0000000..257cc56
+  > --- /dev/null
+  > +++ b/foo bar	
+  > @@ -0,0 +1 @@
+  > +foo
+  > EOF
+  applying patch from stdin
+
+  $ hg tip -q
+  13:04750ef42fb3
+
+  $ cat "foo bar"
+  foo
+
+Copy then modify the original file:
+
+  $ hg import -d "1000000 0" -m copy-mod-orig - <<EOF
+  > diff --git a/foo2 b/foo2
+  > index 257cc56..fe08ec6 100644
+  > --- a/foo2
+  > +++ b/foo2
+  > @@ -1 +1,2 @@
+  >  foo
+  > +new line
+  > diff --git a/foo2 b/foo3
+  > similarity index 100%
+  > copy from foo2
+  > copy to foo3
+  > EOF
+  applying patch from stdin
+
+  $ hg tip -q
+  14:c4cd9cdeaa74
+
+  $ cat foo3
+  foo
+
--- a/tests/test-globalopts	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +0,0 @@
-#!/bin/sh
-
-"$TESTDIR/hghave" no-outer-repo || exit 80
-
-hg init a
-cd a
-echo a > a
-hg ci -A -d'1 0' -m a
-
-cd ..
-
-hg init b
-cd b
-echo b > b
-hg ci -A -d'1 0' -m b
-
-cd ..
-
-hg clone a c
-cd c
-hg pull -f ../b
-hg merge
-
-cd ..
-
-echo %% -R/--repository
-hg -R a tip
-hg --repository b tip
-
-echo %% implicit -R
-hg ann a/a
-hg ann a/a a/a
-hg ann a/a b/b
-hg -R b ann a/a
-hg log
-
-echo %% abbrev of long option
-hg --repo c tip
-
-echo "%% earlygetopt with duplicate options (36d23de02da1)"
-hg --cwd a --cwd b --cwd c tip
-hg --repo c --repository b -R a tip
-
-echo "%% earlygetopt short option without following space"
-hg -q -Rb tip
-
-echo "%% earlygetopt with illegal abbreviations"
-hg --confi "foo.bar=baz"
-hg --cw a tip
-hg --rep a tip
-hg --repositor a tip
-hg -qR a tip
-hg -qRa tip
-
-echo %% --cwd
-hg --cwd a parents
-
-echo %% -y/--noninteractive - just be sure it is parsed
-hg --cwd a tip -q --noninteractive
-hg --cwd a tip -q -y
-
-echo %% -q/--quiet
-hg -R a -q tip
-hg -R b -q tip
-hg -R c --quiet parents
-
-echo %% -v/--verbose
-hg --cwd c head -v
-hg --cwd b tip --verbose
-
-echo %% --config
-hg --cwd c --config paths.quuxfoo=bar paths | grep quuxfoo > /dev/null && echo quuxfoo
-hg --cwd c --config '' tip -q
-hg --cwd c --config a.b tip -q
-hg --cwd c --config a tip -q
-hg --cwd c --config a.= tip -q
-hg --cwd c --config .b= tip -q
-
-echo %% --debug
-hg --cwd c log --debug
-
-echo %% --traceback
-hg --cwd c --config x --traceback tip 2>&1 | grep -i 'traceback'
-
-echo %% --time
-hg --cwd a --time tip 2>&1 | grep '^Time:' | sed 's/[0-9][0-9]*/x/g'
-
-echo %% --version
-hg --version -q | sed 's/version [^)]*/version xxx/'
-
-echo %% -h/--help
-hg -h
-hg --help
-
-echo %% not tested: --debugger
-
--- a/tests/test-globalopts.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,292 +0,0 @@
-adding a
-adding b
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-pulling from ../b
-searching for changes
-warning: repository is unrelated
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files (+1 heads)
-(run 'hg heads' to see heads, 'hg merge' to merge)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-%% -R/--repository
-changeset:   0:8580ff50825a
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-summary:     a
-
-changeset:   0:b6c483daf290
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-summary:     b
-
-%% implicit -R
-0: a
-0: a
-abort: There is no Mercurial repository here (.hg not found)!
-abort: a/a not under root
-abort: There is no Mercurial repository here (.hg not found)!
-%% abbrev of long option
-changeset:   1:b6c483daf290
-tag:         tip
-parent:      -1:000000000000
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-summary:     b
-
-%% earlygetopt with duplicate options (36d23de02da1)
-changeset:   1:b6c483daf290
-tag:         tip
-parent:      -1:000000000000
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-summary:     b
-
-changeset:   0:8580ff50825a
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-summary:     a
-
-%% earlygetopt short option without following space
-0:b6c483daf290
-%% earlygetopt with illegal abbreviations
-abort: option --config may not be abbreviated!
-abort: option --cwd may not be abbreviated!
-abort: Option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
-abort: Option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
-abort: Option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
-abort: Option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
-%% --cwd
-changeset:   0:8580ff50825a
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-summary:     a
-
-%% -y/--noninteractive - just be sure it is parsed
-0:8580ff50825a
-0:8580ff50825a
-%% -q/--quiet
-0:8580ff50825a
-0:b6c483daf290
-0:8580ff50825a
-1:b6c483daf290
-%% -v/--verbose
-changeset:   1:b6c483daf290
-tag:         tip
-parent:      -1:000000000000
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-files:       b
-description:
-b
-
-
-changeset:   0:8580ff50825a
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-files:       a
-description:
-a
-
-
-changeset:   0:b6c483daf290
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-files:       b
-description:
-b
-
-
-%% --config
-quuxfoo
-abort: malformed --config option: '' (use --config section.name=value)
-abort: malformed --config option: 'a.b' (use --config section.name=value)
-abort: malformed --config option: 'a' (use --config section.name=value)
-abort: malformed --config option: 'a.=' (use --config section.name=value)
-abort: malformed --config option: '.b=' (use --config section.name=value)
-%% --debug
-changeset:   1:b6c483daf2907ce5825c0bb50f5716226281cc1a
-tag:         tip
-parent:      -1:0000000000000000000000000000000000000000
-parent:      -1:0000000000000000000000000000000000000000
-manifest:    1:23226e7a252cacdc2d99e4fbdc3653441056de49
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-files+:      b
-extra:       branch=default
-description:
-b
-
-
-changeset:   0:8580ff50825a50c8f716709acdf8de0deddcd6ab
-parent:      -1:0000000000000000000000000000000000000000
-parent:      -1:0000000000000000000000000000000000000000
-manifest:    0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-files+:      a
-extra:       branch=default
-description:
-a
-
-
-%% --traceback
-Traceback (most recent call last):
-%% --time
-Time: real x.x secs (user x.x+x.x sys x.x+x.x)
-%% --version
-Mercurial Distributed SCM (version xxx)
-%% -h/--help
-Mercurial Distributed SCM
-
-list of commands:
-
- add          add the specified files on the next commit
- addremove    add all new files, delete all missing files
- annotate     show changeset information by line for each file
- archive      create an unversioned archive of a repository revision
- backout      reverse effect of earlier changeset
- bisect       subdivision search of changesets
- branch       set or show the current branch name
- branches     list repository named branches
- bundle       create a changegroup file
- cat          output the current or given revision of files
- clone        make a copy of an existing repository
- commit       commit the specified files or all outstanding changes
- copy         mark files as copied for the next commit
- diff         diff repository (or selected files)
- export       dump the header and diffs for one or more changesets
- forget       forget the specified files on the next commit
- grep         search for a pattern in specified files and revisions
- heads        show current repository heads or show branch heads
- help         show help for a given topic or a help overview
- identify     identify the working copy or specified revision
- import       import an ordered set of patches
- incoming     show new changesets found in source
- init         create a new repository in the given directory
- locate       locate files matching specific patterns
- log          show revision history of entire repository or files
- manifest     output the current or given revision of the project manifest
- merge        merge working directory with another revision
- outgoing     show changesets not found in the destination
- parents      show the parents of the working directory or revision
- paths        show aliases for remote repositories
- pull         pull changes from the specified source
- push         push changes to the specified destination
- recover      roll back an interrupted transaction
- remove       remove the specified files on the next commit
- rename       rename files; equivalent of copy + remove
- resolve      redo merges or set/view the merge status of files
- revert       restore individual files or directories to an earlier state
- rollback     roll back the last transaction (dangerous)
- root         print the root (top) of the current working directory
- serve        start stand-alone webserver
- showconfig   show combined config settings from all hgrc files
- status       show changed files in the working directory
- summary      summarize working directory state
- tag          add one or more tags for the current or given revision
- tags         list repository tags
- tip          show the tip revision
- unbundle     apply one or more changegroup files
- update       update working directory (or switch revisions)
- verify       verify the integrity of the repository
- version      output version and copyright information
-
-additional help topics:
-
- config       Configuration Files
- dates        Date Formats
- patterns     File Name Patterns
- environment  Environment Variables
- revisions    Specifying Single Revisions
- multirevs    Specifying Multiple Revisions
- revsets      Specifying Revision Sets
- diffs        Diff Formats
- templating   Template Usage
- urls         URL Paths
- extensions   Using additional features
- hgweb        Configuring hgweb
- glossary     Glossary
-
-use "hg -v help" to show aliases and global options
-Mercurial Distributed SCM
-
-list of commands:
-
- add          add the specified files on the next commit
- addremove    add all new files, delete all missing files
- annotate     show changeset information by line for each file
- archive      create an unversioned archive of a repository revision
- backout      reverse effect of earlier changeset
- bisect       subdivision search of changesets
- branch       set or show the current branch name
- branches     list repository named branches
- bundle       create a changegroup file
- cat          output the current or given revision of files
- clone        make a copy of an existing repository
- commit       commit the specified files or all outstanding changes
- copy         mark files as copied for the next commit
- diff         diff repository (or selected files)
- export       dump the header and diffs for one or more changesets
- forget       forget the specified files on the next commit
- grep         search for a pattern in specified files and revisions
- heads        show current repository heads or show branch heads
- help         show help for a given topic or a help overview
- identify     identify the working copy or specified revision
- import       import an ordered set of patches
- incoming     show new changesets found in source
- init         create a new repository in the given directory
- locate       locate files matching specific patterns
- log          show revision history of entire repository or files
- manifest     output the current or given revision of the project manifest
- merge        merge working directory with another revision
- outgoing     show changesets not found in the destination
- parents      show the parents of the working directory or revision
- paths        show aliases for remote repositories
- pull         pull changes from the specified source
- push         push changes to the specified destination
- recover      roll back an interrupted transaction
- remove       remove the specified files on the next commit
- rename       rename files; equivalent of copy + remove
- resolve      redo merges or set/view the merge status of files
- revert       restore individual files or directories to an earlier state
- rollback     roll back the last transaction (dangerous)
- root         print the root (top) of the current working directory
- serve        start stand-alone webserver
- showconfig   show combined config settings from all hgrc files
- status       show changed files in the working directory
- summary      summarize working directory state
- tag          add one or more tags for the current or given revision
- tags         list repository tags
- tip          show the tip revision
- unbundle     apply one or more changegroup files
- update       update working directory (or switch revisions)
- verify       verify the integrity of the repository
- version      output version and copyright information
-
-additional help topics:
-
- config       Configuration Files
- dates        Date Formats
- patterns     File Name Patterns
- environment  Environment Variables
- revisions    Specifying Single Revisions
- multirevs    Specifying Multiple Revisions
- revsets      Specifying Revision Sets
- diffs        Diff Formats
- templating   Template Usage
- urls         URL Paths
- extensions   Using additional features
- hgweb        Configuring hgweb
- glossary     Glossary
-
-use "hg -v help" to show aliases and global options
-%% not tested: --debugger
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-globalopts.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,401 @@
+  $ "$TESTDIR/hghave" no-outer-repo || exit 80
+
+  $ hg init a
+  $ cd a
+  $ echo a > a
+  $ hg ci -A -d'1 0' -m a
+  adding a
+
+  $ cd ..
+
+  $ hg init b
+  $ cd b
+  $ echo b > b
+  $ hg ci -A -d'1 0' -m b
+  adding b
+
+  $ cd ..
+
+  $ hg clone a c
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd c
+  $ hg pull -f ../b
+  pulling from ../b
+  searching for changes
+  warning: repository is unrelated
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files (+1 heads)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+  $ hg merge
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+  $ cd ..
+
+Testing -R/--repository:
+
+  $ hg -R a tip
+  changeset:   0:8580ff50825a
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  summary:     a
+  
+  $ hg --repository b tip
+  changeset:   0:b6c483daf290
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  summary:     b
+  
+
+Implicit -R:
+
+  $ hg ann a/a
+  0: a
+  $ hg ann a/a a/a
+  0: a
+  $ hg ann a/a b/b
+  abort: There is no Mercurial repository here (.hg not found)!
+  [255]
+  $ hg -R b ann a/a
+  abort: a/a not under root
+  [255]
+  $ hg log
+  abort: There is no Mercurial repository here (.hg not found)!
+  [255]
+
+Abbreviation of long option:
+
+  $ hg --repo c tip
+  changeset:   1:b6c483daf290
+  tag:         tip
+  parent:      -1:000000000000
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  summary:     b
+  
+
+earlygetopt with duplicate options (36d23de02da1):
+
+  $ hg --cwd a --cwd b --cwd c tip
+  changeset:   1:b6c483daf290
+  tag:         tip
+  parent:      -1:000000000000
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  summary:     b
+  
+  $ hg --repo c --repository b -R a tip
+  changeset:   0:8580ff50825a
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  summary:     a
+  
+
+earlygetopt short option without following space:
+
+  $ hg -q -Rb tip
+  0:b6c483daf290
+
+earlygetopt with illegal abbreviations:
+
+  $ hg --confi "foo.bar=baz"
+  abort: option --config may not be abbreviated!
+  [255]
+  $ hg --cw a tip
+  abort: option --cwd may not be abbreviated!
+  [255]
+  $ hg --rep a tip
+  abort: Option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
+  [255]
+  $ hg --repositor a tip
+  abort: Option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
+  [255]
+  $ hg -qR a tip
+  abort: Option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
+  [255]
+  $ hg -qRa tip
+  abort: Option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
+  [255]
+
+Testing --cwd:
+
+  $ hg --cwd a parents
+  changeset:   0:8580ff50825a
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  summary:     a
+  
+
+Testing -y/--noninteractive - just be sure it is parsed:
+
+  $ hg --cwd a tip -q --noninteractive
+  0:8580ff50825a
+  $ hg --cwd a tip -q -y
+  0:8580ff50825a
+
+Testing -q/--quiet:
+
+  $ hg -R a -q tip
+  0:8580ff50825a
+  $ hg -R b -q tip
+  0:b6c483daf290
+  $ hg -R c --quiet parents
+  0:8580ff50825a
+  1:b6c483daf290
+
+Testing -v/--verbose:
+
+  $ hg --cwd c head -v
+  changeset:   1:b6c483daf290
+  tag:         tip
+  parent:      -1:000000000000
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  files:       b
+  description:
+  b
+  
+  
+  changeset:   0:8580ff50825a
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  files:       a
+  description:
+  a
+  
+  
+  $ hg --cwd b tip --verbose
+  changeset:   0:b6c483daf290
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  files:       b
+  description:
+  b
+  
+  
+
+Testing --config:
+
+  $ hg --cwd c --config paths.quuxfoo=bar paths | grep quuxfoo > /dev/null && echo quuxfoo
+  quuxfoo
+  $ hg --cwd c --config '' tip -q
+  abort: malformed --config option: '' (use --config section.name=value)
+  [255]
+  $ hg --cwd c --config a.b tip -q
+  abort: malformed --config option: 'a.b' (use --config section.name=value)
+  [255]
+  $ hg --cwd c --config a tip -q
+  abort: malformed --config option: 'a' (use --config section.name=value)
+  [255]
+  $ hg --cwd c --config a.= tip -q
+  abort: malformed --config option: 'a.=' (use --config section.name=value)
+  [255]
+  $ hg --cwd c --config .b= tip -q
+  abort: malformed --config option: '.b=' (use --config section.name=value)
+  [255]
+
+Testing --debug:
+
+  $ hg --cwd c log --debug
+  changeset:   1:b6c483daf2907ce5825c0bb50f5716226281cc1a
+  tag:         tip
+  parent:      -1:0000000000000000000000000000000000000000
+  parent:      -1:0000000000000000000000000000000000000000
+  manifest:    1:23226e7a252cacdc2d99e4fbdc3653441056de49
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  files+:      b
+  extra:       branch=default
+  description:
+  b
+  
+  
+  changeset:   0:8580ff50825a50c8f716709acdf8de0deddcd6ab
+  parent:      -1:0000000000000000000000000000000000000000
+  parent:      -1:0000000000000000000000000000000000000000
+  manifest:    0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  files+:      a
+  extra:       branch=default
+  description:
+  a
+  
+  
+
+Testing --traceback:
+
+  $ hg --cwd c --config x --traceback id 2>&1 | grep -i 'traceback'
+  Traceback (most recent call last):
+
+Testing --time:
+
+  $ hg --cwd a --time id
+  8580ff50825a tip
+  Time: real * (glob)
+
+Testing --version:
+
+  $ hg --version -q
+  Mercurial Distributed SCM * (glob)
+
+Testing -h/--help:
+
+  $ hg -h
+  Mercurial Distributed SCM
+  
+  list of commands:
+  
+   add          add the specified files on the next commit
+   addremove    add all new files, delete all missing files
+   annotate     show changeset information by line for each file
+   archive      create an unversioned archive of a repository revision
+   backout      reverse effect of earlier changeset
+   bisect       subdivision search of changesets
+   branch       set or show the current branch name
+   branches     list repository named branches
+   bundle       create a changegroup file
+   cat          output the current or given revision of files
+   clone        make a copy of an existing repository
+   commit       commit the specified files or all outstanding changes
+   copy         mark files as copied for the next commit
+   diff         diff repository (or selected files)
+   export       dump the header and diffs for one or more changesets
+   forget       forget the specified files on the next commit
+   grep         search for a pattern in specified files and revisions
+   heads        show current repository heads or show branch heads
+   help         show help for a given topic or a help overview
+   identify     identify the working copy or specified revision
+   import       import an ordered set of patches
+   incoming     show new changesets found in source
+   init         create a new repository in the given directory
+   locate       locate files matching specific patterns
+   log          show revision history of entire repository or files
+   manifest     output the current or given revision of the project manifest
+   merge        merge working directory with another revision
+   outgoing     show changesets not found in the destination
+   parents      show the parents of the working directory or revision
+   paths        show aliases for remote repositories
+   pull         pull changes from the specified source
+   push         push changes to the specified destination
+   recover      roll back an interrupted transaction
+   remove       remove the specified files on the next commit
+   rename       rename files; equivalent of copy + remove
+   resolve      redo merges or set/view the merge status of files
+   revert       restore individual files or directories to an earlier state
+   rollback     roll back the last transaction (dangerous)
+   root         print the root (top) of the current working directory
+   serve        start stand-alone webserver
+   showconfig   show combined config settings from all hgrc files
+   status       show changed files in the working directory
+   summary      summarize working directory state
+   tag          add one or more tags for the current or given revision
+   tags         list repository tags
+   tip          show the tip revision
+   unbundle     apply one or more changegroup files
+   update       update working directory (or switch revisions)
+   verify       verify the integrity of the repository
+   version      output version and copyright information
+  
+  additional help topics:
+  
+   config       Configuration Files
+   dates        Date Formats
+   patterns     File Name Patterns
+   environment  Environment Variables
+   revisions    Specifying Single Revisions
+   multirevs    Specifying Multiple Revisions
+   revsets      Specifying Revision Sets
+   diffs        Diff Formats
+   templating   Template Usage
+   urls         URL Paths
+   extensions   Using additional features
+   hgweb        Configuring hgweb
+   glossary     Glossary
+  
+  use "hg -v help" to show aliases and global options
+
+  $ hg --help
+  Mercurial Distributed SCM
+  
+  list of commands:
+  
+   add          add the specified files on the next commit
+   addremove    add all new files, delete all missing files
+   annotate     show changeset information by line for each file
+   archive      create an unversioned archive of a repository revision
+   backout      reverse effect of earlier changeset
+   bisect       subdivision search of changesets
+   branch       set or show the current branch name
+   branches     list repository named branches
+   bundle       create a changegroup file
+   cat          output the current or given revision of files
+   clone        make a copy of an existing repository
+   commit       commit the specified files or all outstanding changes
+   copy         mark files as copied for the next commit
+   diff         diff repository (or selected files)
+   export       dump the header and diffs for one or more changesets
+   forget       forget the specified files on the next commit
+   grep         search for a pattern in specified files and revisions
+   heads        show current repository heads or show branch heads
+   help         show help for a given topic or a help overview
+   identify     identify the working copy or specified revision
+   import       import an ordered set of patches
+   incoming     show new changesets found in source
+   init         create a new repository in the given directory
+   locate       locate files matching specific patterns
+   log          show revision history of entire repository or files
+   manifest     output the current or given revision of the project manifest
+   merge        merge working directory with another revision
+   outgoing     show changesets not found in the destination
+   parents      show the parents of the working directory or revision
+   paths        show aliases for remote repositories
+   pull         pull changes from the specified source
+   push         push changes to the specified destination
+   recover      roll back an interrupted transaction
+   remove       remove the specified files on the next commit
+   rename       rename files; equivalent of copy + remove
+   resolve      redo merges or set/view the merge status of files
+   revert       restore individual files or directories to an earlier state
+   rollback     roll back the last transaction (dangerous)
+   root         print the root (top) of the current working directory
+   serve        start stand-alone webserver
+   showconfig   show combined config settings from all hgrc files
+   status       show changed files in the working directory
+   summary      summarize working directory state
+   tag          add one or more tags for the current or given revision
+   tags         list repository tags
+   tip          show the tip revision
+   unbundle     apply one or more changegroup files
+   update       update working directory (or switch revisions)
+   verify       verify the integrity of the repository
+   version      output version and copyright information
+  
+  additional help topics:
+  
+   config       Configuration Files
+   dates        Date Formats
+   patterns     File Name Patterns
+   environment  Environment Variables
+   revisions    Specifying Single Revisions
+   multirevs    Specifying Multiple Revisions
+   revsets      Specifying Revision Sets
+   diffs        Diff Formats
+   templating   Template Usage
+   urls         URL Paths
+   extensions   Using additional features
+   hgweb        Configuring hgweb
+   glossary     Glossary
+  
+  use "hg -v help" to show aliases and global options
+
+Not tested: --debugger
+
--- a/tests/test-glog	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,196 +0,0 @@
-#!/bin/sh
-
-# @  (34) head
-# |
-# | o  (33) head
-# | |
-# o |    (32) expand
-# |\ \
-# | o \    (31) expand
-# | |\ \
-# | | o \    (30) expand
-# | | |\ \
-# | | | o |  (29) regular commit
-# | | | | |
-# | | o | |    (28) merge zero known
-# | | |\ \ \
-# o | | | | |  (27) collapse
-# |/ / / / /
-# | | o---+  (26) merge one known; far right
-# | | | | |
-# +---o | |  (25) merge one known; far left
-# | | | | |
-# | | o | |  (24) merge one known; immediate right
-# | | |\| |
-# | | o | |  (23) merge one known; immediate left
-# | |/| | |
-# +---o---+  (22) merge two known; one far left, one far right
-# | |  / /
-# o | | |    (21) expand
-# |\ \ \ \
-# | o---+-+  (20) merge two known; two far right
-# |  / / /
-# o | | |    (19) expand
-# |\ \ \ \
-# +---+---o  (18) merge two known; two far left
-# | | | |
-# | o | |    (17) expand
-# | |\ \ \
-# | | o---+  (16) merge two known; one immediate right, one near right
-# | | |/ /
-# o | | |    (15) expand
-# |\ \ \ \
-# | o-----+  (14) merge two known; one immediate right, one far right
-# | |/ / /
-# o | | |    (13) expand
-# |\ \ \ \
-# +---o | |  (12) merge two known; one immediate right, one far left
-# | | |/ /
-# | o | |    (11) expand
-# | |\ \ \
-# | | o---+  (10) merge two known; one immediate left, one near right
-# | |/ / /
-# o | | |    (9) expand
-# |\ \ \ \
-# | o-----+  (8) merge two known; one immediate left, one far right
-# |/ / / /
-# o | | |    (7) expand
-# |\ \ \ \
-# +---o | |  (6) merge two known; one immediate left, one far left
-# | |/ / /
-# | o | |    (5) expand
-# | |\ \ \
-# | | o | |  (4) merge two known; one immediate left, one immediate right
-# | |/|/ /
-# | o / /  (3) collapse
-# |/ / /
-# o / /  (2) collapse
-# |/ /
-# o /  (1) collapse
-# |/
-# o  (0) root
-
-"$TESTDIR/hghave" no-outer-repo || exit 80
-
-set -e
-
-commit()
-{
-    rev=$1
-    msg=$2
-    shift 2
-    if [ "$#" -gt 0 ]; then
-        hg debugsetparents "$@"
-    fi
-    echo $rev > a
-    hg commit -Aqd "$rev 0" -m "($rev) $msg"
-}
-
-echo "[extensions]" >> $HGRCPATH
-echo "graphlog=" >> $HGRCPATH
-
-echo % init
-hg init repo
-
-cd repo
-
-echo % empty repo
-hg glog
-
-echo % building tree
-commit 0 "root"
-commit 1 "collapse" 0
-commit 2 "collapse" 1
-commit 3 "collapse" 2
-commit 4 "merge two known; one immediate left, one immediate right" 1 3
-commit 5 "expand" 3 4
-commit 6 "merge two known; one immediate left, one far left" 2 5
-commit 7 "expand" 2 5
-commit 8 "merge two known; one immediate left, one far right" 0 7
-commit 9 "expand" 7 8
-commit 10 "merge two known; one immediate left, one near right" 0 6
-commit 11 "expand" 6 10
-commit 12 "merge two known; one immediate right, one far left" 1 9
-commit 13 "expand" 9 11
-commit 14 "merge two known; one immediate right, one far right" 0 12
-commit 15 "expand" 13 14
-commit 16 "merge two known; one immediate right, one near right" 0 1
-commit 17 "expand" 12 16
-commit 18 "merge two known; two far left" 1 15
-commit 19 "expand" 15 17
-commit 20 "merge two known; two far right" 0 18
-commit 21 "expand" 19 20
-commit 22 "merge two known; one far left, one far right" 18 21
-commit 23 "merge one known; immediate left" 1 22
-commit 24 "merge one known; immediate right" 0 23
-commit 25 "merge one known; far left" 21 24
-commit 26 "merge one known; far right" 18 25
-commit 27 "collapse" 21
-commit 28 "merge zero known" 1 26
-commit 29 "regular commit" 0
-commit 30 "expand" 28 29
-commit 31 "expand" 21 30
-commit 32 "expand" 27 31
-commit 33 "head" 18
-commit 34 "head" 32
-
-echo % glog -q
-hg glog -q
-
-echo % glog
-hg glog
-
-echo % file glog
-hg glog a
-
-echo % unused arguments
-hg glog -q foo bar || echo failed
-
-echo % empty revision range - display nothing
-hg glog -r 1..0
-
-echo % from outer space
-cd ..
-hg glog -l1 repo
-hg glog -l1 repo/a
-hg glog -l1 repo/missing
-
-echo % file log with revs != cset revs
-hg init flog
-cd flog
-echo one >one
-hg add one
-hg commit -mone
-echo two >two
-hg add two
-hg commit -mtwo
-echo more >two
-hg commit -mmore
-hg glog two
-
-echo "% file log with explicit style (issue 1896)"
-hg glog --style=default one
-
-echo % incoming and outgoing
-cd ..
-hg clone -U -r31 repo repo2
-cd repo2
-hg incoming --graph ../repo
-cd ..
-hg -R repo outgoing --graph repo2
-
-cd repo
-echo % file + limit with revs != cset revs
-touch b
-hg ci -Aqm0
-# this used to show only one cset
-hg glog -l2 a
-
-echo "% file + limit + -ra:b, (b - a) < limit"
-hg glog -l3000 -r32:tip a
-
-echo "% file + limit + -ra:b, b < tip"
-hg glog -l1 -r32:34 a
-
-echo "% file + limit + -ra:b, b < tip, (b - a) < limit"
-hg glog -l10 -r33:34 a
--- a/tests/test-glog.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,699 +0,0 @@
-% init
-% empty repo
-% building tree
-% glog -q
-@  34:fea3ac5810e0
-|
-| o  33:68608f5145f9
-| |
-o |    32:d06dffa21a31
-|\ \
-| o \    31:621d83e11f67
-| |\ \
-| | o \    30:6e11cd4b648f
-| | |\ \
-| | | o |  29:cd9bb2be7593
-| | | | |
-| | o | |    28:44ecd0b9ae99
-| | |\ \ \
-o | | | | |  27:886ed638191b
-|/ / / / /
-| | o---+  26:7f25b6c2f0b9
-| | | | |
-+---o | |  25:91da8ed57247
-| | | | |
-| | o | |  24:a9c19a3d96b7
-| | |\| |
-| | o | |  23:a01cddf0766d
-| |/| | |
-+---o---+  22:e0d9cccacb5d
-| |  / /
-o | | |    21:d42a756af44d
-|\ \ \ \
-| o---+-+  20:d30ed6450e32
-|  / / /
-o | | |    19:31ddc2c1573b
-|\ \ \ \
-+---+---o  18:1aa84d96232a
-| | | |
-| o | |    17:44765d7c06e0
-| |\ \ \
-| | o---+  16:3677d192927d
-| | |/ /
-o | | |    15:1dda3f72782d
-|\ \ \ \
-| o-----+  14:8eac370358ef
-| |/ / /
-o | | |    13:22d8966a97e3
-|\ \ \ \
-+---o | |  12:86b91144a6e9
-| | |/ /
-| o | |    11:832d76e6bdf2
-| |\ \ \
-| | o---+  10:74c64d036d72
-| |/ / /
-o | | |    9:7010c0af0a35
-|\ \ \ \
-| o-----+  8:7a0b11f71937
-|/ / / /
-o | | |    7:b632bb1b1224
-|\ \ \ \
-+---o | |  6:b105a072e251
-| |/ / /
-| o | |    5:4409d547b708
-| |\ \ \
-| | o | |  4:26a8bac39d9f
-| |/|/ /
-| o / /  3:27eef8ed80b4
-|/ / /
-o / /  2:3d9a33b8d1e1
-|/ /
-o /  1:6db2ef61d156
-|/
-o  0:e6eb3150255d
-
-% glog
-@  changeset:   34:fea3ac5810e0
-|  tag:         tip
-|  parent:      32:d06dffa21a31
-|  user:        test
-|  date:        Thu Jan 01 00:00:34 1970 +0000
-|  summary:     (34) head
-|
-| o  changeset:   33:68608f5145f9
-| |  parent:      18:1aa84d96232a
-| |  user:        test
-| |  date:        Thu Jan 01 00:00:33 1970 +0000
-| |  summary:     (33) head
-| |
-o |    changeset:   32:d06dffa21a31
-|\ \   parent:      27:886ed638191b
-| | |  parent:      31:621d83e11f67
-| | |  user:        test
-| | |  date:        Thu Jan 01 00:00:32 1970 +0000
-| | |  summary:     (32) expand
-| | |
-| o |    changeset:   31:621d83e11f67
-| |\ \   parent:      21:d42a756af44d
-| | | |  parent:      30:6e11cd4b648f
-| | | |  user:        test
-| | | |  date:        Thu Jan 01 00:00:31 1970 +0000
-| | | |  summary:     (31) expand
-| | | |
-| | o |    changeset:   30:6e11cd4b648f
-| | |\ \   parent:      28:44ecd0b9ae99
-| | | | |  parent:      29:cd9bb2be7593
-| | | | |  user:        test
-| | | | |  date:        Thu Jan 01 00:00:30 1970 +0000
-| | | | |  summary:     (30) expand
-| | | | |
-| | | o |  changeset:   29:cd9bb2be7593
-| | | | |  parent:      0:e6eb3150255d
-| | | | |  user:        test
-| | | | |  date:        Thu Jan 01 00:00:29 1970 +0000
-| | | | |  summary:     (29) regular commit
-| | | | |
-| | o | |    changeset:   28:44ecd0b9ae99
-| | |\ \ \   parent:      1:6db2ef61d156
-| | | | | |  parent:      26:7f25b6c2f0b9
-| | | | | |  user:        test
-| | | | | |  date:        Thu Jan 01 00:00:28 1970 +0000
-| | | | | |  summary:     (28) merge zero known
-| | | | | |
-o | | | | |  changeset:   27:886ed638191b
-|/ / / / /   parent:      21:d42a756af44d
-| | | | |    user:        test
-| | | | |    date:        Thu Jan 01 00:00:27 1970 +0000
-| | | | |    summary:     (27) collapse
-| | | | |
-| | o---+  changeset:   26:7f25b6c2f0b9
-| | | | |  parent:      18:1aa84d96232a
-| | | | |  parent:      25:91da8ed57247
-| | | | |  user:        test
-| | | | |  date:        Thu Jan 01 00:00:26 1970 +0000
-| | | | |  summary:     (26) merge one known; far right
-| | | | |
-+---o | |  changeset:   25:91da8ed57247
-| | | | |  parent:      21:d42a756af44d
-| | | | |  parent:      24:a9c19a3d96b7
-| | | | |  user:        test
-| | | | |  date:        Thu Jan 01 00:00:25 1970 +0000
-| | | | |  summary:     (25) merge one known; far left
-| | | | |
-| | o | |  changeset:   24:a9c19a3d96b7
-| | |\| |  parent:      0:e6eb3150255d
-| | | | |  parent:      23:a01cddf0766d
-| | | | |  user:        test
-| | | | |  date:        Thu Jan 01 00:00:24 1970 +0000
-| | | | |  summary:     (24) merge one known; immediate right
-| | | | |
-| | o | |  changeset:   23:a01cddf0766d
-| |/| | |  parent:      1:6db2ef61d156
-| | | | |  parent:      22:e0d9cccacb5d
-| | | | |  user:        test
-| | | | |  date:        Thu Jan 01 00:00:23 1970 +0000
-| | | | |  summary:     (23) merge one known; immediate left
-| | | | |
-+---o---+  changeset:   22:e0d9cccacb5d
-| |   | |  parent:      18:1aa84d96232a
-| |  / /   parent:      21:d42a756af44d
-| | | |    user:        test
-| | | |    date:        Thu Jan 01 00:00:22 1970 +0000
-| | | |    summary:     (22) merge two known; one far left, one far right
-| | | |
-o | | |    changeset:   21:d42a756af44d
-|\ \ \ \   parent:      19:31ddc2c1573b
-| | | | |  parent:      20:d30ed6450e32
-| | | | |  user:        test
-| | | | |  date:        Thu Jan 01 00:00:21 1970 +0000
-| | | | |  summary:     (21) expand
-| | | | |
-| o---+-+  changeset:   20:d30ed6450e32
-|   | | |  parent:      0:e6eb3150255d
-|  / / /   parent:      18:1aa84d96232a
-| | | |    user:        test
-| | | |    date:        Thu Jan 01 00:00:20 1970 +0000
-| | | |    summary:     (20) merge two known; two far right
-| | | |
-o | | |    changeset:   19:31ddc2c1573b
-|\ \ \ \   parent:      15:1dda3f72782d
-| | | | |  parent:      17:44765d7c06e0
-| | | | |  user:        test
-| | | | |  date:        Thu Jan 01 00:00:19 1970 +0000
-| | | | |  summary:     (19) expand
-| | | | |
-+---+---o  changeset:   18:1aa84d96232a
-| | | |    parent:      1:6db2ef61d156
-| | | |    parent:      15:1dda3f72782d
-| | | |    user:        test
-| | | |    date:        Thu Jan 01 00:00:18 1970 +0000
-| | | |    summary:     (18) merge two known; two far left
-| | | |
-| o | |    changeset:   17:44765d7c06e0
-| |\ \ \   parent:      12:86b91144a6e9
-| | | | |  parent:      16:3677d192927d
-| | | | |  user:        test
-| | | | |  date:        Thu Jan 01 00:00:17 1970 +0000
-| | | | |  summary:     (17) expand
-| | | | |
-| | o---+  changeset:   16:3677d192927d
-| | | | |  parent:      0:e6eb3150255d
-| | |/ /   parent:      1:6db2ef61d156
-| | | |    user:        test
-| | | |    date:        Thu Jan 01 00:00:16 1970 +0000
-| | | |    summary:     (16) merge two known; one immediate right, one near right
-| | | |
-o | | |    changeset:   15:1dda3f72782d
-|\ \ \ \   parent:      13:22d8966a97e3
-| | | | |  parent:      14:8eac370358ef
-| | | | |  user:        test
-| | | | |  date:        Thu Jan 01 00:00:15 1970 +0000
-| | | | |  summary:     (15) expand
-| | | | |
-| o-----+  changeset:   14:8eac370358ef
-| | | | |  parent:      0:e6eb3150255d
-| |/ / /   parent:      12:86b91144a6e9
-| | | |    user:        test
-| | | |    date:        Thu Jan 01 00:00:14 1970 +0000
-| | | |    summary:     (14) merge two known; one immediate right, one far right
-| | | |
-o | | |    changeset:   13:22d8966a97e3
-|\ \ \ \   parent:      9:7010c0af0a35
-| | | | |  parent:      11:832d76e6bdf2
-| | | | |  user:        test
-| | | | |  date:        Thu Jan 01 00:00:13 1970 +0000
-| | | | |  summary:     (13) expand
-| | | | |
-+---o | |  changeset:   12:86b91144a6e9
-| | |/ /   parent:      1:6db2ef61d156
-| | | |    parent:      9:7010c0af0a35
-| | | |    user:        test
-| | | |    date:        Thu Jan 01 00:00:12 1970 +0000
-| | | |    summary:     (12) merge two known; one immediate right, one far left
-| | | |
-| o | |    changeset:   11:832d76e6bdf2
-| |\ \ \   parent:      6:b105a072e251
-| | | | |  parent:      10:74c64d036d72
-| | | | |  user:        test
-| | | | |  date:        Thu Jan 01 00:00:11 1970 +0000
-| | | | |  summary:     (11) expand
-| | | | |
-| | o---+  changeset:   10:74c64d036d72
-| | | | |  parent:      0:e6eb3150255d
-| |/ / /   parent:      6:b105a072e251
-| | | |    user:        test
-| | | |    date:        Thu Jan 01 00:00:10 1970 +0000
-| | | |    summary:     (10) merge two known; one immediate left, one near right
-| | | |
-o | | |    changeset:   9:7010c0af0a35
-|\ \ \ \   parent:      7:b632bb1b1224
-| | | | |  parent:      8:7a0b11f71937
-| | | | |  user:        test
-| | | | |  date:        Thu Jan 01 00:00:09 1970 +0000
-| | | | |  summary:     (9) expand
-| | | | |
-| o-----+  changeset:   8:7a0b11f71937
-| | | | |  parent:      0:e6eb3150255d
-|/ / / /   parent:      7:b632bb1b1224
-| | | |    user:        test
-| | | |    date:        Thu Jan 01 00:00:08 1970 +0000
-| | | |    summary:     (8) merge two known; one immediate left, one far right
-| | | |
-o | | |    changeset:   7:b632bb1b1224
-|\ \ \ \   parent:      2:3d9a33b8d1e1
-| | | | |  parent:      5:4409d547b708
-| | | | |  user:        test
-| | | | |  date:        Thu Jan 01 00:00:07 1970 +0000
-| | | | |  summary:     (7) expand
-| | | | |
-+---o | |  changeset:   6:b105a072e251
-| |/ / /   parent:      2:3d9a33b8d1e1
-| | | |    parent:      5:4409d547b708
-| | | |    user:        test
-| | | |    date:        Thu Jan 01 00:00:06 1970 +0000
-| | | |    summary:     (6) merge two known; one immediate left, one far left
-| | | |
-| o | |    changeset:   5:4409d547b708
-| |\ \ \   parent:      3:27eef8ed80b4
-| | | | |  parent:      4:26a8bac39d9f
-| | | | |  user:        test
-| | | | |  date:        Thu Jan 01 00:00:05 1970 +0000
-| | | | |  summary:     (5) expand
-| | | | |
-| | o | |  changeset:   4:26a8bac39d9f
-| |/|/ /   parent:      1:6db2ef61d156
-| | | |    parent:      3:27eef8ed80b4
-| | | |    user:        test
-| | | |    date:        Thu Jan 01 00:00:04 1970 +0000
-| | | |    summary:     (4) merge two known; one immediate left, one immediate right
-| | | |
-| o | |  changeset:   3:27eef8ed80b4
-|/ / /   user:        test
-| | |    date:        Thu Jan 01 00:00:03 1970 +0000
-| | |    summary:     (3) collapse
-| | |
-o | |  changeset:   2:3d9a33b8d1e1
-|/ /   user:        test
-| |    date:        Thu Jan 01 00:00:02 1970 +0000
-| |    summary:     (2) collapse
-| |
-o |  changeset:   1:6db2ef61d156
-|/   user:        test
-|    date:        Thu Jan 01 00:00:01 1970 +0000
-|    summary:     (1) collapse
-|
-o  changeset:   0:e6eb3150255d
-   user:        test
-   date:        Thu Jan 01 00:00:00 1970 +0000
-   summary:     (0) root
-
-% file glog
-@  changeset:   34:fea3ac5810e0
-|  tag:         tip
-|  parent:      32:d06dffa21a31
-|  user:        test
-|  date:        Thu Jan 01 00:00:34 1970 +0000
-|  summary:     (34) head
-|
-| o  changeset:   33:68608f5145f9
-| |  parent:      18:1aa84d96232a
-| |  user:        test
-| |  date:        Thu Jan 01 00:00:33 1970 +0000
-| |  summary:     (33) head
-| |
-o |    changeset:   32:d06dffa21a31
-|\ \   parent:      27:886ed638191b
-| | |  parent:      31:621d83e11f67
-| | |  user:        test
-| | |  date:        Thu Jan 01 00:00:32 1970 +0000
-| | |  summary:     (32) expand
-| | |
-| o |  changeset:   31:621d83e11f67
-| | |  parent:      21:d42a756af44d
-| | |  parent:      30:6e11cd4b648f
-| | |  user:        test
-| | |  date:        Thu Jan 01 00:00:31 1970 +0000
-| | |  summary:     (31) expand
-| | |
-| o |    changeset:   30:6e11cd4b648f
-| |\ \   parent:      28:44ecd0b9ae99
-| | | |  parent:      29:cd9bb2be7593
-| | | |  user:        test
-| | | |  date:        Thu Jan 01 00:00:30 1970 +0000
-| | | |  summary:     (30) expand
-| | | |
-| | o |  changeset:   29:cd9bb2be7593
-| | | |  parent:      0:e6eb3150255d
-| | | |  user:        test
-| | | |  date:        Thu Jan 01 00:00:29 1970 +0000
-| | | |  summary:     (29) regular commit
-| | | |
-| o | |  changeset:   28:44ecd0b9ae99
-| | | |  parent:      1:6db2ef61d156
-| | | |  parent:      26:7f25b6c2f0b9
-| | | |  user:        test
-| | | |  date:        Thu Jan 01 00:00:28 1970 +0000
-| | | |  summary:     (28) merge zero known
-| | | |
-o | | |  changeset:   27:886ed638191b
-| | | |  parent:      21:d42a756af44d
-| | | |  user:        test
-| | | |  date:        Thu Jan 01 00:00:27 1970 +0000
-| | | |  summary:     (27) collapse
-| | | |
-| o | |  changeset:   26:7f25b6c2f0b9
-| | | |  parent:      18:1aa84d96232a
-| | | |  parent:      25:91da8ed57247
-| | | |  user:        test
-| | | |  date:        Thu Jan 01 00:00:26 1970 +0000
-| | | |  summary:     (26) merge one known; far right
-| | | |
-| o | |  changeset:   25:91da8ed57247
-| | | |  parent:      21:d42a756af44d
-| | | |  parent:      24:a9c19a3d96b7
-| | | |  user:        test
-| | | |  date:        Thu Jan 01 00:00:25 1970 +0000
-| | | |  summary:     (25) merge one known; far left
-| | | |
-| o | |  changeset:   24:a9c19a3d96b7
-| | | |  parent:      0:e6eb3150255d
-| | | |  parent:      23:a01cddf0766d
-| | | |  user:        test
-| | | |  date:        Thu Jan 01 00:00:24 1970 +0000
-| | | |  summary:     (24) merge one known; immediate right
-| | | |
-| o | |  changeset:   23:a01cddf0766d
-| | | |  parent:      1:6db2ef61d156
-| | | |  parent:      22:e0d9cccacb5d
-| | | |  user:        test
-| | | |  date:        Thu Jan 01 00:00:23 1970 +0000
-| | | |  summary:     (23) merge one known; immediate left
-| | | |
-| o | |  changeset:   22:e0d9cccacb5d
-|/ / /   parent:      18:1aa84d96232a
-| | |    parent:      21:d42a756af44d
-| | |    user:        test
-| | |    date:        Thu Jan 01 00:00:22 1970 +0000
-| | |    summary:     (22) merge two known; one far left, one far right
-| | |
-o | |    changeset:   21:d42a756af44d
-|\ \ \   parent:      19:31ddc2c1573b
-| | | |  parent:      20:d30ed6450e32
-| | | |  user:        test
-| | | |  date:        Thu Jan 01 00:00:21 1970 +0000
-| | | |  summary:     (21) expand
-| | | |
-| o---+  changeset:   20:d30ed6450e32
-|   | |  parent:      0:e6eb3150255d
-|  / /   parent:      18:1aa84d96232a
-| | |    user:        test
-| | |    date:        Thu Jan 01 00:00:20 1970 +0000
-| | |    summary:     (20) merge two known; two far right
-| | |
-o | |    changeset:   19:31ddc2c1573b
-|\ \ \   parent:      15:1dda3f72782d
-| | | |  parent:      17:44765d7c06e0
-| | | |  user:        test
-| | | |  date:        Thu Jan 01 00:00:19 1970 +0000
-| | | |  summary:     (19) expand
-| | | |
-+-----o  changeset:   18:1aa84d96232a
-| | |    parent:      1:6db2ef61d156
-| | |    parent:      15:1dda3f72782d
-| | |    user:        test
-| | |    date:        Thu Jan 01 00:00:18 1970 +0000
-| | |    summary:     (18) merge two known; two far left
-| | |
-| o |    changeset:   17:44765d7c06e0
-| |\ \   parent:      12:86b91144a6e9
-| | | |  parent:      16:3677d192927d
-| | | |  user:        test
-| | | |  date:        Thu Jan 01 00:00:17 1970 +0000
-| | | |  summary:     (17) expand
-| | | |
-| | o |  changeset:   16:3677d192927d
-| | | |  parent:      0:e6eb3150255d
-| | | |  parent:      1:6db2ef61d156
-| | | |  user:        test
-| | | |  date:        Thu Jan 01 00:00:16 1970 +0000
-| | | |  summary:     (16) merge two known; one immediate right, one near right
-| | | |
-o | | |    changeset:   15:1dda3f72782d
-|\ \ \ \   parent:      13:22d8966a97e3
-| | | | |  parent:      14:8eac370358ef
-| | | | |  user:        test
-| | | | |  date:        Thu Jan 01 00:00:15 1970 +0000
-| | | | |  summary:     (15) expand
-| | | | |
-| o | | |  changeset:   14:8eac370358ef
-| |/ / /   parent:      0:e6eb3150255d
-| | | |    parent:      12:86b91144a6e9
-| | | |    user:        test
-| | | |    date:        Thu Jan 01 00:00:14 1970 +0000
-| | | |    summary:     (14) merge two known; one immediate right, one far right
-| | | |
-o | | |    changeset:   13:22d8966a97e3
-|\ \ \ \   parent:      9:7010c0af0a35
-| | | | |  parent:      11:832d76e6bdf2
-| | | | |  user:        test
-| | | | |  date:        Thu Jan 01 00:00:13 1970 +0000
-| | | | |  summary:     (13) expand
-| | | | |
-+---o | |  changeset:   12:86b91144a6e9
-| |  / /   parent:      1:6db2ef61d156
-| | | |    parent:      9:7010c0af0a35
-| | | |    user:        test
-| | | |    date:        Thu Jan 01 00:00:12 1970 +0000
-| | | |    summary:     (12) merge two known; one immediate right, one far left
-| | | |
-| o | |  changeset:   11:832d76e6bdf2
-| | | |  parent:      6:b105a072e251
-| | | |  parent:      10:74c64d036d72
-| | | |  user:        test
-| | | |  date:        Thu Jan 01 00:00:11 1970 +0000
-| | | |  summary:     (11) expand
-| | | |
-| o | |  changeset:   10:74c64d036d72
-| | | |  parent:      0:e6eb3150255d
-| | | |  parent:      6:b105a072e251
-| | | |  user:        test
-| | | |  date:        Thu Jan 01 00:00:10 1970 +0000
-| | | |  summary:     (10) merge two known; one immediate left, one near right
-| | | |
-o | | |  changeset:   9:7010c0af0a35
-| | | |  parent:      7:b632bb1b1224
-| | | |  parent:      8:7a0b11f71937
-| | | |  user:        test
-| | | |  date:        Thu Jan 01 00:00:09 1970 +0000
-| | | |  summary:     (9) expand
-| | | |
-o | | |  changeset:   8:7a0b11f71937
-| | | |  parent:      0:e6eb3150255d
-| | | |  parent:      7:b632bb1b1224
-| | | |  user:        test
-| | | |  date:        Thu Jan 01 00:00:08 1970 +0000
-| | | |  summary:     (8) merge two known; one immediate left, one far right
-| | | |
-o | | |  changeset:   7:b632bb1b1224
-| | | |  parent:      2:3d9a33b8d1e1
-| | | |  parent:      5:4409d547b708
-| | | |  user:        test
-| | | |  date:        Thu Jan 01 00:00:07 1970 +0000
-| | | |  summary:     (7) expand
-| | | |
-| o | |  changeset:   6:b105a072e251
-|/ / /   parent:      2:3d9a33b8d1e1
-| | |    parent:      5:4409d547b708
-| | |    user:        test
-| | |    date:        Thu Jan 01 00:00:06 1970 +0000
-| | |    summary:     (6) merge two known; one immediate left, one far left
-| | |
-o | |  changeset:   5:4409d547b708
-| | |  parent:      3:27eef8ed80b4
-| | |  parent:      4:26a8bac39d9f
-| | |  user:        test
-| | |  date:        Thu Jan 01 00:00:05 1970 +0000
-| | |  summary:     (5) expand
-| | |
-o | |  changeset:   4:26a8bac39d9f
-| | |  parent:      1:6db2ef61d156
-| | |  parent:      3:27eef8ed80b4
-| | |  user:        test
-| | |  date:        Thu Jan 01 00:00:04 1970 +0000
-| | |  summary:     (4) merge two known; one immediate left, one immediate right
-| | |
-o | |  changeset:   3:27eef8ed80b4
-| | |  user:        test
-| | |  date:        Thu Jan 01 00:00:03 1970 +0000
-| | |  summary:     (3) collapse
-| | |
-o | |  changeset:   2:3d9a33b8d1e1
-|/ /   user:        test
-| |    date:        Thu Jan 01 00:00:02 1970 +0000
-| |    summary:     (2) collapse
-| |
-o |  changeset:   1:6db2ef61d156
-|/   user:        test
-|    date:        Thu Jan 01 00:00:01 1970 +0000
-|    summary:     (1) collapse
-|
-o  changeset:   0:e6eb3150255d
-   user:        test
-   date:        Thu Jan 01 00:00:00 1970 +0000
-   summary:     (0) root
-
-% unused arguments
-hg glog: invalid arguments
-hg glog [OPTION]... [FILE]
-
-show revision history alongside an ASCII revision graph
-failed
-% empty revision range - display nothing
-% from outer space
-@  changeset:   34:fea3ac5810e0
-|  tag:         tip
-|  parent:      32:d06dffa21a31
-|  user:        test
-|  date:        Thu Jan 01 00:00:34 1970 +0000
-|  summary:     (34) head
-|
-@  changeset:   34:fea3ac5810e0
-|  tag:         tip
-|  parent:      32:d06dffa21a31
-|  user:        test
-|  date:        Thu Jan 01 00:00:34 1970 +0000
-|  summary:     (34) head
-|
-% file log with revs != cset revs
-@  changeset:   2:12c28321755b
-|  tag:         tip
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     more
-|
-o  changeset:   1:5ac72c0599bf
-   user:        test
-   date:        Thu Jan 01 00:00:00 1970 +0000
-   summary:     two
-
-% file log with explicit style (issue 1896)
-o  changeset:   0:3d578b4a1f53
-   user:        test
-   date:        Thu Jan 01 00:00:00 1970 +0000
-   summary:     one
-
-% incoming and outgoing
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 31 changesets with 31 changes to 1 files
-comparing with ../repo
-searching for changes
-o  changeset:   34:fea3ac5810e0
-|  tag:         tip
-|  parent:      32:d06dffa21a31
-|  user:        test
-|  date:        Thu Jan 01 00:00:34 1970 +0000
-|  summary:     (34) head
-|
-| o  changeset:   33:68608f5145f9
-|    parent:      18:1aa84d96232a
-|    user:        test
-|    date:        Thu Jan 01 00:00:33 1970 +0000
-|    summary:     (33) head
-|
-o  changeset:   32:d06dffa21a31
-|  parent:      27:886ed638191b
-|  parent:      31:621d83e11f67
-|  user:        test
-|  date:        Thu Jan 01 00:00:32 1970 +0000
-|  summary:     (32) expand
-|
-o  changeset:   27:886ed638191b
-   parent:      21:d42a756af44d
-   user:        test
-   date:        Thu Jan 01 00:00:27 1970 +0000
-   summary:     (27) collapse
-
-comparing with repo2
-searching for changes
-@  changeset:   34:fea3ac5810e0
-|  tag:         tip
-|  parent:      32:d06dffa21a31
-|  user:        test
-|  date:        Thu Jan 01 00:00:34 1970 +0000
-|  summary:     (34) head
-|
-| o  changeset:   33:68608f5145f9
-|    parent:      18:1aa84d96232a
-|    user:        test
-|    date:        Thu Jan 01 00:00:33 1970 +0000
-|    summary:     (33) head
-|
-o  changeset:   32:d06dffa21a31
-|  parent:      27:886ed638191b
-|  parent:      31:621d83e11f67
-|  user:        test
-|  date:        Thu Jan 01 00:00:32 1970 +0000
-|  summary:     (32) expand
-|
-o  changeset:   27:886ed638191b
-   parent:      21:d42a756af44d
-   user:        test
-   date:        Thu Jan 01 00:00:27 1970 +0000
-   summary:     (27) collapse
-
-% file + limit with revs != cset revs
-o  changeset:   34:fea3ac5810e0
-|  parent:      32:d06dffa21a31
-|  user:        test
-|  date:        Thu Jan 01 00:00:34 1970 +0000
-|  summary:     (34) head
-|
-| o  changeset:   33:68608f5145f9
-| |  parent:      18:1aa84d96232a
-| |  user:        test
-| |  date:        Thu Jan 01 00:00:33 1970 +0000
-| |  summary:     (33) head
-| |
-% file + limit + -ra:b, (b - a) < limit
-o  changeset:   34:fea3ac5810e0
-|  parent:      32:d06dffa21a31
-|  user:        test
-|  date:        Thu Jan 01 00:00:34 1970 +0000
-|  summary:     (34) head
-|
-| o  changeset:   33:68608f5145f9
-| |  parent:      18:1aa84d96232a
-| |  user:        test
-| |  date:        Thu Jan 01 00:00:33 1970 +0000
-| |  summary:     (33) head
-| |
-o |    changeset:   32:d06dffa21a31
-|\ \   parent:      27:886ed638191b
-| | |  parent:      31:621d83e11f67
-| | |  user:        test
-| | |  date:        Thu Jan 01 00:00:32 1970 +0000
-| | |  summary:     (32) expand
-| | |
-% file + limit + -ra:b, b < tip
-o  changeset:   34:fea3ac5810e0
-|  parent:      32:d06dffa21a31
-|  user:        test
-|  date:        Thu Jan 01 00:00:34 1970 +0000
-|  summary:     (34) head
-|
-% file + limit + -ra:b, b < tip, (b - a) < limit
-o  changeset:   34:fea3ac5810e0
-|  parent:      32:d06dffa21a31
-|  user:        test
-|  date:        Thu Jan 01 00:00:34 1970 +0000
-|  summary:     (34) head
-|
-| o  changeset:   33:68608f5145f9
-| |  parent:      18:1aa84d96232a
-| |  user:        test
-| |  date:        Thu Jan 01 00:00:33 1970 +0000
-| |  summary:     (33) head
-| |
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-glog.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,879 @@
+@  (34) head
+|
+| o  (33) head
+| |
+o |    (32) expand
+|\ \
+| o \    (31) expand
+| |\ \
+| | o \    (30) expand
+| | |\ \
+| | | o |  (29) regular commit
+| | | | |
+| | o | |    (28) merge zero known
+| | |\ \ \
+o | | | | |  (27) collapse
+|/ / / / /
+| | o---+  (26) merge one known; far right
+| | | | |
++---o | |  (25) merge one known; far left
+| | | | |
+| | o | |  (24) merge one known; immediate right
+| | |\| |
+| | o | |  (23) merge one known; immediate left
+| |/| | |
++---o---+  (22) merge two known; one far left, one far right
+| |  / /
+o | | |    (21) expand
+|\ \ \ \
+| o---+-+  (20) merge two known; two far right
+|  / / /
+o | | |    (19) expand
+|\ \ \ \
++---+---o  (18) merge two known; two far left
+| | | |
+| o | |    (17) expand
+| |\ \ \
+| | o---+  (16) merge two known; one immediate right, one near right
+| | |/ /
+o | | |    (15) expand
+|\ \ \ \
+| o-----+  (14) merge two known; one immediate right, one far right
+| |/ / /
+o | | |    (13) expand
+|\ \ \ \
++---o | |  (12) merge two known; one immediate right, one far left
+| | |/ /
+| o | |    (11) expand
+| |\ \ \
+| | o---+  (10) merge two known; one immediate left, one near right
+| |/ / /
+o | | |    (9) expand
+|\ \ \ \
+| o-----+  (8) merge two known; one immediate left, one far right
+|/ / / /
+o | | |    (7) expand
+|\ \ \ \
++---o | |  (6) merge two known; one immediate left, one far left
+| |/ / /
+| o | |    (5) expand
+| |\ \ \
+| | o | |  (4) merge two known; one immediate left, one immediate right
+| |/|/ /
+| o / /  (3) collapse
+|/ / /
+o / /  (2) collapse
+|/ /
+o /  (1) collapse
+|/
+o  (0) root
+
+
+  $ "$TESTDIR/hghave" no-outer-repo || exit 80
+
+  $ commit()
+  > {
+  >   rev=$1
+  >   msg=$2
+  >   shift 2
+  >   if [ "$#" -gt 0 ]; then
+  >       hg debugsetparents "$@"
+  >   fi
+  >   echo $rev > a
+  >   hg commit -Aqd "$rev 0" -m "($rev) $msg"
+  > }
+
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "graphlog=" >> $HGRCPATH
+
+  $ hg init repo
+  $ cd repo
+
+Empty repo:
+
+  $ hg glog
+
+
+Building DAG:
+
+  $ commit 0 "root"
+  $ commit 1 "collapse" 0
+  $ commit 2 "collapse" 1
+  $ commit 3 "collapse" 2
+  $ commit 4 "merge two known; one immediate left, one immediate right" 1 3
+  $ commit 5 "expand" 3 4
+  $ commit 6 "merge two known; one immediate left, one far left" 2 5
+  $ commit 7 "expand" 2 5
+  $ commit 8 "merge two known; one immediate left, one far right" 0 7
+  $ commit 9 "expand" 7 8
+  $ commit 10 "merge two known; one immediate left, one near right" 0 6
+  $ commit 11 "expand" 6 10
+  $ commit 12 "merge two known; one immediate right, one far left" 1 9
+  $ commit 13 "expand" 9 11
+  $ commit 14 "merge two known; one immediate right, one far right" 0 12
+  $ commit 15 "expand" 13 14
+  $ commit 16 "merge two known; one immediate right, one near right" 0 1
+  $ commit 17 "expand" 12 16
+  $ commit 18 "merge two known; two far left" 1 15
+  $ commit 19 "expand" 15 17
+  $ commit 20 "merge two known; two far right" 0 18
+  $ commit 21 "expand" 19 20
+  $ commit 22 "merge two known; one far left, one far right" 18 21
+  $ commit 23 "merge one known; immediate left" 1 22
+  $ commit 24 "merge one known; immediate right" 0 23
+  $ commit 25 "merge one known; far left" 21 24
+  $ commit 26 "merge one known; far right" 18 25
+  $ commit 27 "collapse" 21
+  $ commit 28 "merge zero known" 1 26
+  $ commit 29 "regular commit" 0
+  $ commit 30 "expand" 28 29
+  $ commit 31 "expand" 21 30
+  $ commit 32 "expand" 27 31
+  $ commit 33 "head" 18
+  $ commit 34 "head" 32
+
+
+  $ hg glog -q
+  @  34:fea3ac5810e0
+  |
+  | o  33:68608f5145f9
+  | |
+  o |    32:d06dffa21a31
+  |\ \
+  | o \    31:621d83e11f67
+  | |\ \
+  | | o \    30:6e11cd4b648f
+  | | |\ \
+  | | | o |  29:cd9bb2be7593
+  | | | | |
+  | | o | |    28:44ecd0b9ae99
+  | | |\ \ \
+  o | | | | |  27:886ed638191b
+  |/ / / / /
+  | | o---+  26:7f25b6c2f0b9
+  | | | | |
+  +---o | |  25:91da8ed57247
+  | | | | |
+  | | o | |  24:a9c19a3d96b7
+  | | |\| |
+  | | o | |  23:a01cddf0766d
+  | |/| | |
+  +---o---+  22:e0d9cccacb5d
+  | |  / /
+  o | | |    21:d42a756af44d
+  |\ \ \ \
+  | o---+-+  20:d30ed6450e32
+  |  / / /
+  o | | |    19:31ddc2c1573b
+  |\ \ \ \
+  +---+---o  18:1aa84d96232a
+  | | | |
+  | o | |    17:44765d7c06e0
+  | |\ \ \
+  | | o---+  16:3677d192927d
+  | | |/ /
+  o | | |    15:1dda3f72782d
+  |\ \ \ \
+  | o-----+  14:8eac370358ef
+  | |/ / /
+  o | | |    13:22d8966a97e3
+  |\ \ \ \
+  +---o | |  12:86b91144a6e9
+  | | |/ /
+  | o | |    11:832d76e6bdf2
+  | |\ \ \
+  | | o---+  10:74c64d036d72
+  | |/ / /
+  o | | |    9:7010c0af0a35
+  |\ \ \ \
+  | o-----+  8:7a0b11f71937
+  |/ / / /
+  o | | |    7:b632bb1b1224
+  |\ \ \ \
+  +---o | |  6:b105a072e251
+  | |/ / /
+  | o | |    5:4409d547b708
+  | |\ \ \
+  | | o | |  4:26a8bac39d9f
+  | |/|/ /
+  | o / /  3:27eef8ed80b4
+  |/ / /
+  o / /  2:3d9a33b8d1e1
+  |/ /
+  o /  1:6db2ef61d156
+  |/
+  o  0:e6eb3150255d
+  
+
+  $ hg glog
+  @  changeset:   34:fea3ac5810e0
+  |  tag:         tip
+  |  parent:      32:d06dffa21a31
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:34 1970 +0000
+  |  summary:     (34) head
+  |
+  | o  changeset:   33:68608f5145f9
+  | |  parent:      18:1aa84d96232a
+  | |  user:        test
+  | |  date:        Thu Jan 01 00:00:33 1970 +0000
+  | |  summary:     (33) head
+  | |
+  o |    changeset:   32:d06dffa21a31
+  |\ \   parent:      27:886ed638191b
+  | | |  parent:      31:621d83e11f67
+  | | |  user:        test
+  | | |  date:        Thu Jan 01 00:00:32 1970 +0000
+  | | |  summary:     (32) expand
+  | | |
+  | o |    changeset:   31:621d83e11f67
+  | |\ \   parent:      21:d42a756af44d
+  | | | |  parent:      30:6e11cd4b648f
+  | | | |  user:        test
+  | | | |  date:        Thu Jan 01 00:00:31 1970 +0000
+  | | | |  summary:     (31) expand
+  | | | |
+  | | o |    changeset:   30:6e11cd4b648f
+  | | |\ \   parent:      28:44ecd0b9ae99
+  | | | | |  parent:      29:cd9bb2be7593
+  | | | | |  user:        test
+  | | | | |  date:        Thu Jan 01 00:00:30 1970 +0000
+  | | | | |  summary:     (30) expand
+  | | | | |
+  | | | o |  changeset:   29:cd9bb2be7593
+  | | | | |  parent:      0:e6eb3150255d
+  | | | | |  user:        test
+  | | | | |  date:        Thu Jan 01 00:00:29 1970 +0000
+  | | | | |  summary:     (29) regular commit
+  | | | | |
+  | | o | |    changeset:   28:44ecd0b9ae99
+  | | |\ \ \   parent:      1:6db2ef61d156
+  | | | | | |  parent:      26:7f25b6c2f0b9
+  | | | | | |  user:        test
+  | | | | | |  date:        Thu Jan 01 00:00:28 1970 +0000
+  | | | | | |  summary:     (28) merge zero known
+  | | | | | |
+  o | | | | |  changeset:   27:886ed638191b
+  |/ / / / /   parent:      21:d42a756af44d
+  | | | | |    user:        test
+  | | | | |    date:        Thu Jan 01 00:00:27 1970 +0000
+  | | | | |    summary:     (27) collapse
+  | | | | |
+  | | o---+  changeset:   26:7f25b6c2f0b9
+  | | | | |  parent:      18:1aa84d96232a
+  | | | | |  parent:      25:91da8ed57247
+  | | | | |  user:        test
+  | | | | |  date:        Thu Jan 01 00:00:26 1970 +0000
+  | | | | |  summary:     (26) merge one known; far right
+  | | | | |
+  +---o | |  changeset:   25:91da8ed57247
+  | | | | |  parent:      21:d42a756af44d
+  | | | | |  parent:      24:a9c19a3d96b7
+  | | | | |  user:        test
+  | | | | |  date:        Thu Jan 01 00:00:25 1970 +0000
+  | | | | |  summary:     (25) merge one known; far left
+  | | | | |
+  | | o | |  changeset:   24:a9c19a3d96b7
+  | | |\| |  parent:      0:e6eb3150255d
+  | | | | |  parent:      23:a01cddf0766d
+  | | | | |  user:        test
+  | | | | |  date:        Thu Jan 01 00:00:24 1970 +0000
+  | | | | |  summary:     (24) merge one known; immediate right
+  | | | | |
+  | | o | |  changeset:   23:a01cddf0766d
+  | |/| | |  parent:      1:6db2ef61d156
+  | | | | |  parent:      22:e0d9cccacb5d
+  | | | | |  user:        test
+  | | | | |  date:        Thu Jan 01 00:00:23 1970 +0000
+  | | | | |  summary:     (23) merge one known; immediate left
+  | | | | |
+  +---o---+  changeset:   22:e0d9cccacb5d
+  | |   | |  parent:      18:1aa84d96232a
+  | |  / /   parent:      21:d42a756af44d
+  | | | |    user:        test
+  | | | |    date:        Thu Jan 01 00:00:22 1970 +0000
+  | | | |    summary:     (22) merge two known; one far left, one far right
+  | | | |
+  o | | |    changeset:   21:d42a756af44d
+  |\ \ \ \   parent:      19:31ddc2c1573b
+  | | | | |  parent:      20:d30ed6450e32
+  | | | | |  user:        test
+  | | | | |  date:        Thu Jan 01 00:00:21 1970 +0000
+  | | | | |  summary:     (21) expand
+  | | | | |
+  | o---+-+  changeset:   20:d30ed6450e32
+  |   | | |  parent:      0:e6eb3150255d
+  |  / / /   parent:      18:1aa84d96232a
+  | | | |    user:        test
+  | | | |    date:        Thu Jan 01 00:00:20 1970 +0000
+  | | | |    summary:     (20) merge two known; two far right
+  | | | |
+  o | | |    changeset:   19:31ddc2c1573b
+  |\ \ \ \   parent:      15:1dda3f72782d
+  | | | | |  parent:      17:44765d7c06e0
+  | | | | |  user:        test
+  | | | | |  date:        Thu Jan 01 00:00:19 1970 +0000
+  | | | | |  summary:     (19) expand
+  | | | | |
+  +---+---o  changeset:   18:1aa84d96232a
+  | | | |    parent:      1:6db2ef61d156
+  | | | |    parent:      15:1dda3f72782d
+  | | | |    user:        test
+  | | | |    date:        Thu Jan 01 00:00:18 1970 +0000
+  | | | |    summary:     (18) merge two known; two far left
+  | | | |
+  | o | |    changeset:   17:44765d7c06e0
+  | |\ \ \   parent:      12:86b91144a6e9
+  | | | | |  parent:      16:3677d192927d
+  | | | | |  user:        test
+  | | | | |  date:        Thu Jan 01 00:00:17 1970 +0000
+  | | | | |  summary:     (17) expand
+  | | | | |
+  | | o---+  changeset:   16:3677d192927d
+  | | | | |  parent:      0:e6eb3150255d
+  | | |/ /   parent:      1:6db2ef61d156
+  | | | |    user:        test
+  | | | |    date:        Thu Jan 01 00:00:16 1970 +0000
+  | | | |    summary:     (16) merge two known; one immediate right, one near right
+  | | | |
+  o | | |    changeset:   15:1dda3f72782d
+  |\ \ \ \   parent:      13:22d8966a97e3
+  | | | | |  parent:      14:8eac370358ef
+  | | | | |  user:        test
+  | | | | |  date:        Thu Jan 01 00:00:15 1970 +0000
+  | | | | |  summary:     (15) expand
+  | | | | |
+  | o-----+  changeset:   14:8eac370358ef
+  | | | | |  parent:      0:e6eb3150255d
+  | |/ / /   parent:      12:86b91144a6e9
+  | | | |    user:        test
+  | | | |    date:        Thu Jan 01 00:00:14 1970 +0000
+  | | | |    summary:     (14) merge two known; one immediate right, one far right
+  | | | |
+  o | | |    changeset:   13:22d8966a97e3
+  |\ \ \ \   parent:      9:7010c0af0a35
+  | | | | |  parent:      11:832d76e6bdf2
+  | | | | |  user:        test
+  | | | | |  date:        Thu Jan 01 00:00:13 1970 +0000
+  | | | | |  summary:     (13) expand
+  | | | | |
+  +---o | |  changeset:   12:86b91144a6e9
+  | | |/ /   parent:      1:6db2ef61d156
+  | | | |    parent:      9:7010c0af0a35
+  | | | |    user:        test
+  | | | |    date:        Thu Jan 01 00:00:12 1970 +0000
+  | | | |    summary:     (12) merge two known; one immediate right, one far left
+  | | | |
+  | o | |    changeset:   11:832d76e6bdf2
+  | |\ \ \   parent:      6:b105a072e251
+  | | | | |  parent:      10:74c64d036d72
+  | | | | |  user:        test
+  | | | | |  date:        Thu Jan 01 00:00:11 1970 +0000
+  | | | | |  summary:     (11) expand
+  | | | | |
+  | | o---+  changeset:   10:74c64d036d72
+  | | | | |  parent:      0:e6eb3150255d
+  | |/ / /   parent:      6:b105a072e251
+  | | | |    user:        test
+  | | | |    date:        Thu Jan 01 00:00:10 1970 +0000
+  | | | |    summary:     (10) merge two known; one immediate left, one near right
+  | | | |
+  o | | |    changeset:   9:7010c0af0a35
+  |\ \ \ \   parent:      7:b632bb1b1224
+  | | | | |  parent:      8:7a0b11f71937
+  | | | | |  user:        test
+  | | | | |  date:        Thu Jan 01 00:00:09 1970 +0000
+  | | | | |  summary:     (9) expand
+  | | | | |
+  | o-----+  changeset:   8:7a0b11f71937
+  | | | | |  parent:      0:e6eb3150255d
+  |/ / / /   parent:      7:b632bb1b1224
+  | | | |    user:        test
+  | | | |    date:        Thu Jan 01 00:00:08 1970 +0000
+  | | | |    summary:     (8) merge two known; one immediate left, one far right
+  | | | |
+  o | | |    changeset:   7:b632bb1b1224
+  |\ \ \ \   parent:      2:3d9a33b8d1e1
+  | | | | |  parent:      5:4409d547b708
+  | | | | |  user:        test
+  | | | | |  date:        Thu Jan 01 00:00:07 1970 +0000
+  | | | | |  summary:     (7) expand
+  | | | | |
+  +---o | |  changeset:   6:b105a072e251
+  | |/ / /   parent:      2:3d9a33b8d1e1
+  | | | |    parent:      5:4409d547b708
+  | | | |    user:        test
+  | | | |    date:        Thu Jan 01 00:00:06 1970 +0000
+  | | | |    summary:     (6) merge two known; one immediate left, one far left
+  | | | |
+  | o | |    changeset:   5:4409d547b708
+  | |\ \ \   parent:      3:27eef8ed80b4
+  | | | | |  parent:      4:26a8bac39d9f
+  | | | | |  user:        test
+  | | | | |  date:        Thu Jan 01 00:00:05 1970 +0000
+  | | | | |  summary:     (5) expand
+  | | | | |
+  | | o | |  changeset:   4:26a8bac39d9f
+  | |/|/ /   parent:      1:6db2ef61d156
+  | | | |    parent:      3:27eef8ed80b4
+  | | | |    user:        test
+  | | | |    date:        Thu Jan 01 00:00:04 1970 +0000
+  | | | |    summary:     (4) merge two known; one immediate left, one immediate right
+  | | | |
+  | o | |  changeset:   3:27eef8ed80b4
+  |/ / /   user:        test
+  | | |    date:        Thu Jan 01 00:00:03 1970 +0000
+  | | |    summary:     (3) collapse
+  | | |
+  o | |  changeset:   2:3d9a33b8d1e1
+  |/ /   user:        test
+  | |    date:        Thu Jan 01 00:00:02 1970 +0000
+  | |    summary:     (2) collapse
+  | |
+  o |  changeset:   1:6db2ef61d156
+  |/   user:        test
+  |    date:        Thu Jan 01 00:00:01 1970 +0000
+  |    summary:     (1) collapse
+  |
+  o  changeset:   0:e6eb3150255d
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     (0) root
+  
+
+File glog:
+  $ hg glog a
+  @  changeset:   34:fea3ac5810e0
+  |  tag:         tip
+  |  parent:      32:d06dffa21a31
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:34 1970 +0000
+  |  summary:     (34) head
+  |
+  | o  changeset:   33:68608f5145f9
+  | |  parent:      18:1aa84d96232a
+  | |  user:        test
+  | |  date:        Thu Jan 01 00:00:33 1970 +0000
+  | |  summary:     (33) head
+  | |
+  o |    changeset:   32:d06dffa21a31
+  |\ \   parent:      27:886ed638191b
+  | | |  parent:      31:621d83e11f67
+  | | |  user:        test
+  | | |  date:        Thu Jan 01 00:00:32 1970 +0000
+  | | |  summary:     (32) expand
+  | | |
+  | o |  changeset:   31:621d83e11f67
+  | | |  parent:      21:d42a756af44d
+  | | |  parent:      30:6e11cd4b648f
+  | | |  user:        test
+  | | |  date:        Thu Jan 01 00:00:31 1970 +0000
+  | | |  summary:     (31) expand
+  | | |
+  | o |    changeset:   30:6e11cd4b648f
+  | |\ \   parent:      28:44ecd0b9ae99
+  | | | |  parent:      29:cd9bb2be7593
+  | | | |  user:        test
+  | | | |  date:        Thu Jan 01 00:00:30 1970 +0000
+  | | | |  summary:     (30) expand
+  | | | |
+  | | o |  changeset:   29:cd9bb2be7593
+  | | | |  parent:      0:e6eb3150255d
+  | | | |  user:        test
+  | | | |  date:        Thu Jan 01 00:00:29 1970 +0000
+  | | | |  summary:     (29) regular commit
+  | | | |
+  | o | |  changeset:   28:44ecd0b9ae99
+  | | | |  parent:      1:6db2ef61d156
+  | | | |  parent:      26:7f25b6c2f0b9
+  | | | |  user:        test
+  | | | |  date:        Thu Jan 01 00:00:28 1970 +0000
+  | | | |  summary:     (28) merge zero known
+  | | | |
+  o | | |  changeset:   27:886ed638191b
+  | | | |  parent:      21:d42a756af44d
+  | | | |  user:        test
+  | | | |  date:        Thu Jan 01 00:00:27 1970 +0000
+  | | | |  summary:     (27) collapse
+  | | | |
+  | o | |  changeset:   26:7f25b6c2f0b9
+  | | | |  parent:      18:1aa84d96232a
+  | | | |  parent:      25:91da8ed57247
+  | | | |  user:        test
+  | | | |  date:        Thu Jan 01 00:00:26 1970 +0000
+  | | | |  summary:     (26) merge one known; far right
+  | | | |
+  | o | |  changeset:   25:91da8ed57247
+  | | | |  parent:      21:d42a756af44d
+  | | | |  parent:      24:a9c19a3d96b7
+  | | | |  user:        test
+  | | | |  date:        Thu Jan 01 00:00:25 1970 +0000
+  | | | |  summary:     (25) merge one known; far left
+  | | | |
+  | o | |  changeset:   24:a9c19a3d96b7
+  | | | |  parent:      0:e6eb3150255d
+  | | | |  parent:      23:a01cddf0766d
+  | | | |  user:        test
+  | | | |  date:        Thu Jan 01 00:00:24 1970 +0000
+  | | | |  summary:     (24) merge one known; immediate right
+  | | | |
+  | o | |  changeset:   23:a01cddf0766d
+  | | | |  parent:      1:6db2ef61d156
+  | | | |  parent:      22:e0d9cccacb5d
+  | | | |  user:        test
+  | | | |  date:        Thu Jan 01 00:00:23 1970 +0000
+  | | | |  summary:     (23) merge one known; immediate left
+  | | | |
+  | o | |  changeset:   22:e0d9cccacb5d
+  |/ / /   parent:      18:1aa84d96232a
+  | | |    parent:      21:d42a756af44d
+  | | |    user:        test
+  | | |    date:        Thu Jan 01 00:00:22 1970 +0000
+  | | |    summary:     (22) merge two known; one far left, one far right
+  | | |
+  o | |    changeset:   21:d42a756af44d
+  |\ \ \   parent:      19:31ddc2c1573b
+  | | | |  parent:      20:d30ed6450e32
+  | | | |  user:        test
+  | | | |  date:        Thu Jan 01 00:00:21 1970 +0000
+  | | | |  summary:     (21) expand
+  | | | |
+  | o---+  changeset:   20:d30ed6450e32
+  |   | |  parent:      0:e6eb3150255d
+  |  / /   parent:      18:1aa84d96232a
+  | | |    user:        test
+  | | |    date:        Thu Jan 01 00:00:20 1970 +0000
+  | | |    summary:     (20) merge two known; two far right
+  | | |
+  o | |    changeset:   19:31ddc2c1573b
+  |\ \ \   parent:      15:1dda3f72782d
+  | | | |  parent:      17:44765d7c06e0
+  | | | |  user:        test
+  | | | |  date:        Thu Jan 01 00:00:19 1970 +0000
+  | | | |  summary:     (19) expand
+  | | | |
+  +-----o  changeset:   18:1aa84d96232a
+  | | |    parent:      1:6db2ef61d156
+  | | |    parent:      15:1dda3f72782d
+  | | |    user:        test
+  | | |    date:        Thu Jan 01 00:00:18 1970 +0000
+  | | |    summary:     (18) merge two known; two far left
+  | | |
+  | o |    changeset:   17:44765d7c06e0
+  | |\ \   parent:      12:86b91144a6e9
+  | | | |  parent:      16:3677d192927d
+  | | | |  user:        test
+  | | | |  date:        Thu Jan 01 00:00:17 1970 +0000
+  | | | |  summary:     (17) expand
+  | | | |
+  | | o |  changeset:   16:3677d192927d
+  | | | |  parent:      0:e6eb3150255d
+  | | | |  parent:      1:6db2ef61d156
+  | | | |  user:        test
+  | | | |  date:        Thu Jan 01 00:00:16 1970 +0000
+  | | | |  summary:     (16) merge two known; one immediate right, one near right
+  | | | |
+  o | | |    changeset:   15:1dda3f72782d
+  |\ \ \ \   parent:      13:22d8966a97e3
+  | | | | |  parent:      14:8eac370358ef
+  | | | | |  user:        test
+  | | | | |  date:        Thu Jan 01 00:00:15 1970 +0000
+  | | | | |  summary:     (15) expand
+  | | | | |
+  | o | | |  changeset:   14:8eac370358ef
+  | |/ / /   parent:      0:e6eb3150255d
+  | | | |    parent:      12:86b91144a6e9
+  | | | |    user:        test
+  | | | |    date:        Thu Jan 01 00:00:14 1970 +0000
+  | | | |    summary:     (14) merge two known; one immediate right, one far right
+  | | | |
+  o | | |    changeset:   13:22d8966a97e3
+  |\ \ \ \   parent:      9:7010c0af0a35
+  | | | | |  parent:      11:832d76e6bdf2
+  | | | | |  user:        test
+  | | | | |  date:        Thu Jan 01 00:00:13 1970 +0000
+  | | | | |  summary:     (13) expand
+  | | | | |
+  +---o | |  changeset:   12:86b91144a6e9
+  | |  / /   parent:      1:6db2ef61d156
+  | | | |    parent:      9:7010c0af0a35
+  | | | |    user:        test
+  | | | |    date:        Thu Jan 01 00:00:12 1970 +0000
+  | | | |    summary:     (12) merge two known; one immediate right, one far left
+  | | | |
+  | o | |  changeset:   11:832d76e6bdf2
+  | | | |  parent:      6:b105a072e251
+  | | | |  parent:      10:74c64d036d72
+  | | | |  user:        test
+  | | | |  date:        Thu Jan 01 00:00:11 1970 +0000
+  | | | |  summary:     (11) expand
+  | | | |
+  | o | |  changeset:   10:74c64d036d72
+  | | | |  parent:      0:e6eb3150255d
+  | | | |  parent:      6:b105a072e251
+  | | | |  user:        test
+  | | | |  date:        Thu Jan 01 00:00:10 1970 +0000
+  | | | |  summary:     (10) merge two known; one immediate left, one near right
+  | | | |
+  o | | |  changeset:   9:7010c0af0a35
+  | | | |  parent:      7:b632bb1b1224
+  | | | |  parent:      8:7a0b11f71937
+  | | | |  user:        test
+  | | | |  date:        Thu Jan 01 00:00:09 1970 +0000
+  | | | |  summary:     (9) expand
+  | | | |
+  o | | |  changeset:   8:7a0b11f71937
+  | | | |  parent:      0:e6eb3150255d
+  | | | |  parent:      7:b632bb1b1224
+  | | | |  user:        test
+  | | | |  date:        Thu Jan 01 00:00:08 1970 +0000
+  | | | |  summary:     (8) merge two known; one immediate left, one far right
+  | | | |
+  o | | |  changeset:   7:b632bb1b1224
+  | | | |  parent:      2:3d9a33b8d1e1
+  | | | |  parent:      5:4409d547b708
+  | | | |  user:        test
+  | | | |  date:        Thu Jan 01 00:00:07 1970 +0000
+  | | | |  summary:     (7) expand
+  | | | |
+  | o | |  changeset:   6:b105a072e251
+  |/ / /   parent:      2:3d9a33b8d1e1
+  | | |    parent:      5:4409d547b708
+  | | |    user:        test
+  | | |    date:        Thu Jan 01 00:00:06 1970 +0000
+  | | |    summary:     (6) merge two known; one immediate left, one far left
+  | | |
+  o | |  changeset:   5:4409d547b708
+  | | |  parent:      3:27eef8ed80b4
+  | | |  parent:      4:26a8bac39d9f
+  | | |  user:        test
+  | | |  date:        Thu Jan 01 00:00:05 1970 +0000
+  | | |  summary:     (5) expand
+  | | |
+  o | |  changeset:   4:26a8bac39d9f
+  | | |  parent:      1:6db2ef61d156
+  | | |  parent:      3:27eef8ed80b4
+  | | |  user:        test
+  | | |  date:        Thu Jan 01 00:00:04 1970 +0000
+  | | |  summary:     (4) merge two known; one immediate left, one immediate right
+  | | |
+  o | |  changeset:   3:27eef8ed80b4
+  | | |  user:        test
+  | | |  date:        Thu Jan 01 00:00:03 1970 +0000
+  | | |  summary:     (3) collapse
+  | | |
+  o | |  changeset:   2:3d9a33b8d1e1
+  |/ /   user:        test
+  | |    date:        Thu Jan 01 00:00:02 1970 +0000
+  | |    summary:     (2) collapse
+  | |
+  o |  changeset:   1:6db2ef61d156
+  |/   user:        test
+  |    date:        Thu Jan 01 00:00:01 1970 +0000
+  |    summary:     (1) collapse
+  |
+  o  changeset:   0:e6eb3150255d
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     (0) root
+  
+
+Unused arguments:
+  $ hg glog -q foo bar
+  hg glog: invalid arguments
+  hg glog [OPTION]... [FILE]
+  
+  show revision history alongside an ASCII revision graph
+  [255]
+
+Empty revision range - display nothing:
+  $ hg glog -r 1..0
+
+From outer space:
+  $ cd ..
+  $ hg glog -l1 repo
+  @  changeset:   34:fea3ac5810e0
+  |  tag:         tip
+  |  parent:      32:d06dffa21a31
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:34 1970 +0000
+  |  summary:     (34) head
+  |
+  $ hg glog -l1 repo/a
+  @  changeset:   34:fea3ac5810e0
+  |  tag:         tip
+  |  parent:      32:d06dffa21a31
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:34 1970 +0000
+  |  summary:     (34) head
+  |
+  $ hg glog -l1 repo/missing
+
+File log with revs != cset revs:
+  $ hg init flog
+  $ cd flog
+  $ echo one >one
+  $ hg add one
+  $ hg commit -mone
+  $ echo two >two
+  $ hg add two
+  $ hg commit -mtwo
+  $ echo more >two
+  $ hg commit -mmore
+  $ hg glog two
+  @  changeset:   2:12c28321755b
+  |  tag:         tip
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     more
+  |
+  o  changeset:   1:5ac72c0599bf
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     two
+  
+
+File log with explicit style (issue 1896):
+  $ hg glog --style=default one
+  o  changeset:   0:3d578b4a1f53
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     one
+  
+  $ cd ..
+
+Incoming and outgoing:
+
+  $ hg clone -U -r31 repo repo2
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 31 changesets with 31 changes to 1 files
+  $ cd repo2
+
+  $ hg incoming --graph ../repo
+  comparing with ../repo
+  searching for changes
+  o  changeset:   34:fea3ac5810e0
+  |  tag:         tip
+  |  parent:      32:d06dffa21a31
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:34 1970 +0000
+  |  summary:     (34) head
+  |
+  | o  changeset:   33:68608f5145f9
+  |    parent:      18:1aa84d96232a
+  |    user:        test
+  |    date:        Thu Jan 01 00:00:33 1970 +0000
+  |    summary:     (33) head
+  |
+  o  changeset:   32:d06dffa21a31
+  |  parent:      27:886ed638191b
+  |  parent:      31:621d83e11f67
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:32 1970 +0000
+  |  summary:     (32) expand
+  |
+  o  changeset:   27:886ed638191b
+     parent:      21:d42a756af44d
+     user:        test
+     date:        Thu Jan 01 00:00:27 1970 +0000
+     summary:     (27) collapse
+  
+  $ cd ..
+
+  $ hg -R repo outgoing --graph repo2
+  comparing with repo2
+  searching for changes
+  @  changeset:   34:fea3ac5810e0
+  |  tag:         tip
+  |  parent:      32:d06dffa21a31
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:34 1970 +0000
+  |  summary:     (34) head
+  |
+  | o  changeset:   33:68608f5145f9
+  |    parent:      18:1aa84d96232a
+  |    user:        test
+  |    date:        Thu Jan 01 00:00:33 1970 +0000
+  |    summary:     (33) head
+  |
+  o  changeset:   32:d06dffa21a31
+  |  parent:      27:886ed638191b
+  |  parent:      31:621d83e11f67
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:32 1970 +0000
+  |  summary:     (32) expand
+  |
+  o  changeset:   27:886ed638191b
+     parent:      21:d42a756af44d
+     user:        test
+     date:        Thu Jan 01 00:00:27 1970 +0000
+     summary:     (27) collapse
+  
+
+File + limit with revs != cset revs:
+  $ cd repo
+  $ touch b
+  $ hg ci -Aqm0
+  $ hg glog -l2 a
+  o  changeset:   34:fea3ac5810e0
+  |  parent:      32:d06dffa21a31
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:34 1970 +0000
+  |  summary:     (34) head
+  |
+  | o  changeset:   33:68608f5145f9
+  | |  parent:      18:1aa84d96232a
+  | |  user:        test
+  | |  date:        Thu Jan 01 00:00:33 1970 +0000
+  | |  summary:     (33) head
+  | |
+
+File + limit + -ra:b, (b - a) < limit:
+  $ hg glog -l3000 -r32:tip a
+  o  changeset:   34:fea3ac5810e0
+  |  parent:      32:d06dffa21a31
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:34 1970 +0000
+  |  summary:     (34) head
+  |
+  | o  changeset:   33:68608f5145f9
+  | |  parent:      18:1aa84d96232a
+  | |  user:        test
+  | |  date:        Thu Jan 01 00:00:33 1970 +0000
+  | |  summary:     (33) head
+  | |
+  o |    changeset:   32:d06dffa21a31
+  |\ \   parent:      27:886ed638191b
+  | | |  parent:      31:621d83e11f67
+  | | |  user:        test
+  | | |  date:        Thu Jan 01 00:00:32 1970 +0000
+  | | |  summary:     (32) expand
+  | | |
+
+File + limit + -ra:b, b < tip:
+  $ hg glog -l1 -r32:34 a
+  o  changeset:   34:fea3ac5810e0
+  |  parent:      32:d06dffa21a31
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:34 1970 +0000
+  |  summary:     (34) head
+  |
+
+File + limit + -ra:b, b < tip, (b - a) < limit:
+  $ hg glog -l10 -r33:34 a
+  o  changeset:   34:fea3ac5810e0
+  |  parent:      32:d06dffa21a31
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:34 1970 +0000
+  |  summary:     (34) head
+  |
+  | o  changeset:   33:68608f5145f9
+  | |  parent:      18:1aa84d96232a
+  | |  user:        test
+  | |  date:        Thu Jan 01 00:00:33 1970 +0000
+  | |  summary:     (33) head
+  | |
+
--- a/tests/test-grep	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,100 +0,0 @@
-#!/bin/sh
-
-mkdir t
-cd t
-hg init
-echo import > port
-hg add port
-hg commit -m 0 -u spam -d '0 0'
-echo export >> port
-hg commit -m 1 -u eggs -d '1 0'
-echo export > port
-echo vaportight >> port
-echo 'import/export' >> port
-hg commit -m 2 -u spam -d '2 0'
-echo 'import/export' >> port
-hg commit -m 3 -u eggs -d '3 0'
-head -n 3 port > port1
-mv port1 port
-hg commit -m 4 -u spam -d '4 0'
-echo % pattern error
-hg grep '**test**'
-echo % simple
-hg grep port port
-echo % simple with color
-hg --config extensions.color= grep --config color.mode=ansi \
-    --color=always port port
-echo % all
-hg grep --traceback --all -nu port port
-echo % other
-hg grep import port
-
-hg cp port port2
-hg commit -m 4 -u spam -d '5 0'
-echo % follow
-hg grep --traceback -f 'import$' port2
-echo deport >> port2
-hg commit -m 5 -u eggs -d '6 0'
-hg grep -f --all -nu port port2
-
-cd ..
-hg init t2
-cd t2
-hg grep foobar foo
-hg grep foobar
-echo blue >> color
-echo black >> color
-hg add color
-hg ci -m 0
-echo orange >> color
-hg ci -m 1
-echo black > color
-hg ci -m 2
-echo orange >> color
-echo blue >> color
-hg ci -m 3
-hg grep orange
-hg grep --all orange
-
-echo % match in last "line" without newline
-python -c 'fp = open("noeol", "wb"); fp.write("no infinite loop"); fp.close();'
-hg ci -Amnoeol
-echo % last character omitted in output to avoid infinite loop
-hg grep loop
-
-# Got a traceback when using grep on a single
-# revision with renamed files.
-cd ..
-echo % issue 685
-hg init issue685
-cd issue685
-echo octarine > color
-hg ci -Amcolor
-hg rename color colour
-hg ci -Am rename
-hg grep octarine
-# Used to crash here
-hg grep -r 1 octarine
-
-# Issue337: test that grep follows parent-child relationships instead
-# of just using revision numbers.
-cd ..
-echo % issue 337
-hg init issue337
-cd issue337
-
-echo white > color
-hg commit -A -m "0 white"
-
-echo red > color
-hg commit -A -m "1 red"
-
-hg update 0
-echo black > color
-hg commit -A -m "2 black"
-
-hg update --clean 1
-echo blue > color
-hg commit -A -m "3 blue"
-
-hg grep --all red
--- a/tests/test-grep.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-% pattern error
-grep: invalid match pattern: nothing to repeat
-% simple
-port:4:export
-port:4:vaportight
-port:4:import/export
-% simple with color
-port:4:export
-port:4:vaportight
-port:4:import/export
-% all
-port:4:4:-:spam:import/export
-port:3:4:+:eggs:import/export
-port:2:1:-:spam:import
-port:2:2:-:spam:export
-port:2:1:+:spam:export
-port:2:2:+:spam:vaportight
-port:2:3:+:spam:import/export
-port:1:2:+:eggs:export
-port:0:1:+:spam:import
-% other
-port:4:import/export
-% follow
-port:0:import
-port2:6:4:+:eggs:deport
-port:4:4:-:spam:import/export
-port:3:4:+:eggs:import/export
-port:2:1:-:spam:import
-port:2:2:-:spam:export
-port:2:1:+:spam:export
-port:2:2:+:spam:vaportight
-port:2:3:+:spam:import/export
-port:1:2:+:eggs:export
-port:0:1:+:spam:import
-color:3:orange
-color:3:+:orange
-color:2:-:orange
-color:1:+:orange
-% match in last line without newline
-adding noeol
-% last character omitted in output to avoid infinite loop
-noeol:4:no infinite loo
-% issue 685
-adding color
-colour:1:octarine
-color:0:octarine
-colour:1:octarine
-% issue 337
-adding color
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-color:3:-:red
-color:1:+:red
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-grep.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,167 @@
+  $ mkdir t
+  $ cd t
+  $ hg init
+  $ echo import > port
+  $ hg add port
+  $ hg commit -m 0 -u spam -d '0 0'
+  $ echo export >> port
+  $ hg commit -m 1 -u eggs -d '1 0'
+  $ echo export > port
+  $ echo vaportight >> port
+  $ echo 'import/export' >> port
+  $ hg commit -m 2 -u spam -d '2 0'
+  $ echo 'import/export' >> port
+  $ hg commit -m 3 -u eggs -d '3 0'
+  $ head -n 3 port > port1
+  $ mv port1 port
+  $ hg commit -m 4 -u spam -d '4 0'
+
+pattern error
+
+  $ hg grep '**test**'
+  grep: invalid match pattern: nothing to repeat
+  [1]
+
+simple
+
+  $ hg grep port port
+  port:4:export
+  port:4:vaportight
+  port:4:import/export
+
+simple with color
+
+  $ hg --config extensions.color= grep --config color.mode=ansi \
+  >     --color=always port port
+  port:4:export
+  port:4:vaportight
+  port:4:import/export
+
+all
+
+  $ hg grep --traceback --all -nu port port
+  port:4:4:-:spam:import/export
+  port:3:4:+:eggs:import/export
+  port:2:1:-:spam:import
+  port:2:2:-:spam:export
+  port:2:1:+:spam:export
+  port:2:2:+:spam:vaportight
+  port:2:3:+:spam:import/export
+  port:1:2:+:eggs:export
+  port:0:1:+:spam:import
+
+other
+
+  $ hg grep import port
+  port:4:import/export
+
+  $ hg cp port port2
+  $ hg commit -m 4 -u spam -d '5 0'
+
+follow
+
+  $ hg grep --traceback -f 'import$' port2
+  port:0:import
+  $ echo deport >> port2
+  $ hg commit -m 5 -u eggs -d '6 0'
+  $ hg grep -f --all -nu port port2
+  port2:6:4:+:eggs:deport
+  port:4:4:-:spam:import/export
+  port:3:4:+:eggs:import/export
+  port:2:1:-:spam:import
+  port:2:2:-:spam:export
+  port:2:1:+:spam:export
+  port:2:2:+:spam:vaportight
+  port:2:3:+:spam:import/export
+  port:1:2:+:eggs:export
+  port:0:1:+:spam:import
+
+  $ cd ..
+  $ hg init t2
+  $ cd t2
+  $ hg grep foobar foo
+  [1]
+  $ hg grep foobar
+  [1]
+  $ echo blue >> color
+  $ echo black >> color
+  $ hg add color
+  $ hg ci -m 0
+  $ echo orange >> color
+  $ hg ci -m 1
+  $ echo black > color
+  $ hg ci -m 2
+  $ echo orange >> color
+  $ echo blue >> color
+  $ hg ci -m 3
+  $ hg grep orange
+  color:3:orange
+  $ hg grep --all orange
+  color:3:+:orange
+  color:2:-:orange
+  color:1:+:orange
+
+
+match in last "line" without newline
+
+  $ python -c 'fp = open("noeol", "wb"); fp.write("no infinite loop"); fp.close();'
+  $ hg ci -Amnoeol
+  adding noeol
+
+last character omitted in output to avoid infinite loop
+
+  $ hg grep loop
+  noeol:4:no infinite loo
+
+
+  $ cd ..
+
+Got a traceback when using grep on a single
+revision with renamed files.
+issue 685
+
+  $ hg init issue685
+  $ cd issue685
+  $ echo octarine > color
+  $ hg ci -Amcolor
+  adding color
+  $ hg rename color colour
+  $ hg ci -Am rename
+  $ hg grep octarine
+  colour:1:octarine
+  color:0:octarine
+
+Used to crash here
+
+  $ hg grep -r 1 octarine
+  colour:1:octarine
+  $ cd ..
+
+
+Issue337: test that grep follows parent-child relationships instead
+of just using revision numbers.
+
+  $ hg init issue337
+  $ cd issue337
+
+  $ echo white > color
+  $ hg commit -A -m "0 white"
+  adding color
+
+  $ echo red > color
+  $ hg commit -A -m "1 red"
+
+  $ hg update 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo black > color
+  $ hg commit -A -m "2 black"
+  created new head
+
+  $ hg update --clean 1
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo blue > color
+  $ hg commit -A -m "3 blue"
+
+  $ hg grep --all red
+  color:3:-:red
+  color:1:+:red
--- a/tests/test-hardlinks-safety	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-#!/bin/sh
-
-# some implementations of cp can't create hardlinks
-cat > cp.py <<EOF
-from mercurial import util
-import sys
-util.copyfiles(sys.argv[1], sys.argv[2], hardlink=True)
-EOF
-
-# test hardlinking outside hg
-mkdir x
-echo foo > x/a
-
-python cp.py x y
-echo bar >> y/a
-echo % no diff if hardlink
-diff x/a y/a
-
-# test mq hardlinking
-echo "[extensions]" >> $HGRCPATH
-echo "mq=" >> $HGRCPATH
-
-echo % init
-hg init a
-cd a
-
-hg qimport -n foo - << EOF
-# HG changeset patch
-# Date 1 0
-diff -r 2588a8b53d66 a
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/a	Wed Jul 23 15:54:29 2008 +0200
-@@ -0,0 +1,1 @@
-+a
-EOF
-
-hg qpush
-
-cd ..
-python cp.py a b
-cd b
-
-hg qimport -n bar - << EOF
-# HG changeset patch
-# Date 2 0
-diff -r 2588a8b53d66 a
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/b	Wed Jul 23 15:54:29 2008 +0200
-@@ -0,0 +1,1 @@
-+b
-EOF
-
-hg qpush
-
-cat .hg/patches/status
-echo %
-cat .hg/patches/series
-echo %%%
-cat ../a/.hg/patches/status
-echo %
-cat ../a/.hg/patches/series
-
-# test tags hardlinking
-hg qdel -r qbase:qtip
-
-hg tag -l lfoo
-hg tag foo
-
-cd ..
-python cp.py b c
-cd c
-
-hg tag -l -r 0 lbar
-hg tag -r 0 bar
-echo %%%
-cat .hgtags
-echo %
-cat .hg/localtags
-echo %%%
-cat ../b/.hgtags
-echo %
-cat ../b/.hg/localtags
--- a/tests/test-hardlinks-safety.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-% no diff if hardlink
-% init
-adding foo to series file
-applying foo
-now at: foo
-adding bar to series file
-applying bar
-now at: bar
-430ed4828a74fa4047bc816a25500f7472ab4bfe:foo
-4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c:bar
-%
-foo
-bar
-%%%
-430ed4828a74fa4047bc816a25500f7472ab4bfe:foo
-%
-foo
-patch foo finalized without changeset message
-patch bar finalized without changeset message
-%%%
-4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo
-430ed4828a74fa4047bc816a25500f7472ab4bfe bar
-%
-4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo
-430ed4828a74fa4047bc816a25500f7472ab4bfe lbar
-%%%
-4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo
-%
-4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-hardlinks-safety.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,106 @@
+some implementations of cp can't create hardlinks
+
+  $ cat > cp.py <<EOF
+  > from mercurial import util
+  > import sys
+  > util.copyfiles(sys.argv[1], sys.argv[2], hardlink=True)
+  > EOF
+
+Test hardlinking outside hg:
+
+  $ mkdir x
+  $ echo foo > x/a
+
+  $ python cp.py x y
+  $ echo bar >> y/a
+
+No diff if hardlink:
+
+  $ diff x/a y/a
+
+Test mq hardlinking:
+
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "mq=" >> $HGRCPATH
+
+  $ hg init a
+  $ cd a
+
+  $ hg qimport -n foo - << EOF
+  > # HG changeset patch
+  > # Date 1 0
+  > diff -r 2588a8b53d66 a
+  > --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  > +++ b/a	Wed Jul 23 15:54:29 2008 +0200
+  > @@ -0,0 +1,1 @@
+  > +a
+  > EOF
+  adding foo to series file
+
+  $ hg qpush
+  applying foo
+  now at: foo
+
+  $ cd ..
+  $ python cp.py a b
+  $ cd b
+
+  $ hg qimport -n bar - << EOF
+  > # HG changeset patch
+  > # Date 2 0
+  > diff -r 2588a8b53d66 a
+  > --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  > +++ b/b	Wed Jul 23 15:54:29 2008 +0200
+  > @@ -0,0 +1,1 @@
+  > +b
+  > EOF
+  adding bar to series file
+
+  $ hg qpush
+  applying bar
+  now at: bar
+
+  $ cat .hg/patches/status
+  430ed4828a74fa4047bc816a25500f7472ab4bfe:foo
+  4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c:bar
+
+  $ cat .hg/patches/series
+  foo
+  bar
+
+  $ cat ../a/.hg/patches/status
+  430ed4828a74fa4047bc816a25500f7472ab4bfe:foo
+
+  $ cat ../a/.hg/patches/series
+  foo
+
+Test tags hardlinking:
+
+  $ hg qdel -r qbase:qtip
+  patch foo finalized without changeset message
+  patch bar finalized without changeset message
+
+  $ hg tag -l lfoo
+  $ hg tag foo
+
+  $ cd ..
+  $ python cp.py b c
+  $ cd c
+
+  $ hg tag -l -r 0 lbar
+  $ hg tag -r 0 bar
+
+  $ cat .hgtags
+  4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo
+  430ed4828a74fa4047bc816a25500f7472ab4bfe bar
+
+  $ cat .hg/localtags
+  4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo
+  430ed4828a74fa4047bc816a25500f7472ab4bfe lbar
+
+  $ cat ../b/.hgtags
+  4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo
+
+  $ cat ../b/.hg/localtags
+  4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo
+
--- a/tests/test-help	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-#!/bin/sh
-
-hg
-hg -q
-hg help
-hg -q help
-
-echo %% test short command list with verbose option
-hg -v help shortlist | sed 's/[(]version [^)]*[)]/(version xxx)/'
-
-hg add -h
-
-echo %% verbose help for add
-hg add -hv
-
-echo %% test help option with version option
-hg add -h --version | sed 's/[(]version [^)]*[)]/(version xxx)/'
-
-hg add --skjdfks
-
-echo %% test ambiguous command help
-hg help ad
-
-echo %% test command without options
-hg help verify
-
-hg help diff
-hg help status
-hg -q help status
-hg help foo
-hg skjdfks
-
-cat > helpext.py <<EOF
-import os
-from mercurial import commands
-
-def nohelp(ui, *args, **kwargs):
-    pass
-
-cmdtable = {
-    "nohelp": (nohelp, [], "hg nohelp"),
-}
-
-commands.norepo += ' nohelp'
-EOF
-abspath=`pwd`/helpext.py
-
-echo '[extensions]' >> $HGRCPATH
-echo "helpext = $abspath" >> $HGRCPATH
-
-echo %% test command with no help text
-hg help nohelp
-
-echo %% test that default list of commands omits extension commands
-hg help
-
-echo %% test list of commands with command with no help text
-hg help helpext
-
-echo %% test a help topic
-hg help revs
-
-exit 0
--- a/tests/test-help.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,678 +0,0 @@
-Mercurial Distributed SCM
-
-basic commands:
-
- add        add the specified files on the next commit
- annotate   show changeset information by line for each file
- clone      make a copy of an existing repository
- commit     commit the specified files or all outstanding changes
- diff       diff repository (or selected files)
- export     dump the header and diffs for one or more changesets
- forget     forget the specified files on the next commit
- init       create a new repository in the given directory
- log        show revision history of entire repository or files
- merge      merge working directory with another revision
- pull       pull changes from the specified source
- push       push changes to the specified destination
- remove     remove the specified files on the next commit
- serve      start stand-alone webserver
- status     show changed files in the working directory
- summary    summarize working directory state
- update     update working directory (or switch revisions)
-
-use "hg help" for the full list of commands or "hg -v" for details
- add        add the specified files on the next commit
- annotate   show changeset information by line for each file
- clone      make a copy of an existing repository
- commit     commit the specified files or all outstanding changes
- diff       diff repository (or selected files)
- export     dump the header and diffs for one or more changesets
- forget     forget the specified files on the next commit
- init       create a new repository in the given directory
- log        show revision history of entire repository or files
- merge      merge working directory with another revision
- pull       pull changes from the specified source
- push       push changes to the specified destination
- remove     remove the specified files on the next commit
- serve      start stand-alone webserver
- status     show changed files in the working directory
- summary    summarize working directory state
- update     update working directory (or switch revisions)
-Mercurial Distributed SCM
-
-list of commands:
-
- add          add the specified files on the next commit
- addremove    add all new files, delete all missing files
- annotate     show changeset information by line for each file
- archive      create an unversioned archive of a repository revision
- backout      reverse effect of earlier changeset
- bisect       subdivision search of changesets
- branch       set or show the current branch name
- branches     list repository named branches
- bundle       create a changegroup file
- cat          output the current or given revision of files
- clone        make a copy of an existing repository
- commit       commit the specified files or all outstanding changes
- copy         mark files as copied for the next commit
- diff         diff repository (or selected files)
- export       dump the header and diffs for one or more changesets
- forget       forget the specified files on the next commit
- grep         search for a pattern in specified files and revisions
- heads        show current repository heads or show branch heads
- help         show help for a given topic or a help overview
- identify     identify the working copy or specified revision
- import       import an ordered set of patches
- incoming     show new changesets found in source
- init         create a new repository in the given directory
- locate       locate files matching specific patterns
- log          show revision history of entire repository or files
- manifest     output the current or given revision of the project manifest
- merge        merge working directory with another revision
- outgoing     show changesets not found in the destination
- parents      show the parents of the working directory or revision
- paths        show aliases for remote repositories
- pull         pull changes from the specified source
- push         push changes to the specified destination
- recover      roll back an interrupted transaction
- remove       remove the specified files on the next commit
- rename       rename files; equivalent of copy + remove
- resolve      redo merges or set/view the merge status of files
- revert       restore individual files or directories to an earlier state
- rollback     roll back the last transaction (dangerous)
- root         print the root (top) of the current working directory
- serve        start stand-alone webserver
- showconfig   show combined config settings from all hgrc files
- status       show changed files in the working directory
- summary      summarize working directory state
- tag          add one or more tags for the current or given revision
- tags         list repository tags
- tip          show the tip revision
- unbundle     apply one or more changegroup files
- update       update working directory (or switch revisions)
- verify       verify the integrity of the repository
- version      output version and copyright information
-
-additional help topics:
-
- config       Configuration Files
- dates        Date Formats
- patterns     File Name Patterns
- environment  Environment Variables
- revisions    Specifying Single Revisions
- multirevs    Specifying Multiple Revisions
- revsets      Specifying Revision Sets
- diffs        Diff Formats
- templating   Template Usage
- urls         URL Paths
- extensions   Using additional features
- hgweb        Configuring hgweb
- glossary     Glossary
-
-use "hg -v help" to show aliases and global options
- add          add the specified files on the next commit
- addremove    add all new files, delete all missing files
- annotate     show changeset information by line for each file
- archive      create an unversioned archive of a repository revision
- backout      reverse effect of earlier changeset
- bisect       subdivision search of changesets
- branch       set or show the current branch name
- branches     list repository named branches
- bundle       create a changegroup file
- cat          output the current or given revision of files
- clone        make a copy of an existing repository
- commit       commit the specified files or all outstanding changes
- copy         mark files as copied for the next commit
- diff         diff repository (or selected files)
- export       dump the header and diffs for one or more changesets
- forget       forget the specified files on the next commit
- grep         search for a pattern in specified files and revisions
- heads        show current repository heads or show branch heads
- help         show help for a given topic or a help overview
- identify     identify the working copy or specified revision
- import       import an ordered set of patches
- incoming     show new changesets found in source
- init         create a new repository in the given directory
- locate       locate files matching specific patterns
- log          show revision history of entire repository or files
- manifest     output the current or given revision of the project manifest
- merge        merge working directory with another revision
- outgoing     show changesets not found in the destination
- parents      show the parents of the working directory or revision
- paths        show aliases for remote repositories
- pull         pull changes from the specified source
- push         push changes to the specified destination
- recover      roll back an interrupted transaction
- remove       remove the specified files on the next commit
- rename       rename files; equivalent of copy + remove
- resolve      redo merges or set/view the merge status of files
- revert       restore individual files or directories to an earlier state
- rollback     roll back the last transaction (dangerous)
- root         print the root (top) of the current working directory
- serve        start stand-alone webserver
- showconfig   show combined config settings from all hgrc files
- status       show changed files in the working directory
- summary      summarize working directory state
- tag          add one or more tags for the current or given revision
- tags         list repository tags
- tip          show the tip revision
- unbundle     apply one or more changegroup files
- update       update working directory (or switch revisions)
- verify       verify the integrity of the repository
- version      output version and copyright information
-
-additional help topics:
-
- config       Configuration Files
- dates        Date Formats
- patterns     File Name Patterns
- environment  Environment Variables
- revisions    Specifying Single Revisions
- multirevs    Specifying Multiple Revisions
- revsets      Specifying Revision Sets
- diffs        Diff Formats
- templating   Template Usage
- urls         URL Paths
- extensions   Using additional features
- hgweb        Configuring hgweb
- glossary     Glossary
-%% test short command list with verbose option
-Mercurial Distributed SCM (version xxx)
-
-Copyright (C) 2005-2010 Matt Mackall <mpm@selenic.com> and others
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-basic commands:
-
- add:
-      add the specified files on the next commit
- annotate, blame:
-      show changeset information by line for each file
- clone:
-      make a copy of an existing repository
- commit, ci:
-      commit the specified files or all outstanding changes
- diff:
-      diff repository (or selected files)
- export:
-      dump the header and diffs for one or more changesets
- forget:
-      forget the specified files on the next commit
- init:
-      create a new repository in the given directory
- log, history:
-      show revision history of entire repository or files
- merge:
-      merge working directory with another revision
- pull:
-      pull changes from the specified source
- push:
-      push changes to the specified destination
- remove, rm:
-      remove the specified files on the next commit
- serve:
-      start stand-alone webserver
- status, st:
-      show changed files in the working directory
- summary, sum:
-      summarize working directory state
- update, up, checkout, co:
-      update working directory (or switch revisions)
-
-global options:
- -R --repository REPO    repository root directory or name of overlay bundle
-                         file
-    --cwd DIR            change working directory
- -y --noninteractive     do not prompt, assume 'yes' for any required answers
- -q --quiet              suppress output
- -v --verbose            enable additional output
-    --config CONFIG [+]  set/override config option (use 'section.name=value')
-    --debug              enable debugging output
-    --debugger           start debugger
-    --encoding ENCODE    set the charset encoding (default: ascii)
-    --encodingmode MODE  set the charset encoding mode (default: strict)
-    --traceback          always print a traceback on exception
-    --time               time how long the command takes
-    --profile            print command execution profile
-    --version            output version information and exit
- -h --help               display help and exit
-
-[+] marked option can be specified multiple times
-
-use "hg help" for the full list of commands
-hg add [OPTION]... [FILE]...
-
-add the specified files on the next commit
-
-    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".
-
-    If no names are given, add all files to the repository.
-
-    Returns 0 if all files are successfully added.
-
-use "hg -v help add" to show verbose help
-
-options:
-
- -I --include PATTERN [+]  include names matching the given patterns
- -X --exclude PATTERN [+]  exclude names matching the given patterns
- -n --dry-run              do not perform actions, just print output
-
-[+] marked option can be specified multiple times
-
-use "hg -v help add" to show global options
-%% verbose help for add
-hg add [OPTION]... [FILE]...
-
-add the specified files on the next commit
-
-    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".
-
-    If no names are given, add all files to the repository.
-
-    An example showing how new (unknown) files are added automatically by "hg
-    add":
-
-      $ ls
-      foo.c
-      $ hg status
-      ? foo.c
-      $ hg add
-      adding foo.c
-      $ hg status
-      A foo.c
-
-    Returns 0 if all files are successfully added.
-
-options:
-
- -I --include PATTERN [+]  include names matching the given patterns
- -X --exclude PATTERN [+]  exclude names matching the given patterns
- -n --dry-run              do not perform actions, just print output
-
-global options:
- -R --repository REPO      repository root directory or name of overlay bundle
-                           file
-    --cwd DIR              change working directory
- -y --noninteractive       do not prompt, assume 'yes' for any required
-                           answers
- -q --quiet                suppress output
- -v --verbose              enable additional output
-    --config CONFIG [+]    set/override config option (use
-                           'section.name=value')
-    --debug                enable debugging output
-    --debugger             start debugger
-    --encoding ENCODE      set the charset encoding (default: ascii)
-    --encodingmode MODE    set the charset encoding mode (default: strict)
-    --traceback            always print a traceback on exception
-    --time                 time how long the command takes
-    --profile              print command execution profile
-    --version              output version information and exit
- -h --help                 display help and exit
-
-[+] marked option can be specified multiple times
-%% test help option with version option
-Mercurial Distributed SCM (version xxx)
-
-Copyright (C) 2005-2010 Matt Mackall <mpm@selenic.com> and others
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-hg add [OPTION]... [FILE]...
-
-add the specified files on the next commit
-
-    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".
-
-    If no names are given, add all files to the repository.
-
-    Returns 0 if all files are successfully added.
-
-use "hg -v help add" to show verbose help
-
-options:
-
- -I --include PATTERN [+]  include names matching the given patterns
- -X --exclude PATTERN [+]  exclude names matching the given patterns
- -n --dry-run              do not perform actions, just print output
-
-[+] marked option can be specified multiple times
-
-use "hg -v help add" to show global options
-hg add: option --skjdfks not recognized
-hg add [OPTION]... [FILE]...
-
-add the specified files on the next commit
-
-    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".
-
-    If no names are given, add all files to the repository.
-
-    Returns 0 if all files are successfully added.
-
-use "hg -v help add" to show verbose help
-
-options:
-
- -I --include PATTERN [+]  include names matching the given patterns
- -X --exclude PATTERN [+]  exclude names matching the given patterns
- -n --dry-run              do not perform actions, just print output
-
-[+] marked option can be specified multiple times
-
-use "hg -v help add" to show global options
-%% test ambiguous command help
-list of commands:
-
- add         add the specified files on the next commit
- addremove   add all new files, delete all missing files
-
-use "hg -v help ad" to show aliases and global options
-%% test command without options
-hg verify
-
-verify the integrity of the repository
-
-    Verify the integrity of the current repository.
-
-    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.
-
-use "hg -v help verify" to show global options
-hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...
-
-diff repository (or selected files)
-
-    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 default
-    to comparing against the working directory's first parent changeset if no
-    revisions are specified.
-
-    When two revision arguments are given, then changes are shown between
-    those revisions. If only one revision is specified then that revision is
-    compared to the working directory, and, when no revisions are specified,
-    the working directory files are compared to its parent.
-
-    Alternatively you can specify -c/--change with a revision to see the
-    changes in that changeset relative to its first parent.
-
-    Without the -a/--text option, diff will avoid generating diffs of files it
-    detects as binary. With -a, diff will generate a diff anyway, probably
-    with undesirable results.
-
-    Use the -g/--git option to generate diffs in the git extended diff format.
-    For more information, read "hg help diffs".
-
-    Returns 0 on success.
-
-options:
-
- -r --rev REV [+]          revision
- -c --change REV           change made by revision
- -a --text                 treat all files as text
- -g --git                  use git extended diff format
-    --nodates              omit dates from diff headers
- -p --show-function        show which function each change is in
-    --reverse              produce a diff that undoes the changes
- -w --ignore-all-space     ignore white space when comparing lines
- -b --ignore-space-change  ignore changes in the amount of white space
- -B --ignore-blank-lines   ignore changes whose lines are all blank
- -U --unified NUM          number of lines of context to show
-    --stat                 output diffstat-style summary of changes
- -I --include PATTERN [+]  include names matching the given patterns
- -X --exclude PATTERN [+]  exclude names matching the given patterns
-
-[+] marked option can be specified multiple times
-
-use "hg -v help diff" to show global options
-hg status [OPTION]... [FILE]...
-
-aliases: st
-
-show changed files in the working directory
-
-    Show status of files in the repository. If names are given, only files
-    that match are shown. Files that are clean or ignored or the source of a
-    copy/move operation, are not listed unless -c/--clean, -i/--ignored,
-    -C/--copies or -A/--all are given. Unless options described with "show
-    only ..." are given, the options -mardu are used.
-
-    Option -q/--quiet hides untracked (unknown and ignored) files unless
-    explicitly requested with -u/--unknown or -i/--ignored.
-
-    NOTE: status may appear to disagree with diff if permissions have changed
-    or a merge has occurred. The standard diff format does not report
-    permission changes and diff only reports changes relative to one merge
-    parent.
-
-    If one revision is given, it is used as the base revision. If two
-    revisions are given, the differences between them are shown. The --change
-    option can also be used as a shortcut to list the changed files of a
-    revision from its first parent.
-
-    The codes used to show the status of files are:
-
-      M = modified
-      A = added
-      R = removed
-      C = clean
-      ! = missing (deleted by non-hg command, but still tracked)
-      ? = not tracked
-      I = ignored
-        = origin of the previous file listed as A (added)
-
-    Returns 0 on success.
-
-options:
-
- -A --all                  show status of all files
- -m --modified             show only modified files
- -a --added                show only added files
- -r --removed              show only removed files
- -d --deleted              show only deleted (but tracked) files
- -c --clean                show only files without changes
- -u --unknown              show only unknown (not tracked) files
- -i --ignored              show only ignored files
- -n --no-status            hide status prefix
- -C --copies               show source of copied files
- -0 --print0               end filenames with NUL, for use with xargs
-    --rev REV [+]          show difference from revision
-    --change REV           list the changed files of a revision
- -I --include PATTERN [+]  include names matching the given patterns
- -X --exclude PATTERN [+]  exclude names matching the given patterns
-
-[+] marked option can be specified multiple times
-
-use "hg -v help status" to show global options
-hg status [OPTION]... [FILE]...
-
-show changed files in the working directory
-hg: unknown command 'foo'
-Mercurial Distributed SCM
-
-basic commands:
-
- add        add the specified files on the next commit
- annotate   show changeset information by line for each file
- clone      make a copy of an existing repository
- commit     commit the specified files or all outstanding changes
- diff       diff repository (or selected files)
- export     dump the header and diffs for one or more changesets
- forget     forget the specified files on the next commit
- init       create a new repository in the given directory
- log        show revision history of entire repository or files
- merge      merge working directory with another revision
- pull       pull changes from the specified source
- push       push changes to the specified destination
- remove     remove the specified files on the next commit
- serve      start stand-alone webserver
- status     show changed files in the working directory
- summary    summarize working directory state
- update     update working directory (or switch revisions)
-
-use "hg help" for the full list of commands or "hg -v" for details
-hg: unknown command 'skjdfks'
-Mercurial Distributed SCM
-
-basic commands:
-
- add        add the specified files on the next commit
- annotate   show changeset information by line for each file
- clone      make a copy of an existing repository
- commit     commit the specified files or all outstanding changes
- diff       diff repository (or selected files)
- export     dump the header and diffs for one or more changesets
- forget     forget the specified files on the next commit
- init       create a new repository in the given directory
- log        show revision history of entire repository or files
- merge      merge working directory with another revision
- pull       pull changes from the specified source
- push       push changes to the specified destination
- remove     remove the specified files on the next commit
- serve      start stand-alone webserver
- status     show changed files in the working directory
- summary    summarize working directory state
- update     update working directory (or switch revisions)
-
-use "hg help" for the full list of commands or "hg -v" for details
-%% test command with no help text
-hg nohelp
-
-(no help text available)
-
-use "hg -v help nohelp" to show global options
-%% test that default list of commands omits extension commands
-Mercurial Distributed SCM
-
-list of commands:
-
- add          add the specified files on the next commit
- addremove    add all new files, delete all missing files
- annotate     show changeset information by line for each file
- archive      create an unversioned archive of a repository revision
- backout      reverse effect of earlier changeset
- bisect       subdivision search of changesets
- branch       set or show the current branch name
- branches     list repository named branches
- bundle       create a changegroup file
- cat          output the current or given revision of files
- clone        make a copy of an existing repository
- commit       commit the specified files or all outstanding changes
- copy         mark files as copied for the next commit
- diff         diff repository (or selected files)
- export       dump the header and diffs for one or more changesets
- forget       forget the specified files on the next commit
- grep         search for a pattern in specified files and revisions
- heads        show current repository heads or show branch heads
- help         show help for a given topic or a help overview
- identify     identify the working copy or specified revision
- import       import an ordered set of patches
- incoming     show new changesets found in source
- init         create a new repository in the given directory
- locate       locate files matching specific patterns
- log          show revision history of entire repository or files
- manifest     output the current or given revision of the project manifest
- merge        merge working directory with another revision
- outgoing     show changesets not found in the destination
- parents      show the parents of the working directory or revision
- paths        show aliases for remote repositories
- pull         pull changes from the specified source
- push         push changes to the specified destination
- recover      roll back an interrupted transaction
- remove       remove the specified files on the next commit
- rename       rename files; equivalent of copy + remove
- resolve      redo merges or set/view the merge status of files
- revert       restore individual files or directories to an earlier state
- rollback     roll back the last transaction (dangerous)
- root         print the root (top) of the current working directory
- serve        start stand-alone webserver
- showconfig   show combined config settings from all hgrc files
- status       show changed files in the working directory
- summary      summarize working directory state
- tag          add one or more tags for the current or given revision
- tags         list repository tags
- tip          show the tip revision
- unbundle     apply one or more changegroup files
- update       update working directory (or switch revisions)
- verify       verify the integrity of the repository
- version      output version and copyright information
-
-enabled extensions:
-
- helpext  (no help text available)
-
-additional help topics:
-
- config       Configuration Files
- dates        Date Formats
- patterns     File Name Patterns
- environment  Environment Variables
- revisions    Specifying Single Revisions
- multirevs    Specifying Multiple Revisions
- revsets      Specifying Revision Sets
- diffs        Diff Formats
- templating   Template Usage
- urls         URL Paths
- extensions   Using additional features
- hgweb        Configuring hgweb
- glossary     Glossary
-
-use "hg -v help" to show aliases and global options
-%% test list of commands with command with no help text
-helpext extension - no help text available
-
-list of commands:
-
- nohelp   (no help text available)
-
-use "hg -v help helpext" to show aliases and global options
-%% test a help topic
-Specifying Single Revisions
-
-    Mercurial supports several ways to specify individual revisions.
-
-    A plain integer is treated as a revision number. Negative integers are
-    treated as sequential offsets from the tip, with -1 denoting the tip, -2
-    denoting the revision prior to the tip, and so forth.
-
-    A 40-digit hexadecimal string is treated as a unique revision identifier.
-
-    A hexadecimal string less than 40 characters long is treated as a unique
-    revision identifier and is referred to as a short-form identifier. A
-    short-form identifier is only valid if it is the prefix of exactly one
-    full-length identifier.
-
-    Any other string is treated as a tag or branch name. A tag name is a
-    symbolic name associated with a revision identifier. A branch name denotes
-    the tipmost revision of that branch. Tag and branch names must not contain
-    the ":" character.
-
-    The reserved name "tip" is a special tag that always identifies the most
-    recent revision.
-
-    The reserved name "null" indicates the null revision. This is the revision
-    of an empty repository, and the parent of revision 0.
-
-    The reserved name "." indicates the working directory parent. If no
-    working directory is checked out, it is equivalent to null. If an
-    uncommitted merge is in progress, "." is the revision of the first parent.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-help.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,753 @@
+Short help:
+
+  $ hg
+  Mercurial Distributed SCM
+  
+  basic commands:
+  
+   add        add the specified files on the next commit
+   annotate   show changeset information by line for each file
+   clone      make a copy of an existing repository
+   commit     commit the specified files or all outstanding changes
+   diff       diff repository (or selected files)
+   export     dump the header and diffs for one or more changesets
+   forget     forget the specified files on the next commit
+   init       create a new repository in the given directory
+   log        show revision history of entire repository or files
+   merge      merge working directory with another revision
+   pull       pull changes from the specified source
+   push       push changes to the specified destination
+   remove     remove the specified files on the next commit
+   serve      start stand-alone webserver
+   status     show changed files in the working directory
+   summary    summarize working directory state
+   update     update working directory (or switch revisions)
+  
+  use "hg help" for the full list of commands or "hg -v" for details
+
+  $ hg -q
+   add        add the specified files on the next commit
+   annotate   show changeset information by line for each file
+   clone      make a copy of an existing repository
+   commit     commit the specified files or all outstanding changes
+   diff       diff repository (or selected files)
+   export     dump the header and diffs for one or more changesets
+   forget     forget the specified files on the next commit
+   init       create a new repository in the given directory
+   log        show revision history of entire repository or files
+   merge      merge working directory with another revision
+   pull       pull changes from the specified source
+   push       push changes to the specified destination
+   remove     remove the specified files on the next commit
+   serve      start stand-alone webserver
+   status     show changed files in the working directory
+   summary    summarize working directory state
+   update     update working directory (or switch revisions)
+
+  $ hg help
+  Mercurial Distributed SCM
+  
+  list of commands:
+  
+   add          add the specified files on the next commit
+   addremove    add all new files, delete all missing files
+   annotate     show changeset information by line for each file
+   archive      create an unversioned archive of a repository revision
+   backout      reverse effect of earlier changeset
+   bisect       subdivision search of changesets
+   branch       set or show the current branch name
+   branches     list repository named branches
+   bundle       create a changegroup file
+   cat          output the current or given revision of files
+   clone        make a copy of an existing repository
+   commit       commit the specified files or all outstanding changes
+   copy         mark files as copied for the next commit
+   diff         diff repository (or selected files)
+   export       dump the header and diffs for one or more changesets
+   forget       forget the specified files on the next commit
+   grep         search for a pattern in specified files and revisions
+   heads        show current repository heads or show branch heads
+   help         show help for a given topic or a help overview
+   identify     identify the working copy or specified revision
+   import       import an ordered set of patches
+   incoming     show new changesets found in source
+   init         create a new repository in the given directory
+   locate       locate files matching specific patterns
+   log          show revision history of entire repository or files
+   manifest     output the current or given revision of the project manifest
+   merge        merge working directory with another revision
+   outgoing     show changesets not found in the destination
+   parents      show the parents of the working directory or revision
+   paths        show aliases for remote repositories
+   pull         pull changes from the specified source
+   push         push changes to the specified destination
+   recover      roll back an interrupted transaction
+   remove       remove the specified files on the next commit
+   rename       rename files; equivalent of copy + remove
+   resolve      redo merges or set/view the merge status of files
+   revert       restore individual files or directories to an earlier state
+   rollback     roll back the last transaction (dangerous)
+   root         print the root (top) of the current working directory
+   serve        start stand-alone webserver
+   showconfig   show combined config settings from all hgrc files
+   status       show changed files in the working directory
+   summary      summarize working directory state
+   tag          add one or more tags for the current or given revision
+   tags         list repository tags
+   tip          show the tip revision
+   unbundle     apply one or more changegroup files
+   update       update working directory (or switch revisions)
+   verify       verify the integrity of the repository
+   version      output version and copyright information
+  
+  additional help topics:
+  
+   config       Configuration Files
+   dates        Date Formats
+   patterns     File Name Patterns
+   environment  Environment Variables
+   revisions    Specifying Single Revisions
+   multirevs    Specifying Multiple Revisions
+   revsets      Specifying Revision Sets
+   diffs        Diff Formats
+   templating   Template Usage
+   urls         URL Paths
+   extensions   Using additional features
+   hgweb        Configuring hgweb
+   glossary     Glossary
+  
+  use "hg -v help" to show aliases and global options
+
+  $ hg -q help
+   add          add the specified files on the next commit
+   addremove    add all new files, delete all missing files
+   annotate     show changeset information by line for each file
+   archive      create an unversioned archive of a repository revision
+   backout      reverse effect of earlier changeset
+   bisect       subdivision search of changesets
+   branch       set or show the current branch name
+   branches     list repository named branches
+   bundle       create a changegroup file
+   cat          output the current or given revision of files
+   clone        make a copy of an existing repository
+   commit       commit the specified files or all outstanding changes
+   copy         mark files as copied for the next commit
+   diff         diff repository (or selected files)
+   export       dump the header and diffs for one or more changesets
+   forget       forget the specified files on the next commit
+   grep         search for a pattern in specified files and revisions
+   heads        show current repository heads or show branch heads
+   help         show help for a given topic or a help overview
+   identify     identify the working copy or specified revision
+   import       import an ordered set of patches
+   incoming     show new changesets found in source
+   init         create a new repository in the given directory
+   locate       locate files matching specific patterns
+   log          show revision history of entire repository or files
+   manifest     output the current or given revision of the project manifest
+   merge        merge working directory with another revision
+   outgoing     show changesets not found in the destination
+   parents      show the parents of the working directory or revision
+   paths        show aliases for remote repositories
+   pull         pull changes from the specified source
+   push         push changes to the specified destination
+   recover      roll back an interrupted transaction
+   remove       remove the specified files on the next commit
+   rename       rename files; equivalent of copy + remove
+   resolve      redo merges or set/view the merge status of files
+   revert       restore individual files or directories to an earlier state
+   rollback     roll back the last transaction (dangerous)
+   root         print the root (top) of the current working directory
+   serve        start stand-alone webserver
+   showconfig   show combined config settings from all hgrc files
+   status       show changed files in the working directory
+   summary      summarize working directory state
+   tag          add one or more tags for the current or given revision
+   tags         list repository tags
+   tip          show the tip revision
+   unbundle     apply one or more changegroup files
+   update       update working directory (or switch revisions)
+   verify       verify the integrity of the repository
+   version      output version and copyright information
+  
+  additional help topics:
+  
+   config       Configuration Files
+   dates        Date Formats
+   patterns     File Name Patterns
+   environment  Environment Variables
+   revisions    Specifying Single Revisions
+   multirevs    Specifying Multiple Revisions
+   revsets      Specifying Revision Sets
+   diffs        Diff Formats
+   templating   Template Usage
+   urls         URL Paths
+   extensions   Using additional features
+   hgweb        Configuring hgweb
+   glossary     Glossary
+
+Test short command list with verbose option
+
+  $ hg -v help shortlist
+  Mercurial Distributed SCM (version *) (glob)
+  
+  Copyright (C) 2005-2010 Matt Mackall <mpm@selenic.com> and others
+  This is free software; see the source for copying conditions. There is NO
+  warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+  
+  basic commands:
+  
+   add:
+        add the specified files on the next commit
+   annotate, blame:
+        show changeset information by line for each file
+   clone:
+        make a copy of an existing repository
+   commit, ci:
+        commit the specified files or all outstanding changes
+   diff:
+        diff repository (or selected files)
+   export:
+        dump the header and diffs for one or more changesets
+   forget:
+        forget the specified files on the next commit
+   init:
+        create a new repository in the given directory
+   log, history:
+        show revision history of entire repository or files
+   merge:
+        merge working directory with another revision
+   pull:
+        pull changes from the specified source
+   push:
+        push changes to the specified destination
+   remove, rm:
+        remove the specified files on the next commit
+   serve:
+        start stand-alone webserver
+   status, st:
+        show changed files in the working directory
+   summary, sum:
+        summarize working directory state
+   update, up, checkout, co:
+        update working directory (or switch revisions)
+  
+  global options:
+   -R --repository REPO    repository root directory or name of overlay bundle
+                           file
+      --cwd DIR            change working directory
+   -y --noninteractive     do not prompt, assume 'yes' for any required answers
+   -q --quiet              suppress output
+   -v --verbose            enable additional output
+      --config CONFIG [+]  set/override config option (use 'section.name=value')
+      --debug              enable debugging output
+      --debugger           start debugger
+      --encoding ENCODE    set the charset encoding (default: ascii)
+      --encodingmode MODE  set the charset encoding mode (default: strict)
+      --traceback          always print a traceback on exception
+      --time               time how long the command takes
+      --profile            print command execution profile
+      --version            output version information and exit
+   -h --help               display help and exit
+  
+  [+] marked option can be specified multiple times
+  
+  use "hg help" for the full list of commands
+
+  $ hg add -h
+  hg add [OPTION]... [FILE]...
+  
+  add the specified files on the next commit
+  
+      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".
+  
+      If no names are given, add all files to the repository.
+  
+      Returns 0 if all files are successfully added.
+  
+  use "hg -v help add" to show verbose help
+  
+  options:
+  
+   -I --include PATTERN [+]  include names matching the given patterns
+   -X --exclude PATTERN [+]  exclude names matching the given patterns
+   -S --subrepos             recurse into subrepositories
+   -n --dry-run              do not perform actions, just print output
+  
+  [+] marked option can be specified multiple times
+  
+  use "hg -v help add" to show global options
+
+Verbose help for add
+
+  $ hg add -hv
+  hg add [OPTION]... [FILE]...
+  
+  add the specified files on the next commit
+  
+      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".
+  
+      If no names are given, add all files to the repository.
+  
+      An example showing how new (unknown) files are added automatically by "hg
+      add":
+  
+        $ ls
+        foo.c
+        $ hg status
+        ? foo.c
+        $ hg add
+        adding foo.c
+        $ hg status
+        A foo.c
+  
+      Returns 0 if all files are successfully added.
+  
+  options:
+  
+   -I --include PATTERN [+]  include names matching the given patterns
+   -X --exclude PATTERN [+]  exclude names matching the given patterns
+   -S --subrepos             recurse into subrepositories
+   -n --dry-run              do not perform actions, just print output
+  
+  global options:
+   -R --repository REPO      repository root directory or name of overlay bundle
+                             file
+      --cwd DIR              change working directory
+   -y --noninteractive       do not prompt, assume 'yes' for any required
+                             answers
+   -q --quiet                suppress output
+   -v --verbose              enable additional output
+      --config CONFIG [+]    set/override config option (use
+                             'section.name=value')
+      --debug                enable debugging output
+      --debugger             start debugger
+      --encoding ENCODE      set the charset encoding (default: ascii)
+      --encodingmode MODE    set the charset encoding mode (default: strict)
+      --traceback            always print a traceback on exception
+      --time                 time how long the command takes
+      --profile              print command execution profile
+      --version              output version information and exit
+   -h --help                 display help and exit
+  
+  [+] marked option can be specified multiple times
+
+Test help option with version option
+
+  $ hg add -h --version
+  Mercurial Distributed SCM (version *) (glob)
+  
+  Copyright (C) 2005-2010 Matt Mackall <mpm@selenic.com> and others
+  This is free software; see the source for copying conditions. There is NO
+  warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+  
+  hg add [OPTION]... [FILE]...
+  
+  add the specified files on the next commit
+  
+      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".
+  
+      If no names are given, add all files to the repository.
+  
+      Returns 0 if all files are successfully added.
+  
+  use "hg -v help add" to show verbose help
+  
+  options:
+  
+   -I --include PATTERN [+]  include names matching the given patterns
+   -X --exclude PATTERN [+]  exclude names matching the given patterns
+   -S --subrepos             recurse into subrepositories
+   -n --dry-run              do not perform actions, just print output
+  
+  [+] marked option can be specified multiple times
+  
+  use "hg -v help add" to show global options
+
+  $ hg add --skjdfks
+  hg add: option --skjdfks not recognized
+  hg add [OPTION]... [FILE]...
+  
+  add the specified files on the next commit
+  
+      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".
+  
+      If no names are given, add all files to the repository.
+  
+      Returns 0 if all files are successfully added.
+  
+  use "hg -v help add" to show verbose help
+  
+  options:
+  
+   -I --include PATTERN [+]  include names matching the given patterns
+   -X --exclude PATTERN [+]  exclude names matching the given patterns
+   -S --subrepos             recurse into subrepositories
+   -n --dry-run              do not perform actions, just print output
+  
+  [+] marked option can be specified multiple times
+  
+  use "hg -v help add" to show global options
+  [255]
+
+Test ambiguous command help
+
+  $ hg help ad
+  list of commands:
+  
+   add         add the specified files on the next commit
+   addremove   add all new files, delete all missing files
+  
+  use "hg -v help ad" to show aliases and global options
+
+Test command without options
+
+  $ hg help verify
+  hg verify
+  
+  verify the integrity of the repository
+  
+      Verify the integrity of the current repository.
+  
+      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.
+  
+  use "hg -v help verify" to show global options
+
+  $ hg help diff
+  hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...
+  
+  diff repository (or selected files)
+  
+      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 default
+      to comparing against the working directory's first parent changeset if no
+      revisions are specified.
+  
+      When two revision arguments are given, then changes are shown between
+      those revisions. If only one revision is specified then that revision is
+      compared to the working directory, and, when no revisions are specified,
+      the working directory files are compared to its parent.
+  
+      Alternatively you can specify -c/--change with a revision to see the
+      changes in that changeset relative to its first parent.
+  
+      Without the -a/--text option, diff will avoid generating diffs of files it
+      detects as binary. With -a, diff will generate a diff anyway, probably
+      with undesirable results.
+  
+      Use the -g/--git option to generate diffs in the git extended diff format.
+      For more information, read "hg help diffs".
+  
+      Returns 0 on success.
+  
+  options:
+  
+   -r --rev REV [+]          revision
+   -c --change REV           change made by revision
+   -a --text                 treat all files as text
+   -g --git                  use git extended diff format
+      --nodates              omit dates from diff headers
+   -p --show-function        show which function each change is in
+      --reverse              produce a diff that undoes the changes
+   -w --ignore-all-space     ignore white space when comparing lines
+   -b --ignore-space-change  ignore changes in the amount of white space
+   -B --ignore-blank-lines   ignore changes whose lines are all blank
+   -U --unified NUM          number of lines of context to show
+      --stat                 output diffstat-style summary of changes
+   -I --include PATTERN [+]  include names matching the given patterns
+   -X --exclude PATTERN [+]  exclude names matching the given patterns
+   -S --subrepos             recurse into subrepositories
+  
+  [+] marked option can be specified multiple times
+  
+  use "hg -v help diff" to show global options
+
+  $ hg help status
+  hg status [OPTION]... [FILE]...
+  
+  aliases: st
+  
+  show changed files in the working directory
+  
+      Show status of files in the repository. If names are given, only files
+      that match are shown. Files that are clean or ignored or the source of a
+      copy/move operation, are not listed unless -c/--clean, -i/--ignored,
+      -C/--copies or -A/--all are given. Unless options described with "show
+      only ..." are given, the options -mardu are used.
+  
+      Option -q/--quiet hides untracked (unknown and ignored) files unless
+      explicitly requested with -u/--unknown or -i/--ignored.
+  
+      NOTE: status may appear to disagree with diff if permissions have changed
+      or a merge has occurred. The standard diff format does not report
+      permission changes and diff only reports changes relative to one merge
+      parent.
+  
+      If one revision is given, it is used as the base revision. If two
+      revisions are given, the differences between them are shown. The --change
+      option can also be used as a shortcut to list the changed files of a
+      revision from its first parent.
+  
+      The codes used to show the status of files are:
+  
+        M = modified
+        A = added
+        R = removed
+        C = clean
+        ! = missing (deleted by non-hg command, but still tracked)
+        ? = not tracked
+        I = ignored
+          = origin of the previous file listed as A (added)
+  
+      Returns 0 on success.
+  
+  options:
+  
+   -A --all                  show status of all files
+   -m --modified             show only modified files
+   -a --added                show only added files
+   -r --removed              show only removed files
+   -d --deleted              show only deleted (but tracked) files
+   -c --clean                show only files without changes
+   -u --unknown              show only unknown (not tracked) files
+   -i --ignored              show only ignored files
+   -n --no-status            hide status prefix
+   -C --copies               show source of copied files
+   -0 --print0               end filenames with NUL, for use with xargs
+      --rev REV [+]          show difference from revision
+      --change REV           list the changed files of a revision
+   -I --include PATTERN [+]  include names matching the given patterns
+   -X --exclude PATTERN [+]  exclude names matching the given patterns
+   -S --subrepos             recurse into subrepositories
+  
+  [+] marked option can be specified multiple times
+  
+  use "hg -v help status" to show global options
+
+  $ hg -q help status
+  hg status [OPTION]... [FILE]...
+  
+  show changed files in the working directory
+
+  $ hg help foo
+  hg: unknown command 'foo'
+  Mercurial Distributed SCM
+  
+  basic commands:
+  
+   add        add the specified files on the next commit
+   annotate   show changeset information by line for each file
+   clone      make a copy of an existing repository
+   commit     commit the specified files or all outstanding changes
+   diff       diff repository (or selected files)
+   export     dump the header and diffs for one or more changesets
+   forget     forget the specified files on the next commit
+   init       create a new repository in the given directory
+   log        show revision history of entire repository or files
+   merge      merge working directory with another revision
+   pull       pull changes from the specified source
+   push       push changes to the specified destination
+   remove     remove the specified files on the next commit
+   serve      start stand-alone webserver
+   status     show changed files in the working directory
+   summary    summarize working directory state
+   update     update working directory (or switch revisions)
+  
+  use "hg help" for the full list of commands or "hg -v" for details
+  [255]
+
+  $ hg skjdfks
+  hg: unknown command 'skjdfks'
+  Mercurial Distributed SCM
+  
+  basic commands:
+  
+   add        add the specified files on the next commit
+   annotate   show changeset information by line for each file
+   clone      make a copy of an existing repository
+   commit     commit the specified files or all outstanding changes
+   diff       diff repository (or selected files)
+   export     dump the header and diffs for one or more changesets
+   forget     forget the specified files on the next commit
+   init       create a new repository in the given directory
+   log        show revision history of entire repository or files
+   merge      merge working directory with another revision
+   pull       pull changes from the specified source
+   push       push changes to the specified destination
+   remove     remove the specified files on the next commit
+   serve      start stand-alone webserver
+   status     show changed files in the working directory
+   summary    summarize working directory state
+   update     update working directory (or switch revisions)
+  
+  use "hg help" for the full list of commands or "hg -v" for details
+  [255]
+
+  $ cat > helpext.py <<EOF
+  > import os
+  > from mercurial import commands
+  > 
+  > def nohelp(ui, *args, **kwargs):
+  >     pass
+  > 
+  > cmdtable = {
+  >     "nohelp": (nohelp, [], "hg nohelp"),
+  > }
+  > 
+  > commands.norepo += ' nohelp'
+  > EOF
+  $ echo '[extensions]' >> $HGRCPATH
+  $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH
+
+Test command with no help text
+
+  $ hg help nohelp
+  hg nohelp
+  
+  (no help text available)
+  
+  use "hg -v help nohelp" to show global options
+
+Test that default list of commands omits extension commands
+
+  $ hg help
+  Mercurial Distributed SCM
+  
+  list of commands:
+  
+   add          add the specified files on the next commit
+   addremove    add all new files, delete all missing files
+   annotate     show changeset information by line for each file
+   archive      create an unversioned archive of a repository revision
+   backout      reverse effect of earlier changeset
+   bisect       subdivision search of changesets
+   branch       set or show the current branch name
+   branches     list repository named branches
+   bundle       create a changegroup file
+   cat          output the current or given revision of files
+   clone        make a copy of an existing repository
+   commit       commit the specified files or all outstanding changes
+   copy         mark files as copied for the next commit
+   diff         diff repository (or selected files)
+   export       dump the header and diffs for one or more changesets
+   forget       forget the specified files on the next commit
+   grep         search for a pattern in specified files and revisions
+   heads        show current repository heads or show branch heads
+   help         show help for a given topic or a help overview
+   identify     identify the working copy or specified revision
+   import       import an ordered set of patches
+   incoming     show new changesets found in source
+   init         create a new repository in the given directory
+   locate       locate files matching specific patterns
+   log          show revision history of entire repository or files
+   manifest     output the current or given revision of the project manifest
+   merge        merge working directory with another revision
+   outgoing     show changesets not found in the destination
+   parents      show the parents of the working directory or revision
+   paths        show aliases for remote repositories
+   pull         pull changes from the specified source
+   push         push changes to the specified destination
+   recover      roll back an interrupted transaction
+   remove       remove the specified files on the next commit
+   rename       rename files; equivalent of copy + remove
+   resolve      redo merges or set/view the merge status of files
+   revert       restore individual files or directories to an earlier state
+   rollback     roll back the last transaction (dangerous)
+   root         print the root (top) of the current working directory
+   serve        start stand-alone webserver
+   showconfig   show combined config settings from all hgrc files
+   status       show changed files in the working directory
+   summary      summarize working directory state
+   tag          add one or more tags for the current or given revision
+   tags         list repository tags
+   tip          show the tip revision
+   unbundle     apply one or more changegroup files
+   update       update working directory (or switch revisions)
+   verify       verify the integrity of the repository
+   version      output version and copyright information
+  
+  enabled extensions:
+  
+   helpext  (no help text available)
+  
+  additional help topics:
+  
+   config       Configuration Files
+   dates        Date Formats
+   patterns     File Name Patterns
+   environment  Environment Variables
+   revisions    Specifying Single Revisions
+   multirevs    Specifying Multiple Revisions
+   revsets      Specifying Revision Sets
+   diffs        Diff Formats
+   templating   Template Usage
+   urls         URL Paths
+   extensions   Using additional features
+   hgweb        Configuring hgweb
+   glossary     Glossary
+  
+  use "hg -v help" to show aliases and global options
+
+Test list of commands with command with no help text
+
+  $ hg help helpext
+  helpext extension - no help text available
+  
+  list of commands:
+  
+   nohelp   (no help text available)
+  
+  use "hg -v help helpext" to show aliases and global options
+
+Test a help topic
+
+  $ hg help revs
+  Specifying Single Revisions
+  
+      Mercurial supports several ways to specify individual revisions.
+  
+      A plain integer is treated as a revision number. Negative integers are
+      treated as sequential offsets from the tip, with -1 denoting the tip, -2
+      denoting the revision prior to the tip, and so forth.
+  
+      A 40-digit hexadecimal string is treated as a unique revision identifier.
+  
+      A hexadecimal string less than 40 characters long is treated as a unique
+      revision identifier and is referred to as a short-form identifier. A
+      short-form identifier is only valid if it is the prefix of exactly one
+      full-length identifier.
+  
+      Any other string is treated as a tag or branch name. A tag name is a
+      symbolic name associated with a revision identifier. A branch name denotes
+      the tipmost revision of that branch. Tag and branch names must not contain
+      the ":" character.
+  
+      The reserved name "tip" is a special tag that always identifies the most
+      recent revision.
+  
+      The reserved name "null" indicates the null revision. This is the revision
+      of an empty repository, and the parent of revision 0.
+  
+      The reserved name "." indicates the working directory parent. If no
+      working directory is checked out, it is equivalent to null. If an
+      uncommitted merge is in progress, "." is the revision of the first parent.
--- a/tests/test-hgignore	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-#!/bin/sh
-
-hg init
-
-# Test issue 562: .hgignore requires newline at end
-touch foo
-touch bar
-touch baz
-cat > makeignore.py <<EOF
-f = open(".hgignore", "w")
-f.write("ignore\n")
-f.write("foo\n")
-# No EOL here
-f.write("bar")
-f.close()
-EOF
-
-python makeignore.py
-echo % should display baz only
-hg status
-rm foo bar baz .hgignore makeignore.py
-
-touch a.o
-touch a.c
-touch syntax
-mkdir dir
-touch dir/a.o
-touch dir/b.o
-touch dir/c.o
-
-hg add dir/a.o
-hg commit -m 0
-hg add dir/b.o
-
-echo "--" ; hg status
-
-echo "*.o" > .hgignore
-echo "--" ; hg status 2>&1 | sed -e 's/abort: .*\.hgignore:/abort: .hgignore:/'
-
-echo ".*\.o" > .hgignore
-echo "--" ; hg status
-
-# Check it does not ignore the current directory '.'
-echo "^\." > .hgignore
-echo "--" ; hg status
-
-echo "glob:**.o" > .hgignore
-echo "--" ; hg status
-
-echo "glob:*.o" > .hgignore
-echo "--" ; hg status
-
-echo "syntax: glob" > .hgignore
-echo "re:.*\.o" >> .hgignore
-echo "--" ; hg status
-
-echo "syntax: invalid" > .hgignore
-echo "--" ; hg status 2>&1 | sed -e 's/.*\.hgignore:/.hgignore:/'
-
-echo "syntax: glob" > .hgignore
-echo "*.o" >> .hgignore
-echo "--" ; hg status
-
-echo "relglob:syntax*" > .hgignore
-echo "--" ; hg status
-
-echo "relglob:*" > .hgignore
-echo "--" ; hg status
-
-cd dir
-echo "--" ; hg status .
--- a/tests/test-hgignore.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-% should display baz only
-? baz
---
-A dir/b.o
-? a.c
-? a.o
-? dir/c.o
-? syntax
---
-abort: .hgignore: invalid pattern (relre): *.o
---
-A dir/b.o
-? .hgignore
-? a.c
-? syntax
---
-A dir/b.o
-? a.c
-? a.o
-? dir/c.o
-? syntax
---
-A dir/b.o
-? .hgignore
-? a.c
-? syntax
---
-A dir/b.o
-? .hgignore
-? a.c
-? syntax
---
-A dir/b.o
-? .hgignore
-? a.c
-? syntax
---
-.hgignore: ignoring invalid syntax 'invalid'
-A dir/b.o
-? .hgignore
-? a.c
-? a.o
-? dir/c.o
-? syntax
---
-A dir/b.o
-? .hgignore
-? a.c
-? syntax
---
-A dir/b.o
-? .hgignore
-? a.c
-? a.o
-? dir/c.o
---
-A dir/b.o
---
-A b.o
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-hgignore.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,122 @@
+  $ hg init
+
+Test issue 562: .hgignore requires newline at end:
+
+  $ touch foo
+  $ touch bar
+  $ touch baz
+  $ cat > makeignore.py <<EOF
+  > f = open(".hgignore", "w")
+  > f.write("ignore\n")
+  > f.write("foo\n")
+  > # No EOL here
+  > f.write("bar")
+  > f.close()
+  > EOF
+
+  $ python makeignore.py
+
+Should display baz only:
+
+  $ hg status
+  ? baz
+
+  $ rm foo bar baz .hgignore makeignore.py
+
+  $ touch a.o
+  $ touch a.c
+  $ touch syntax
+  $ mkdir dir
+  $ touch dir/a.o
+  $ touch dir/b.o
+  $ touch dir/c.o
+
+  $ hg add dir/a.o
+  $ hg commit -m 0
+  $ hg add dir/b.o
+
+  $ hg status
+  A dir/b.o
+  ? a.c
+  ? a.o
+  ? dir/c.o
+  ? syntax
+
+  $ echo "*.o" > .hgignore
+  $ hg status
+  abort: */.hgignore: invalid pattern (relre): \*.o (glob)
+  [255]
+
+  $ echo ".*\.o" > .hgignore
+  $  hg status
+  A dir/b.o
+  ? .hgignore
+  ? a.c
+  ? syntax
+
+Check it does not ignore the current directory '.':
+
+  $ echo "^\." > .hgignore
+  $ hg status
+  A dir/b.o
+  ? a.c
+  ? a.o
+  ? dir/c.o
+  ? syntax
+
+  $ echo "glob:**.o" > .hgignore
+  $ hg status
+  A dir/b.o
+  ? .hgignore
+  ? a.c
+  ? syntax
+
+  $ echo "glob:*.o" > .hgignore
+  $ hg status
+  A dir/b.o
+  ? .hgignore
+  ? a.c
+  ? syntax
+
+  $ echo "syntax: glob" > .hgignore
+  $ echo "re:.*\.o" >> .hgignore
+  $ hg status
+  A dir/b.o
+  ? .hgignore
+  ? a.c
+  ? syntax
+
+  $ echo "syntax: invalid" > .hgignore
+  $ hg status
+  */.hgignore: ignoring invalid syntax 'invalid' (glob)
+  A dir/b.o
+  ? .hgignore
+  ? a.c
+  ? a.o
+  ? dir/c.o
+  ? syntax
+
+  $ echo "syntax: glob" > .hgignore
+  $ echo "*.o" >> .hgignore
+  $ hg status
+  A dir/b.o
+  ? .hgignore
+  ? a.c
+  ? syntax
+
+  $ echo "relglob:syntax*" > .hgignore
+  $ hg status
+  A dir/b.o
+  ? .hgignore
+  ? a.c
+  ? a.o
+  ? dir/c.o
+
+  $ echo "relglob:*" > .hgignore
+  $ hg status
+  A dir/b.o
+
+  $ cd dir
+  $ hg status .
+  A b.o
+
--- a/tests/test-hgrc	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-#!/bin/sh
-
-echo "invalid" > $HGRCPATH
-hg version 2>&1 | sed -e "s|$HGRCPATH|\$HGRCPATH|"
-echo "" > $HGRCPATH
-
-# issue1199: escaping
-hg init "foo%bar"
-hg clone "foo%bar" foobar
-p=`pwd`
-cd foobar
-cat .hg/hgrc | sed -e "s:$p:...:"
-hg paths | sed -e "s:$p:...:"
-hg showconfig | sed -e "s:$p:...:"
-cd ..
-
-# issue1829: wrong indentation
-echo '[foo]' > $HGRCPATH
-echo '  x = y' >> $HGRCPATH
-hg version 2>&1 | sed -e "s|$HGRCPATH|\$HGRCPATH|"
-
-python -c "print '[foo]\nbar = a\n b\n c \n  de\n fg \nbaz = bif cb \n'" \
-    > $HGRCPATH
-hg showconfig foo
-
-FAKEPATH=/path/to/nowhere
-export FAKEPATH
-echo '%include $FAKEPATH/no-such-file' > $HGRCPATH
-hg version 2>&1 | sed -e "s|$HGRCPATH|\$HGRCPATH|"
-unset FAKEPATH
-
-echo "% username expansion"
-olduser=$HGUSER
-unset HGUSER
-
-FAKEUSER='John Doe'
-export FAKEUSER
-echo '[ui]' > $HGRCPATH
-echo 'username = $FAKEUSER' >> $HGRCPATH
-
-hg init usertest
-cd usertest
-touch bar
-hg commit --addremove --quiet -m "added bar"
-hg log --template "{author}\n"
-cd ..
-
-hg showconfig | sed -e "s:$p:...:"
-
-unset FAKEUSER
-HGUSER=$olduser
-export HGUSER
-
-# HGPLAIN
-cd ..
-p=`pwd`
-echo "[ui]" > $HGRCPATH
-echo "debug=true" >> $HGRCPATH
-echo "fallbackencoding=ASCII" >> $HGRCPATH
-echo "quiet=true" >> $HGRCPATH
-echo "slash=true" >> $HGRCPATH
-echo "traceback=true" >> $HGRCPATH
-echo "verbose=true" >> $HGRCPATH
-echo "style=~/.hgstyle" >> $HGRCPATH
-echo "logtemplate={node}" >> $HGRCPATH
-echo "[defaults]" >> $HGRCPATH
-echo "identify=-n" >> $HGRCPATH
-echo "[alias]" >> $HGRCPATH
-echo "log=log -g" >> $HGRCPATH
-
-echo '% customized hgrc'
-hg showconfig | sed -e "s:$p:...:"
-
-echo '% plain hgrc'
-HGPLAIN=; export HGPLAIN
-hg showconfig --config ui.traceback=True --debug | sed -e "s:$p:...:"
--- a/tests/test-hgrc.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-hg: parse error at $HGRCPATH:1: invalid
-updating to branch default
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-[paths]
-default = .../foo%bar
-default = .../foo%bar
-bundle.mainreporoot=.../foobar
-paths.default=.../foo%bar
-hg: parse error at $HGRCPATH:2:   x = y
-foo.bar=a\nb\nc\nde\nfg
-foo.baz=bif cb
-hg: parse error at $HGRCPATH:1: cannot include /path/to/nowhere/no-such-file (No such file or directory)
-% username expansion
-John Doe
-ui.username=$FAKEUSER
-% customized hgrc
-read config from: .../.hgrc
-.../.hgrc:13: alias.log=log -g
-.../.hgrc:11: defaults.identify=-n
-.../.hgrc:2: ui.debug=true
-.../.hgrc:3: ui.fallbackencoding=ASCII
-.../.hgrc:4: ui.quiet=true
-.../.hgrc:5: ui.slash=true
-.../.hgrc:6: ui.traceback=true
-.../.hgrc:7: ui.verbose=true
-.../.hgrc:8: ui.style=~/.hgstyle
-.../.hgrc:9: ui.logtemplate={node}
-% plain hgrc
-read config from: .../.hgrc
-none: ui.traceback=True
-none: ui.verbose=False
-none: ui.debug=True
-none: ui.quiet=False
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-hgrc.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,113 @@
+  $ echo "invalid" > $HGRCPATH
+  $ hg version
+  hg: parse error at */.hgrc:1: invalid (glob)
+  [255]
+  $ echo "" > $HGRCPATH
+
+issue1199: escaping
+
+  $ hg init "foo%bar"
+  $ hg clone "foo%bar" foobar
+  updating to branch default
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ p=`pwd`
+  $ cd foobar
+  $ cat .hg/hgrc
+  [paths]
+  default = */foo%bar (glob)
+  $ hg paths
+  default = */foo%bar (glob)
+  $ hg showconfig
+  bundle.mainreporoot=*/foobar (glob)
+  paths.default=*/foo%bar (glob)
+  $ cd ..
+
+issue1829: wrong indentation
+
+  $ echo '[foo]' > $HGRCPATH
+  $ echo '  x = y' >> $HGRCPATH
+  $ hg version
+  hg: parse error at */.hgrc:2:   x = y (glob)
+  [255]
+
+  $ python -c "print '[foo]\nbar = a\n b\n c \n  de\n fg \nbaz = bif cb \n'" \
+  > > $HGRCPATH
+  $ hg showconfig foo
+  foo.bar=a\nb\nc\nde\nfg
+  foo.baz=bif cb
+
+  $ FAKEPATH=/path/to/nowhere
+  $ export FAKEPATH
+  $ echo '%include $FAKEPATH/no-such-file' > $HGRCPATH
+  $ hg version
+  hg: parse error at */.hgrc:1: cannot include /path/to/nowhere/no-such-file (No such file or directory) (glob)
+  [255]
+  $ unset FAKEPATH
+
+username expansion
+
+  $ olduser=$HGUSER
+  $ unset HGUSER
+
+  $ FAKEUSER='John Doe'
+  $ export FAKEUSER
+  $ echo '[ui]' > $HGRCPATH
+  $ echo 'username = $FAKEUSER' >> $HGRCPATH
+
+  $ hg init usertest
+  $ cd usertest
+  $ touch bar
+  $ hg commit --addremove --quiet -m "added bar"
+  $ hg log --template "{author}\n"
+  John Doe
+  $ cd ..
+
+  $ hg showconfig
+  ui.username=$FAKEUSER
+
+  $ unset FAKEUSER
+  $ HGUSER=$olduser
+  $ export HGUSER
+
+HGPLAIN
+
+  $ cd ..
+  $ p=`pwd`
+  $ echo "[ui]" > $HGRCPATH
+  $ echo "debug=true" >> $HGRCPATH
+  $ echo "fallbackencoding=ASCII" >> $HGRCPATH
+  $ echo "quiet=true" >> $HGRCPATH
+  $ echo "slash=true" >> $HGRCPATH
+  $ echo "traceback=true" >> $HGRCPATH
+  $ echo "verbose=true" >> $HGRCPATH
+  $ echo "style=~/.hgstyle" >> $HGRCPATH
+  $ echo "logtemplate={node}" >> $HGRCPATH
+  $ echo "[defaults]" >> $HGRCPATH
+  $ echo "identify=-n" >> $HGRCPATH
+  $ echo "[alias]" >> $HGRCPATH
+  $ echo "log=log -g" >> $HGRCPATH
+
+customized hgrc
+
+  $ hg showconfig
+  read config from: */.hgrc (glob)
+  */.hgrc:13: alias.log=log -g (glob)
+  */.hgrc:11: defaults.identify=-n (glob)
+  */.hgrc:2: ui.debug=true (glob)
+  */.hgrc:3: ui.fallbackencoding=ASCII (glob)
+  */.hgrc:4: ui.quiet=true (glob)
+  */.hgrc:5: ui.slash=true (glob)
+  */.hgrc:6: ui.traceback=true (glob)
+  */.hgrc:7: ui.verbose=true (glob)
+  */.hgrc:8: ui.style=~/.hgstyle (glob)
+  */.hgrc:9: ui.logtemplate={node} (glob)
+
+plain hgrc
+
+  $ HGPLAIN=; export HGPLAIN
+  $ hg showconfig --config ui.traceback=True --debug
+  read config from: */.hgrc (glob)
+  none: ui.traceback=True
+  none: ui.verbose=False
+  none: ui.debug=True
+  none: ui.quiet=False
--- a/tests/test-hgweb	Wed Sep 22 17:13:49 2010 -0500
+++ b/tests/test-hgweb	Wed Sep 22 18:29:41 2010 -0500
@@ -43,7 +43,7 @@
 python -c "print len(file('access.log').readlines()), 'log lines written'"
 
 echo % static file
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/static/style-gitweb.css'
+"$TESTDIR/get-with-headers.py" --twice localhost:$HGPORT '/static/style-gitweb.css'
 
 echo % errors
 cat errors.log
--- a/tests/test-hgweb-commands	Wed Sep 22 17:13:49 2010 -0500
+++ b/tests/test-hgweb-commands	Wed Sep 22 18:29:41 2010 -0500
@@ -46,11 +46,11 @@
 echo % heads
 "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=heads'
 echo % lookup
-"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=lookup&node=1'
+"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=lookup&key=1'
 echo % branches
-"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=branches'
+"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=branches&nodes=0000000000000000000000000000000000000000'
 echo % changegroup
-"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=changegroup' \
+"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=changegroup&roots=0000000000000000000000000000000000000000' \
     | $TESTDIR/printrepr.py
 echo % stream_out
 "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=stream_out'
--- a/tests/test-hgweb-commands.out	Wed Sep 22 17:13:49 2010 -0500
+++ b/tests/test-hgweb-commands.out	Wed Sep 22 18:29:41 2010 -0500
@@ -852,11 +852,11 @@
 % lookup
 200 Script output follows
 
-0 'key'
+1 a4f92ed23982be056b9852de5dfe873eaac7f0de
 % branches
 200 Script output follows
 
-1d22e65f027e5a0609357e7d8e7508cd2ba5d2fe 2ef0ac749a14e4f57a5a822464a0902c6f7f448f 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
+0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
 % changegroup
 200 Script output follows
 
--- a/tests/test-hgweb-no-path-info	Wed Sep 22 17:13:49 2010 -0500
+++ b/tests/test-hgweb-no-path-info	Wed Sep 22 18:29:41 2010 -0500
@@ -8,7 +8,7 @@
 hg init
 echo foo > bar
 hg add bar
-hg commit -m "test" -u "Testing"
+hg commit -m "test"
 hg tip
 
 cat > request.py <<EOF
@@ -19,11 +19,12 @@
 errors = StringIO()
 input = StringIO()
 
-def startrsp(headers, data):
+def startrsp(status, headers):
+	print '---- STATUS'
+	print status
 	print '---- HEADERS'
-	print headers
+	print [i for i in headers if i[0] != 'ETag']
 	print '---- DATA'
-	print data
 	return output.write
 
 env = {
--- a/tests/test-hgweb-no-path-info.out	Wed Sep 22 17:13:49 2010 -0500
+++ b/tests/test-hgweb-no-path-info.out	Wed Sep 22 18:29:41 2010 -0500
@@ -1,13 +1,14 @@
-changeset:   0:4cbec7e6f8c4
+changeset:   0:61c9426e69fe
 tag:         tip
-user:        Testing
+user:        test
 date:        Thu Jan 01 00:00:00 1970 +0000
 summary:     test
 
----- HEADERS
+---- STATUS
 200 Script output follows
+---- HEADERS
+[('Content-Type', 'application/atom+xml; charset=ascii')]
 ---- DATA
-[('Content-Type', 'application/atom+xml; charset=ascii')]
 <?xml version="1.0" encoding="ascii"?>
 <feed xmlns="http://www.w3.org/2005/Atom">
  <!-- Changelog -->
@@ -19,11 +20,11 @@
 
  <entry>
   <title>test</title>
-  <id>http://127.0.0.1/#changeset-4cbec7e6f8c42eb52b6b52670e1f7560ae9a101e</id>
-  <link href="http://127.0.0.1/rev/4cbec7e6f8c4"/>
+  <id>http://127.0.0.1/#changeset-61c9426e69fef294feed5e2bbfc97d39944a5b1c</id>
+  <link href="http://127.0.0.1/rev/61c9426e69fe"/>
   <author>
-   <name>Testing</name>
-   <email>&#84;&#101;&#115;&#116;&#105;&#110;&#103;</email>
+   <name>test</name>
+   <email>&#116;&#101;&#115;&#116;</email>
   </author>
   <updated>1970-01-01T00:00:00+00:00</updated>
   <published>1970-01-01T00:00:00+00:00</published>
@@ -37,10 +38,11 @@
 </feed>
 ---- ERRORS
 
----- HEADERS
+---- STATUS
 200 Script output follows
+---- HEADERS
+[('Content-Type', 'text/plain; charset=ascii')]
 ---- DATA
-[('Content-Type', 'text/plain; charset=ascii')]
 
 repo/
 
--- a/tests/test-hgweb-no-request-uri	Wed Sep 22 17:13:49 2010 -0500
+++ b/tests/test-hgweb-no-request-uri	Wed Sep 22 18:29:41 2010 -0500
@@ -8,7 +8,7 @@
 hg init
 echo foo > bar
 hg add bar
-hg commit -m "test" -u "Testing"
+hg commit -m "test"
 hg tip
 
 cat > request.py <<EOF
@@ -19,11 +19,12 @@
 errors = StringIO()
 input = StringIO()
 
-def startrsp(headers, data):
+def startrsp(status, headers):
+	print '---- STATUS'
+	print status
 	print '---- HEADERS'
-	print headers
+	print [i for i in headers if i[0] != 'ETag']
 	print '---- DATA'
-	print data
 	return output.write
 
 env = {
--- a/tests/test-hgweb-no-request-uri.out	Wed Sep 22 17:13:49 2010 -0500
+++ b/tests/test-hgweb-no-request-uri.out	Wed Sep 22 18:29:41 2010 -0500
@@ -1,13 +1,14 @@
-changeset:   0:4cbec7e6f8c4
+changeset:   0:61c9426e69fe
 tag:         tip
-user:        Testing
+user:        test
 date:        Thu Jan 01 00:00:00 1970 +0000
 summary:     test
 
----- HEADERS
+---- STATUS
 200 Script output follows
+---- HEADERS
+[('Content-Type', 'application/atom+xml; charset=ascii')]
 ---- DATA
-[('Content-Type', 'application/atom+xml; charset=ascii')]
 <?xml version="1.0" encoding="ascii"?>
 <feed xmlns="http://www.w3.org/2005/Atom">
  <!-- Changelog -->
@@ -19,11 +20,11 @@
 
  <entry>
   <title>test</title>
-  <id>http://127.0.0.1/#changeset-4cbec7e6f8c42eb52b6b52670e1f7560ae9a101e</id>
-  <link href="http://127.0.0.1/rev/4cbec7e6f8c4"/>
+  <id>http://127.0.0.1/#changeset-61c9426e69fef294feed5e2bbfc97d39944a5b1c</id>
+  <link href="http://127.0.0.1/rev/61c9426e69fe"/>
   <author>
-   <name>Testing</name>
-   <email>&#84;&#101;&#115;&#116;&#105;&#110;&#103;</email>
+   <name>test</name>
+   <email>&#116;&#101;&#115;&#116;</email>
   </author>
   <updated>1970-01-01T00:00:00+00:00</updated>
   <published>1970-01-01T00:00:00+00:00</published>
@@ -37,29 +38,32 @@
 </feed>
 ---- ERRORS
 
----- HEADERS
+---- STATUS
 200 Script output follows
+---- HEADERS
+[('Content-Type', 'text/plain; charset=ascii')]
 ---- DATA
-[('Content-Type', 'text/plain; charset=ascii')]
 
 -rw-r--r-- 4 bar
 
 
 ---- ERRORS
 
----- HEADERS
+---- STATUS
 200 Script output follows
+---- HEADERS
+[('Content-Type', 'text/plain; charset=ascii')]
 ---- DATA
-[('Content-Type', 'text/plain; charset=ascii')]
 
 /repo/
 
 ---- ERRORS
 
----- HEADERS
+---- STATUS
 200 Script output follows
+---- HEADERS
+[('Content-Type', 'text/plain; charset=ascii')]
 ---- DATA
-[('Content-Type', 'text/plain; charset=ascii')]
 
 -rw-r--r-- 4 bar
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-hgweb-non-interactive	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,74 @@
+#!/bin/sh
+# Tests if hgweb can run without touching sys.stdin, as is required
+# by the WSGI standard and strictly implemented by mod_wsgi.
+
+mkdir repo
+cd repo
+hg init
+echo foo > bar
+hg add bar
+hg commit -m "test"
+hg tip
+
+cat > request.py <<EOF
+from mercurial import dispatch
+from mercurial.hgweb.hgweb_mod import hgweb
+from mercurial.ui import ui
+from mercurial import hg
+from StringIO import StringIO
+import os, sys
+
+class FileLike(object):
+    def __init__(self, real):
+        self.real = real
+    def fileno(self):
+        print >> sys.__stdout__, 'FILENO'
+        return self.real.fileno()
+    def read(self):
+        print >> sys.__stdout__, 'READ'
+        return self.real.read()
+    def readline(self):
+        print >> sys.__stdout__, 'READLINE'
+        return self.real.readline()
+
+sys.stdin = FileLike(sys.stdin)
+errors = StringIO()
+input = StringIO()
+output = StringIO()
+
+def startrsp(status, headers):
+	print '---- STATUS'
+	print status
+	print '---- HEADERS'
+	print [i for i in headers if i[0] != 'ETag']
+	print '---- DATA'
+	return output.write
+
+env = {
+	'wsgi.version': (1, 0),
+	'wsgi.url_scheme': 'http',
+	'wsgi.errors': errors,
+	'wsgi.input': input,
+	'wsgi.multithread': False,
+	'wsgi.multiprocess': False,
+	'wsgi.run_once': False,
+	'REQUEST_METHOD': 'GET',
+	'SCRIPT_NAME': '',
+	'PATH_INFO': '',
+	'QUERY_STRING': '',
+	'SERVER_NAME': '127.0.0.1',
+	'SERVER_PORT': os.environ['HGPORT'],
+	'SERVER_PROTOCOL': 'HTTP/1.0'
+}
+
+i = hgweb('.')
+i(env, startrsp)
+print '---- ERRORS'
+print errors.getvalue()
+print '---- OS.ENVIRON wsgi variables'
+print sorted([x for x in os.environ if x.startswith('wsgi')])
+print '---- request.ENVIRON wsgi variables'
+print sorted([x for x in i.repo.ui.environ if x.startswith('wsgi')])
+EOF
+
+python request.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-hgweb-non-interactive.out	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,17 @@
+changeset:   0:61c9426e69fe
+tag:         tip
+user:        test
+date:        Thu Jan 01 00:00:00 1970 +0000
+summary:     test
+
+---- STATUS
+200 Script output follows
+---- HEADERS
+[('Content-Type', 'text/html; charset=ascii')]
+---- DATA
+---- ERRORS
+
+---- OS.ENVIRON wsgi variables
+[]
+---- request.ENVIRON wsgi variables
+['wsgi.errors', 'wsgi.input', 'wsgi.multiprocess', 'wsgi.multithread', 'wsgi.run_once', 'wsgi.url_scheme', 'wsgi.version']
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-hgweb-raw	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+hg init test
+cd test
+mkdir sub
+cat >'sub/some "text".txt' <<ENDSOME
+This is just some random text
+that will go inside the file and take a few lines.
+It is very boring to read, but computers don't
+care about things like that.
+ENDSOME
+hg add 'sub/some "text".txt'
+hg commit -d "1 0" -m "Just some text"
+hg serve -p $HGPORT -A access.log -E error.log -d --pid-file=hg.pid
+cat hg.pid >> $DAEMON_PIDS
+("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/?f=a23bf1310f6e;file=sub/some%20%22text%22.txt;style=raw' content-type content-length content-disposition) >getoutput.txt &
+
+sleep 5
+kill `cat hg.pid`
+sleep 1 # wait for server to scream and die
+cat getoutput.txt
+cat access.log error.log | \
+  sed 's/^[^ ]*\( [^[]*\[\)[^]]*\(\].*\)$/host\1date\2/'
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-hgweb-raw.out	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,10 @@
+200 Script output follows
+content-type: text/plain; charset="ascii"
+content-length: 157
+content-disposition: inline; filename="some \"text\".txt"
+
+This is just some random text
+that will go inside the file and take a few lines.
+It is very boring to read, but computers don't
+care about things like that.
+host - - [date] "GET /?f=a23bf1310f6e;file=sub/some%20%22text%22.txt;style=raw HTTP/1.1" 200 -
--- a/tests/test-hgweb.out	Wed Sep 22 17:13:49 2010 -0500
+++ b/tests/test-hgweb.out	Wed Sep 22 18:29:41 2010 -0500
@@ -365,4 +365,6 @@
 	top: -3px;
 	font-style: italic;
 }
+304 Not Modified
+
 % errors
--- a/tests/test-hook	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,273 +0,0 @@
-#!/bin/sh
-
-cp "$TESTDIR"/printenv.py .
-
-# commit hooks can see env vars
-hg init a
-cd a
-echo "[hooks]" > .hg/hgrc
-echo 'commit = unset HG_LOCAL HG_TAG; python ../printenv.py commit' >> .hg/hgrc
-echo 'commit.b = unset HG_LOCAL HG_TAG; python ../printenv.py commit.b' >> .hg/hgrc
-echo 'precommit = unset HG_LOCAL HG_NODE HG_TAG; python ../printenv.py precommit' >> .hg/hgrc
-echo 'pretxncommit = unset HG_LOCAL HG_TAG; python ../printenv.py pretxncommit' >> .hg/hgrc
-echo 'pretxncommit.tip = hg -q tip' >> .hg/hgrc
-echo 'pre-identify = python ../printenv.py pre-identify 1' >> .hg/hgrc
-echo 'pre-cat = python ../printenv.py pre-cat' >> .hg/hgrc
-echo 'post-cat = python ../printenv.py post-cat' >> .hg/hgrc
-echo a > a
-hg add a
-hg commit -m a -d "1000000 0"
-
-hg clone . ../b
-cd ../b
-
-# changegroup hooks can see env vars
-echo '[hooks]' > .hg/hgrc
-echo 'prechangegroup = python ../printenv.py prechangegroup' >> .hg/hgrc
-echo 'changegroup = python ../printenv.py changegroup' >> .hg/hgrc
-echo 'incoming = python ../printenv.py incoming' >> .hg/hgrc
-
-# pretxncommit and commit hooks can see both parents of merge
-cd ../a
-echo b >> a
-hg commit -m a1 -d "1 0"
-hg update -C 0
-echo b > b
-hg add b
-hg commit -m b -d '1 0'
-hg merge 1
-hg commit -m merge -d '2 0'
-
-# test generic hooks
-hg id
-hg cat b
-
-cd ../b
-hg pull ../a
-
-# tag hooks can see env vars
-cd ../a
-echo 'pretag = python ../printenv.py pretag' >> .hg/hgrc
-echo 'tag = unset HG_PARENT1 HG_PARENT2; python ../printenv.py tag' >> .hg/hgrc
-hg tag -d '3 0' a
-hg tag -l la
-
-# pretag hook can forbid tagging
-echo 'pretag.forbid = python ../printenv.py pretag.forbid 1' >> .hg/hgrc
-hg tag -d '4 0' fa
-hg tag -l fla
-
-# pretxncommit hook can see changeset, can roll back txn, changeset
-# no more there after
-echo 'pretxncommit.forbid0 = hg tip -q' >> .hg/hgrc
-echo 'pretxncommit.forbid1 = python ../printenv.py pretxncommit.forbid 1' >> .hg/hgrc
-echo z > z
-hg add z
-hg -q tip
-hg commit -m 'fail' -d '4 0'
-hg -q tip
-
-# precommit hook can prevent commit
-echo 'precommit.forbid = python ../printenv.py precommit.forbid 1' >> .hg/hgrc
-hg commit -m 'fail' -d '4 0'
-hg -q tip
-
-# preupdate hook can prevent update
-echo 'preupdate = python ../printenv.py preupdate' >> .hg/hgrc
-hg update 1
-
-# update hook
-echo 'update = python ../printenv.py update' >> .hg/hgrc
-hg update
-
-# prechangegroup hook can prevent incoming changes
-cd ../b
-hg -q tip
-echo '[hooks]' > .hg/hgrc
-echo 'prechangegroup.forbid = python ../printenv.py prechangegroup.forbid 1' >> .hg/hgrc
-hg pull ../a
-
-# pretxnchangegroup hook can see incoming changes, can roll back txn,
-# incoming changes no longer there after
-echo '[hooks]' > .hg/hgrc
-echo 'pretxnchangegroup.forbid0 = hg tip -q' >> .hg/hgrc
-echo 'pretxnchangegroup.forbid1 = python ../printenv.py pretxnchangegroup.forbid 1' >> .hg/hgrc
-hg pull ../a
-hg -q tip
-
-# outgoing hooks can see env vars
-rm .hg/hgrc
-echo '[hooks]' > ../a/.hg/hgrc
-echo 'preoutgoing = python ../printenv.py preoutgoing' >> ../a/.hg/hgrc
-echo 'outgoing = python ../printenv.py outgoing' >> ../a/.hg/hgrc
-hg pull ../a
-hg rollback
-
-# preoutgoing hook can prevent outgoing changes
-echo 'preoutgoing.forbid = python ../printenv.py preoutgoing.forbid 1' >> ../a/.hg/hgrc
-hg pull ../a
-
-# outgoing hooks work for local clones
-cd ..
-echo '[hooks]' > a/.hg/hgrc
-echo 'preoutgoing = python ../printenv.py preoutgoing' >> a/.hg/hgrc
-echo 'outgoing = python ../printenv.py outgoing' >> a/.hg/hgrc
-hg clone a c
-rm -rf c
-
-# preoutgoing hook can prevent outgoing changes for local clones
-echo 'preoutgoing.forbid = python ../printenv.py preoutgoing.forbid 1' >> a/.hg/hgrc
-hg clone a zzz
-cd b
-
-cat > hooktests.py <<EOF
-from mercurial import util
-
-uncallable = 0
-
-def printargs(args):
-    args.pop('ui', None)
-    args.pop('repo', None)
-    a = list(args.items())
-    a.sort()
-    print 'hook args:'
-    for k, v in a:
-       print ' ', k, v
-
-def passhook(**args):
-    printargs(args)
-
-def failhook(**args):
-    printargs(args)
-    return True
-
-class LocalException(Exception):
-    pass
-
-def raisehook(**args):
-    raise LocalException('exception from hook')
-
-def aborthook(**args):
-    raise util.Abort('raise abort from hook')
-
-def brokenhook(**args):
-    return 1 + {}
-
-class container:
-    unreachable = 1
-EOF
-
-echo '# test python hooks'
-PYTHONPATH="`pwd`:$PYTHONPATH"
-export PYTHONPATH
-
-echo '[hooks]' > ../a/.hg/hgrc
-echo 'preoutgoing.broken = python:hooktests.brokenhook' >> ../a/.hg/hgrc
-hg pull ../a 2>&1 | grep 'raised an exception'
-
-echo '[hooks]' > ../a/.hg/hgrc
-echo 'preoutgoing.raise = python:hooktests.raisehook' >> ../a/.hg/hgrc
-hg pull ../a 2>&1 | grep 'raised an exception'
-
-echo '[hooks]' > ../a/.hg/hgrc
-echo 'preoutgoing.abort = python:hooktests.aborthook' >> ../a/.hg/hgrc
-hg pull ../a
-
-echo '[hooks]' > ../a/.hg/hgrc
-echo 'preoutgoing.fail = python:hooktests.failhook' >> ../a/.hg/hgrc
-hg pull ../a
-
-echo '[hooks]' > ../a/.hg/hgrc
-echo 'preoutgoing.uncallable = python:hooktests.uncallable' >> ../a/.hg/hgrc
-hg pull ../a
-
-echo '[hooks]' > ../a/.hg/hgrc
-echo 'preoutgoing.nohook = python:hooktests.nohook' >> ../a/.hg/hgrc
-hg pull ../a
-
-echo '[hooks]' > ../a/.hg/hgrc
-echo 'preoutgoing.nomodule = python:nomodule' >> ../a/.hg/hgrc
-hg pull ../a
-
-echo '[hooks]' > ../a/.hg/hgrc
-echo 'preoutgoing.badmodule = python:nomodule.nowhere' >> ../a/.hg/hgrc
-hg pull ../a
-
-echo '[hooks]' > ../a/.hg/hgrc
-echo 'preoutgoing.unreachable = python:hooktests.container.unreachable' >> ../a/.hg/hgrc
-hg pull ../a
-
-echo '[hooks]' > ../a/.hg/hgrc
-echo 'preoutgoing.pass = python:hooktests.passhook' >> ../a/.hg/hgrc
-hg pull ../a
-
-echo '# make sure --traceback works'
-echo '[hooks]' > .hg/hgrc
-echo 'commit.abort = python:hooktests.aborthook' >> .hg/hgrc
-
-echo aa > a
-hg --traceback commit -d '0 0' -ma 2>&1 | grep '^Traceback'
-
-cd ..
-hg init c
-cd c
-
-cat > hookext.py <<EOF
-def autohook(**args):
-    print "Automatically installed hook"
-
-def reposetup(ui, repo):
-    repo.ui.setconfig("hooks", "commit.auto", autohook)
-EOF
-echo '[extensions]' >> .hg/hgrc
-echo 'hookext = hookext.py' >> .hg/hgrc
-
-touch foo
-hg add foo
-hg ci -d '0 0' -m 'add foo'
-echo >> foo
-hg ci --debug -d '0 0' -m 'change foo' | sed -e 's/ at .*>/>/'
-
-hg showconfig hooks | sed -e 's/ at .*>/>/'
-
-echo '# test python hook configured with python:[file]:[hook] syntax'
-cd ..
-mkdir d
-cd d
-hg init repo
-mkdir hooks
-
-cd hooks
-cat > testhooks.py <<EOF
-def testhook(**args):
-    print 'hook works'
-EOF
-echo '[hooks]' > ../repo/.hg/hgrc
-echo "pre-commit.test = python:`pwd`/testhooks.py:testhook" >> ../repo/.hg/hgrc
-
-cd ../repo
-hg commit -d '0 0'
-
-cd ../../b
-echo '# make sure --traceback works on hook import failure'
-cat > importfail.py <<EOF
-import somebogusmodule
-# dereference something in the module to force demandimport to load it
-somebogusmodule.whatever
-EOF
-
-echo '[hooks]' > .hg/hgrc
-echo 'precommit.importfail = python:importfail.whatever' >> .hg/hgrc
-
-echo a >> a
-hg --traceback commit -d '0 0' -ma 2>&1 | egrep '^(exception|Traceback|ImportError)'
-
-echo '# commit and update hooks should run after command completion (issue 1827)'
-echo '[hooks]' > .hg/hgrc
-echo 'commit = hg id' >> .hg/hgrc
-echo 'update = hg id' >> .hg/hgrc
-echo bb > a
-hg ci -d '0 0' -ma
-hg up 0
-
-exit 0
--- a/tests/test-hook.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,177 +0,0 @@
-precommit hook: HG_PARENT1=0000000000000000000000000000000000000000 
-pretxncommit hook: HG_NODE=29b62aeb769fdf78d8d9c5f28b017f76d7ef824b HG_PARENT1=0000000000000000000000000000000000000000 HG_PENDING=$HGTMP/test-hook/a 
-0:29b62aeb769f
-commit hook: HG_NODE=29b62aeb769fdf78d8d9c5f28b017f76d7ef824b HG_PARENT1=0000000000000000000000000000000000000000 
-commit.b hook: HG_NODE=29b62aeb769fdf78d8d9c5f28b017f76d7ef824b HG_PARENT1=0000000000000000000000000000000000000000 
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-precommit hook: HG_PARENT1=29b62aeb769fdf78d8d9c5f28b017f76d7ef824b 
-pretxncommit hook: HG_NODE=b702efe9688826e3a91283852b328b84dbf37bc2 HG_PARENT1=29b62aeb769fdf78d8d9c5f28b017f76d7ef824b HG_PENDING=$HGTMP/test-hook/a 
-1:b702efe96888
-commit hook: HG_NODE=b702efe9688826e3a91283852b328b84dbf37bc2 HG_PARENT1=29b62aeb769fdf78d8d9c5f28b017f76d7ef824b 
-commit.b hook: HG_NODE=b702efe9688826e3a91283852b328b84dbf37bc2 HG_PARENT1=29b62aeb769fdf78d8d9c5f28b017f76d7ef824b 
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-precommit hook: HG_PARENT1=29b62aeb769fdf78d8d9c5f28b017f76d7ef824b 
-pretxncommit hook: HG_NODE=1324a5531bac09b329c3845d35ae6a7526874edb HG_PARENT1=29b62aeb769fdf78d8d9c5f28b017f76d7ef824b HG_PENDING=$HGTMP/test-hook/a 
-2:1324a5531bac
-commit hook: HG_NODE=1324a5531bac09b329c3845d35ae6a7526874edb HG_PARENT1=29b62aeb769fdf78d8d9c5f28b017f76d7ef824b 
-commit.b hook: HG_NODE=1324a5531bac09b329c3845d35ae6a7526874edb HG_PARENT1=29b62aeb769fdf78d8d9c5f28b017f76d7ef824b 
-created new head
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-precommit hook: HG_PARENT1=1324a5531bac09b329c3845d35ae6a7526874edb HG_PARENT2=b702efe9688826e3a91283852b328b84dbf37bc2 
-pretxncommit hook: HG_NODE=4c52fb2e402287dd5dc052090682536c8406c321 HG_PARENT1=1324a5531bac09b329c3845d35ae6a7526874edb HG_PARENT2=b702efe9688826e3a91283852b328b84dbf37bc2 HG_PENDING=$HGTMP/test-hook/a 
-3:4c52fb2e4022
-commit hook: HG_NODE=4c52fb2e402287dd5dc052090682536c8406c321 HG_PARENT1=1324a5531bac09b329c3845d35ae6a7526874edb HG_PARENT2=b702efe9688826e3a91283852b328b84dbf37bc2 
-commit.b hook: HG_NODE=4c52fb2e402287dd5dc052090682536c8406c321 HG_PARENT1=1324a5531bac09b329c3845d35ae6a7526874edb HG_PARENT2=b702efe9688826e3a91283852b328b84dbf37bc2 
-pre-identify hook: HG_ARGS=id HG_OPTS={'tags': None, 'rev': '', 'num': None, 'branch': None, 'id': None} HG_PATS=[] 
-warning: pre-identify hook exited with status 1
-pre-cat hook: HG_ARGS=cat b HG_OPTS={'rev': '', 'decode': None, 'exclude': [], 'output': '', 'include': []} HG_PATS=['b'] 
-post-cat hook: HG_ARGS=cat b HG_OPTS={'rev': '', 'decode': None, 'exclude': [], 'output': '', 'include': []} HG_PATS=['b'] HG_RESULT=0 
-b
-prechangegroup hook: HG_SOURCE=pull HG_URL=file: 
-changegroup hook: HG_NODE=b702efe9688826e3a91283852b328b84dbf37bc2 HG_SOURCE=pull HG_URL=file: 
-incoming hook: HG_NODE=b702efe9688826e3a91283852b328b84dbf37bc2 HG_SOURCE=pull HG_URL=file: 
-incoming hook: HG_NODE=1324a5531bac09b329c3845d35ae6a7526874edb HG_SOURCE=pull HG_URL=file: 
-incoming hook: HG_NODE=4c52fb2e402287dd5dc052090682536c8406c321 HG_SOURCE=pull HG_URL=file: 
-pulling from ../a
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 3 changesets with 2 changes to 2 files
-(run 'hg update' to get a working copy)
-pretag hook: HG_LOCAL=0 HG_NODE=4c52fb2e402287dd5dc052090682536c8406c321 HG_TAG=a 
-precommit hook: HG_PARENT1=4c52fb2e402287dd5dc052090682536c8406c321 
-pretxncommit hook: HG_NODE=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 HG_PARENT1=4c52fb2e402287dd5dc052090682536c8406c321 HG_PENDING=$HGTMP/test-hook/a 
-4:8ea2ef7ad3e8
-commit hook: HG_NODE=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 HG_PARENT1=4c52fb2e402287dd5dc052090682536c8406c321 
-commit.b hook: HG_NODE=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 HG_PARENT1=4c52fb2e402287dd5dc052090682536c8406c321 
-tag hook: HG_LOCAL=0 HG_NODE=4c52fb2e402287dd5dc052090682536c8406c321 HG_TAG=a 
-pretag hook: HG_LOCAL=1 HG_NODE=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 HG_TAG=la 
-tag hook: HG_LOCAL=1 HG_NODE=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 HG_TAG=la 
-pretag hook: HG_LOCAL=0 HG_NODE=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 HG_TAG=fa 
-pretag.forbid hook: HG_LOCAL=0 HG_NODE=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 HG_TAG=fa 
-abort: pretag.forbid hook exited with status 1
-pretag hook: HG_LOCAL=1 HG_NODE=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 HG_TAG=fla 
-pretag.forbid hook: HG_LOCAL=1 HG_NODE=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 HG_TAG=fla 
-abort: pretag.forbid hook exited with status 1
-4:8ea2ef7ad3e8
-precommit hook: HG_PARENT1=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 
-pretxncommit hook: HG_NODE=fad284daf8c032148abaffcd745dafeceefceb61 HG_PARENT1=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 HG_PENDING=$HGTMP/test-hook/a 
-5:fad284daf8c0
-5:fad284daf8c0
-pretxncommit.forbid hook: HG_NODE=fad284daf8c032148abaffcd745dafeceefceb61 HG_PARENT1=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 HG_PENDING=$HGTMP/test-hook/a 
-transaction abort!
-rollback completed
-abort: pretxncommit.forbid1 hook exited with status 1
-4:8ea2ef7ad3e8
-precommit hook: HG_PARENT1=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 
-precommit.forbid hook: HG_PARENT1=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 
-abort: precommit.forbid hook exited with status 1
-4:8ea2ef7ad3e8
-preupdate hook: HG_PARENT1=b702efe96888 
-0 files updated, 0 files merged, 2 files removed, 0 files unresolved
-preupdate hook: HG_PARENT1=8ea2ef7ad3e8 
-update hook: HG_ERROR=0 HG_PARENT1=8ea2ef7ad3e8 
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-3:4c52fb2e4022
-prechangegroup.forbid hook: HG_SOURCE=pull HG_URL=file: 
-pulling from ../a
-searching for changes
-abort: prechangegroup.forbid hook exited with status 1
-4:8ea2ef7ad3e8
-pretxnchangegroup.forbid hook: HG_NODE=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 HG_PENDING=$HGTMP/test-hook/b HG_SOURCE=pull HG_URL=file: 
-pulling from ../a
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-transaction abort!
-rollback completed
-abort: pretxnchangegroup.forbid1 hook exited with status 1
-3:4c52fb2e4022
-preoutgoing hook: HG_SOURCE=pull 
-outgoing hook: HG_NODE=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 HG_SOURCE=pull 
-pulling from ../a
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-(run 'hg update' to get a working copy)
-rolling back to revision 3 (undo pull)
-preoutgoing hook: HG_SOURCE=pull 
-preoutgoing.forbid hook: HG_SOURCE=pull 
-pulling from ../a
-searching for changes
-abort: preoutgoing.forbid hook exited with status 1
-preoutgoing hook: HG_SOURCE=clone 
-outgoing hook: HG_NODE=0000000000000000000000000000000000000000 HG_SOURCE=clone 
-updating to branch default
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-preoutgoing hook: HG_SOURCE=clone 
-preoutgoing.forbid hook: HG_SOURCE=clone 
-abort: preoutgoing.forbid hook exited with status 1
-# test python hooks
-error: preoutgoing.broken hook raised an exception: unsupported operand type(s) for +: 'int' and 'dict'
-error: preoutgoing.raise hook raised an exception: exception from hook
-pulling from ../a
-searching for changes
-error: preoutgoing.abort hook failed: raise abort from hook
-abort: raise abort from hook
-pulling from ../a
-searching for changes
-hook args:
-  hooktype preoutgoing
-  source pull
-abort: preoutgoing.fail hook failed
-pulling from ../a
-searching for changes
-abort: preoutgoing.uncallable hook is invalid ("hooktests.uncallable" is not callable)
-pulling from ../a
-searching for changes
-abort: preoutgoing.nohook hook is invalid ("hooktests.nohook" is not defined)
-pulling from ../a
-searching for changes
-abort: preoutgoing.nomodule hook is invalid ("nomodule" not in a module)
-pulling from ../a
-searching for changes
-abort: preoutgoing.badmodule hook is invalid (import of "nomodule" failed)
-pulling from ../a
-searching for changes
-abort: preoutgoing.unreachable hook is invalid (import of "hooktests.container" failed)
-pulling from ../a
-searching for changes
-hook args:
-  hooktype preoutgoing
-  source pull
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-(run 'hg update' to get a working copy)
-# make sure --traceback works
-Traceback (most recent call last):
-Automatically installed hook
-foo
-calling hook commit.auto: <function autohook>
-Automatically installed hook
-committed changeset 1:52998019f6252a2b893452765fcb0a47351a5708
-hooks.commit.auto=<function autohook>
-# test python hook configured with python:[file]:[hook] syntax
-hook works
-nothing changed
-# make sure --traceback works on hook import failure
-exception from first failed import attempt:
-Traceback (most recent call last):
-ImportError: No module named somebogusmodule
-exception from second failed import attempt:
-Traceback (most recent call last):
-ImportError: No module named hgext_importfail
-Traceback (most recent call last):
-# commit and update hooks should run after command completion (issue 1827)
-8da618c33484 tip
-29b62aeb769f
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-hook.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,481 @@
+  $ cp "$TESTDIR"/printenv.py .
+
+commit hooks can see env vars
+
+  $ hg init a
+  $ cd a
+  $ echo "[hooks]" > .hg/hgrc
+  $ echo 'commit = unset HG_LOCAL HG_TAG; python ../printenv.py commit' >> .hg/hgrc
+  $ echo 'commit.b = unset HG_LOCAL HG_TAG; python ../printenv.py commit.b' >> .hg/hgrc
+  $ echo 'precommit = unset HG_LOCAL HG_NODE HG_TAG; python ../printenv.py precommit' >> .hg/hgrc
+  $ echo 'pretxncommit = unset HG_LOCAL HG_TAG; python ../printenv.py pretxncommit' >> .hg/hgrc
+  $ echo 'pretxncommit.tip = hg -q tip' >> .hg/hgrc
+  $ echo 'pre-identify = python ../printenv.py pre-identify 1' >> .hg/hgrc
+  $ echo 'pre-cat = python ../printenv.py pre-cat' >> .hg/hgrc
+  $ echo 'post-cat = python ../printenv.py post-cat' >> .hg/hgrc
+  $ echo a > a
+  $ hg add a
+  $ hg commit -m a
+  precommit hook: HG_PARENT1=0000000000000000000000000000000000000000 
+  pretxncommit hook: HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000 HG_PENDING=$HGTMP/test-hook.t/a 
+  0:cb9a9f314b8b
+  commit hook: HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000 
+  commit.b hook: HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000 
+
+  $ hg clone . ../b
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd ../b
+
+changegroup hooks can see env vars
+
+  $ echo '[hooks]' > .hg/hgrc
+  $ echo 'prechangegroup = python ../printenv.py prechangegroup' >> .hg/hgrc
+  $ echo 'changegroup = python ../printenv.py changegroup' >> .hg/hgrc
+  $ echo 'incoming = python ../printenv.py incoming' >> .hg/hgrc
+
+pretxncommit and commit hooks can see both parents of merge
+
+  $ cd ../a
+  $ echo b >> a
+  $ hg commit -m a1 -d "1 0"
+  precommit hook: HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b 
+  pretxncommit hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PENDING=$HGTMP/test-hook.t/a 
+  1:ab228980c14d
+  commit hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b 
+  commit.b hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b 
+  $ hg update -C 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo b > b
+  $ hg add b
+  $ hg commit -m b -d '1 0'
+  precommit hook: HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b 
+  pretxncommit hook: HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PENDING=$HGTMP/test-hook.t/a 
+  2:ee9deb46ab31
+  commit hook: HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b 
+  commit.b hook: HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b 
+  created new head
+  $ hg merge 1
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg commit -m merge -d '2 0'
+  precommit hook: HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd 
+  pretxncommit hook: HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd HG_PENDING=$HGTMP/test-hook.t/a 
+  3:07f3376c1e65
+  commit hook: HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd 
+  commit.b hook: HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd 
+
+test generic hooks
+
+  $ hg id
+  pre-identify hook: HG_ARGS=id HG_OPTS={'tags': None, 'rev': '', 'num': None, 'branch': None, 'id': None} HG_PATS=[] 
+  warning: pre-identify hook exited with status 1
+  [1]
+  $ hg cat b
+  pre-cat hook: HG_ARGS=cat b HG_OPTS={'rev': '', 'decode': None, 'exclude': [], 'output': '', 'include': []} HG_PATS=['b'] 
+  post-cat hook: HG_ARGS=cat b HG_OPTS={'rev': '', 'decode': None, 'exclude': [], 'output': '', 'include': []} HG_PATS=['b'] HG_RESULT=0 
+  b
+
+  $ cd ../b
+  $ hg pull ../a
+  prechangegroup hook: HG_SOURCE=pull HG_URL=file: 
+  changegroup hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_SOURCE=pull HG_URL=file: 
+  incoming hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_SOURCE=pull HG_URL=file: 
+  incoming hook: HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_SOURCE=pull HG_URL=file: 
+  incoming hook: HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_SOURCE=pull HG_URL=file: 
+  pulling from ../a
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 3 changesets with 2 changes to 2 files
+  (run 'hg update' to get a working copy)
+
+tag hooks can see env vars
+
+  $ cd ../a
+  $ echo 'pretag = python ../printenv.py pretag' >> .hg/hgrc
+  $ echo 'tag = unset HG_PARENT1 HG_PARENT2; python ../printenv.py tag' >> .hg/hgrc
+  $ hg tag -d '3 0' a
+  pretag hook: HG_LOCAL=0 HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_TAG=a 
+  precommit hook: HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 
+  pretxncommit hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PENDING=$HGTMP/test-hook.t/a 
+  4:539e4b31b6dc
+  commit hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 
+  commit.b hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 
+  tag hook: HG_LOCAL=0 HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_TAG=a 
+  $ hg tag -l la
+  pretag hook: HG_LOCAL=1 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=la 
+  tag hook: HG_LOCAL=1 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=la 
+
+pretag hook can forbid tagging
+
+  $ echo 'pretag.forbid = python ../printenv.py pretag.forbid 1' >> .hg/hgrc
+  $ hg tag -d '4 0' fa
+  pretag hook: HG_LOCAL=0 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=fa 
+  pretag.forbid hook: HG_LOCAL=0 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=fa 
+  abort: pretag.forbid hook exited with status 1
+  [255]
+  $ hg tag -l fla
+  pretag hook: HG_LOCAL=1 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=fla 
+  pretag.forbid hook: HG_LOCAL=1 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=fla 
+  abort: pretag.forbid hook exited with status 1
+  [255]
+
+pretxncommit hook can see changeset, can roll back txn, changeset no
+more there after
+
+  $ echo 'pretxncommit.forbid0 = hg tip -q' >> .hg/hgrc
+  $ echo 'pretxncommit.forbid1 = python ../printenv.py pretxncommit.forbid 1' >> .hg/hgrc
+  $ echo z > z
+  $ hg add z
+  $ hg -q tip
+  4:539e4b31b6dc
+  $ hg commit -m 'fail' -d '4 0'
+  precommit hook: HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 
+  pretxncommit hook: HG_NODE=6f611f8018c10e827fee6bd2bc807f937e761567 HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$HGTMP/test-hook.t/a 
+  5:6f611f8018c1
+  5:6f611f8018c1
+  pretxncommit.forbid hook: HG_NODE=6f611f8018c10e827fee6bd2bc807f937e761567 HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$HGTMP/test-hook.t/a 
+  transaction abort!
+  rollback completed
+  abort: pretxncommit.forbid1 hook exited with status 1
+  [255]
+  $ hg -q tip
+  4:539e4b31b6dc
+
+precommit hook can prevent commit
+
+  $ echo 'precommit.forbid = python ../printenv.py precommit.forbid 1' >> .hg/hgrc
+  $ hg commit -m 'fail' -d '4 0'
+  precommit hook: HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 
+  precommit.forbid hook: HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 
+  abort: precommit.forbid hook exited with status 1
+  [255]
+  $ hg -q tip
+  4:539e4b31b6dc
+
+preupdate hook can prevent update
+
+  $ echo 'preupdate = python ../printenv.py preupdate' >> .hg/hgrc
+  $ hg update 1
+  preupdate hook: HG_PARENT1=ab228980c14d 
+  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
+
+update hook
+
+  $ echo 'update = python ../printenv.py update' >> .hg/hgrc
+  $ hg update
+  preupdate hook: HG_PARENT1=539e4b31b6dc 
+  update hook: HG_ERROR=0 HG_PARENT1=539e4b31b6dc 
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+prechangegroup hook can prevent incoming changes
+
+  $ cd ../b
+  $ hg -q tip
+  3:07f3376c1e65
+  $ echo '[hooks]' > .hg/hgrc
+  $ echo 'prechangegroup.forbid = python ../printenv.py prechangegroup.forbid 1' >> .hg/hgrc
+  $ hg pull ../a
+  prechangegroup.forbid hook: HG_SOURCE=pull HG_URL=file: 
+  pulling from ../a
+  searching for changes
+  abort: prechangegroup.forbid hook exited with status 1
+  [255]
+
+pretxnchangegroup hook can see incoming changes, can roll back txn,
+incoming changes no longer there after
+
+  $ echo '[hooks]' > .hg/hgrc
+  $ echo 'pretxnchangegroup.forbid0 = hg tip -q' >> .hg/hgrc
+  $ echo 'pretxnchangegroup.forbid1 = python ../printenv.py pretxnchangegroup.forbid 1' >> .hg/hgrc
+  $ hg pull ../a
+  4:539e4b31b6dc
+  pretxnchangegroup.forbid hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$HGTMP/test-hook.t/b HG_SOURCE=pull HG_URL=file: 
+  pulling from ../a
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  transaction abort!
+  rollback completed
+  abort: pretxnchangegroup.forbid1 hook exited with status 1
+  [255]
+  $ hg -q tip
+  3:07f3376c1e65
+
+outgoing hooks can see env vars
+
+  $ rm .hg/hgrc
+  $ echo '[hooks]' > ../a/.hg/hgrc
+  $ echo 'preoutgoing = python ../printenv.py preoutgoing' >> ../a/.hg/hgrc
+  $ echo 'outgoing = python ../printenv.py outgoing' >> ../a/.hg/hgrc
+  $ hg pull ../a
+  preoutgoing hook: HG_SOURCE=pull 
+  outgoing hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_SOURCE=pull 
+  pulling from ../a
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  (run 'hg update' to get a working copy)
+  $ hg rollback
+  rolling back to revision 3 (undo pull)
+
+preoutgoing hook can prevent outgoing changes
+
+  $ echo 'preoutgoing.forbid = python ../printenv.py preoutgoing.forbid 1' >> ../a/.hg/hgrc
+  $ hg pull ../a
+  preoutgoing hook: HG_SOURCE=pull 
+  preoutgoing.forbid hook: HG_SOURCE=pull 
+  pulling from ../a
+  searching for changes
+  abort: preoutgoing.forbid hook exited with status 1
+  [255]
+
+outgoing hooks work for local clones
+
+  $ cd ..
+  $ echo '[hooks]' > a/.hg/hgrc
+  $ echo 'preoutgoing = python ../printenv.py preoutgoing' >> a/.hg/hgrc
+  $ echo 'outgoing = python ../printenv.py outgoing' >> a/.hg/hgrc
+  $ hg clone a c
+  preoutgoing hook: HG_SOURCE=clone 
+  outgoing hook: HG_NODE=0000000000000000000000000000000000000000 HG_SOURCE=clone 
+  updating to branch default
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm -rf c
+
+preoutgoing hook can prevent outgoing changes for local clones
+
+  $ echo 'preoutgoing.forbid = python ../printenv.py preoutgoing.forbid 1' >> a/.hg/hgrc
+  $ hg clone a zzz
+  preoutgoing hook: HG_SOURCE=clone 
+  preoutgoing.forbid hook: HG_SOURCE=clone 
+  abort: preoutgoing.forbid hook exited with status 1
+  [255]
+  $ cd b
+
+  $ cat > hooktests.py <<EOF
+  > from mercurial import util
+  > 
+  > uncallable = 0
+  > 
+  > def printargs(args):
+  >     args.pop('ui', None)
+  >     args.pop('repo', None)
+  >     a = list(args.items())
+  >     a.sort()
+  >     print 'hook args:'
+  >     for k, v in a:
+  >        print ' ', k, v
+  > 
+  > def passhook(**args):
+  >     printargs(args)
+  > 
+  > def failhook(**args):
+  >     printargs(args)
+  >     return True
+  > 
+  > class LocalException(Exception):
+  >     pass
+  > 
+  > def raisehook(**args):
+  >     raise LocalException('exception from hook')
+  > 
+  > def aborthook(**args):
+  >     raise util.Abort('raise abort from hook')
+  > 
+  > def brokenhook(**args):
+  >     return 1 + {}
+  > 
+  > class container:
+  >     unreachable = 1
+  > EOF
+
+test python hooks
+
+  $ PYTHONPATH="`pwd`:$PYTHONPATH"
+  $ export PYTHONPATH
+
+  $ echo '[hooks]' > ../a/.hg/hgrc
+  $ echo 'preoutgoing.broken = python:hooktests.brokenhook' >> ../a/.hg/hgrc
+  $ hg pull ../a 2>&1 | grep 'raised an exception'
+  error: preoutgoing.broken hook raised an exception: unsupported operand type(s) for +: 'int' and 'dict'
+
+  $ echo '[hooks]' > ../a/.hg/hgrc
+  $ echo 'preoutgoing.raise = python:hooktests.raisehook' >> ../a/.hg/hgrc
+  $ hg pull ../a 2>&1 | grep 'raised an exception'
+  error: preoutgoing.raise hook raised an exception: exception from hook
+
+  $ echo '[hooks]' > ../a/.hg/hgrc
+  $ echo 'preoutgoing.abort = python:hooktests.aborthook' >> ../a/.hg/hgrc
+  $ hg pull ../a
+  pulling from ../a
+  searching for changes
+  error: preoutgoing.abort hook failed: raise abort from hook
+  abort: raise abort from hook
+  [255]
+
+  $ echo '[hooks]' > ../a/.hg/hgrc
+  $ echo 'preoutgoing.fail = python:hooktests.failhook' >> ../a/.hg/hgrc
+  $ hg pull ../a
+  pulling from ../a
+  searching for changes
+  hook args:
+    hooktype preoutgoing
+    source pull
+  abort: preoutgoing.fail hook failed
+  [255]
+
+  $ echo '[hooks]' > ../a/.hg/hgrc
+  $ echo 'preoutgoing.uncallable = python:hooktests.uncallable' >> ../a/.hg/hgrc
+  $ hg pull ../a
+  pulling from ../a
+  searching for changes
+  abort: preoutgoing.uncallable hook is invalid ("hooktests.uncallable" is not callable)
+  [255]
+
+  $ echo '[hooks]' > ../a/.hg/hgrc
+  $ echo 'preoutgoing.nohook = python:hooktests.nohook' >> ../a/.hg/hgrc
+  $ hg pull ../a
+  pulling from ../a
+  searching for changes
+  abort: preoutgoing.nohook hook is invalid ("hooktests.nohook" is not defined)
+  [255]
+
+  $ echo '[hooks]' > ../a/.hg/hgrc
+  $ echo 'preoutgoing.nomodule = python:nomodule' >> ../a/.hg/hgrc
+  $ hg pull ../a
+  pulling from ../a
+  searching for changes
+  abort: preoutgoing.nomodule hook is invalid ("nomodule" not in a module)
+  [255]
+
+  $ echo '[hooks]' > ../a/.hg/hgrc
+  $ echo 'preoutgoing.badmodule = python:nomodule.nowhere' >> ../a/.hg/hgrc
+  $ hg pull ../a
+  pulling from ../a
+  searching for changes
+  abort: preoutgoing.badmodule hook is invalid (import of "nomodule" failed)
+  [255]
+
+  $ echo '[hooks]' > ../a/.hg/hgrc
+  $ echo 'preoutgoing.unreachable = python:hooktests.container.unreachable' >> ../a/.hg/hgrc
+  $ hg pull ../a
+  pulling from ../a
+  searching for changes
+  abort: preoutgoing.unreachable hook is invalid (import of "hooktests.container" failed)
+  [255]
+
+  $ echo '[hooks]' > ../a/.hg/hgrc
+  $ echo 'preoutgoing.pass = python:hooktests.passhook' >> ../a/.hg/hgrc
+  $ hg pull ../a
+  pulling from ../a
+  searching for changes
+  hook args:
+    hooktype preoutgoing
+    source pull
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  (run 'hg update' to get a working copy)
+
+make sure --traceback works
+
+  $ echo '[hooks]' > .hg/hgrc
+  $ echo 'commit.abort = python:hooktests.aborthook' >> .hg/hgrc
+
+  $ echo aa > a
+  $ hg --traceback commit -d '0 0' -ma 2>&1 | grep '^Traceback'
+  Traceback (most recent call last):
+
+  $ cd ..
+  $ hg init c
+  $ cd c
+
+  $ cat > hookext.py <<EOF
+  > def autohook(**args):
+  >     print "Automatically installed hook"
+  > 
+  > def reposetup(ui, repo):
+  >     repo.ui.setconfig("hooks", "commit.auto", autohook)
+  > EOF
+  $ echo '[extensions]' >> .hg/hgrc
+  $ echo 'hookext = hookext.py' >> .hg/hgrc
+
+  $ touch foo
+  $ hg add foo
+  $ hg ci -d '0 0' -m 'add foo'
+  Automatically installed hook
+  $ echo >> foo
+  $ hg ci --debug -d '0 0' -m 'change foo'
+  foo
+  calling hook commit.auto: <function autohook at *> (glob)
+  Automatically installed hook
+  committed changeset 1:52998019f6252a2b893452765fcb0a47351a5708
+
+  $ hg showconfig hooks
+  hooks.commit.auto=<function autohook at *> (glob)
+
+test python hook configured with python:[file]:[hook] syntax
+
+  $ cd ..
+  $ mkdir d
+  $ cd d
+  $ hg init repo
+  $ mkdir hooks
+
+  $ cd hooks
+  $ cat > testhooks.py <<EOF
+  > def testhook(**args):
+  >     print 'hook works'
+  > EOF
+  $ echo '[hooks]' > ../repo/.hg/hgrc
+  $ echo "pre-commit.test = python:`pwd`/testhooks.py:testhook" >> ../repo/.hg/hgrc
+
+  $ cd ../repo
+  $ hg commit -d '0 0'
+  hook works
+  nothing changed
+  [1]
+
+  $ cd ../../b
+
+make sure --traceback works on hook import failure
+
+  $ cat > importfail.py <<EOF
+  > import somebogusmodule
+  > # dereference something in the module to force demandimport to load it
+  > somebogusmodule.whatever
+  > EOF
+
+  $ echo '[hooks]' > .hg/hgrc
+  $ echo 'precommit.importfail = python:importfail.whatever' >> .hg/hgrc
+
+  $ echo a >> a
+  $ hg --traceback commit -ma 2>&1 | egrep '^(exception|Traceback|ImportError)'
+  exception from first failed import attempt:
+  Traceback (most recent call last):
+  ImportError: No module named somebogusmodule
+  exception from second failed import attempt:
+  Traceback (most recent call last):
+  ImportError: No module named hgext_importfail
+  Traceback (most recent call last):
+
+commit and update hooks should run after command completion (issue 1827)
+
+  $ echo '[hooks]' > .hg/hgrc
+  $ echo 'commit = hg id' >> .hg/hgrc
+  $ echo 'update = hg id' >> .hg/hgrc
+  $ echo bb > a
+  $ hg ci -ma
+  223eafe2750c tip
+  $ hg up 0
+  cb9a9f314b8b
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-http-branchmap	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,58 @@
+#!/bin/sh
+
+hgserve()
+{
+    hg serve -a localhost -p $HGPORT1 -d --pid-file=hg.pid -E errors.log -v $@ \
+        | sed -e 's/:[0-9][0-9]*//g' -e 's/http:\/\/[^/]*\//http:\/\/localhost\//'
+    cat hg.pid >> "$DAEMON_PIDS"
+}
+
+hg init a
+hg --encoding utf-8 -R a branch æ
+echo foo > a/foo
+hg -R a ci -Am foo
+
+hgserve -R a --config web.push_ssl=False --config web.allow_push=* --encoding latin1
+hg --encoding utf-8 clone http://localhost:$HGPORT1 b
+hg --encoding utf-8 -R b log
+echo bar >> b/foo
+hg -R b ci -m bar
+hg --encoding utf-8 -R b push | sed "s/$HGPORT1/PORT/"
+hg -R a --encoding utf-8 log
+
+kill `cat hg.pid`
+
+
+# verify 7e7d56fe4833 (encoding fallback in branchmap to maintain compatibility with 1.3.x)
+
+cat <<EOF > oldhg
+import sys
+from mercurial import ui, hg, commands
+
+class StdoutWrapper(object):
+    def __init__(self, stdout):
+        self._file = stdout
+
+    def write(self, data):
+        if data == '47\n':
+            # latin1 encoding is one %xx (3 bytes) shorter
+            data = '44\n'
+        elif data.startswith('%C3%A6 '):
+            # translate to latin1 encoding
+            data = '%%E6 %s' % data[7:]
+        self._file.write(data)
+
+    def __getattr__(self, name):
+        return getattr(self._file, name)
+
+sys.stdout = StdoutWrapper(sys.stdout)
+sys.stderr = StdoutWrapper(sys.stderr)
+
+myui = ui.ui()
+repo = hg.repository(myui, 'a')
+commands.serve(myui, repo, stdio=True)
+EOF
+
+echo baz >> b/foo
+hg -R b ci -m baz
+hg push -R b -e 'python oldhg' ssh://dummy/ --encoding latin1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-http-branchmap.out	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,42 @@
+marked working directory as branch æ
+adding foo
+listening at http://localhost/ (bound to 127.0.0.1)
+requesting all changes
+adding changesets
+adding manifests
+adding file changes
+added 1 changesets with 1 changes to 1 files
+updating to branch æ
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+changeset:   0:867c11ce77b8
+branch:      æ
+tag:         tip
+user:        test
+date:        Thu Jan 01 00:00:00 1970 +0000
+summary:     foo
+
+pushing to http://localhost:PORT
+searching for changes
+remote: adding changesets
+remote: adding manifests
+remote: adding file changes
+remote: added 1 changesets with 1 changes to 1 files
+changeset:   1:58e7c90d67cb
+branch:      æ
+tag:         tip
+user:        test
+date:        Thu Jan 01 00:00:00 1970 +0000
+summary:     bar
+
+changeset:   0:867c11ce77b8
+branch:      æ
+user:        test
+date:        Thu Jan 01 00:00:00 1970 +0000
+summary:     foo
+
+pushing to ssh://dummy/
+searching for changes
+remote: adding changesets
+remote: adding manifests
+remote: adding file changes
+remote: added 1 changesets with 1 changes to 1 files
--- a/tests/test-identify	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-#!/bin/sh
-
-"$TESTDIR/hghave" no-outer-repo || exit 80
-
-echo % no repo
-hg id
-
-echo % create repo
-hg init test
-cd test
-echo a > a
-hg ci -Ama
-
-echo % basic id usage
-hg id
-hg id --debug
-hg id -q
-hg id -v
-
-echo % with options
-hg id -r.
-hg id -n
-hg id -t
-hg id -b
-hg id -i
-hg id -n -t -b -i
-
-echo % with modifications
-echo b > a
-hg id -n -t -b -i
-
-echo % other local repo
-cd ..
-hg -R test id
-hg id test
-
-echo % with remote http repo
-cd test
-hg serve -p $HGPORT1 -d --pid-file=hg.pid
-cat hg.pid >> $DAEMON_PIDS
-hg id http://localhost:$HGPORT1/
-
-echo % remote with tags?
-hg id -t http://localhost:$HGPORT1/
-
-true # ends with util.Abort -> returns 255
--- a/tests/test-identify.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-% no repo
-abort: there is no Mercurial repository here (.hg not found)
-% create repo
-adding a
-% basic id usage
-cb9a9f314b8b tip
-cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b tip
-cb9a9f314b8b
-cb9a9f314b8b tip
-% with options
-cb9a9f314b8b tip
-0
-tip
-default
-cb9a9f314b8b
-cb9a9f314b8b 0 default tip
-% with modifications
-cb9a9f314b8b+ 0+ default tip
-% other local repo
-cb9a9f314b8b+ tip
-cb9a9f314b8b+ tip
-% with remote http repo
-cb9a9f314b8b
-% remote with tags?
-abort: can't query remote revision number, branch, or tags
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-identify.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,69 @@
+  $ "$TESTDIR/hghave" no-outer-repo || exit 80
+
+no repo
+
+  $ hg id
+  abort: there is no Mercurial repository here (.hg not found)
+  [255]
+
+create repo
+
+  $ hg init test
+  $ cd test
+  $ echo a > a
+  $ hg ci -Ama
+  adding a
+
+basic id usage
+
+  $ hg id
+  cb9a9f314b8b tip
+  $ hg id --debug
+  cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b tip
+  $ hg id -q
+  cb9a9f314b8b
+  $ hg id -v
+  cb9a9f314b8b tip
+
+with options
+
+  $ hg id -r.
+  cb9a9f314b8b tip
+  $ hg id -n
+  0
+  $ hg id -t
+  tip
+  $ hg id -b
+  default
+  $ hg id -i
+  cb9a9f314b8b
+  $ hg id -n -t -b -i
+  cb9a9f314b8b 0 default tip
+
+with modifications
+
+  $ echo b > a
+  $ hg id -n -t -b -i
+  cb9a9f314b8b+ 0+ default tip
+
+other local repo
+
+  $ cd ..
+  $ hg -R test id
+  cb9a9f314b8b+ tip
+  $ hg id test
+  cb9a9f314b8b+ tip
+
+with remote http repo
+
+  $ cd test
+  $ hg serve -p $HGPORT1 -d --pid-file=hg.pid
+  $ cat hg.pid >> $DAEMON_PIDS
+  $ hg id http://localhost:$HGPORT1/
+  cb9a9f314b8b
+
+remote with tags?
+
+  $ hg id -t http://localhost:$HGPORT1/
+  abort: can't query remote revision number, branch, or tags
+  [255]
--- a/tests/test-impexp-branch	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-#!/bin/sh
-
-cat >findbranch.py <<EOF
-import re, sys
-
-head_re = re.compile('^#(?:(?:\\s+([A-Za-z][A-Za-z0-9_]*)(?:\\s.*)?)|(?:\\s*))$')
-
-for line in sys.stdin:
-    hmatch = head_re.match(line)
-    if not hmatch:
-        sys.exit(1)
-    if hmatch.group(1) == 'Branch':
-        sys.exit(0)
-sys.exit(1)
-EOF
-hg init a
-cd a
-echo "Rev 1" >rev
-hg add rev
-hg commit -m "No branch."
-hg branch abranch
-echo "Rev  2" >rev
-hg commit -m "With branch."
-if hg export 0 | python ../findbranch.py; then
-    echo "Export of default branch revision has Branch header" 1>&2
-    exit 1
-fi
-if hg export 1 | python ../findbranch.py; then
-    :  # Do nothing
-else
-    echo "Export of branch revision is missing Branch header" 1>&2
-    exit 1
-fi
-# Make sure import still works with branch information in patches.
-cd ..
-hg init b
-cd b
-hg -R ../a export 0 | hg import -
-hg -R ../a export 1 | hg import -
-cd ..
-rm -rf b
-hg init b
-cd b
-hg -R ../a export 0 | hg import --exact -
-hg -R ../a export 1 | hg import --exact -
--- a/tests/test-impexp-branch.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-marked working directory as branch abranch
-applying patch from stdin
-applying patch from stdin
-applying patch from stdin
-applying patch from stdin
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-impexp-branch.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,50 @@
+  $ cat >findbranch.py <<EOF
+  > import re, sys
+  > 
+  > head_re = re.compile('^#(?:(?:\\s+([A-Za-z][A-Za-z0-9_]*)(?:\\s.*)?)|(?:\\s*))$')
+  > 
+  > for line in sys.stdin:
+  >     hmatch = head_re.match(line)
+  >     if not hmatch:
+  >         sys.exit(1)
+  >     if hmatch.group(1) == 'Branch':
+  >         sys.exit(0)
+  > sys.exit(1)
+  > EOF
+  $ hg init a
+  $ cd a
+  $ echo "Rev 1" >rev
+  $ hg add rev
+  $ hg commit -m "No branch."
+  $ hg branch abranch
+  marked working directory as branch abranch
+  $ echo "Rev  2" >rev
+  $ hg commit -m "With branch."
+  $ if hg export 0 | python ../findbranch.py; then
+  >     echo "Export of default branch revision has Branch header" 1>&2
+  >     exit 1
+  > fi
+  $ if hg export 1 | python ../findbranch.py; then
+  >     :  # Do nothing
+  > else
+  >     echo "Export of branch revision is missing Branch header" 1>&2
+  >     exit 1
+  > fi
+
+Make sure import still works with branch information in patches.
+
+  $ cd ..
+  $ hg init b
+  $ cd b
+  $ hg -R ../a export 0 | hg import -
+  applying patch from stdin
+  $ hg -R ../a export 1 | hg import -
+  applying patch from stdin
+  $ cd ..
+  $ rm -rf b
+  $ hg init b
+  $ cd b
+  $ hg -R ../a export 0 | hg import --exact -
+  applying patch from stdin
+  $ hg -R ../a export 1 | hg import --exact -
+  applying patch from stdin
--- a/tests/test-import	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,497 +0,0 @@
-#!/bin/sh
-
-hg init a
-mkdir a/d1
-mkdir a/d1/d2
-echo line 1 > a/a
-echo line 1 > a/d1/d2/a
-hg --cwd a ci -Ama
-
-echo line 2 >> a/a
-hg --cwd a ci -u someone -d '1 0' -m'second change'
-
-echo % import exported patch
-hg clone -r0 a b
-hg --cwd a export tip > tip.patch
-hg --cwd b import ../tip.patch
-echo % message should be same
-hg --cwd b tip | grep 'second change'
-echo % committer should be same
-hg --cwd b tip | grep someone
-rm -r b
-
-echo % import exported patch with external patcher
-cat > dummypatch.py <<EOF
-print 'patching file a'
-file('a', 'wb').write('line2\n')
-EOF
-chmod +x dummypatch.py
-hg clone -r0 a b
-hg --cwd a export tip > tip.patch
-hg --config ui.patch='python ../dummypatch.py' --cwd b import ../tip.patch
-cat b/a
-rm -r b
-
-echo % import of plain diff should fail without message
-hg clone -r0 a b
-hg --cwd a diff -r0:1 > tip.patch
-hg --cwd b import ../tip.patch
-rm -r b
-
-echo % import of plain diff should be ok with message
-hg clone -r0 a b
-hg --cwd a diff -r0:1 > tip.patch
-hg --cwd b import -mpatch ../tip.patch
-rm -r b
-
-echo % import of plain diff with specific date and user
-hg clone -r0 a b
-hg --cwd a diff -r0:1 > tip.patch
-hg --cwd b import -mpatch -d '1 0' -u 'user@nowhere.net' ../tip.patch
-hg -R b tip -pv
-rm -r b
-
-echo % import of plain diff should be ok with --no-commit
-hg clone -r0 a b
-hg --cwd a diff -r0:1 > tip.patch
-hg --cwd b import --no-commit ../tip.patch
-hg --cwd b diff --nodates
-rm -r b
-
-echo % hg -R repo import
-# put the clone in a subdir - having a directory named "a"
-# used to hide a bug.
-mkdir dir
-hg clone -r0 a dir/b
-hg --cwd a export tip > dir/tip.patch
-cd dir
-hg -R b import tip.patch
-cd ..
-rm -r dir
-
-echo % import from stdin
-hg clone -r0 a b
-hg --cwd a export tip | hg --cwd b import -
-rm -r b
-
-echo % import two patches in one stream
-hg init b
-hg --cwd a export 0:tip | hg --cwd b import -
-hg --cwd a id
-hg --cwd b id
-rm -r b
-
-echo % override commit message
-hg clone -r0 a b
-hg --cwd a export tip | hg --cwd b import -m 'override' -
-hg --cwd b tip | grep override
-rm -r b
-
-cat > mkmsg.py <<EOF
-import email.Message, sys
-msg = email.Message.Message()
-msg.set_payload('email commit message\n' + open('tip.patch', 'rb').read())
-msg['Subject'] = 'email patch'
-msg['From'] = 'email patcher'
-sys.stdout.write(msg.as_string())
-EOF
-
-echo % plain diff in email, subject, message body
-hg clone -r0 a b
-hg --cwd a diff -r0:1 > tip.patch
-python mkmsg.py > msg.patch
-hg --cwd b import ../msg.patch
-hg --cwd b tip | grep email
-rm -r b
-
-echo % plain diff in email, no subject, message body
-hg clone -r0 a b
-grep -v '^Subject:' msg.patch | hg --cwd b import -
-rm -r b
-
-echo % plain diff in email, subject, no message body
-hg clone -r0 a b
-grep -v '^email ' msg.patch | hg --cwd b import -
-rm -r b
-
-echo % plain diff in email, no subject, no message body, should fail
-hg clone -r0 a b
-egrep -v '^(Subject|email)' msg.patch | hg --cwd b import -
-rm -r b
-
-echo % hg export in email, should use patch header
-hg clone -r0 a b
-hg --cwd a export tip > tip.patch
-python mkmsg.py | hg --cwd b import -
-hg --cwd b tip | grep second
-rm -r b
-
-# subject: duplicate detection, removal of [PATCH]
-# The '---' tests the gitsendmail handling without proper mail headers
-cat > mkmsg2.py <<EOF
-import email.Message, sys
-msg = email.Message.Message()
-msg.set_payload('email patch\n\nnext line\n---\n' + open('tip.patch').read())
-msg['Subject'] = '[PATCH] email patch'
-msg['From'] = 'email patcher'
-sys.stdout.write(msg.as_string())
-EOF
-
-echo '% plain diff in email, [PATCH] subject, message body with subject'
-hg clone -r0 a b
-hg --cwd a diff -r0:1 > tip.patch
-python mkmsg2.py | hg --cwd b import -
-hg --cwd b tip --template '{desc}\n'
-rm -r b
-
-# We weren't backing up the correct dirstate file when importing many patches
-# (issue963)
-echo '% import patch1 patch2; rollback'
-echo line 3 >> a/a
-hg --cwd a ci -m'third change'
-hg --cwd a export -o '../patch%R' 1 2
-hg clone -qr0 a b
-hg --cwd b parents --template 'parent: {rev}\n'
-hg --cwd b import ../patch1 ../patch2
-hg --cwd b rollback
-hg --cwd b parents --template 'parent: {rev}\n'
-rm -r b
-
-# bug non regression test
-# importing a patch in a subdirectory failed at the commit stage
-echo line 2 >> a/d1/d2/a
-hg --cwd a ci -u someoneelse -d '1 0' -m'subdir change'
-echo % hg import in a subdirectory
-hg clone -r0 a b
-hg --cwd a export tip | sed -e 's/d1\/d2\///' > tip.patch
-dir=`pwd`
-cd b/d1/d2 2>&1 > /dev/null
-hg import  ../../../tip.patch
-cd "$dir"
-echo "% message should be 'subdir change'"
-hg --cwd b tip | grep 'subdir change'
-echo "% committer should be 'someoneelse'"
-hg --cwd b tip | grep someoneelse
-echo "% should be empty"
-hg --cwd b status
-
-
-# Test fuzziness (ambiguous patch location, fuzz=2)
-echo % test fuzziness
-hg init fuzzy
-cd fuzzy
-echo line1 > a
-echo line0 >> a
-echo line3 >> a
-hg ci -Am adda
-echo line1 > a
-echo line2 >> a
-echo line0 >> a
-echo line3 >> a
-hg ci -m change a
-hg export tip > tip.patch
-hg up -C 0
-echo line1 > a
-echo line0 >> a
-echo line1 >> a
-echo line0 >> a
-hg ci -m brancha
-hg import --no-commit -v tip.patch
-hg revert -a
-echo '% test fuzziness with eol=auto'
-hg --config patch.eol=auto import --no-commit -v tip.patch
-cd ..
-
-# Test hunk touching empty files (issue906)
-hg init empty
-cd empty
-touch a
-touch b1
-touch c1
-echo d > d
-hg ci -Am init
-echo a > a
-echo b > b1
-hg mv b1 b2
-echo c > c1
-hg copy c1 c2
-rm d
-touch d
-hg diff --git
-hg ci -m empty
-hg export --git tip > empty.diff
-hg up -C 0
-hg import empty.diff
-for name in a b1 b2 c1 c2 d;
-do
-    echo % $name file
-    test -f $name && cat $name
-done
-cd ..
-
-# Test importing a patch ending with a binary file removal
-echo % test trailing binary removal
-hg init binaryremoval
-cd binaryremoval
-echo a > a
-python -c "file('b', 'wb').write('a\x00b')"
-hg ci -Am addall
-hg rm a
-hg rm b
-hg st
-hg ci -m remove
-hg export --git . > remove.diff
-cat remove.diff | grep git
-hg up -C 0
-hg import remove.diff
-hg manifest
-cd ..
-
-echo % 'test update+rename with common name (issue 927)'
-hg init t
-cd t
-touch a
-hg ci -Am t
-echo a > a
-# Here, bfile.startswith(afile)
-hg copy a a2
-hg ci -m copya
-hg export --git tip > copy.diff
-hg up -C 0
-hg import copy.diff
-echo % view a
-# a should contain an 'a'
-cat a
-echo % view a2
-# and a2 should have duplicated it
-cat a2
-cd ..
-
-echo % 'test -p0'
-hg init p0
-cd p0
-echo a > a
-hg ci -Am t
-hg import -p0 - << EOF
-foobar
---- a	Sat Apr 12 22:43:58 2008 -0400
-+++ a	Sat Apr 12 22:44:05 2008 -0400
-@@ -1,1 +1,1 @@
--a
-+bb
-EOF
-hg status
-cat a
-cd ..
-
-echo % 'test paths outside repo root'
-mkdir outside
-touch outside/foo
-hg init inside
-cd inside
-hg import - <<EOF
-diff --git a/a b/b
-rename from ../outside/foo
-rename to bar
-EOF
-cd ..
-
-echo '% test import with similarity and git and strip (issue295 et al.)'
-hg init sim
-cd sim
-echo 'this is a test' > a
-hg ci -Ama
-cat > ../rename.diff <<EOF
-diff --git a/foo/a b/foo/a
-deleted file mode 100644
---- a/foo/a
-+++ /dev/null
-@@ -1,1 +0,0 @@
--this is a test
-diff --git a/foo/b b/foo/b
-new file mode 100644
---- /dev/null
-+++ b/foo/b
-@@ -0,0 +1,2 @@
-+this is a test
-+foo
-EOF
-hg import --no-commit -v -s 1 ../rename.diff -p2
-hg st -C
-hg revert -a
-rm b
-hg import --no-commit -v -s 100 ../rename.diff -p2
-hg st -C
-cd ..
-
-
-echo '% add empty file from the end of patch (issue 1495)'
-hg init addemptyend
-cd addemptyend
-touch a
-hg addremove
-hg ci -m "commit"
-cat > a.patch <<EOF
-diff --git a/a b/a
---- a/a
-+++ b/a
-@@ -0,0 +1,1 @@
-+a
-diff --git a/b b/b
-new file mode 100644
-EOF
-hg import --no-commit a.patch
-cd ..
-
-echo '% create file when source is not /dev/null'
-cat > create.patch <<EOF
-diff -Naur proj-orig/foo proj-new/foo
---- proj-orig/foo       1969-12-31 16:00:00.000000000 -0800
-+++ proj-new/foo        2009-07-17 16:50:45.801368000 -0700
-@@ -0,0 +1,1 @@
-+a
-EOF
-# some people have patches like the following too
-cat > create2.patch <<EOF
-diff -Naur proj-orig/foo proj-new/foo
---- proj-orig/foo.orig  1969-12-31 16:00:00.000000000 -0800
-+++ proj-new/foo        2009-07-17 16:50:45.801368000 -0700
-@@ -0,0 +1,1 @@
-+a
-EOF
-hg init oddcreate
-cd oddcreate
-hg import --no-commit ../create.patch
-cat foo
-rm foo
-hg revert foo
-hg import --no-commit ../create2.patch
-cat foo
-
-echo % 'first line mistaken for email headers (issue 1859)'
-hg init emailconfusion
-cd emailconfusion
-cat > a.patch <<EOF
-module: summary
-
-description
-
-
-diff -r 000000000000 -r 9b4c1e343b55 test.txt
---- /dev/null
-+++ b/a
-@@ -0,0 +1,1 @@
-+a
-EOF
-hg import -d '0 0' a.patch
-hg parents -v
-cd ..
-
-echo % '--- in commit message'
-hg init commitconfusion
-cd commitconfusion
-cat > a.patch <<EOF
-module: summary
-
---- description
-
-diff --git a/a b/a
-new file mode 100644
---- /dev/null
-+++ b/a
-@@ -0,0 +1,1 @@
-+a
-EOF
-hg import -d '0 0' a.patch
-hg parents -v
-cd ..
-
-echo '% tricky header splitting'
-cat > trickyheaders.patch <<EOF
-From: User A <user@a>
-Subject: [PATCH] from: tricky!
-
-# HG changeset patch
-# User User B
-# Date 1266264441 18000
-# Branch stable
-# Node ID f2be6a1170ac83bf31cb4ae0bad00d7678115bc0
-# Parent  0000000000000000000000000000000000000000
-from: tricky!
-
-That is not a header.
-
-diff -r 000000000000 -r f2be6a1170ac foo
---- /dev/null
-+++ b/foo
-@@ -0,0 +1,1 @@
-+foo
-EOF
-
-hg init trickyheaders
-cd trickyheaders
-hg import -d '0 0' ../trickyheaders.patch
-hg export --git tip
-cd ..
-
-echo '% issue2102'
-hg init issue2102
-cd issue2102
-mkdir -p src/cmd/gc
-touch src/cmd/gc/mksys.bash
-hg ci -Am init
-hg import - <<EOF
-# HG changeset patch
-# User Rob Pike
-# Date 1216685449 25200
-# Node ID 03aa2b206f499ad6eb50e6e207b9e710d6409c98
-# Parent  93d10138ad8df586827ca90b4ddb5033e21a3a84
-help management of empty pkg and lib directories in perforce
-
-R=gri
-DELTA=4  (4 added, 0 deleted, 0 changed)
-OCL=13328
-CL=13328
-
-diff --git a/lib/place-holder b/lib/place-holder
-new file mode 100644
---- /dev/null
-+++ b/lib/place-holder
-@@ -0,0 +1,2 @@
-+perforce does not maintain empty directories.
-+this file helps.
-diff --git a/pkg/place-holder b/pkg/place-holder
-new file mode 100644
---- /dev/null
-+++ b/pkg/place-holder
-@@ -0,0 +1,2 @@
-+perforce does not maintain empty directories.
-+this file helps.
-diff --git a/src/cmd/gc/mksys.bash b/src/cmd/gc/mksys.bash
-old mode 100644
-new mode 100755
-EOF
-hg sum
-hg diff --git -c tip
-cd ..
-
-echo '% diff lines looking like headers'
-hg init difflineslikeheaders
-cd difflineslikeheaders
-echo a >a
-echo b >b
-echo c >c
-hg ci -Am1
-
-echo "key: value" >>a
-echo "key: value" >>b
-echo "foo" >>c
-hg ci -m2
-
-hg up -C 0
-hg diff --git -c1 >want
-hg diff -c1 | hg import --no-commit -
-hg diff --git >have
-diff want have
-cd ..
-
--- a/tests/test-import-eol	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-#!/bin/sh
-
-cat > makepatch.py <<EOF
-f = file('eol.diff', 'wb')
-w = f.write
-w('test message\n')
-w('diff --git a/a b/a\n')
-w('--- a/a\n')
-w('+++ b/a\n')
-w('@@ -1,5 +1,5 @@\n')
-w(' a\n')
-w('-bbb\r\n')
-w('+yyyy\r\n')
-w(' cc\r\n')
-w(' \n')
-w(' d\n')
-w('-e\n')
-w('\ No newline at end of file\n')
-w('+z\r\n')
-w('\ No newline at end of file\r\n')
-EOF
-
-hg init repo
-cd repo
-echo '\.diff' > .hgignore
-
-# Test different --eol values
-python -c 'file("a", "wb").write("a\nbbb\ncc\n\nd\ne")'
-hg ci -Am adda
-python ../makepatch.py
-
-echo % invalid eol
-hg --config patch.eol='LFCR' import eol.diff
-hg revert -a
-
-echo % force LF
-hg --traceback --config patch.eol='LF' import eol.diff
-python -c 'print repr(file("a","rb").read())'
-hg st
-
-echo % force CRLF
-hg up -C 0
-hg --traceback --config patch.eol='CRLF' import eol.diff
-python -c 'print repr(file("a","rb").read())'
-hg st
-
-echo % auto EOL on LF file
-hg up -C 0
-hg --traceback --config patch.eol='auto' import eol.diff
-python -c 'print repr(file("a","rb").read())'
-hg st
-
-echo % auto EOL on CRLF file
-python -c 'file("a", "wb").write("a\r\nbbb\r\ncc\r\n\r\nd\r\ne")'
-hg commit -m 'switch EOLs in a'
-hg --traceback --config patch.eol='auto' import eol.diff
-python -c 'print repr(file("a","rb").read())'
-hg st
-
-echo % auto EOL on new file or source without any EOL
-python -c 'file("noeol", "wb").write("noeol")'
-hg add noeol
-hg commit -m 'add noeol'
-python -c 'file("noeol", "wb").write("noeol\r\nnoeol\n")'
-python -c 'file("neweol", "wb").write("neweol\nneweol\r\n")'
-hg add neweol
-hg diff --git > noeol.diff
-hg revert --no-backup noeol neweol
-rm neweol
-hg --traceback --config patch.eol='auto' import -m noeol noeol.diff
-python -c 'print repr(file("noeol","rb").read())'
-python -c 'print repr(file("neweol","rb").read())'
-hg st
-
-# Test --eol and binary patches
-python -c 'file("b", "wb").write("a\x00\nb\r\nd")'
-hg ci -Am addb
-python -c 'file("b", "wb").write("a\x00\nc\r\nd")'
-hg diff --git > bin.diff
-hg revert --no-backup b
-echo % binary patch with --eol
-hg import --config patch.eol='CRLF' -m changeb bin.diff
-python -c 'print repr(file("b","rb").read())'
-hg st
-cd ..
--- a/tests/test-import-eol.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-adding .hgignore
-adding a
-% invalid eol
-applying eol.diff
-abort: unsupported line endings type: LFCR
-% force LF
-applying eol.diff
-'a\nyyyy\ncc\n\nd\ne'
-% force CRLF
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-applying eol.diff
-'a\r\nyyyy\r\ncc\r\n\r\nd\r\ne'
-% auto EOL on LF file
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-applying eol.diff
-'a\nyyyy\ncc\n\nd\ne'
-% auto EOL on CRLF file
-applying eol.diff
-'a\r\nyyyy\r\ncc\r\n\r\nd\r\ne'
-% auto EOL on new file or source without any EOL
-applying noeol.diff
-'noeol\r\nnoeol\n'
-'neweol\nneweol\r\n'
-adding b
-% binary patch with --eol
-applying bin.diff
-'a\x00\nc\r\nd'
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-import-eol.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,122 @@
+  $ cat > makepatch.py <<EOF
+  > f = file('eol.diff', 'wb')
+  > w = f.write
+  > w('test message\n')
+  > w('diff --git a/a b/a\n')
+  > w('--- a/a\n')
+  > w('+++ b/a\n')
+  > w('@@ -1,5 +1,5 @@\n')
+  > w(' a\n')
+  > w('-bbb\r\n')
+  > w('+yyyy\r\n')
+  > w(' cc\r\n')
+  > w(' \n')
+  > w(' d\n')
+  > w('-e\n')
+  > w('\ No newline at end of file\n')
+  > w('+z\r\n')
+  > w('\ No newline at end of file\r\n')
+  > EOF
+
+  $ hg init repo
+  $ cd repo
+  $ echo '\.diff' > .hgignore
+
+
+Test different --eol values
+
+  $ python -c 'file("a", "wb").write("a\nbbb\ncc\n\nd\ne")'
+  $ hg ci -Am adda
+  adding .hgignore
+  adding a
+  $ python ../makepatch.py
+
+
+invalid eol
+
+  $ hg --config patch.eol='LFCR' import eol.diff
+  applying eol.diff
+  abort: unsupported line endings type: LFCR
+  [255]
+  $ hg revert -a
+
+
+force LF
+
+  $ hg --traceback --config patch.eol='LF' import eol.diff
+  applying eol.diff
+  $ python -c 'print repr(file("a","rb").read())'
+  'a\nyyyy\ncc\n\nd\ne'
+  $ hg st
+
+
+force CRLF
+
+  $ hg up -C 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg --traceback --config patch.eol='CRLF' import eol.diff
+  applying eol.diff
+  $ python -c 'print repr(file("a","rb").read())'
+  'a\r\nyyyy\r\ncc\r\n\r\nd\r\ne'
+  $ hg st
+
+
+auto EOL on LF file
+
+  $ hg up -C 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg --traceback --config patch.eol='auto' import eol.diff
+  applying eol.diff
+  $ python -c 'print repr(file("a","rb").read())'
+  'a\nyyyy\ncc\n\nd\ne'
+  $ hg st
+
+
+auto EOL on CRLF file
+
+  $ python -c 'file("a", "wb").write("a\r\nbbb\r\ncc\r\n\r\nd\r\ne")'
+  $ hg commit -m 'switch EOLs in a'
+  $ hg --traceback --config patch.eol='auto' import eol.diff
+  applying eol.diff
+  $ python -c 'print repr(file("a","rb").read())'
+  'a\r\nyyyy\r\ncc\r\n\r\nd\r\ne'
+  $ hg st
+
+
+auto EOL on new file or source without any EOL
+
+  $ python -c 'file("noeol", "wb").write("noeol")'
+  $ hg add noeol
+  $ hg commit -m 'add noeol'
+  $ python -c 'file("noeol", "wb").write("noeol\r\nnoeol\n")'
+  $ python -c 'file("neweol", "wb").write("neweol\nneweol\r\n")'
+  $ hg add neweol
+  $ hg diff --git > noeol.diff
+  $ hg revert --no-backup noeol neweol
+  $ rm neweol
+  $ hg --traceback --config patch.eol='auto' import -m noeol noeol.diff
+  applying noeol.diff
+  $ python -c 'print repr(file("noeol","rb").read())'
+  'noeol\r\nnoeol\n'
+  $ python -c 'print repr(file("neweol","rb").read())'
+  'neweol\nneweol\r\n'
+  $ hg st
+
+
+Test --eol and binary patches
+
+  $ python -c 'file("b", "wb").write("a\x00\nb\r\nd")'
+  $ hg ci -Am addb
+  adding b
+  $ python -c 'file("b", "wb").write("a\x00\nc\r\nd")'
+  $ hg diff --git > bin.diff
+  $ hg revert --no-backup b
+
+binary patch with --eol
+
+  $ hg import --config patch.eol='CRLF' -m changeb bin.diff
+  applying bin.diff
+  $ python -c 'print repr(file("b","rb").read())'
+  'a\x00\nc\r\nd'
+  $ hg st
+  $ cd ..
--- a/tests/test-import.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,381 +0,0 @@
-adding a
-adding d1/d2/a
-% import exported patch
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 2 changes to 2 files
-updating to branch default
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-applying ../tip.patch
-% message should be same
-summary:     second change
-% committer should be same
-user:        someone
-% import exported patch with external patcher
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 2 changes to 2 files
-updating to branch default
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-applying ../tip.patch
-line2
-% import of plain diff should fail without message
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 2 changes to 2 files
-updating to branch default
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-applying ../tip.patch
-abort: empty commit message
-% import of plain diff should be ok with message
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 2 changes to 2 files
-updating to branch default
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-applying ../tip.patch
-% import of plain diff with specific date and user
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 2 changes to 2 files
-updating to branch default
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-applying ../tip.patch
-changeset:   1:ca68f19f3a40
-tag:         tip
-user:        user@nowhere.net
-date:        Thu Jan 01 00:00:01 1970 +0000
-files:       a
-description:
-patch
-
-
-diff -r 80971e65b431 -r ca68f19f3a40 a
---- a/a	Thu Jan 01 00:00:00 1970 +0000
-+++ b/a	Thu Jan 01 00:00:01 1970 +0000
-@@ -1,1 +1,2 @@
- line 1
-+line 2
-
-% import of plain diff should be ok with --no-commit
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 2 changes to 2 files
-updating to branch default
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-applying ../tip.patch
-diff -r 80971e65b431 a
---- a/a
-+++ b/a
-@@ -1,1 +1,2 @@
- line 1
-+line 2
-% hg -R repo import
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 2 changes to 2 files
-updating to branch default
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-applying tip.patch
-% import from stdin
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 2 changes to 2 files
-updating to branch default
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-applying patch from stdin
-% import two patches in one stream
-applying patch from stdin
-applied 80971e65b431
-1d4bd90af0e4 tip
-1d4bd90af0e4 tip
-% override commit message
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 2 changes to 2 files
-updating to branch default
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-applying patch from stdin
-summary:     override
-% plain diff in email, subject, message body
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 2 changes to 2 files
-updating to branch default
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-applying ../msg.patch
-user:        email patcher
-summary:     email patch
-% plain diff in email, no subject, message body
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 2 changes to 2 files
-updating to branch default
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-applying patch from stdin
-% plain diff in email, subject, no message body
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 2 changes to 2 files
-updating to branch default
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-applying patch from stdin
-% plain diff in email, no subject, no message body, should fail
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 2 changes to 2 files
-updating to branch default
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-applying patch from stdin
-abort: empty commit message
-% hg export in email, should use patch header
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 2 changes to 2 files
-updating to branch default
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-applying patch from stdin
-summary:     second change
-% plain diff in email, [PATCH] subject, message body with subject
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 2 changes to 2 files
-updating to branch default
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-applying patch from stdin
-email patch
-
-next line
----
-% import patch1 patch2; rollback
-parent: 0
-applying ../patch1
-applying ../patch2
-applied 1d4bd90af0e4
-rolling back to revision 1 (undo commit)
-parent: 1
-% hg import in a subdirectory
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 2 changes to 2 files
-updating to branch default
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-applying ../../../tip.patch
-% message should be 'subdir change'
-summary:     subdir change
-% committer should be 'someoneelse'
-user:        someoneelse
-% should be empty
-% test fuzziness
-adding a
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-applying tip.patch
-patching file a
-Hunk #1 succeeded at 1 with fuzz 2 (offset -2 lines).
-reverting a
-% test fuzziness with eol=auto
-applying tip.patch
-patching file a
-Hunk #1 succeeded at 1 with fuzz 2 (offset -2 lines).
-adding a
-adding b1
-adding c1
-adding d
-diff --git a/a b/a
---- a/a
-+++ b/a
-@@ -0,0 +1,1 @@
-+a
-diff --git a/b1 b/b2
-rename from b1
-rename to b2
---- a/b1
-+++ b/b2
-@@ -0,0 +1,1 @@
-+b
-diff --git a/c1 b/c1
---- a/c1
-+++ b/c1
-@@ -0,0 +1,1 @@
-+c
-diff --git a/c1 b/c2
-copy from c1
-copy to c2
---- a/c1
-+++ b/c2
-@@ -0,0 +1,1 @@
-+c
-diff --git a/d b/d
---- a/d
-+++ b/d
-@@ -1,1 +0,0 @@
--d
-4 files updated, 0 files merged, 2 files removed, 0 files unresolved
-applying empty.diff
-% a file
-a
-% b1 file
-% b2 file
-b
-% c1 file
-c
-% c2 file
-c
-% d file
-% test trailing binary removal
-adding a
-adding b
-R a
-R b
-diff --git a/a b/a
-diff --git a/b b/b
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-applying remove.diff
-% test update+rename with common name (issue 927)
-adding a
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-applying copy.diff
-% view a
-a
-% view a2
-a
-% test -p0
-adding a
-applying patch from stdin
-bb
-% test paths outside repo root
-applying patch from stdin
-abort: ../outside/foo not under root
-% test import with similarity and git and strip (issue295 et al.)
-adding a
-applying ../rename.diff
-patching file a
-patching file b
-removing a
-adding b
-recording removal of a as rename to b (88% similar)
-A b
-  a
-R a
-undeleting a
-forgetting b
-applying ../rename.diff
-patching file a
-patching file b
-removing a
-adding b
-A b
-R a
-% add empty file from the end of patch (issue 1495)
-adding a
-applying a.patch
-% create file when source is not /dev/null
-applying ../create.patch
-a
-applying ../create2.patch
-a
-% first line mistaken for email headers (issue 1859)
-applying a.patch
-changeset:   0:5a681217c0ad
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-files:       a
-description:
-module: summary
-
-description
-
-
-% --- in commit message
-applying a.patch
-changeset:   0:f34d9187897d
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-files:       a
-description:
-module: summary
-
-
-% tricky header splitting
-applying ../trickyheaders.patch
-# HG changeset patch
-# User User B
-# Date 0 0
-# Node ID eb56ab91903632294ac504838508cb370c0901d2
-# Parent  0000000000000000000000000000000000000000
-from: tricky!
-
-That is not a header.
-
-diff --git a/foo b/foo
-new file mode 100644
---- /dev/null
-+++ b/foo
-@@ -0,0 +1,1 @@
-+foo
-% issue2102
-adding src/cmd/gc/mksys.bash
-applying patch from stdin
-parent: 1:d59915696727 tip
- help management of empty pkg and lib directories in perforce
-branch: default
-commit: (clean)
-update: (current)
-diff --git a/lib/place-holder b/lib/place-holder
-new file mode 100644
---- /dev/null
-+++ b/lib/place-holder
-@@ -0,0 +1,2 @@
-+perforce does not maintain empty directories.
-+this file helps.
-diff --git a/pkg/place-holder b/pkg/place-holder
-new file mode 100644
---- /dev/null
-+++ b/pkg/place-holder
-@@ -0,0 +1,2 @@
-+perforce does not maintain empty directories.
-+this file helps.
-diff --git a/src/cmd/gc/mksys.bash b/src/cmd/gc/mksys.bash
-old mode 100644
-new mode 100755
-% diff lines looking like headers
-adding a
-adding b
-adding c
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-applying patch from stdin
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-import.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,920 @@
+  $ hg init a
+  $ mkdir a/d1
+  $ mkdir a/d1/d2
+  $ echo line 1 > a/a
+  $ echo line 1 > a/d1/d2/a
+  $ hg --cwd a ci -Ama
+  adding a
+  adding d1/d2/a
+
+  $ echo line 2 >> a/a
+  $ hg --cwd a ci -u someone -d '1 0' -m'second change'
+
+
+import exported patch
+
+  $ hg clone -r0 a b
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 2 changes to 2 files
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg --cwd a export tip > tip.patch
+  $ hg --cwd b import ../tip.patch
+  applying ../tip.patch
+
+message should be same
+
+  $ hg --cwd b tip | grep 'second change'
+  summary:     second change
+
+committer should be same
+
+  $ hg --cwd b tip | grep someone
+  user:        someone
+  $ rm -r b
+
+
+import exported patch with external patcher
+
+  $ cat > dummypatch.py <<EOF
+  > print 'patching file a'
+  > file('a', 'wb').write('line2\n')
+  > EOF
+  $ chmod +x dummypatch.py
+  $ hg clone -r0 a b
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 2 changes to 2 files
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg --cwd a export tip > tip.patch
+  $ hg --config ui.patch='python ../dummypatch.py' --cwd b import ../tip.patch
+  applying ../tip.patch
+  $ cat b/a
+  line2
+  $ rm -r b
+
+
+import of plain diff should fail without message
+
+  $ hg clone -r0 a b
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 2 changes to 2 files
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg --cwd a diff -r0:1 > tip.patch
+  $ hg --cwd b import ../tip.patch
+  applying ../tip.patch
+  abort: empty commit message
+  [255]
+  $ rm -r b
+
+
+import of plain diff should be ok with message
+
+  $ hg clone -r0 a b
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 2 changes to 2 files
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg --cwd a diff -r0:1 > tip.patch
+  $ hg --cwd b import -mpatch ../tip.patch
+  applying ../tip.patch
+  $ rm -r b
+
+
+import of plain diff with specific date and user
+
+  $ hg clone -r0 a b
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 2 changes to 2 files
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg --cwd a diff -r0:1 > tip.patch
+  $ hg --cwd b import -mpatch -d '1 0' -u 'user@nowhere.net' ../tip.patch
+  applying ../tip.patch
+  $ hg -R b tip -pv
+  changeset:   1:ca68f19f3a40
+  tag:         tip
+  user:        user@nowhere.net
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  files:       a
+  description:
+  patch
+  
+  
+  diff -r 80971e65b431 -r ca68f19f3a40 a
+  --- a/a	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/a	Thu Jan 01 00:00:01 1970 +0000
+  @@ -1,1 +1,2 @@
+   line 1
+  +line 2
+  
+  $ rm -r b
+
+
+import of plain diff should be ok with --no-commit
+
+  $ hg clone -r0 a b
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 2 changes to 2 files
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg --cwd a diff -r0:1 > tip.patch
+  $ hg --cwd b import --no-commit ../tip.patch
+  applying ../tip.patch
+  $ hg --cwd b diff --nodates
+  diff -r 80971e65b431 a
+  --- a/a
+  +++ b/a
+  @@ -1,1 +1,2 @@
+   line 1
+  +line 2
+  $ rm -r b
+
+
+hg -R repo import
+put the clone in a subdir - having a directory named "a"
+used to hide a bug.
+
+  $ mkdir dir
+  $ hg clone -r0 a dir/b
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 2 changes to 2 files
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg --cwd a export tip > dir/tip.patch
+  $ cd dir
+  $ hg -R b import tip.patch
+  applying tip.patch
+  $ cd ..
+  $ rm -r dir
+
+
+import from stdin
+
+  $ hg clone -r0 a b
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 2 changes to 2 files
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg --cwd a export tip | hg --cwd b import -
+  applying patch from stdin
+  $ rm -r b
+
+
+import two patches in one stream
+
+  $ hg init b
+  $ hg --cwd a export 0:tip | hg --cwd b import -
+  applying patch from stdin
+  applied 80971e65b431
+  $ hg --cwd a id
+  1d4bd90af0e4 tip
+  $ hg --cwd b id
+  1d4bd90af0e4 tip
+  $ rm -r b
+
+
+override commit message
+
+  $ hg clone -r0 a b
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 2 changes to 2 files
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg --cwd a export tip | hg --cwd b import -m 'override' -
+  applying patch from stdin
+  $ hg --cwd b tip | grep override
+  summary:     override
+  $ rm -r b
+
+  $ cat > mkmsg.py <<EOF
+  > import email.Message, sys
+  > msg = email.Message.Message()
+  > msg.set_payload('email commit message\n' + open('tip.patch', 'rb').read())
+  > msg['Subject'] = 'email patch'
+  > msg['From'] = 'email patcher'
+  > sys.stdout.write(msg.as_string())
+  > EOF
+
+
+plain diff in email, subject, message body
+
+  $ hg clone -r0 a b
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 2 changes to 2 files
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg --cwd a diff -r0:1 > tip.patch
+  $ python mkmsg.py > msg.patch
+  $ hg --cwd b import ../msg.patch
+  applying ../msg.patch
+  $ hg --cwd b tip | grep email
+  user:        email patcher
+  summary:     email patch
+  $ rm -r b
+
+
+plain diff in email, no subject, message body
+
+  $ hg clone -r0 a b
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 2 changes to 2 files
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ grep -v '^Subject:' msg.patch | hg --cwd b import -
+  applying patch from stdin
+  $ rm -r b
+
+
+plain diff in email, subject, no message body
+
+  $ hg clone -r0 a b
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 2 changes to 2 files
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ grep -v '^email ' msg.patch | hg --cwd b import -
+  applying patch from stdin
+  $ rm -r b
+
+
+plain diff in email, no subject, no message body, should fail
+
+  $ hg clone -r0 a b
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 2 changes to 2 files
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ egrep -v '^(Subject|email)' msg.patch | hg --cwd b import -
+  applying patch from stdin
+  abort: empty commit message
+  [255]
+  $ rm -r b
+
+
+hg export in email, should use patch header
+
+  $ hg clone -r0 a b
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 2 changes to 2 files
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg --cwd a export tip > tip.patch
+  $ python mkmsg.py | hg --cwd b import -
+  applying patch from stdin
+  $ hg --cwd b tip | grep second
+  summary:     second change
+  $ rm -r b
+
+
+subject: duplicate detection, removal of [PATCH]
+The '---' tests the gitsendmail handling without proper mail headers
+
+  $ cat > mkmsg2.py <<EOF
+  > import email.Message, sys
+  > msg = email.Message.Message()
+  > msg.set_payload('email patch\n\nnext line\n---\n' + open('tip.patch').read())
+  > msg['Subject'] = '[PATCH] email patch'
+  > msg['From'] = 'email patcher'
+  > sys.stdout.write(msg.as_string())
+  > EOF
+
+
+plain diff in email, [PATCH] subject, message body with subject
+
+  $ hg clone -r0 a b
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 2 changes to 2 files
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg --cwd a diff -r0:1 > tip.patch
+  $ python mkmsg2.py | hg --cwd b import -
+  applying patch from stdin
+  $ hg --cwd b tip --template '{desc}\n'
+  email patch
+  
+  next line
+  ---
+  $ rm -r b
+
+
+We weren't backing up the correct dirstate file when importing many patches
+(issue963)
+import patch1 patch2; rollback
+
+  $ echo line 3 >> a/a
+  $ hg --cwd a ci -m'third change'
+  $ hg --cwd a export -o '../patch%R' 1 2
+  $ hg clone -qr0 a b
+  $ hg --cwd b parents --template 'parent: {rev}\n'
+  parent: 0
+  $ hg --cwd b import ../patch1 ../patch2
+  applying ../patch1
+  applying ../patch2
+  applied 1d4bd90af0e4
+  $ hg --cwd b rollback
+  rolling back to revision 1 (undo commit)
+  $ hg --cwd b parents --template 'parent: {rev}\n'
+  parent: 1
+  $ rm -r b
+
+
+importing a patch in a subdirectory failed at the commit stage
+
+  $ echo line 2 >> a/d1/d2/a
+  $ hg --cwd a ci -u someoneelse -d '1 0' -m'subdir change'
+
+hg import in a subdirectory
+
+  $ hg clone -r0 a b
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 2 changes to 2 files
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg --cwd a export tip > tmp
+  $ sed -e 's/d1\/d2\///' < tmp > tip.patch
+  $ dir=`pwd`
+  $ cd b/d1/d2 2>&1 > /dev/null
+  $ hg import  ../../../tip.patch
+  applying ../../../tip.patch
+  $ cd "$dir"
+
+message should be 'subdir change'
+
+  $ hg --cwd b tip | grep 'subdir change'
+  summary:     subdir change
+
+committer should be 'someoneelse'
+
+  $ hg --cwd b tip | grep someoneelse
+  user:        someoneelse
+
+should be empty
+
+  $ hg --cwd b status
+
+
+Test fuzziness (ambiguous patch location, fuzz=2)
+
+  $ hg init fuzzy
+  $ cd fuzzy
+  $ echo line1 > a
+  $ echo line0 >> a
+  $ echo line3 >> a
+  $ hg ci -Am adda
+  adding a
+  $ echo line1 > a
+  $ echo line2 >> a
+  $ echo line0 >> a
+  $ echo line3 >> a
+  $ hg ci -m change a
+  $ hg export tip > tip.patch
+  $ hg up -C 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo line1 > a
+  $ echo line0 >> a
+  $ echo line1 >> a
+  $ echo line0 >> a
+  $ hg ci -m brancha
+  created new head
+  $ hg import --no-commit -v tip.patch
+  applying tip.patch
+  patching file a
+  Hunk #1 succeeded at 1 with fuzz 2 (offset -2 lines).
+  $ hg revert -a
+  reverting a
+
+test fuzziness with eol=auto
+
+  $ hg --config patch.eol=auto import --no-commit -v tip.patch
+  applying tip.patch
+  patching file a
+  Hunk #1 succeeded at 1 with fuzz 2 (offset -2 lines).
+  $ cd ..
+
+
+Test hunk touching empty files (issue906)
+
+  $ hg init empty
+  $ cd empty
+  $ touch a
+  $ touch b1
+  $ touch c1
+  $ echo d > d
+  $ hg ci -Am init
+  adding a
+  adding b1
+  adding c1
+  adding d
+  $ echo a > a
+  $ echo b > b1
+  $ hg mv b1 b2
+  $ echo c > c1
+  $ hg copy c1 c2
+  $ rm d
+  $ touch d
+  $ hg diff --git
+  diff --git a/a b/a
+  --- a/a
+  +++ b/a
+  @@ -0,0 +1,1 @@
+  +a
+  diff --git a/b1 b/b2
+  rename from b1
+  rename to b2
+  --- a/b1
+  +++ b/b2
+  @@ -0,0 +1,1 @@
+  +b
+  diff --git a/c1 b/c1
+  --- a/c1
+  +++ b/c1
+  @@ -0,0 +1,1 @@
+  +c
+  diff --git a/c1 b/c2
+  copy from c1
+  copy to c2
+  --- a/c1
+  +++ b/c2
+  @@ -0,0 +1,1 @@
+  +c
+  diff --git a/d b/d
+  --- a/d
+  +++ b/d
+  @@ -1,1 +0,0 @@
+  -d
+  $ hg ci -m empty
+  $ hg export --git tip > empty.diff
+  $ hg up -C 0
+  4 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  $ hg import empty.diff
+  applying empty.diff
+  $ for name in a b1 b2 c1 c2 d; do
+  >   echo % $name file
+  >   test -f $name && cat $name
+  >   done
+  % a file
+  a
+  % b1 file
+  % b2 file
+  b
+  % c1 file
+  c
+  % c2 file
+  c
+  % d file
+  $ cd ..
+
+
+Test importing a patch ending with a binary file removal
+
+  $ hg init binaryremoval
+  $ cd binaryremoval
+  $ echo a > a
+  $ python -c "file('b', 'wb').write('a\x00b')"
+  $ hg ci -Am addall
+  adding a
+  adding b
+  $ hg rm a
+  $ hg rm b
+  $ hg st
+  R a
+  R b
+  $ hg ci -m remove
+  $ hg export --git . > remove.diff
+  $ cat remove.diff | grep git
+  diff --git a/a b/a
+  diff --git a/b b/b
+  $ hg up -C 0
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg import remove.diff
+  applying remove.diff
+  $ hg manifest
+  $ cd ..
+
+
+test update+rename with common name (issue 927)
+
+  $ hg init t
+  $ cd t
+  $ touch a
+  $ hg ci -Am t
+  adding a
+  $ echo a > a
+
+Here, bfile.startswith(afile)
+
+  $ hg copy a a2
+  $ hg ci -m copya
+  $ hg export --git tip > copy.diff
+  $ hg up -C 0
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg import copy.diff
+  applying copy.diff
+
+a should contain an 'a'
+
+  $ cat a
+  a
+
+and a2 should have duplicated it
+
+  $ cat a2
+  a
+  $ cd ..
+
+
+test -p0
+
+  $ hg init p0
+  $ cd p0
+  $ echo a > a
+  $ hg ci -Am t
+  adding a
+  $ hg import -p0 - << EOF
+  > foobar
+  > --- a	Sat Apr 12 22:43:58 2008 -0400
+  > +++ a	Sat Apr 12 22:44:05 2008 -0400
+  > @@ -1,1 +1,1 @@
+  > -a
+  > +bb
+  > EOF
+  applying patch from stdin
+  $ hg status
+  $ cat a
+  bb
+  $ cd ..
+
+
+test paths outside repo root
+
+  $ mkdir outside
+  $ touch outside/foo
+  $ hg init inside
+  $ cd inside
+  $ hg import - <<EOF
+  > diff --git a/a b/b
+  > rename from ../outside/foo
+  > rename to bar
+  > EOF
+  applying patch from stdin
+  abort: ../outside/foo not under root
+  [255]
+  $ cd ..
+
+
+test import with similarity and git and strip (issue295 et al.)
+
+  $ hg init sim
+  $ cd sim
+  $ echo 'this is a test' > a
+  $ hg ci -Ama
+  adding a
+  $ cat > ../rename.diff <<EOF
+  > diff --git a/foo/a b/foo/a
+  > deleted file mode 100644
+  > --- a/foo/a
+  > +++ /dev/null
+  > @@ -1,1 +0,0 @@
+  > -this is a test
+  > diff --git a/foo/b b/foo/b
+  > new file mode 100644
+  > --- /dev/null
+  > +++ b/foo/b
+  > @@ -0,0 +1,2 @@
+  > +this is a test
+  > +foo
+  > EOF
+  $ hg import --no-commit -v -s 1 ../rename.diff -p2
+  applying ../rename.diff
+  patching file a
+  patching file b
+  removing a
+  adding b
+  recording removal of a as rename to b (88% similar)
+  $ hg st -C
+  A b
+    a
+  R a
+  $ hg revert -a
+  undeleting a
+  forgetting b
+  $ rm b
+  $ hg import --no-commit -v -s 100 ../rename.diff -p2
+  applying ../rename.diff
+  patching file a
+  patching file b
+  removing a
+  adding b
+  $ hg st -C
+  A b
+  R a
+  $ cd ..
+
+
+add empty file from the end of patch (issue 1495)
+
+  $ hg init addemptyend
+  $ cd addemptyend
+  $ touch a
+  $ hg addremove
+  adding a
+  $ hg ci -m "commit"
+  $ cat > a.patch <<EOF
+  > diff --git a/a b/a
+  > --- a/a
+  > +++ b/a
+  > @@ -0,0 +1,1 @@
+  > +a
+  > diff --git a/b b/b
+  > new file mode 100644
+  > EOF
+  $ hg import --no-commit a.patch
+  applying a.patch
+  $ cd ..
+
+
+create file when source is not /dev/null
+
+  $ cat > create.patch <<EOF
+  > diff -Naur proj-orig/foo proj-new/foo
+  > --- proj-orig/foo       1969-12-31 16:00:00.000000000 -0800
+  > +++ proj-new/foo        2009-07-17 16:50:45.801368000 -0700
+  > @@ -0,0 +1,1 @@
+  > +a
+  > EOF
+
+some people have patches like the following too
+
+  $ cat > create2.patch <<EOF
+  > diff -Naur proj-orig/foo proj-new/foo
+  > --- proj-orig/foo.orig  1969-12-31 16:00:00.000000000 -0800
+  > +++ proj-new/foo        2009-07-17 16:50:45.801368000 -0700
+  > @@ -0,0 +1,1 @@
+  > +a
+  > EOF
+  $ hg init oddcreate
+  $ cd oddcreate
+  $ hg import --no-commit ../create.patch
+  applying ../create.patch
+  $ cat foo
+  a
+  $ rm foo
+  $ hg revert foo
+  $ hg import --no-commit ../create2.patch
+  applying ../create2.patch
+  $ cat foo
+  a
+
+
+first line mistaken for email headers (issue 1859)
+
+  $ hg init emailconfusion
+  $ cd emailconfusion
+  $ cat > a.patch <<EOF
+  > module: summary
+  > 
+  > description
+  > 
+  > 
+  > diff -r 000000000000 -r 9b4c1e343b55 test.txt
+  > --- /dev/null
+  > +++ b/a
+  > @@ -0,0 +1,1 @@
+  > +a
+  > EOF
+  $ hg import -d '0 0' a.patch
+  applying a.patch
+  $ hg parents -v
+  changeset:   0:5a681217c0ad
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files:       a
+  description:
+  module: summary
+  
+  description
+  
+  
+  $ cd ..
+
+
+--- in commit message
+
+  $ hg init commitconfusion
+  $ cd commitconfusion
+  $ cat > a.patch <<EOF
+  > module: summary
+  > 
+  > --- description
+  > 
+  > diff --git a/a b/a
+  > new file mode 100644
+  > --- /dev/null
+  > +++ b/a
+  > @@ -0,0 +1,1 @@
+  > +a
+  > EOF
+  > hg import -d '0 0' a.patch
+  > hg parents -v
+  > cd ..
+  > 
+  > echo '% tricky header splitting'
+  > cat > trickyheaders.patch <<EOF
+  > From: User A <user@a>
+  > Subject: [PATCH] from: tricky!
+  > 
+  > # HG changeset patch
+  > # User User B
+  > # Date 1266264441 18000
+  > # Branch stable
+  > # Node ID f2be6a1170ac83bf31cb4ae0bad00d7678115bc0
+  > # Parent  0000000000000000000000000000000000000000
+  > from: tricky!
+  > 
+  > That is not a header.
+  > 
+  > diff -r 000000000000 -r f2be6a1170ac foo
+  > --- /dev/null
+  > +++ b/foo
+  > @@ -0,0 +1,1 @@
+  > +foo
+  > EOF
+  applying a.patch
+  changeset:   0:f34d9187897d
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files:       a
+  description:
+  module: summary
+  
+  
+  % tricky header splitting
+
+  $ hg init trickyheaders
+  $ cd trickyheaders
+  $ hg import -d '0 0' ../trickyheaders.patch
+  applying ../trickyheaders.patch
+  $ hg export --git tip
+  # HG changeset patch
+  # User User B
+  # Date 0 0
+  # Node ID eb56ab91903632294ac504838508cb370c0901d2
+  # Parent  0000000000000000000000000000000000000000
+  from: tricky!
+  
+  That is not a header.
+  
+  diff --git a/foo b/foo
+  new file mode 100644
+  --- /dev/null
+  +++ b/foo
+  @@ -0,0 +1,1 @@
+  +foo
+  $ cd ..
+
+
+issue2102
+
+  $ hg init issue2102
+  $ cd issue2102
+  $ mkdir -p src/cmd/gc
+  $ touch src/cmd/gc/mksys.bash
+  $ hg ci -Am init
+  adding src/cmd/gc/mksys.bash
+  $ hg import - <<EOF
+  > # HG changeset patch
+  > # User Rob Pike
+  > # Date 1216685449 25200
+  > # Node ID 03aa2b206f499ad6eb50e6e207b9e710d6409c98
+  > # Parent  93d10138ad8df586827ca90b4ddb5033e21a3a84
+  > help management of empty pkg and lib directories in perforce
+  > 
+  > R=gri
+  > DELTA=4  (4 added, 0 deleted, 0 changed)
+  > OCL=13328
+  > CL=13328
+  > 
+  > diff --git a/lib/place-holder b/lib/place-holder
+  > new file mode 100644
+  > --- /dev/null
+  > +++ b/lib/place-holder
+  > @@ -0,0 +1,2 @@
+  > +perforce does not maintain empty directories.
+  > +this file helps.
+  > diff --git a/pkg/place-holder b/pkg/place-holder
+  > new file mode 100644
+  > --- /dev/null
+  > +++ b/pkg/place-holder
+  > @@ -0,0 +1,2 @@
+  > +perforce does not maintain empty directories.
+  > +this file helps.
+  > diff --git a/src/cmd/gc/mksys.bash b/src/cmd/gc/mksys.bash
+  > old mode 100644
+  > new mode 100755
+  > EOF
+  applying patch from stdin
+  $ hg sum
+  parent: 1:d59915696727 tip
+   help management of empty pkg and lib directories in perforce
+  branch: default
+  commit: (clean)
+  update: (current)
+  $ hg diff --git -c tip
+  diff --git a/lib/place-holder b/lib/place-holder
+  new file mode 100644
+  --- /dev/null
+  +++ b/lib/place-holder
+  @@ -0,0 +1,2 @@
+  +perforce does not maintain empty directories.
+  +this file helps.
+  diff --git a/pkg/place-holder b/pkg/place-holder
+  new file mode 100644
+  --- /dev/null
+  +++ b/pkg/place-holder
+  @@ -0,0 +1,2 @@
+  +perforce does not maintain empty directories.
+  +this file helps.
+  diff --git a/src/cmd/gc/mksys.bash b/src/cmd/gc/mksys.bash
+  old mode 100644
+  new mode 100755
+  $ cd ..
+
+
+diff lines looking like headers
+
+  $ hg init difflineslikeheaders
+  $ cd difflineslikeheaders
+  $ echo a >a
+  $ echo b >b
+  $ echo c >c
+  $ hg ci -Am1
+  adding a
+  adding b
+  adding c
+
+  $ echo "key: value" >>a
+  $ echo "key: value" >>b
+  $ echo "foo" >>c
+  $ hg ci -m2
+
+  $ hg up -C 0
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg diff --git -c1 >want
+  $ hg diff -c1 | hg import --no-commit -
+  applying patch from stdin
+  $ hg diff --git >have
+  $ diff want have
+  $ cd ..
+
--- a/tests/test-incoming-outgoing	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-#!/bin/sh
-
-mkdir test
-cd test
-hg init
-for i in 0 1 2 3 4 5 6 7 8; do
-	echo $i >> foo
-	hg commit -A -m $i -d "1000000 0"
-done
-hg verify
-hg serve -p $HGPORT -d --pid-file=hg.pid
-cat hg.pid >> $DAEMON_PIDS
-cd ..
-
-hg init new
-# http incoming
-hg -R new incoming http://localhost:$HGPORT/ | sed -e "s,:$HGPORT/,:\$HGPORT/,"
-hg -R new incoming -r 4 http://localhost:$HGPORT/ | sed -e "s,:$HGPORT/,:\$HGPORT/,"
-# local incoming
-hg -R new incoming test
-hg -R new incoming -r 4 test
-echo "% limit to 2 changesets"
-hg -R new incoming -l 2 test
-echo "% limit to 2 changesets, test with -p --git"
-hg -R new incoming -l 2 -p --git test
-
-# test with --bundle
-hg -R new incoming --bundle test.hg http://localhost:$HGPORT/ | sed -e "s,:$HGPORT/,:\$HGPORT/,"
-hg -R new incoming --bundle test2.hg test
-
-# test the resulting bundles
-hg init temp
-hg init temp2
-hg -R temp unbundle test.hg
-hg -R temp2 unbundle test2.hg
-hg -R temp tip
-hg -R temp2 tip
-
-rm -r temp temp2 new
-
-# test outgoing
-hg clone test test-dev
-cd test-dev
-for i in 9 10 11 12 13; do
-	echo $i >> foo
-	hg commit -A -m $i -d "1000000 0"
-done
-hg verify
-cd ..
-hg -R test-dev outgoing test
-echo "% limit to 3 changesets"
-hg -R test-dev outgoing -l 3 test
-hg -R test-dev outgoing http://localhost:$HGPORT/ | sed -e "s,:$HGPORT/,:\$HGPORT/,"
-hg -R test-dev outgoing -r 11 http://localhost:$HGPORT/ | sed -e "s,:$HGPORT/,:\$HGPORT/,"
--- a/tests/test-incoming-outgoing.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,405 +0,0 @@
-adding foo
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 9 changesets, 9 total revisions
-comparing with http://localhost:$HGPORT/
-changeset:   0:9cb21d99fe27
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     0
-
-changeset:   1:d717f5dfad6a
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     1
-
-changeset:   2:c0d6b86da426
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     2
-
-changeset:   3:dfacbd43b3fe
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     3
-
-changeset:   4:1f3a964b6022
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     4
-
-changeset:   5:c028bcc7a28a
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     5
-
-changeset:   6:a0c0095f3389
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     6
-
-changeset:   7:d4be65f4e891
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     7
-
-changeset:   8:92b83e334ef8
-tag:         tip
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     8
-
-comparing with http://localhost:$HGPORT/
-changeset:   0:9cb21d99fe27
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     0
-
-changeset:   1:d717f5dfad6a
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     1
-
-changeset:   2:c0d6b86da426
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     2
-
-changeset:   3:dfacbd43b3fe
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     3
-
-changeset:   4:1f3a964b6022
-tag:         tip
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     4
-
-comparing with test
-changeset:   0:9cb21d99fe27
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     0
-
-changeset:   1:d717f5dfad6a
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     1
-
-changeset:   2:c0d6b86da426
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     2
-
-changeset:   3:dfacbd43b3fe
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     3
-
-changeset:   4:1f3a964b6022
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     4
-
-changeset:   5:c028bcc7a28a
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     5
-
-changeset:   6:a0c0095f3389
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     6
-
-changeset:   7:d4be65f4e891
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     7
-
-changeset:   8:92b83e334ef8
-tag:         tip
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     8
-
-comparing with test
-changeset:   0:9cb21d99fe27
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     0
-
-changeset:   1:d717f5dfad6a
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     1
-
-changeset:   2:c0d6b86da426
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     2
-
-changeset:   3:dfacbd43b3fe
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     3
-
-changeset:   4:1f3a964b6022
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     4
-
-% limit to 2 changesets
-comparing with test
-changeset:   0:9cb21d99fe27
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     0
-
-changeset:   1:d717f5dfad6a
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     1
-
-% limit to 2 changesets, test with -p --git
-comparing with test
-changeset:   0:9cb21d99fe27
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     0
-
-diff --git a/foo b/foo
-new file mode 100644
---- /dev/null
-+++ b/foo
-@@ -0,0 +1,1 @@
-+0
-
-changeset:   1:d717f5dfad6a
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     1
-
-diff --git a/foo b/foo
---- a/foo
-+++ b/foo
-@@ -1,1 +1,2 @@
- 0
-+1
-
-comparing with http://localhost:$HGPORT/
-changeset:   0:9cb21d99fe27
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     0
-
-changeset:   1:d717f5dfad6a
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     1
-
-changeset:   2:c0d6b86da426
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     2
-
-changeset:   3:dfacbd43b3fe
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     3
-
-changeset:   4:1f3a964b6022
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     4
-
-changeset:   5:c028bcc7a28a
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     5
-
-changeset:   6:a0c0095f3389
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     6
-
-changeset:   7:d4be65f4e891
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     7
-
-changeset:   8:92b83e334ef8
-tag:         tip
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     8
-
-comparing with test
-changeset:   0:9cb21d99fe27
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     0
-
-changeset:   1:d717f5dfad6a
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     1
-
-changeset:   2:c0d6b86da426
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     2
-
-changeset:   3:dfacbd43b3fe
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     3
-
-changeset:   4:1f3a964b6022
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     4
-
-changeset:   5:c028bcc7a28a
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     5
-
-changeset:   6:a0c0095f3389
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     6
-
-changeset:   7:d4be65f4e891
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     7
-
-changeset:   8:92b83e334ef8
-tag:         tip
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     8
-
-adding changesets
-adding manifests
-adding file changes
-added 9 changesets with 9 changes to 1 files
-(run 'hg update' to get a working copy)
-adding changesets
-adding manifests
-adding file changes
-added 9 changesets with 9 changes to 1 files
-(run 'hg update' to get a working copy)
-changeset:   8:92b83e334ef8
-tag:         tip
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     8
-
-changeset:   8:92b83e334ef8
-tag:         tip
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     8
-
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 14 changesets, 14 total revisions
-comparing with test
-searching for changes
-changeset:   9:3741c3ad1096
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     9
-
-changeset:   10:de4143c8d9a5
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     10
-
-changeset:   11:0e1c188b9a7a
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     11
-
-changeset:   12:251354d0fdd3
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     12
-
-changeset:   13:bdaadd969642
-tag:         tip
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     13
-
-% limit to 3 changesets
-comparing with test
-searching for changes
-changeset:   9:3741c3ad1096
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     9
-
-changeset:   10:de4143c8d9a5
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     10
-
-changeset:   11:0e1c188b9a7a
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     11
-
-comparing with http://localhost:$HGPORT/
-searching for changes
-changeset:   9:3741c3ad1096
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     9
-
-changeset:   10:de4143c8d9a5
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     10
-
-changeset:   11:0e1c188b9a7a
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     11
-
-changeset:   12:251354d0fdd3
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     12
-
-changeset:   13:bdaadd969642
-tag:         tip
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     13
-
-comparing with http://localhost:$HGPORT/
-searching for changes
-changeset:   9:3741c3ad1096
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     9
-
-changeset:   10:de4143c8d9a5
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     10
-
-changeset:   11:0e1c188b9a7a
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     11
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-incoming-outgoing.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,468 @@
+  $ mkdir test
+  $ cd test
+  $ hg init
+  $ for i in 0 1 2 3 4 5 6 7 8; do
+  >     echo $i >> foo
+  >     hg commit -A -m $i
+  > done
+  adding foo
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 9 changesets, 9 total revisions
+  $ hg serve -p $HGPORT -d --pid-file=hg.pid
+  $ cat hg.pid >> $DAEMON_PIDS
+  $ cd ..
+
+  $ hg init new
+
+http incoming
+
+  $ hg -R new incoming http://localhost:$HGPORT/
+  comparing with http://localhost:\d+/ (re)
+  changeset:   0:00a43fa82f62
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     0
+  
+  changeset:   1:5460a410df01
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     1
+  
+  changeset:   2:d9f42cd1a1ec
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     2
+  
+  changeset:   3:376476025137
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     3
+  
+  changeset:   4:70d7eb252d49
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     4
+  
+  changeset:   5:ad284ee3b5ee
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     5
+  
+  changeset:   6:e9229f2de384
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     6
+  
+  changeset:   7:d152815bb8db
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     7
+  
+  changeset:   8:e4feb4ac9035
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     8
+  
+  $ hg -R new incoming -r 4 http://localhost:$HGPORT/
+  comparing with http://localhost:\d+/ (re)
+  changeset:   0:00a43fa82f62
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     0
+  
+  changeset:   1:5460a410df01
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     1
+  
+  changeset:   2:d9f42cd1a1ec
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     2
+  
+  changeset:   3:376476025137
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     3
+  
+  changeset:   4:70d7eb252d49
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     4
+  
+
+local incoming
+
+  $ hg -R new incoming test
+  comparing with test
+  changeset:   0:00a43fa82f62
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     0
+  
+  changeset:   1:5460a410df01
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     1
+  
+  changeset:   2:d9f42cd1a1ec
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     2
+  
+  changeset:   3:376476025137
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     3
+  
+  changeset:   4:70d7eb252d49
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     4
+  
+  changeset:   5:ad284ee3b5ee
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     5
+  
+  changeset:   6:e9229f2de384
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     6
+  
+  changeset:   7:d152815bb8db
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     7
+  
+  changeset:   8:e4feb4ac9035
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     8
+  
+  $ hg -R new incoming -r 4 test
+  comparing with test
+  changeset:   0:00a43fa82f62
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     0
+  
+  changeset:   1:5460a410df01
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     1
+  
+  changeset:   2:d9f42cd1a1ec
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     2
+  
+  changeset:   3:376476025137
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     3
+  
+  changeset:   4:70d7eb252d49
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     4
+  
+
+limit to 2 changesets
+
+  $ hg -R new incoming -l 2 test
+  comparing with test
+  changeset:   0:00a43fa82f62
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     0
+  
+  changeset:   1:5460a410df01
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     1
+  
+
+limit to 2 changesets, test with -p --git
+
+  $ hg -R new incoming -l 2 -p --git test
+  comparing with test
+  changeset:   0:00a43fa82f62
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     0
+  
+  diff --git a/foo b/foo
+  new file mode 100644
+  --- /dev/null
+  +++ b/foo
+  @@ -0,0 +1,1 @@
+  +0
+  
+  changeset:   1:5460a410df01
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     1
+  
+  diff --git a/foo b/foo
+  --- a/foo
+  +++ b/foo
+  @@ -1,1 +1,2 @@
+   0
+  +1
+  
+
+test with --bundle
+
+  $ hg -R new incoming --bundle test.hg http://localhost:$HGPORT/
+  comparing with http://localhost:*/ (glob)
+  changeset:   0:00a43fa82f62
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     0
+  
+  changeset:   1:5460a410df01
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     1
+  
+  changeset:   2:d9f42cd1a1ec
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     2
+  
+  changeset:   3:376476025137
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     3
+  
+  changeset:   4:70d7eb252d49
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     4
+  
+  changeset:   5:ad284ee3b5ee
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     5
+  
+  changeset:   6:e9229f2de384
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     6
+  
+  changeset:   7:d152815bb8db
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     7
+  
+  changeset:   8:e4feb4ac9035
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     8
+  
+  $ hg -R new incoming --bundle test2.hg test
+  comparing with test
+  changeset:   0:00a43fa82f62
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     0
+  
+  changeset:   1:5460a410df01
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     1
+  
+  changeset:   2:d9f42cd1a1ec
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     2
+  
+  changeset:   3:376476025137
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     3
+  
+  changeset:   4:70d7eb252d49
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     4
+  
+  changeset:   5:ad284ee3b5ee
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     5
+  
+  changeset:   6:e9229f2de384
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     6
+  
+  changeset:   7:d152815bb8db
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     7
+  
+  changeset:   8:e4feb4ac9035
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     8
+  
+
+
+test the resulting bundles
+
+  $ hg init temp
+  $ hg init temp2
+  $ hg -R temp unbundle test.hg
+  adding changesets
+  adding manifests
+  adding file changes
+  added 9 changesets with 9 changes to 1 files
+  (run 'hg update' to get a working copy)
+  $ hg -R temp2 unbundle test2.hg
+  adding changesets
+  adding manifests
+  adding file changes
+  added 9 changesets with 9 changes to 1 files
+  (run 'hg update' to get a working copy)
+  $ hg -R temp tip
+  changeset:   8:e4feb4ac9035
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     8
+  
+  $ hg -R temp2 tip
+  changeset:   8:e4feb4ac9035
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     8
+  
+
+  $ rm -r temp temp2 new
+
+test outgoing
+
+  $ hg clone test test-dev
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd test-dev
+  $ for i in 9 10 11 12 13; do
+  >     echo $i >> foo
+  >     hg commit -A -m $i
+  > done
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 14 changesets, 14 total revisions
+  $ cd ..
+  $ hg -R test-dev outgoing test
+  comparing with test
+  searching for changes
+  changeset:   9:d89d4abea5bc
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     9
+  
+  changeset:   10:820095aa7158
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     10
+  
+  changeset:   11:09ede2f3a638
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     11
+  
+  changeset:   12:e576b1bed305
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     12
+  
+  changeset:   13:96bbff09a7cc
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     13
+  
+
+limit to 3 changesets
+
+  $ hg -R test-dev outgoing -l 3 test
+  comparing with test
+  searching for changes
+  changeset:   9:d89d4abea5bc
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     9
+  
+  changeset:   10:820095aa7158
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     10
+  
+  changeset:   11:09ede2f3a638
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     11
+  
+  $ hg -R test-dev outgoing http://localhost:$HGPORT/
+  comparing with http://localhost:*/ (glob)
+  searching for changes
+  changeset:   9:d89d4abea5bc
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     9
+  
+  changeset:   10:820095aa7158
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     10
+  
+  changeset:   11:09ede2f3a638
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     11
+  
+  changeset:   12:e576b1bed305
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     12
+  
+  changeset:   13:96bbff09a7cc
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     13
+  
+  $ hg -R test-dev outgoing -r 11 http://localhost:$HGPORT/
+  comparing with http://localhost:*/ (glob)
+  searching for changes
+  changeset:   9:d89d4abea5bc
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     9
+  
+  changeset:   10:820095aa7158
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     10
+  
+  changeset:   11:09ede2f3a638
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     11
+  
--- a/tests/test-inherit-mode	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,91 +0,0 @@
-#!/bin/sh
-
-# test that new files created in .hg inherit the permissions from .hg/store
-
-"$TESTDIR/hghave" unix-permissions || exit 80
-
-mkdir dir
-# just in case somebody has a strange $TMPDIR
-chmod g-s dir
-cd dir
-
-cat >printmodes.py <<EOF
-import os, sys
-
-allnames = []
-isdir = {}
-for root, dirs, files in os.walk(sys.argv[1]):
-    for d in dirs:
-	name = os.path.join(root, d)
-	isdir[name] = 1
-	allnames.append(name)
-    for f in files:
-	name = os.path.join(root, f)
-	allnames.append(name)
-allnames.sort()
-for name in allnames:
-    suffix = name in isdir and '/' or ''
-    print '%05o %s%s' % (os.lstat(name).st_mode & 07777, name, suffix)
-EOF
-
-cat >mode.py <<EOF
-import sys
-import os
-print '%05o' % os.lstat(sys.argv[1]).st_mode
-EOF
-
-umask 077
-
-hg init repo
-cd repo
-
-chmod 0770 .hg/store
-
-echo '% before commit'
-echo '% store can be written by the group, other files cannot'
-echo '% store is setgid'
-python ../printmodes.py .
-
-mkdir dir
-touch foo dir/bar
-hg ci -qAm 'add files'
-
-echo
-echo '% after commit'
-echo '% working dir files can only be written by the owner'
-echo '% files created in .hg can be written by the group'
-echo '% (in particular, store/**, dirstate, branch cache file, undo files)'
-echo '% new directories are setgid'
-python ../printmodes.py .
-
-umask 007
-hg init ../push
-echo
-echo '% before push'
-echo '% group can write everything'
-python ../printmodes.py ../push
-
-umask 077
-hg -q push ../push
-echo
-echo '% after push'
-echo '% group can still write everything'
-python ../printmodes.py ../push
-
-# Test that we don't lose the setgid bit when we call chmod.
-# Not all systems support setgid directories (e.g. HFS+), so
-# just check that directories have the same mode.
-cd ..
-hg init setgid
-cd setgid
-chmod g+rwx .hg/store
-chmod g+s .hg/store 2> /dev/null
-mkdir dir
-touch dir/file
-hg ci -qAm 'add dir/file'
-storemode=`python ../mode.py .hg/store`
-dirmode=`python ../mode.py .hg/store/data/dir`
-if [ "$storemode" != "$dirmode" ]; then
-    echo "$storemode != $dirmode"
-fi
-
--- a/tests/test-inherit-mode.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-% before commit
-% store can be written by the group, other files cannot
-% store is setgid
-00700 ./.hg/
-00600 ./.hg/00changelog.i
-00600 ./.hg/requires
-00770 ./.hg/store/
-
-% after commit
-% working dir files can only be written by the owner
-% files created in .hg can be written by the group
-% (in particular, store/**, dirstate, branch cache file, undo files)
-% new directories are setgid
-00700 ./.hg/
-00600 ./.hg/00changelog.i
-00660 ./.hg/dirstate
-00660 ./.hg/last-message.txt
-00600 ./.hg/requires
-00770 ./.hg/store/
-00660 ./.hg/store/00changelog.i
-00660 ./.hg/store/00manifest.i
-00770 ./.hg/store/data/
-00770 ./.hg/store/data/dir/
-00660 ./.hg/store/data/dir/bar.i
-00660 ./.hg/store/data/foo.i
-00660 ./.hg/store/fncache
-00660 ./.hg/store/undo
-00660 ./.hg/undo.branch
-00660 ./.hg/undo.desc
-00660 ./.hg/undo.dirstate
-00700 ./dir/
-00600 ./dir/bar
-00600 ./foo
-
-% before push
-% group can write everything
-00770 ../push/.hg/
-00660 ../push/.hg/00changelog.i
-00660 ../push/.hg/requires
-00770 ../push/.hg/store/
-
-% after push
-% group can still write everything
-00770 ../push/.hg/
-00660 ../push/.hg/00changelog.i
-00660 ../push/.hg/branchheads.cache
-00660 ../push/.hg/requires
-00770 ../push/.hg/store/
-00660 ../push/.hg/store/00changelog.i
-00660 ../push/.hg/store/00manifest.i
-00770 ../push/.hg/store/data/
-00770 ../push/.hg/store/data/dir/
-00660 ../push/.hg/store/data/dir/bar.i
-00660 ../push/.hg/store/data/foo.i
-00660 ../push/.hg/store/fncache
-00660 ../push/.hg/store/undo
-00660 ../push/.hg/undo.branch
-00660 ../push/.hg/undo.desc
-00660 ../push/.hg/undo.dirstate
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-inherit-mode.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,140 @@
+test that new files created in .hg inherit the permissions from .hg/store
+
+
+  $ "$TESTDIR/hghave" unix-permissions || exit 80
+
+  $ mkdir dir
+
+just in case somebody has a strange $TMPDIR
+
+  $ chmod g-s dir
+  $ cd dir
+
+  $ cat >printmodes.py <<EOF
+  > import os, sys
+  > 
+  > allnames = []
+  > isdir = {}
+  > for root, dirs, files in os.walk(sys.argv[1]):
+  >     for d in dirs:
+  > 	name = os.path.join(root, d)
+  > 	isdir[name] = 1
+  > 	allnames.append(name)
+  >     for f in files:
+  > 	name = os.path.join(root, f)
+  > 	allnames.append(name)
+  > allnames.sort()
+  > for name in allnames:
+  >     suffix = name in isdir and '/' or ''
+  >     print '%05o %s%s' % (os.lstat(name).st_mode & 07777, name, suffix)
+  > EOF
+
+  $ cat >mode.py <<EOF
+  > import sys
+  > import os
+  > print '%05o' % os.lstat(sys.argv[1]).st_mode
+  > EOF
+
+  $ umask 077
+
+  $ hg init repo
+  $ cd repo
+
+  $ chmod 0770 .hg/store
+
+before commit
+store can be written by the group, other files cannot
+store is setgid
+
+  $ python ../printmodes.py .
+  00700 ./.hg/
+  00600 ./.hg/00changelog.i
+  00600 ./.hg/requires
+  00770 ./.hg/store/
+
+  $ mkdir dir
+  $ touch foo dir/bar
+  $ hg ci -qAm 'add files'
+
+after commit
+working dir files can only be written by the owner
+files created in .hg can be written by the group
+(in particular, store/**, dirstate, branch cache file, undo files)
+new directories are setgid
+
+  $ python ../printmodes.py .
+  00700 ./.hg/
+  00600 ./.hg/00changelog.i
+  00660 ./.hg/dirstate
+  00660 ./.hg/last-message.txt
+  00600 ./.hg/requires
+  00770 ./.hg/store/
+  00660 ./.hg/store/00changelog.i
+  00660 ./.hg/store/00manifest.i
+  00770 ./.hg/store/data/
+  00770 ./.hg/store/data/dir/
+  00660 ./.hg/store/data/dir/bar.i
+  00660 ./.hg/store/data/foo.i
+  00660 ./.hg/store/fncache
+  00660 ./.hg/store/undo
+  00660 ./.hg/undo.branch
+  00660 ./.hg/undo.desc
+  00660 ./.hg/undo.dirstate
+  00700 ./dir/
+  00600 ./dir/bar
+  00600 ./foo
+
+  $ umask 007
+  $ hg init ../push
+
+before push
+group can write everything
+
+  $ python ../printmodes.py ../push
+  00770 ../push/.hg/
+  00660 ../push/.hg/00changelog.i
+  00660 ../push/.hg/requires
+  00770 ../push/.hg/store/
+
+  $ umask 077
+  $ hg -q push ../push
+
+after push
+group can still write everything
+
+  $ python ../printmodes.py ../push
+  00770 ../push/.hg/
+  00660 ../push/.hg/00changelog.i
+  00660 ../push/.hg/branchheads.cache
+  00660 ../push/.hg/requires
+  00770 ../push/.hg/store/
+  00660 ../push/.hg/store/00changelog.i
+  00660 ../push/.hg/store/00manifest.i
+  00770 ../push/.hg/store/data/
+  00770 ../push/.hg/store/data/dir/
+  00660 ../push/.hg/store/data/dir/bar.i
+  00660 ../push/.hg/store/data/foo.i
+  00660 ../push/.hg/store/fncache
+  00660 ../push/.hg/store/undo
+  00660 ../push/.hg/undo.branch
+  00660 ../push/.hg/undo.desc
+  00660 ../push/.hg/undo.dirstate
+
+
+Test that we don't lose the setgid bit when we call chmod.
+Not all systems support setgid directories (e.g. HFS+), so
+just check that directories have the same mode.
+
+  $ cd ..
+  $ hg init setgid
+  $ cd setgid
+  $ chmod g+rwx .hg/store
+  $ chmod g+s .hg/store 2> /dev/null
+  $ mkdir dir
+  $ touch dir/file
+  $ hg ci -qAm 'add dir/file'
+  $ storemode=`python ../mode.py .hg/store`
+  $ dirmode=`python ../mode.py .hg/store/data/dir`
+  $ if [ "$storemode" != "$dirmode" ]; then
+  >  echo "$storemode != $dirmode"
+  $ fi
--- a/tests/test-init	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +0,0 @@
-#!/bin/sh
-
-# This test tries to exercise the ssh functionality with a dummy script
-
-cat <<EOF > dummyssh
-import sys
-import os
-
-os.chdir(os.path.dirname(sys.argv[0]))
-if sys.argv[1] != "user@dummy":
-    sys.exit(-1)
-
-if not os.path.exists("dummyssh"):
-    sys.exit(-1)
-
-log = open("dummylog", "ab")
-log.write("Got arguments")
-for i, arg in enumerate(sys.argv[1:]):
-    log.write(" %d:%s" % (i+1, arg))
-log.write("\n")
-log.close()
-r = os.system(sys.argv[2])
-sys.exit(bool(r))
-EOF
-
-checknewrepo()
-{
-    name=$1
-
-    if [ -d $name/.hg/store ]; then
-	echo store created
-    fi
-
-    if [ -f $name/.hg/00changelog.i ]; then
-	echo 00changelog.i created
-    fi
-
-    cat $name/.hg/requires
-}
-
-echo "# creating 'local'"
-hg init local
-checknewrepo local
-echo this > local/foo
-hg ci --cwd local -A -m "init" -d "1000000 0"
-
-echo "# creating repo with format.usestore=false"
-hg --config format.usestore=false init old
-checknewrepo old
-
-echo "# creating repo with format.usefncache=false"
-hg --config format.usefncache=false init old2
-checknewrepo old2
-
-echo "#test failure"
-hg init local
-
-echo "# init+push to remote2"
-hg init -e "python ./dummyssh" ssh://user@dummy/remote2
-hg incoming -R remote2 local
-hg push -R local -e "python ./dummyssh" ssh://user@dummy/remote2
-
-echo "# clone to remote1"
-hg clone -e "python ./dummyssh" local ssh://user@dummy/remote1
-
-echo "# init to existing repo"
-hg init -e "python ./dummyssh" ssh://user@dummy/remote1
-
-echo "# clone to existing repo"
-hg clone -e "python ./dummyssh" local ssh://user@dummy/remote1
-
-echo "# output of dummyssh"
-cat dummylog
-
-echo "# comparing repositories"
-hg tip -q -R local
-hg tip -q -R remote1
-hg tip -q -R remote2
-
-echo "# check names for repositories (clashes with URL schemes, special chars)"
-for i in bundle file hg http https old-http ssh static-http " " "with space"; do
-  echo "# hg init \"$i\""
-  hg init "$i"
-  test -d "$i" -a -d "$i/.hg" && echo "ok" || echo "failed"
-done
-
-echo "# creating 'local/sub/repo'"
-hg init local/sub/repo
-checknewrepo local/sub/repo
--- a/tests/test-init.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-# creating 'local'
-store created
-00changelog.i created
-revlogv1
-store
-fncache
-adding foo
-# creating repo with format.usestore=false
-revlogv1
-# creating repo with format.usefncache=false
-store created
-00changelog.i created
-revlogv1
-store
-#test failure
-abort: repository local already exists!
-# init+push to remote2
-comparing with local
-changeset:   0:c4e059d443be
-tag:         tip
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     init
-
-pushing to ssh://user@dummy/remote2
-searching for changes
-remote: adding changesets
-remote: adding manifests
-remote: adding file changes
-remote: added 1 changesets with 1 changes to 1 files
-# clone to remote1
-searching for changes
-remote: adding changesets
-remote: adding manifests
-remote: adding file changes
-remote: added 1 changesets with 1 changes to 1 files
-# init to existing repo
-abort: repository remote1 already exists!
-abort: could not create remote repo!
-# clone to existing repo
-abort: repository remote1 already exists!
-abort: could not create remote repo!
-# output of dummyssh
-Got arguments 1:user@dummy 2:hg init remote2
-Got arguments 1:user@dummy 2:hg -R remote2 serve --stdio
-Got arguments 1:user@dummy 2:hg -R remote2 serve --stdio
-Got arguments 1:user@dummy 2:hg init remote1
-Got arguments 1:user@dummy 2:hg -R remote1 serve --stdio
-Got arguments 1:user@dummy 2:hg init remote1
-Got arguments 1:user@dummy 2:hg init remote1
-# comparing repositories
-0:c4e059d443be
-0:c4e059d443be
-0:c4e059d443be
-# check names for repositories (clashes with URL schemes, special chars)
-# hg init "bundle"
-ok
-# hg init "file"
-ok
-# hg init "hg"
-ok
-# hg init "http"
-ok
-# hg init "https"
-ok
-# hg init "old-http"
-ok
-# hg init "ssh"
-ok
-# hg init "static-http"
-ok
-# hg init " "
-ok
-# hg init "with space"
-ok
-# creating 'local/sub/repo'
-store created
-00changelog.i created
-revlogv1
-store
-fncache
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-init.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,159 @@
+This test tries to exercise the ssh functionality with a dummy script
+
+  $ cat <<EOF > dummyssh
+  > import sys
+  > import os
+  > 
+  > os.chdir(os.path.dirname(sys.argv[0]))
+  > if sys.argv[1] != "user@dummy":
+  >     sys.exit(-1)
+  > 
+  > if not os.path.exists("dummyssh"):
+  >     sys.exit(-1)
+  > 
+  > log = open("dummylog", "ab")
+  > log.write("Got arguments")
+  > for i, arg in enumerate(sys.argv[1:]):
+  >     log.write(" %d:%s" % (i+1, arg))
+  > log.write("\n")
+  > log.close()
+  > r = os.system(sys.argv[2])
+  > sys.exit(bool(r))
+  > EOF
+
+  $ checknewrepo()
+  > {
+  >    name=$1
+  >    if [ -d $name/.hg/store ]; then
+  >    echo store created
+  >    fi
+  >    if [ -f $name/.hg/00changelog.i ]; then
+  >    echo 00changelog.i created
+  >    fi
+  >    cat $name/.hg/requires
+  > }
+
+creating 'local'
+
+  $ hg init local
+  $ checknewrepo local
+  store created
+  00changelog.i created
+  revlogv1
+  store
+  fncache
+  $ echo this > local/foo
+  $ hg ci --cwd local -A -m "init"
+  adding foo
+
+creating repo with format.usestore=false
+
+  $ hg --config format.usestore=false init old
+  $ checknewrepo old
+  revlogv1
+
+creating repo with format.usefncache=false
+
+  $ hg --config format.usefncache=false init old2
+  $ checknewrepo old2
+  store created
+  00changelog.i created
+  revlogv1
+  store
+
+test failure
+
+  $ hg init local
+  abort: repository local already exists!
+  [255]
+
+init+push to remote2
+
+  $ hg init -e "python ./dummyssh" ssh://user@dummy/remote2
+  $ hg incoming -R remote2 local
+  comparing with local
+  changeset:   0:08b9e9f63b32
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     init
+  
+
+  $ hg push -R local -e "python ./dummyssh" ssh://user@dummy/remote2
+  pushing to ssh://user@dummy/remote2
+  searching for changes
+  remote: adding changesets
+  remote: adding manifests
+  remote: adding file changes
+  remote: added 1 changesets with 1 changes to 1 files
+
+clone to remote1
+
+  $ hg clone -e "python ./dummyssh" local ssh://user@dummy/remote1
+  searching for changes
+  remote: adding changesets
+  remote: adding manifests
+  remote: adding file changes
+  remote: added 1 changesets with 1 changes to 1 files
+
+init to existing repo
+
+  $ hg init -e "python ./dummyssh" ssh://user@dummy/remote1
+  abort: repository remote1 already exists!
+  abort: could not create remote repo!
+  [255]
+
+clone to existing repo
+
+  $ hg clone -e "python ./dummyssh" local ssh://user@dummy/remote1
+  abort: repository remote1 already exists!
+  abort: could not create remote repo!
+  [255]
+
+output of dummyssh
+
+  $ cat dummylog
+  Got arguments 1:user@dummy 2:hg init remote2
+  Got arguments 1:user@dummy 2:hg -R remote2 serve --stdio
+  Got arguments 1:user@dummy 2:hg -R remote2 serve --stdio
+  Got arguments 1:user@dummy 2:hg init remote1
+  Got arguments 1:user@dummy 2:hg -R remote1 serve --stdio
+  Got arguments 1:user@dummy 2:hg init remote1
+  Got arguments 1:user@dummy 2:hg init remote1
+
+comparing repositories
+
+  $ hg tip -q -R local
+  0:08b9e9f63b32
+  $ hg tip -q -R remote1
+  0:08b9e9f63b32
+  $ hg tip -q -R remote2
+  0:08b9e9f63b32
+
+check names for repositories (clashes with URL schemes, special chars)
+
+  $ for i in bundle file hg http https old-http ssh static-http " " "with space"; do
+  >   printf "hg init \"$i\"... "
+  >   hg init "$i"
+  >   test -d "$i" -a -d "$i/.hg" && echo "ok" || echo "failed"
+  > done
+  hg init "bundle"... ok
+  hg init "file"... ok
+  hg init "hg"... ok
+  hg init "http"... ok
+  hg init "https"... ok
+  hg init "old-http"... ok
+  hg init "ssh"... ok
+  hg init "static-http"... ok
+  hg init " "... ok
+  hg init "with space"... ok
+
+creating 'local/sub/repo'
+
+  $ hg init local/sub/repo
+  $ checknewrepo local/sub/repo
+  store created
+  00changelog.i created
+  revlogv1
+  store
+  fncache
--- a/tests/test-install	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-#!/bin/sh
-
-echo '% hg debuginstall'
-hg debuginstall
-
-echo '% hg debuginstall with no username'
-HGUSER= hg debuginstall
-
-# Happy End
-true
--- a/tests/test-install.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-% hg debuginstall
-Checking encoding (ascii)...
-Checking extensions...
-Checking templates...
-Checking patch...
-Checking commit editor...
-Checking username...
-No problems detected
-% hg debuginstall with no username
-Checking encoding (ascii)...
-Checking extensions...
-Checking templates...
-Checking patch...
-Checking commit editor...
-Checking username...
- no username supplied (see "hg help config")
- (specify a username in your configuration file)
-1 problems detected, please check your install!
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-install.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,22 @@
+hg debuginstall
+  $ hg debuginstall
+  Checking encoding (ascii)...
+  Checking installed modules (*/mercurial)... (glob)
+  Checking templates...
+  Checking patch...
+  Checking commit editor...
+  Checking username...
+  No problems detected
+
+hg debuginstall with no username
+  $ HGUSER= hg debuginstall
+  Checking encoding (ascii)...
+  Checking installed modules (*/mercurial)... (glob)
+  Checking templates...
+  Checking patch...
+  Checking commit editor...
+  Checking username...
+   no username supplied (see "hg help config")
+   (specify a username in your configuration file)
+  1 problems detected, please check your install!
+  [1]
--- a/tests/test-interhg	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-#!/bin/sh
-
-hg init test
-cd test
-
-cat > .hg/hgrc <<EOF
-[extensions]
-interhg =
-
-[interhg]
-issues = s|Issue(\d+)|<a href="http://bts.example.org/issue\1">Issue\1</a>|
-
-# yes, 'x' is a weird delimiter...
-markbugs = sxbugx<i class="\x">bug</i>x
-EOF
-
-touch foo
-hg add foo
-hg commit -d '1 0' -m 'Issue123: fixed the bug!'
-
-hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
-cat hg.pid >> $DAEMON_PIDS
-
-echo % log
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/' | grep bts
-
-echo % errors
-cat errors.log
--- a/tests/test-interhg.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-% log
-  <td class="description"><a href="/rev/1b0e7ece6bd6"><a href="http://bts.example.org/issue123">Issue123</a>: fixed the <i class="x">bug</i>!</a><span class="branchhead">default</span> <span class="tag">tip</span> </td>
-% errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-interhg.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,29 @@
+  $ hg init test
+  $ cd test
+
+  $ cat > .hg/hgrc <<EOF
+  > [extensions]
+  > interhg =
+  > 
+  > [interhg]
+  > issues = s|Issue(\d+)|<a href="http://bts.example.org/issue\1">Issue\1</a>|
+  > 
+  > # yes, 'x' is a weird delimiter...
+  > markbugs = sxbugx<i class="\x">bug</i>x
+  > EOF
+
+  $ touch foo
+  $ hg add foo
+  $ hg commit -d '1 0' -m 'Issue123: fixed the bug!'
+
+  $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
+  $ cat hg.pid >> $DAEMON_PIDS
+
+log
+
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/' | grep bts
+    <td class="description"><a href="/rev/1b0e7ece6bd6"><a href="http://bts.example.org/issue123">Issue123</a>: fixed the <i class="x">bug</i>!</a><span class="branchhead">default</span> <span class="tag">tip</span> </td>
+
+errors
+
+  $ cat errors.log
--- a/tests/test-issue1089	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-#!/bin/sh
-
-hg init a
-cd a
-mkdir a
-echo a > a/b
-hg ci -Am m
-hg rm a
-hg ci -m m a
-
-mkdir a b
-echo a > a/b
-hg ci -Am m
-hg rm a
-cd b
-# relative delete
-hg ci -m m ../a
--- a/tests/test-issue1089.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-adding a/b
-removing a/b
-adding a/b
-removing a/b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-issue1089.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,25 @@
+http://mercurial.selenic.com/bts/issue1089
+
+  $ hg init
+  $ mkdir a
+  $ echo a > a/b
+  $ hg ci -Am m
+  adding a/b
+
+  $ hg rm a
+  removing a/b
+  $ hg ci -m m a
+
+  $ mkdir a b
+  $ echo a > a/b
+  $ hg ci -Am m
+  adding a/b
+
+  $ hg rm a
+  removing a/b
+  $ cd b
+
+Relative delete:
+
+  $ hg ci -m m ../a
+
--- a/tests/test-issue1175	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-#!/bin/sh
-rm -rf a
-hg init a
-cd a
-touch a
-hg ci -Am0
-hg mv a a1
-hg ci -m1
-hg co 0
-hg mv a a2
-hg up
-hg ci -m2
-
-touch a
-hg ci -Am3
-hg mv a b
-hg ci -Am4 a
-hg ci --debug --traceback -Am5 b
-hg verify
-hg export --git tip
--- a/tests/test-issue1175.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-adding a
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-warning: detected divergent renames of a to:
- a2
- a1
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-adding a
-b
- b: searching for copy revision for a
- b: copy a:b80de5d138758541c5f05265ad144ab9fa86d1db
-committed changeset 5:89e8e4be0de296fa3d6dd7825ccc44d7dc0f1f3b
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-4 files, 6 changesets, 4 total revisions
-# HG changeset patch
-# User test
-# Date 0 0
-# Node ID 89e8e4be0de296fa3d6dd7825ccc44d7dc0f1f3b
-# Parent  7fc86ba705e717a721dbc361bf8c9bc05a18ca2f
-5
-
-diff --git a/b b/b
-new file mode 100644
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-issue1175.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,53 @@
+http://mercurial.selenic.com/bts/issue1175
+
+  $ hg init
+  $ touch a
+  $ hg ci -Am0
+  adding a
+
+  $ hg mv a a1
+  $ hg ci -m1
+
+  $ hg co 0
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+  $ hg mv a a2
+  $ hg up
+  warning: detected divergent renames of a to:
+   a2
+   a1
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ hg ci -m2
+
+  $ touch a
+  $ hg ci -Am3
+  adding a
+
+  $ hg mv a b
+  $ hg ci -Am4 a
+
+  $ hg ci --debug --traceback -Am5 b
+  b
+   b: searching for copy revision for a
+   b: copy a:b80de5d138758541c5f05265ad144ab9fa86d1db
+  committed changeset 5:89e8e4be0de296fa3d6dd7825ccc44d7dc0f1f3b
+
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  4 files, 6 changesets, 4 total revisions
+
+  $ hg export --git tip
+  # HG changeset patch
+  # User test
+  # Date 0 0
+  # Node ID 89e8e4be0de296fa3d6dd7825ccc44d7dc0f1f3b
+  # Parent  7fc86ba705e717a721dbc361bf8c9bc05a18ca2f
+  5
+  
+  diff --git a/b b/b
+  new file mode 100644
+
--- a/tests/test-issue1306	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-#!/bin/sh
-
-echo % initialize remote repo with branches
-hg init remote
-cd remote
-echo a > a
-hg ci -Ama
-hg branch br
-hg ci -Amb
-echo c > c
-hg ci -Amc
-hg log
-
-cd ..
-echo % try cloning -r branch
-hg clone -rbr remote local1
-hg -R local1 parents
-
-echo % try cloning -rother clone#branch
-hg clone -r0 remote#br local2
-hg -R local2 parents
-
-echo % try cloning -r1 clone#branch
-hg clone -r1 remote#br local3
-hg -R local3 parents
--- a/tests/test-issue1306.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-% initialize remote repo with branches
-adding a
-marked working directory as branch br
-adding c
-changeset:   2:1630aed6ed2b
-branch:      br
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     c
-
-changeset:   1:234f53e6c5ff
-branch:      br
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     b
-
-changeset:   0:cb9a9f314b8b
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     a
-
-% try cloning -r branch
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 3 changesets with 2 changes to 2 files
-updating to branch br
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-changeset:   2:1630aed6ed2b
-branch:      br
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     c
-
-% try cloning -rother clone#branch
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 3 changesets with 2 changes to 2 files
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-changeset:   0:cb9a9f314b8b
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     a
-
-% try cloning -r1 clone#branch
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 3 changesets with 2 changes to 2 files
-updating to branch br
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-changeset:   1:234f53e6c5ff
-branch:      br
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     b
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-issue1306.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,98 @@
+http://mercurial.selenic.com/bts/issue1306
+
+Initialize remote repo with branches:
+
+  $ hg init remote
+  $ cd remote
+
+  $ echo a > a
+  $ hg ci -Ama
+  adding a
+
+  $ hg branch br
+  marked working directory as branch br
+  $ hg ci -Amb
+
+  $ echo c > c
+  $ hg ci -Amc
+  adding c
+
+  $ hg log
+  changeset:   2:1630aed6ed2b
+  branch:      br
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     c
+  
+  changeset:   1:234f53e6c5ff
+  branch:      br
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     b
+  
+  changeset:   0:cb9a9f314b8b
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     a
+  
+
+  $ cd ..
+
+Try cloning -r branch:
+
+  $ hg clone -rbr remote local1
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 3 changesets with 2 changes to 2 files
+  updating to branch br
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ hg -R local1 parents
+  changeset:   2:1630aed6ed2b
+  branch:      br
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     c
+  
+
+Try cloning -rother clone#branch:
+
+  $ hg clone -r0 remote#br local2
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 3 changesets with 2 changes to 2 files
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ hg -R local2 parents
+  changeset:   0:cb9a9f314b8b
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     a
+  
+
+Try cloning -r1 clone#branch:
+
+  $ hg clone -r1 remote#br local3
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 3 changesets with 2 changes to 2 files
+  updating to branch br
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ hg -R local3 parents
+  changeset:   1:234f53e6c5ff
+  branch:      br
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     b
+  
+
--- a/tests/test-issue1438	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-#!/bin/sh
-"$TESTDIR/hghave" symlink || exit 80
-
-rm -rf a
-hg init a
-cd a
-
-ln -s foo link
-hg add link
-hg ci -mbad link
-hg rm link
-hg ci -mok
-hg diff -g -r 0:1 > bad.patch
-hg up 0
-hg import --no-commit bad.patch
-hg st
--- a/tests/test-issue1438.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-applying bad.patch
-R link
-? bad.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-issue1438.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,23 @@
+http://mercurial.selenic.com/bts/issue1438
+
+  $ "$TESTDIR/hghave" symlink || exit 80
+
+  $ hg init
+
+  $ ln -s foo link
+  $ hg add link
+  $ hg ci -mbad link
+  $ hg rm link
+  $ hg ci -mok
+  $ hg diff -g -r 0:1 > bad.patch
+
+  $ hg up 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ hg import --no-commit bad.patch
+  applying bad.patch
+
+  $ hg status
+  R link
+  ? bad.patch
+
--- a/tests/test-issue2137	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-#!/bin/sh
-
-echo "% setup"
-
-# create a little extension that has 3 side-effects:
-#   1) ensure changelog data is not inlined
-#   2) make revlog to use lazyparser
-#   3) test that repo.lookup() works
-# 1 and 2 are preconditions for the bug; 3 is the bug.
-cat > commitwrapper.py <<EOF
-from mercurial import extensions, node, revlog
-
-def reposetup(ui, repo):
-    def wrapcommit(orig, *args, **kwargs):
-        result = orig(*args, **kwargs)
-        tip1 = node.short(repo.changelog.tip())
-        tip2 = node.short(repo.lookup(tip1))
-        assert tip1 == tip2
-        ui.write('new tip: %s\n' % tip1)
-        return result
-
-    extensions.wrapfunction(repo, 'commit', wrapcommit)
-
-def extsetup(ui):
-    revlog._maxinline = 8             # split out 00changelog.d early
-    revlog._prereadsize = 8           # use revlog.lazyparser
-EOF
-
-cat >> $HGRCPATH <<EOF
-[extensions]
-commitwrapper = `pwd`/commitwrapper.py
-EOF
-
-hg init repo1
-cd repo1
-echo a > a
-hg commit -A -m'add a with a long commit message to make the changelog a bit bigger'
-
-echo ""
-echo "% test that new changesets are visible to repo.lookup()"
-echo a >> a
-hg commit -m'one more commit to demonstrate the bug'
-hg tip
--- a/tests/test-issue2137.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-% setup
-adding a
-new tip: 553596fad57b
-
-% test that new changesets are visible to repo.lookup()
-new tip: 799ae3599e0e
-changeset:   1:799ae3599e0e
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     one more commit to demonstrate the bug
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-issue2137.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,54 @@
+http://mercurial.selenic.com/bts/issue2137
+
+Setup:
+
+create a little extension that has 3 side-effects:
+1) ensure changelog data is not inlined
+2) make revlog to use lazyparser
+3) test that repo.lookup() works
+1 and 2 are preconditions for the bug; 3 is the bug.
+
+  $ cat > commitwrapper.py <<EOF
+  > from mercurial import extensions, node, revlog
+  > 
+  > def reposetup(ui, repo):
+  >     def wrapcommit(orig, *args, **kwargs):
+  >         result = orig(*args, **kwargs)
+  >         tip1 = node.short(repo.changelog.tip())
+  >         tip2 = node.short(repo.lookup(tip1))
+  >         assert tip1 == tip2
+  >         ui.write('new tip: %s\n' % tip1)
+  >         return result
+  > 
+  >     extensions.wrapfunction(repo, 'commit', wrapcommit)
+  > 
+  > def extsetup(ui):
+  >     revlog._maxinline = 8             # split out 00changelog.d early
+  >     revlog._prereadsize = 8           # use revlog.lazyparser
+  > EOF
+
+  $ cat >> $HGRCPATH <<EOF
+  > [extensions]
+  > commitwrapper = `pwd`/commitwrapper.py
+  > EOF
+
+  $ hg init repo1
+  $ cd repo1
+  $ echo a > a
+  $ hg commit -A -m'add a with a long commit message to make the changelog a bit bigger'
+  adding a
+  new tip: 553596fad57b
+
+Test that new changesets are visible to repo.lookup():
+
+  $ echo a >> a
+  $ hg commit -m'one more commit to demonstrate the bug'
+  new tip: 799ae3599e0e
+
+  $ hg tip
+  changeset:   1:799ae3599e0e
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     one more commit to demonstrate the bug
+  
--- a/tests/test-issue322	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-#!/bin/sh
-# http://mercurial.selenic.com/bts/issue322
-
-echo % file replaced with directory
-
-hg init a
-cd a
-echo a > a
-hg commit -Ama
-rm a
-mkdir a
-echo a > a/a
-
-echo % should fail - would corrupt dirstate
-hg add a/a
-
-cd ..
-
-echo % directory replaced with file
-
-hg init c
-cd c
-mkdir a
-echo a > a/a
-hg commit -Ama
-
-rm -r a
-echo a > a
-
-echo % should fail - would corrupt dirstate
-hg add a
-
-cd ..
-
-echo % directory replaced with file
-
-hg init d
-cd d
-mkdir b
-mkdir b/c
-echo a > b/c/d
-hg commit -Ama
-rm -r b
-echo a > b
-
-echo % should fail - would corrupt dirstate
-hg add b
-
-exit 0
--- a/tests/test-issue322.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-% file replaced with directory
-adding a
-% should fail - would corrupt dirstate
-abort: file 'a' in dirstate clashes with 'a/a'
-% directory replaced with file
-adding a/a
-% should fail - would corrupt dirstate
-abort: directory 'a' already in dirstate
-% directory replaced with file
-adding b/c/d
-% should fail - would corrupt dirstate
-abort: directory 'b' already in dirstate
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-issue322.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,59 @@
+http://mercurial.selenic.com/bts/issue322
+
+File replaced with directory:
+
+  $ hg init a
+  $ cd a
+  $ echo a > a
+  $ hg commit -Ama
+  adding a
+  $ rm a
+  $ mkdir a
+  $ echo a > a/a
+
+Should fail - would corrupt dirstate:
+
+  $ hg add a/a
+  abort: file 'a' in dirstate clashes with 'a/a'
+  [255]
+
+  $ cd ..
+
+Directory replaced with file:
+
+  $ hg init c
+  $ cd c
+  $ mkdir a
+  $ echo a > a/a
+  $ hg commit -Ama
+  adding a/a
+
+  $ rm -r a
+  $ echo a > a
+
+Should fail - would corrupt dirstate:
+
+  $ hg add a
+  abort: directory 'a' already in dirstate
+  [255]
+
+  $ cd ..
+
+Directory replaced with file:
+
+  $ hg init d
+  $ cd d
+  $ mkdir b
+  $ mkdir b/c
+  $ echo a > b/c/d
+  $ hg commit -Ama
+  adding b/c/d
+  $ rm -r b
+  $ echo a > b
+
+Should fail - would corrupt dirstate:
+
+  $ hg add b
+  abort: directory 'b' already in dirstate
+  [255]
+
--- a/tests/test-issue433	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-#!/bin/sh
-# http://mercurial.selenic.com/bts/issue433
-
-hg init a
-cd a
-echo a > a
-hg commit -Ama
-
-hg parents -r 0 doesnotexist
-true
--- a/tests/test-issue433.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-adding a
-abort: 'doesnotexist' not found in manifest!
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-issue433.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,10 @@
+http://mercurial.selenic.com/bts/issue433
+
+  $ hg init
+  $ echo a > a
+  $ hg commit -Ama
+  adding a
+
+  $ hg parents -r 0 doesnotexist
+  abort: 'doesnotexist' not found in manifest!
+  [255]
--- a/tests/test-issue436	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-hg init a
-cd a
-hg -v log -v
-hg -v log -v x
-true
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-issue436.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,6 @@
+http://mercurial.selenic.com/bts/issue436
+
+  $ hg init
+  $ hg -v log -v
+  $ hg -v log -v x
+
--- a/tests/test-issue522	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-#!/bin/sh
-
-# In the merge below, the file "foo" has the same contents in both
-# parents, but if we look at the file-level history, we'll notice that
-# the version in p1 is an ancestor of the version in p2.  This test
-# makes sure that we'll use the version from p2 in the manifest of the
-# merge revision.
-
-hg init repo
-cd repo
-
-echo foo > foo
-hg ci -qAm 'add foo'
-
-echo bar >> foo
-hg ci -m 'change foo'
-
-hg backout -r tip -m 'backout changed foo'
-
-hg up -C 0
-touch bar
-hg ci -qAm 'add bar'
-
-hg merge --debug
-hg debugstate | grep foo
-hg st -A foo
-hg ci -m 'merge'
-
-hg manifest --debug | grep foo
-hg debugindex .hg/store/data/foo.i
-
--- a/tests/test-issue522.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-reverting foo
-changeset 2:4d9e78aaceee backs out changeset 1:b515023e500e
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  searching for copies back to rev 1
-  unmatched files in local:
-   bar
-resolving manifests
- overwrite None partial False
- ancestor bbd179dfa0a7 local 71766447bdbb+ remote 4d9e78aaceee
- foo: remote is newer -> g
-updating: foo 1/1 files (100.00%)
-getting foo
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-n   0         -2 unset               foo
-M foo
-c6fc755d7e68f49f880599da29f15add41f42f5a 644   foo
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0       5      0       0 2ed2a3912a0b 000000000000 000000000000
-     1         5       9      1       1 6f4310b00b9a 2ed2a3912a0b 000000000000
-     2        14       5      2       2 c6fc755d7e68 6f4310b00b9a 000000000000
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-issue522.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,56 @@
+http://mercurial.selenic.com/bts/issue522
+
+In the merge below, the file "foo" has the same contents in both
+parents, but if we look at the file-level history, we'll notice that
+the version in p1 is an ancestor of the version in p2. This test makes
+sure that we'll use the version from p2 in the manifest of the merge
+revision.
+
+  $ hg init
+
+  $ echo foo > foo
+  $ hg ci -qAm 'add foo'
+
+  $ echo bar >> foo
+  $ hg ci -m 'change foo'
+
+  $ hg backout -r tip -m 'backout changed foo'
+  reverting foo
+  changeset 2:4d9e78aaceee backs out changeset 1:b515023e500e
+
+  $ hg up -C 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ touch bar
+  $ hg ci -qAm 'add bar'
+
+  $ hg merge --debug
+    searching for copies back to rev 1
+    unmatched files in local:
+     bar
+  resolving manifests
+   overwrite None partial False
+   ancestor bbd179dfa0a7 local 71766447bdbb+ remote 4d9e78aaceee
+   foo: remote is newer -> g
+  updating: foo 1/1 files (100.00%)
+  getting foo
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+  $ hg debugstate | grep foo
+  n   0         -2 unset               foo
+
+  $ hg st -A foo
+  M foo
+
+  $ hg ci -m 'merge'
+
+  $ hg manifest --debug | grep foo
+  c6fc755d7e68f49f880599da29f15add41f42f5a 644   foo
+
+  $ hg debugindex .hg/store/data/foo.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0       5      0       0 2ed2a3912a0b 000000000000 000000000000
+       1         5       9      1       1 6f4310b00b9a 2ed2a3912a0b 000000000000
+       2        14       5      2       2 c6fc755d7e68 6f4310b00b9a 000000000000
+
--- a/tests/test-issue612	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-#!/bin/sh
-
-mkdir t
-cd t
-
-hg init
-mkdir src
-echo a > src/a.c
-hg ci -Ama -d "10000000 0"
-
-hg mv src source
-hg ci -Ammove -d "1000000 0"
-
-hg co -C 0
-echo new > src/a.c
-echo compiled > src/a.o
-hg ci -mupdate -d "1000000 0"
-
-hg st
-
-hg merge
-
-hg st
-
--- a/tests/test-issue612.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-adding src/a.c
-moving src/a.c to source/a.c
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-created new head
-? src/a.o
-merging src/a.c and source/a.c to source/a.c
-1 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-M source/a.c
-R src/a.c
-? source/a.o
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-issue612.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,34 @@
+http://mercurial.selenic.com/bts/issue612
+
+  $ hg init
+  $ mkdir src
+  $ echo a > src/a.c
+  $ hg ci -Ama
+  adding src/a.c
+
+  $ hg mv src source
+  moving src/a.c to source/a.c
+
+  $ hg ci -Ammove
+
+  $ hg co -C 0
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+  $ echo new > src/a.c
+  $ echo compiled > src/a.o
+  $ hg ci -mupdate
+  created new head
+
+  $ hg status
+  ? src/a.o
+
+  $ hg merge
+  merging src/a.c and source/a.c to source/a.c
+  1 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+  $ hg status
+  M source/a.c
+  R src/a.c
+  ? source/a.o
+
--- a/tests/test-issue619	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-#!/bin/sh
-
-mkdir t
-cd t
-hg init
-echo a > a
-hg ci -Ama -d '1000000000 0'
-echo b > b
-hg branch b
-hg ci -Amb -d '1000000000 0'
-hg co -C 0
-
-echo fast-forward
-hg merge b
-hg ci -Ammerge -d '1000000000 0'
-
-echo bogus fast-forward should fail
-hg merge b
-
-echo done
--- a/tests/test-issue619.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-adding a
-marked working directory as branch b
-adding b
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-fast-forward
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-bogus fast-forward should fail
-abort: merging with a working directory ancestor has no effect
-done
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-issue619.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,29 @@
+http://mercurial.selenic.com/bts/issue619
+
+  $ hg init
+  $ echo a > a
+  $ hg ci -Ama
+  adding a
+
+  $ echo b > b
+  $ hg branch b
+  marked working directory as branch b
+  $ hg ci -Amb
+  adding b
+
+  $ hg co -C 0
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+Fast-forward:
+
+  $ hg merge b
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg ci -Ammerge
+
+Bogus fast-forward should fail:
+
+  $ hg merge b
+  abort: merging with a working directory ancestor has no effect
+  [255]
+
--- a/tests/test-issue660	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,94 +0,0 @@
-#!/bin/sh
-# http://mercurial.selenic.com/bts/issue660
-
-
-hg init a
-cd a
-echo a > a
-mkdir b
-echo b > b/b
-hg commit -A -m "a is file, b is dir"
-
-echo % file replaced with directory
-
-rm a
-mkdir a
-echo a > a/a
-
-echo % should fail - would corrupt dirstate
-hg add a/a
-
-echo % removing shadow
-hg rm --after a
-
-echo % should succeed - shadow removed
-hg add a/a
-
-echo % directory replaced with file
-
-rm -r b
-echo b > b
-
-echo % should fail - would corrupt dirstate
-hg add b
-
-echo % removing shadow
-hg rm --after b/b
-
-echo % should succeed - shadow removed
-hg add b
-
-echo % look what we got
-hg st
-
-echo % revert reintroducing shadow - should fail
-rm -r a b
-hg revert b/b
-
-echo % revert all - should succeed
-hg revert --all
-hg st
-
-echo % addremove
-
-rm -r a b
-mkdir a
-echo a > a/a
-echo b > b
-
-hg addremove
-hg st
-
-echo % commit
-hg ci -A -m "a is dir, b is file"
-hg st --all
-
-echo % long directory replaced with file
-
-mkdir d
-mkdir d/d
-echo d > d/d/d
-hg commit -A -m "d is long directory"
-rm -r d
-echo d > d
-
-echo % should fail - would corrupt dirstate
-hg add d
-
-echo % removing shadow
-hg rm --after d/d/d
-
-echo % should succeed - shadow removed
-hg add d
-hg ci -md
-
-echo % update should work at least with clean workdir
-
-rm -r a b d
-hg up -r 0
-hg st --all
-rm -r a b
-hg up -r 1
-hg st --all
-
-exit 0
--- a/tests/test-issue660.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-adding a
-adding b/b
-% file replaced with directory
-% should fail - would corrupt dirstate
-abort: file 'a' in dirstate clashes with 'a/a'
-% removing shadow
-% should succeed - shadow removed
-% directory replaced with file
-% should fail - would corrupt dirstate
-abort: directory 'b' already in dirstate
-% removing shadow
-% should succeed - shadow removed
-% look what we got
-A a/a
-A b
-R a
-R b/b
-% revert reintroducing shadow - should fail
-abort: file 'b' in dirstate clashes with 'b/b'
-% revert all - should succeed
-undeleting a
-forgetting a/a
-forgetting b
-undeleting b/b
-% addremove
-removing a
-adding a/a
-adding b
-removing b/b
-A a/a
-A b
-R a
-R b/b
-% commit
-C a/a
-C b
-% long directory replaced with file
-adding d/d/d
-% should fail - would corrupt dirstate
-abort: directory 'd' already in dirstate
-% removing shadow
-% should succeed - shadow removed
-% update should work at least with clean workdir
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-C a
-C b/b
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-C a/a
-C b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-issue660.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,144 @@
+http://mercurial.selenic.com/bts/issue660
+
+  $ hg init
+  $ echo a > a
+  $ mkdir b
+  $ echo b > b/b
+  $ hg commit -A -m "a is file, b is dir"
+  adding a
+  adding b/b
+
+File replaced with directory:
+
+  $ rm a
+  $ mkdir a
+  $ echo a > a/a
+
+Should fail - would corrupt dirstate:
+
+  $ hg add a/a
+  abort: file 'a' in dirstate clashes with 'a/a'
+  [255]
+
+Removing shadow:
+
+  $ hg rm --after a
+
+Should succeed - shadow removed:
+
+  $ hg add a/a
+
+Directory replaced with file:
+
+  $ rm -r b
+  $ echo b > b
+
+Should fail - would corrupt dirstate:
+
+  $ hg add b
+  abort: directory 'b' already in dirstate
+  [255]
+
+Removing shadow:
+
+  $ hg rm --after b/b
+
+Should succeed - shadow removed:
+
+  $ hg add b
+
+Look what we got:
+
+  $ hg st
+  A a/a
+  A b
+  R a
+  R b/b
+
+Revert reintroducing shadow - should fail:
+
+  $ rm -r a b
+  $ hg revert b/b
+  abort: file 'b' in dirstate clashes with 'b/b'
+  [255]
+
+Revert all - should succeed:
+
+  $ hg revert --all
+  undeleting a
+  forgetting a/a
+  forgetting b
+  undeleting b/b
+
+  $ hg st
+
+addremove:
+
+  $ rm -r a b
+  $ mkdir a
+  $ echo a > a/a
+  $ echo b > b
+
+  $ hg addremove -s 0
+  removing a
+  adding a/a
+  adding b
+  removing b/b
+
+  $ hg st
+  A a/a
+  A b
+  R a
+  R b/b
+
+commit:
+
+  $ hg ci -A -m "a is dir, b is file"
+  $ hg st --all
+  C a/a
+  C b
+
+Long directory replaced with file:
+
+  $ mkdir d
+  $ mkdir d/d
+  $ echo d > d/d/d
+  $ hg commit -A -m "d is long directory"
+  adding d/d/d
+
+  $ rm -r d
+  $ echo d > d
+
+Should fail - would corrupt dirstate:
+
+  $ hg add d
+  abort: directory 'd' already in dirstate
+  [255]
+
+Removing shadow:
+
+  $ hg rm --after d/d/d
+
+Should succeed - shadow removed:
+
+  $ hg add d
+  $ hg ci -md
+
+Update should work at least with clean working directory:
+
+  $ rm -r a b d
+  $ hg up -r 0
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ hg st --all
+  C a
+  C b/b
+
+  $ rm -r a b
+  $ hg up -r 1
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ hg st --all
+  C a/a
+  C b
+
--- a/tests/test-issue672	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-#!/bin/sh
-
-# 0-2-4
-#  \ \ \
-#   1-3-5
-#
-# rename in #1, content change in #4.
-
-hg init t
-cd t
-
-touch 1
-touch 2
-hg commit -Am init  # 0
-
-hg rename 1 1a
-hg commit -m rename # 1
-
-hg co -C 0
-echo unrelated >> 2
-hg ci -m unrelated1 # 2
-
-hg merge --debug 1
-hg ci -m merge1 # 3
-
-hg co -C 2
-echo hello >> 1
-hg ci -m unrelated2 # 4
-
-hg co -C 3
-hg merge -y --debug 4
-
-hg co -C 4
-hg merge -y --debug 3
-
--- a/tests/test-issue672.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-adding 1
-adding 2
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-created new head
-  searching for copies back to rev 1
-  unmatched files in other:
-   1a
-  all copies found (* = to merge, ! = divergent):
-   1a -> 1 
-  checking for directory renames
-resolving manifests
- overwrite None partial False
- ancestor 81f4b099af3d local c64f439569a9+ remote c12dcd37c90a
- 1: other deleted -> r
- 1a: remote created -> g
-updating: 1 1/2 files (50.00%)
-removing 1
-updating: 1a 2/2 files (100.00%)
-getting 1a
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-created new head
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-  searching for copies back to rev 1
-  unmatched files in local:
-   1a
-  all copies found (* = to merge, ! = divergent):
-   1a -> 1 *
-  checking for directory renames
-resolving manifests
- overwrite None partial False
- ancestor c64f439569a9 local e327dca35ac8+ remote 746e9549ea96
- 1a: local copied/moved to 1 -> m
-preserving 1a for resolve of 1a
-updating: 1a 1/1 files (100.00%)
-picked tool 'internal:merge' for 1a (binary False symlink False)
-merging 1a and 1 to 1a
-my 1a@e327dca35ac8+ other 1@746e9549ea96 ancestor 1@81f4b099af3d
- premerge successful
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-  searching for copies back to rev 1
-  unmatched files in other:
-   1a
-  all copies found (* = to merge, ! = divergent):
-   1a -> 1 *
-  checking for directory renames
-resolving manifests
- overwrite None partial False
- ancestor c64f439569a9 local 746e9549ea96+ remote e327dca35ac8
- 1: remote moved to 1a -> m
-preserving 1 for resolve of 1a
-removing 1
-updating: 1 1/1 files (100.00%)
-picked tool 'internal:merge' for 1a (binary False symlink False)
-merging 1 and 1a to 1a
-my 1a@746e9549ea96+ other 1a@e327dca35ac8 ancestor 1@81f4b099af3d
- premerge successful
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-issue672.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,101 @@
+http://mercurial.selenic.com/bts/issue672
+
+# 0-2-4
+#  \ \ \
+#   1-3-5
+#
+# rename in #1, content change in #4.
+
+  $ hg init
+
+  $ touch 1
+  $ touch 2
+  $ hg commit -Am init  # 0
+  adding 1
+  adding 2
+
+  $ hg rename 1 1a
+  $ hg commit -m rename # 1
+
+  $ hg co -C 0
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+  $ echo unrelated >> 2
+  $ hg ci -m unrelated1 # 2
+  created new head
+
+  $ hg merge --debug 1
+    searching for copies back to rev 1
+    unmatched files in other:
+     1a
+    all copies found (* = to merge, ! = divergent):
+     1a -> 1 
+    checking for directory renames
+  resolving manifests
+   overwrite None partial False
+   ancestor 81f4b099af3d local c64f439569a9+ remote c12dcd37c90a
+   1: other deleted -> r
+   1a: remote created -> g
+  updating: 1 1/2 files (50.00%)
+  removing 1
+  updating: 1a 2/2 files (100.00%)
+  getting 1a
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+  $ hg ci -m merge1 # 3
+
+  $ hg co -C 2
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+  $ echo hello >> 1
+  $ hg ci -m unrelated2 # 4
+  created new head
+
+  $ hg co -C 3
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+  $ hg merge -y --debug 4
+    searching for copies back to rev 1
+    unmatched files in local:
+     1a
+    all copies found (* = to merge, ! = divergent):
+     1a -> 1 *
+    checking for directory renames
+  resolving manifests
+   overwrite None partial False
+   ancestor c64f439569a9 local e327dca35ac8+ remote 746e9549ea96
+   1a: local copied/moved to 1 -> m
+  preserving 1a for resolve of 1a
+  updating: 1a 1/1 files (100.00%)
+  picked tool 'internal:merge' for 1a (binary False symlink False)
+  merging 1a and 1 to 1a
+  my 1a@e327dca35ac8+ other 1@746e9549ea96 ancestor 1@81f4b099af3d
+   premerge successful
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+  $ hg co -C 4
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+  $ hg merge -y --debug 3
+    searching for copies back to rev 1
+    unmatched files in other:
+     1a
+    all copies found (* = to merge, ! = divergent):
+     1a -> 1 *
+    checking for directory renames
+  resolving manifests
+   overwrite None partial False
+   ancestor c64f439569a9 local 746e9549ea96+ remote e327dca35ac8
+   1: remote moved to 1a -> m
+  preserving 1 for resolve of 1a
+  removing 1
+  updating: 1 1/1 files (100.00%)
+  picked tool 'internal:merge' for 1a (binary False symlink False)
+  merging 1 and 1a to 1a
+  my 1a@746e9549ea96+ other 1a@e327dca35ac8 ancestor 1@81f4b099af3d
+   premerge successful
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
--- a/tests/test-issue842	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-#!/bin/sh
-
-hg init test
-cd test
-echo foo > a
-hg ci -Ama
-
-hg up -r0000
-echo bar > a
-echo % should issue warning
-hg ci -Amb
-
-hg up -r0000
-echo stuffy > a
-echo % should not issue warning
-hg ci -q -Amc
-
-hg up -r0000
-echo crap > a
-hg branch testing
-echo % should not issue warning
-hg ci -q -Amd
--- a/tests/test-issue842.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-adding a
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-% should issue warning
-adding a
-created new head
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-% should not issue warning
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-marked working directory as branch testing
-% should not issue warning
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-issue842.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,38 @@
+http://mercurial.selenic.com/bts/issue842
+
+  $ hg init
+  $ echo foo > a
+  $ hg ci -Ama
+  adding a
+
+  $ hg up -r0000
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+  $ echo bar > a
+
+Should issue new head warning:
+
+  $ hg ci -Amb
+  adding a
+  created new head
+
+  $ hg up -r0000
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+  $ echo stuffy > a
+
+Should not issue new head warning:
+
+  $ hg ci -q -Amc
+
+  $ hg up -r0000
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+  $ echo crap > a
+  $ hg branch testing
+  marked working directory as branch testing
+
+Should not issue warning:
+
+  $ hg ci -q -Amd
+
--- a/tests/test-journal-exists	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-#!/bin/sh
-
-hg init
-echo a > a
-hg ci -Am0
-hg -q clone . foo
-
-touch .hg/store/journal
-
-echo foo > a
-hg ci -Am0
-
-hg recover
-
-echo % check that zero-size journals are correctly aborted
-hg bundle -qa repo.hg
-chmod -w foo/.hg/store/00changelog.i
-hg -R foo unbundle repo.hg 2>&1 | sed 's/\(abort: Permission denied\).*/\1/'
-if test -f foo/.hg/store/journal; then echo 'journal exists :-('; fi
-exit 0
--- a/tests/test-journal-exists.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-adding a
-abort: abandoned transaction found - run hg recover!
-rolling back interrupted transaction
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 1 changesets, 1 total revisions
-% check that zero-size journals are correctly aborted
-adding changesets
-abort: Permission denied
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-journal-exists.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,34 @@
+  $ hg init
+  $ echo a > a
+  $ hg ci -Am0
+  adding a
+
+  $ hg -q clone . foo
+
+  $ touch .hg/store/journal
+
+  $ echo foo > a
+  $ hg ci -Am0
+  abort: abandoned transaction found - run hg recover!
+  [255]
+
+  $ hg recover
+  rolling back interrupted transaction
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 1 changesets, 1 total revisions
+
+Check that zero-size journals are correctly aborted:
+
+  $ hg bundle -qa repo.hg
+  $ chmod -w foo/.hg/store/00changelog.i
+
+  $ hg -R foo unbundle repo.hg
+  adding changesets
+  abort: Permission denied: * (glob)
+  [255]
+
+  $ if test -f foo/.hg/store/journal; then echo 'journal exists :-('; fi
+
--- a/tests/test-keyword	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,418 +0,0 @@
-#!/bin/sh
-
-cat <<EOF >> $HGRCPATH
-[extensions]
-keyword =
-mq =
-notify =
-record =
-transplant =
-[ui]
-interactive = true
-EOF
-
-# demo before [keyword] files are set up
-# would succeed without uisetup otherwise
-echo % hg kwdemo
-hg --quiet kwdemo \
-| sed -e 's![^ ][^ ]*demo.txt,v!/TMP/demo.txt,v!' \
- -e 's/,v [a-z0-9][a-z0-9]* /,v xxxxxxxxxxxx /' \
- -e '/[$]Revision/ s/: [a-z0-9][a-z0-9]* /: xxxxxxxxxxxx /' \
- -e 's! 20[0-9][0-9]/[01][0-9]/[0-3][0-9] [0-2][0-9]:[0-6][0-9]:[0-6][0-9]! 2000/00/00 00:00:00!'
-
-hg --quiet kwdemo "Branch = {branches}"
-
-cat <<EOF >> $HGRCPATH
-[keyword]
-** =
-b = ignore
-[hooks]
-commit=
-commit.test=cp a hooktest
-EOF
-
-hg init Test-bndl
-cd Test-bndl
-
-echo % kwshrink should exit silently in empty/invalid repo
-hg kwshrink
-
-# Symlinks cannot be created on Windows. The bundle was made with:
-#
-# hg init t
-# cd t
-# echo a > a
-# ln -s a sym
-# hg add sym
-# hg ci -m addsym -u mercurial
-# hg bundle --base null ../test-keyword.hg
-#
-hg pull -u "$TESTDIR/test-keyword.hg" \
-    | sed 's/pulling from.*test-keyword.hg/pulling from test-keyword.hg/'
-
-echo 'expand $Id$' > a
-echo 'do not process $Id:' >> a
-echo 'xxx $' >> a
-echo 'ignore $Id$' > b
-echo % cat
-cat a b
-
-echo % no kwfiles
-hg kwfiles
-echo % untracked candidates
-hg -v kwfiles --unknown
-
-echo % addremove
-hg addremove
-echo % status
-hg status
-
-echo % default keyword expansion including commit hook
-echo % interrupted commit should not change state or run commit hook
-hg --debug commit
-echo % status
-hg status
-
-echo % commit
-hg --debug commit -mabsym -u 'User Name <user@example.com>'
-echo % status
-hg status
-echo % identify
-hg debugrebuildstate
-hg --quiet identify
-echo % cat
-cat a b
-echo % hg cat
-hg cat sym a b
-
-echo
-echo % diff a hooktest
-diff a hooktest
-
-echo % removing commit hook from config
-sed -e '/\[hooks\]/,$ d' "$HGRCPATH" > $HGRCPATH.nohook
-mv "$HGRCPATH".nohook "$HGRCPATH"
-rm hooktest
-
-echo % bundle
-hg bundle --base null ../kw.hg
-
-cd ..
-hg init Test
-cd Test
-
-echo % notify on pull to check whether keywords stay as is in email
-echo % ie. if patch.diff wrapper acts as it should
-
-cat <<EOF >> $HGRCPATH
-[hooks]
-incoming.notify = python:hgext.notify.hook
-[notify]
-sources = pull
-diffstat = False
-[reposubs]
-* = Test
-EOF
-
-echo % pull from bundle
-hg pull -u ../kw.hg 2>&1 | sed -e '/^Content-Type:/,/^diffs (/ d'
-
-echo % remove notify config
-sed -e '/\[hooks\]/,$ d' "$HGRCPATH" > $HGRCPATH.nonotify
-mv "$HGRCPATH".nonotify "$HGRCPATH"
-
-echo % touch
-touch a b
-echo % status
-hg status
-
-rm sym a b
-echo % update
-hg update -C
-echo % cat
-cat a b
-
-echo % check whether expansion is filewise
-echo '$Id$' > c
-echo 'tests for different changenodes' >> c
-echo % commit c
-hg commit -A -mcndiff -d '1 0' -u 'User Name <user@example.com>'
-echo % force expansion
-hg -v kwexpand
-echo % compare changenodes in a c
-cat a c
-
-echo % record chunk
-python -c \
-'l=open("a").readlines();l.insert(1,"foo\n");l.append("bar\n");open("a","w").writelines(l);'
-hg record -d '1 10' -m rectest<<EOF
-y
-y
-n
-EOF
-echo
-hg identify
-hg status
-echo % cat modified file
-cat a
-hg diff | grep -v 'b/a'
-hg rollback
-
-echo % record file
-echo foo > msg
-# do not use "hg record -m" here!
-hg record -l msg -d '1 11'<<EOF
-y
-y
-y
-EOF
-echo % a should be clean
-hg status -A a
-rm msg
-hg rollback
-hg update -C
-
-echo % init --mq
-hg init --mq
-echo % qimport
-hg qimport -r tip -n mqtest.diff
-echo % commit --mq
-hg commit --mq -m mqtest
-echo % keywords should not be expanded in patch
-cat .hg/patches/mqtest.diff
-echo % qpop
-hg qpop
-echo % qgoto - should imply qpush
-hg qgoto mqtest.diff
-echo % cat
-cat c
-echo % hg cat
-hg cat c
-echo % keyword should not be expanded in filelog
-hg --config 'extensions.keyword=!' cat c
-echo % qpop and move on
-hg qpop
-
-echo % copy
-hg cp a c
-
-echo % kwfiles added
-hg kwfiles
-
-echo % commit
-hg --debug commit -ma2c -d '1 0' -u 'User Name <user@example.com>'
-echo % cat a c
-cat a c
-echo % touch copied c
-touch c
-echo % status
-hg status
-
-echo % kwfiles
-hg kwfiles
-echo % ignored files
-hg -v kwfiles --ignore
-echo % all files
-hg kwfiles --all
-
-echo % diff --rev
-hg diff --rev 1 | grep -v 'b/c'
-
-echo % rollback
-hg rollback
-echo % status
-hg status
-echo % update -C
-hg update --clean
-
-echo % custom keyword expansion
-echo % try with kwdemo
-hg --quiet kwdemo "Xinfo = {author}: {desc}"
-
-cat <<EOF >>$HGRCPATH
-[keywordmaps]
-Id = {file} {node|short} {date|rfc822date} {author|user}
-Xinfo = {author}: {desc}
-EOF
-
-echo % cat
-cat a b
-echo % hg cat
-hg cat sym a b
-
-echo
-echo '$Xinfo$' >> a
-cat <<EOF >> log
-firstline
-secondline
-EOF
-
-echo % interrupted commit should not change state
-hg commit
-echo % status
-hg status
-
-echo % commit
-hg --debug commit -l log -d '2 0' -u 'User Name <user@example.com>'
-rm log
-echo % status
-hg status
-echo % verify
-hg verify
-
-echo % cat
-cat a b
-echo % hg cat
-hg cat sym a b
-echo
-echo % annotate
-hg annotate a
-
-echo % remove
-hg debugrebuildstate
-hg remove a
-hg --debug commit -m rma
-echo % status
-hg status
-echo % rollback
-hg rollback
-echo % status
-hg status
-echo % revert a
-hg revert --no-backup --rev tip a
-echo % cat a
-cat a
-
-echo % clone
-cd ..
-
-echo % expansion in dest
-hg --quiet clone Test globalconf
-cat globalconf/a
-echo % no expansion in dest
-hg --quiet --config 'keyword.**=ignore' clone Test localconf
-cat localconf/a
-
-echo % clone to test incoming
-hg clone -r1 Test Test-a
-cd Test-a
-cat <<EOF >> .hg/hgrc
-[paths]
-default = ../Test
-EOF
-echo % incoming
-# remove path to temp dir
-hg incoming | sed -e 's/^\(comparing with \).*\(test-keyword.*\)/\1\2/'
-
-sed -e 's/Id.*/& rejecttest/' a > a.new
-mv a.new a
-echo % commit rejecttest
-hg --debug commit -m'rejects?' -d '3 0' -u 'User Name <user@example.com>'
-echo % export
-hg export -o ../rejecttest.diff tip
-
-cd ../Test
-echo % import
-hg import ../rejecttest.diff
-echo % cat
-cat a b
-echo
-echo % rollback
-hg rollback
-echo % clean update
-hg update --clean
-
-echo % kwexpand/kwshrink on selected files
-mkdir x
-echo % copy a x/a
-hg copy a x/a
-echo % kwexpand a
-hg --verbose kwexpand a
-echo % kwexpand x/a should abort
-hg --verbose kwexpand x/a
-cd x
-hg --debug commit -m xa -d '3 0' -u 'User Name <user@example.com>'
-echo % cat a
-cat a
-echo % kwshrink a inside directory x
-hg --verbose kwshrink a
-echo % cat a
-cat a
-cd ..
-
-echo % kwexpand nonexistent
-hg kwexpand nonexistent 2>&1 | sed 's/nonexistent:.*/nonexistent:/'
-
-echo % hg serve
-hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
-cat hg.pid >> $DAEMON_PIDS
-echo % expansion
-echo % hgweb file
-("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/a/?style=raw')
-echo % no expansion
-echo % hgweb annotate
-("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/annotate/tip/a/?style=raw')
-echo % hgweb changeset
-("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/rev/tip/?style=raw')
-echo % hgweb filediff
-("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/diff/bb948857c743/a?style=raw')
-echo % errors encountered
-cat errors.log
-
-echo % merge/resolve
-echo '$Id$' > m
-hg add m
-hg commit -m 4kw 
-echo foo >> m
-hg commit -m 5foo
-echo % simplemerge
-hg update 4
-echo foo >> m
-hg commit -m 6foo
-hg merge
-hg commit -m simplemerge
-cat m
-echo % conflict
-hg update 4
-echo bar >> m
-hg commit -m 8bar
-hg merge
-echo % keyword stays outside conflict zone
-cat m
-echo % resolve to local
-HGMERGE=internal:local hg resolve -a
-hg commit -m localresolve
-cat m
-
-echo % test restricted mode with transplant -b
-hg update 6
-hg branch foo
-mv a a.bak
-echo foobranch > a
-cat a.bak >> a
-rm a.bak
-hg commit -m 9foobranch
-hg update default
-hg -y transplant -b foo tip
-echo % no expansion in changeset
-hg tip -p
-echo % expansion in file
-head -n 2 a
-hg -q rollback
-hg -q update -C
-
-echo % switch off expansion
-echo % kwshrink with unknown file u
-cp a u
-hg --verbose kwshrink
-echo % cat
-cat a b
-echo % hg cat
-hg cat sym a b
-echo
-rm "$HGRCPATH"
-echo % cat
-cat a b
-echo % hg cat
-hg cat sym a b
-echo
--- a/tests/test-keyword.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,547 +0,0 @@
-% hg kwdemo
-[extensions]
-keyword =
-[keyword]
-demo.txt = 
-[keywordmaps]
-Author = {author|user}
-Date = {date|utcdate}
-Header = {root}/{file},v {node|short} {date|utcdate} {author|user}
-Id = {file|basename},v {node|short} {date|utcdate} {author|user}
-RCSFile = {file|basename},v
-RCSfile = {file|basename},v
-Revision = {node|short}
-Source = {root}/{file},v
-$Author: test $
-$Date: 2000/00/00 00:00:00 $
-$Header: /TMP/demo.txt,v xxxxxxxxxxxx 2000/00/00 00:00:00 test $
-$Id: demo.txt,v xxxxxxxxxxxx 2000/00/00 00:00:00 test $
-$RCSFile: demo.txt,v $
-$RCSfile: demo.txt,v $
-$Revision: xxxxxxxxxxxx $
-$Source: /TMP/demo.txt,v $
-[extensions]
-keyword =
-[keyword]
-demo.txt = 
-[keywordmaps]
-Branch = {branches}
-$Branch: demobranch $
-% kwshrink should exit silently in empty/invalid repo
-pulling from test-keyword.hg
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% cat
-expand $Id$
-do not process $Id:
-xxx $
-ignore $Id$
-% no kwfiles
-% untracked candidates
-k a
-% addremove
-adding a
-adding b
-% status
-A a
-A b
-% default keyword expansion including commit hook
-% interrupted commit should not change state or run commit hook
-abort: empty commit message
-% status
-A a
-A b
-% commit
-a
-b
-overwriting a expanding keywords
-running hook commit.test: cp a hooktest
-committed changeset 1:ef63ca68695bc9495032c6fda1350c71e6d256e9
-% status
-? hooktest
-% identify
-ef63ca68695b
-% cat
-expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
-do not process $Id:
-xxx $
-ignore $Id$
-% hg cat
-expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
-do not process $Id:
-xxx $
-ignore $Id$
-a
-% diff a hooktest
-% removing commit hook from config
-% bundle
-2 changesets found
-% notify on pull to check whether keywords stay as is in email
-% ie. if patch.diff wrapper acts as it should
-% pull from bundle
-pulling from ../kw.hg
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 3 changes to 3 files
-
-diff -r 000000000000 -r a2392c293916 sym
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/sym	Sat Feb 09 20:25:47 2008 +0100
-@@ -0,0 +1,1 @@
-+a
-\ No newline at end of file
-
-diff -r a2392c293916 -r ef63ca68695b a
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/a	Thu Jan 01 00:00:00 1970 +0000
-@@ -0,0 +1,3 @@
-+expand $Id$
-+do not process $Id:
-+xxx $
-diff -r a2392c293916 -r ef63ca68695b b
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/b	Thu Jan 01 00:00:00 1970 +0000
-@@ -0,0 +1,1 @@
-+ignore $Id$
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% remove notify config
-% touch
-% status
-% update
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% cat
-expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
-do not process $Id:
-xxx $
-ignore $Id$
-% check whether expansion is filewise
-% commit c
-adding c
-% force expansion
-overwriting a expanding keywords
-overwriting c expanding keywords
-% compare changenodes in a c
-expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
-do not process $Id:
-xxx $
-$Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
-tests for different changenodes
-% record chunk
-diff --git a/a b/a
-2 hunks, 2 lines changed
-examine changes to 'a'? [Ynsfdaq?] 
-@@ -1,3 +1,4 @@
- expand $Id$
-+foo
- do not process $Id:
- xxx $
-record change 1/2 to 'a'? [Ynsfdaq?] 
-@@ -2,2 +3,3 @@
- do not process $Id:
- xxx $
-+bar
-record change 2/2 to 'a'? [Ynsfdaq?] 
-
-d17e03c92c97+ tip
-M a
-% cat modified file
-expand $Id: a,v d17e03c92c97 1970/01/01 00:00:01 test $
-foo
-do not process $Id:
-xxx $
-bar
-diff -r d17e03c92c97 a
---- a/a	Wed Dec 31 23:59:51 1969 -0000
-@@ -2,3 +2,4 @@
- foo
- do not process $Id:
- xxx $
-+bar
-rolling back to revision 2 (undo commit)
-% record file
-diff --git a/a b/a
-2 hunks, 2 lines changed
-examine changes to 'a'? [Ynsfdaq?] 
-@@ -1,3 +1,4 @@
- expand $Id$
-+foo
- do not process $Id:
- xxx $
-record change 1/2 to 'a'? [Ynsfdaq?] 
-@@ -2,2 +3,3 @@
- do not process $Id:
- xxx $
-+bar
-record change 2/2 to 'a'? [Ynsfdaq?] 
-% a should be clean
-C a
-rolling back to revision 2 (undo commit)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% init --mq
-% qimport
-% commit --mq
-% keywords should not be expanded in patch
-# HG changeset patch
-# User User Name <user@example.com>
-# Date 1 0
-# Node ID 40a904bbbe4cd4ab0a1f28411e35db26341a40ad
-# Parent  ef63ca68695bc9495032c6fda1350c71e6d256e9
-cndiff
-
-diff -r ef63ca68695b -r 40a904bbbe4c c
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/c	Thu Jan 01 00:00:01 1970 +0000
-@@ -0,0 +1,2 @@
-+$Id$
-+tests for different changenodes
-% qpop
-popping mqtest.diff
-patch queue now empty
-% qgoto - should imply qpush
-applying mqtest.diff
-now at: mqtest.diff
-% cat
-$Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
-tests for different changenodes
-% hg cat
-$Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
-tests for different changenodes
-% keyword should not be expanded in filelog
-$Id$
-tests for different changenodes
-% qpop and move on
-popping mqtest.diff
-patch queue now empty
-% copy
-% kwfiles added
-a
-c
-% commit
-c
- c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292
-overwriting c expanding keywords
-committed changeset 2:25736cf2f5cbe41f6be4e6784ef6ecf9f3bbcc7d
-% cat a c
-expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
-do not process $Id:
-xxx $
-expand $Id: c,v 25736cf2f5cb 1970/01/01 00:00:01 user $
-do not process $Id:
-xxx $
-% touch copied c
-% status
-% kwfiles
-a
-c
-% ignored files
-I b
-I sym
-% all files
-K a
-K c
-I b
-I sym
-% diff --rev
-diff -r ef63ca68695b c
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-@@ -0,0 +1,3 @@
-+expand $Id$
-+do not process $Id:
-+xxx $
-% rollback
-rolling back to revision 1 (undo commit)
-% status
-A c
-% update -C
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% custom keyword expansion
-% try with kwdemo
-[extensions]
-keyword =
-[keyword]
-** = 
-b = ignore
-demo.txt = 
-[keywordmaps]
-Xinfo = {author}: {desc}
-$Xinfo: test: hg keyword configuration and expansion example $
-% cat
-expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
-do not process $Id:
-xxx $
-ignore $Id$
-% hg cat
-expand $Id: a ef63ca68695b Thu, 01 Jan 1970 00:00:00 +0000 user $
-do not process $Id:
-xxx $
-ignore $Id$
-a
-% interrupted commit should not change state
-abort: empty commit message
-% status
-M a
-? c
-? log
-% commit
-a
-overwriting a expanding keywords
-committed changeset 2:bb948857c743469b22bbf51f7ec8112279ca5d83
-% status
-? c
-% verify
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-3 files, 3 changesets, 4 total revisions
-% cat
-expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
-do not process $Id:
-xxx $
-$Xinfo: User Name <user@example.com>: firstline $
-ignore $Id$
-% hg cat
-expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
-do not process $Id:
-xxx $
-$Xinfo: User Name <user@example.com>: firstline $
-ignore $Id$
-a
-% annotate
-1: expand $Id$
-1: do not process $Id:
-1: xxx $
-2: $Xinfo$
-% remove
-committed changeset 3:d14c712653769de926994cf7fbb06c8fbd68f012
-% status
-? c
-% rollback
-rolling back to revision 2 (undo commit)
-% status
-R a
-? c
-% revert a
-% cat a
-expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
-do not process $Id:
-xxx $
-$Xinfo: User Name <user@example.com>: firstline $
-% clone
-% expansion in dest
-expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
-do not process $Id:
-xxx $
-$Xinfo: User Name <user@example.com>: firstline $
-% no expansion in dest
-expand $Id$
-do not process $Id:
-xxx $
-$Xinfo$
-% clone to test incoming
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 3 changes to 3 files
-updating to branch default
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% incoming
-comparing with test-keyword/Test
-searching for changes
-changeset:   2:bb948857c743
-tag:         tip
-user:        User Name <user@example.com>
-date:        Thu Jan 01 00:00:02 1970 +0000
-summary:     firstline
-
-% commit rejecttest
-a
-overwriting a expanding keywords
-committed changeset 2:85e279d709ffc28c9fdd1b868570985fc3d87082
-% export
-% import
-applying ../rejecttest.diff
-% cat
-expand $Id: a 4e0994474d25 Thu, 01 Jan 1970 00:00:03 +0000 user $ rejecttest
-do not process $Id: rejecttest
-xxx $
-$Xinfo: User Name <user@example.com>: rejects? $
-ignore $Id$
-
-% rollback
-rolling back to revision 2 (undo commit)
-% clean update
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% kwexpand/kwshrink on selected files
-% copy a x/a
-% kwexpand a
-overwriting a expanding keywords
-% kwexpand x/a should abort
-abort: outstanding uncommitted changes
-x/a
- x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e
-overwriting x/a expanding keywords
-committed changeset 3:b4560182a3f9a358179fd2d835c15e9da379c1e4
-% cat a
-expand $Id: x/a b4560182a3f9 Thu, 01 Jan 1970 00:00:03 +0000 user $
-do not process $Id:
-xxx $
-$Xinfo: User Name <user@example.com>: xa $
-% kwshrink a inside directory x
-overwriting x/a shrinking keywords
-% cat a
-expand $Id$
-do not process $Id:
-xxx $
-$Xinfo$
-% kwexpand nonexistent
-nonexistent:
-% hg serve
-% expansion
-% hgweb file
-200 Script output follows
-
-expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
-do not process $Id:
-xxx $
-$Xinfo: User Name <user@example.com>: firstline $
-% no expansion
-% hgweb annotate
-200 Script output follows
-
-
-user@1: expand $Id$
-user@1: do not process $Id:
-user@1: xxx $
-user@2: $Xinfo$
-
-
-
-
-% hgweb changeset
-200 Script output follows
-
-
-# HG changeset patch
-# User User Name <user@example.com>
-# Date 3 0
-# Node ID b4560182a3f9a358179fd2d835c15e9da379c1e4
-# Parent  bb948857c743469b22bbf51f7ec8112279ca5d83
-xa
-
-diff -r bb948857c743 -r b4560182a3f9 x/a
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/x/a	Thu Jan 01 00:00:03 1970 +0000
-@@ -0,0 +1,4 @@
-+expand $Id$
-+do not process $Id:
-+xxx $
-+$Xinfo$
-
-% hgweb filediff
-200 Script output follows
-
-
-diff -r ef63ca68695b -r bb948857c743 a
---- a/a	Thu Jan 01 00:00:00 1970 +0000
-+++ b/a	Thu Jan 01 00:00:02 1970 +0000
-@@ -1,3 +1,4 @@
- expand $Id$
- do not process $Id:
- xxx $
-+$Xinfo$
-
-
-
-
-% errors encountered
-% merge/resolve
-% simplemerge
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-$Id: m 27d48ee14f67 Thu, 01 Jan 1970 00:00:00 +0000 test $
-foo
-% conflict
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-merging m
-warning: conflicts during merge.
-merging m failed!
-0 files updated, 0 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
-% keyword stays outside conflict zone
-$Id$
-<<<<<<< local
-bar
-=======
-foo
->>>>>>> other
-% resolve to local
-$Id: m 41efa6d38e9b Thu, 01 Jan 1970 00:00:00 +0000 test $
-bar
-% test restricted mode with transplant -b
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-marked working directory as branch foo
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-applying 4aa30d025d50
-4aa30d025d50 transplanted to 5a4da427c162
-% no expansion in changeset
-changeset:   11:5a4da427c162
-tag:         tip
-parent:      9:41efa6d38e9b
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     9foobranch
-
-diff -r 41efa6d38e9b -r 5a4da427c162 a
---- a/a	Thu Jan 01 00:00:00 1970 +0000
-+++ b/a	Thu Jan 01 00:00:00 1970 +0000
-@@ -1,3 +1,4 @@
-+foobranch
- expand $Id$
- do not process $Id:
- xxx $
-
-% expansion in file
-foobranch
-expand $Id: a 5a4da427c162 Thu, 01 Jan 1970 00:00:00 +0000 test $
-% switch off expansion
-% kwshrink with unknown file u
-overwriting a shrinking keywords
-overwriting m shrinking keywords
-overwriting x/a shrinking keywords
-% cat
-expand $Id$
-do not process $Id:
-xxx $
-$Xinfo$
-ignore $Id$
-% hg cat
-expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
-do not process $Id:
-xxx $
-$Xinfo: User Name <user@example.com>: firstline $
-ignore $Id$
-a
-% cat
-expand $Id$
-do not process $Id:
-xxx $
-$Xinfo$
-ignore $Id$
-% hg cat
-expand $Id$
-do not process $Id:
-xxx $
-$Xinfo$
-ignore $Id$
-a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-keyword.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,927 @@
+  $ cat <<EOF >> $HGRCPATH
+  > [extensions]
+  > keyword =
+  > mq =
+  > notify =
+  > record =
+  > transplant =
+  > [ui]
+  > interactive = true
+  > EOF
+
+Run kwdemo before [keyword] files are set up
+as it would succeed without uisetup otherwise
+
+  $ hg --quiet kwdemo
+  [extensions]
+  keyword =
+  [keyword]
+  demo.txt = 
+  [keywordmaps]
+  Author = {author|user}
+  Date = {date|utcdate}
+  Header = {root}/{file},v {node|short} {date|utcdate} {author|user}
+  Id = {file|basename},v {node|short} {date|utcdate} {author|user}
+  RCSFile = {file|basename},v
+  RCSfile = {file|basename},v
+  Revision = {node|short}
+  Source = {root}/{file},v
+  $Author: test $
+  $Date: ????/??/?? ??:??:?? $ (glob)
+  $Header: */demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
+  $Id: demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
+  $RCSFile: demo.txt,v $
+  $RCSfile: demo.txt,v $
+  $Revision: ???????????? $ (glob)
+  $Source: */demo.txt,v $ (glob)
+
+  $ hg --quiet kwdemo "Branch = {branches}"
+  [extensions]
+  keyword =
+  [keyword]
+  demo.txt = 
+  [keywordmaps]
+  Branch = {branches}
+  $Branch: demobranch $
+
+  $ cat <<EOF >> $HGRCPATH
+  > [keyword]
+  > ** =
+  > b = ignore
+  > [hooks]
+  > commit=
+  > commit.test=cp a hooktest
+  > EOF
+
+  $ hg init Test-bndl
+  $ cd Test-bndl
+
+kwshrink should exit silently in empty/invalid repo
+
+  $ hg kwshrink
+
+Symlinks cannot be created on Windows.
+A bundle to test this was made with:
+ hg init t
+ cd t
+ echo a > a
+ ln -s a sym
+ hg add sym
+ hg ci -m addsym -u mercurial
+ hg bundle --base null ../test-keyword.hg
+
+  $ hg pull -u "$TESTDIR"/test-keyword.hg
+  pulling from *test-keyword.hg (glob)
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ echo 'expand $Id$' > a
+  $ echo 'do not process $Id:' >> a
+  $ echo 'xxx $' >> a
+  $ echo 'ignore $Id$' > b
+
+Output files as they were created
+
+  $ cat a b
+  expand $Id$
+  do not process $Id:
+  xxx $
+  ignore $Id$
+
+no kwfiles
+
+  $ hg kwfiles
+
+untracked candidates
+
+  $ hg -v kwfiles --unknown
+  k a
+
+Add files and check status
+
+  $ hg addremove
+  adding a
+  adding b
+  $ hg status
+  A a
+  A b
+
+
+Default keyword expansion including commit hook
+Interrupted commit should not change state or run commit hook
+
+  $ hg --debug commit
+  abort: empty commit message
+  [255]
+  $ hg status
+  A a
+  A b
+
+Commit with several checks
+
+  $ hg --debug commit -mabsym -u 'User Name <user@example.com>'
+  a
+  b
+  overwriting a expanding keywords
+  running hook commit.test: cp a hooktest
+  committed changeset 1:ef63ca68695bc9495032c6fda1350c71e6d256e9
+  $ hg status
+  ? hooktest
+  $ hg debugrebuildstate
+  $ hg --quiet identify
+  ef63ca68695b
+
+cat files in working directory with keywords expanded
+
+  $ cat a b
+  expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
+  do not process $Id:
+  xxx $
+  ignore $Id$
+
+hg cat files and symlink, no expansion
+
+  $ hg cat sym a b && echo
+  expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
+  do not process $Id:
+  xxx $
+  ignore $Id$
+  a* (glob)
+
+Test hook execution
+
+  $ diff a hooktest
+
+Removing commit hook from config
+
+  $ sed -e '/\[hooks\]/,$ d' "$HGRCPATH" > $HGRCPATH.nohook
+  $ mv "$HGRCPATH".nohook "$HGRCPATH"
+  $ rm hooktest
+
+bundle
+
+  $ hg bundle --base null ../kw.hg
+  2 changesets found
+  $ cd ..
+  $ hg init Test
+  $ cd Test
+
+Notify on pull to check whether keywords stay as is in email
+ie. if patch.diff wrapper acts as it should
+
+  $ cat <<EOF >> $HGRCPATH
+  > [hooks]
+  > incoming.notify = python:hgext.notify.hook
+  > [notify]
+  > sources = pull
+  > diffstat = False
+  > [reposubs]
+  > * = Test
+  > EOF
+
+Pull from bundle and trigger notify
+
+  $ hg pull -u ../kw.hg
+  pulling from ../kw.hg
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 3 changes to 3 files
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Date: * (glob)
+  Subject: changeset in * (glob)
+  From: mercurial
+  X-Hg-Notification: changeset a2392c293916
+  Message-Id: <hg.a2392c293916*> (glob)
+  To: Test
+  
+  changeset a2392c293916 in * (glob)
+  details: *cmd=changeset;node=a2392c293916 (glob)
+  description:
+  	addsym
+  
+  diffs (6 lines):
+  
+  diff -r 000000000000 -r a2392c293916 sym
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/sym	Sat Feb 09 20:25:47 2008 +0100
+  @@ -0,0 +1,1 @@
+  +a
+  \ No newline at end of file
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Date:* (glob)
+  Subject: changeset in* (glob)
+  From: User Name <user@example.com>
+  X-Hg-Notification: changeset ef63ca68695b
+  Message-Id: <hg.ef63ca68695b*> (glob)
+  To: Test
+  
+  changeset ef63ca68695b in * (glob)
+  details: *cmd=changeset;node=ef63ca68695b (glob)
+  description:
+  	absym
+  
+  diffs (12 lines):
+  
+  diff -r a2392c293916 -r ef63ca68695b a
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/a	Thu Jan 01 00:00:00 1970 +0000
+  @@ -0,0 +1,3 @@
+  +expand $Id$
+  +do not process $Id:
+  +xxx $
+  diff -r a2392c293916 -r ef63ca68695b b
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/b	Thu Jan 01 00:00:00 1970 +0000
+  @@ -0,0 +1,1 @@
+  +ignore $Id$
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+Remove notify config
+
+  $ sed -e '/\[hooks\]/,$ d' "$HGRCPATH" > $HGRCPATH.nonotify
+  $ mv "$HGRCPATH".nonotify "$HGRCPATH"
+
+Touch files and check with status
+
+  $ touch a b
+  $ hg status
+
+Update and expand
+
+  $ rm sym a b
+  $ hg update -C
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cat a b
+  expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
+  do not process $Id:
+  xxx $
+  ignore $Id$
+
+Check whether expansion is filewise
+
+  $ echo '$Id$' > c
+  $ echo 'tests for different changenodes' >> c
+
+commit file c
+
+  $ hg commit -A -mcndiff -d '1 0' -u 'User Name <user@example.com>'
+  adding c
+
+force expansion
+
+  $ hg -v kwexpand
+  overwriting a expanding keywords
+  overwriting c expanding keywords
+
+compare changenodes in a and c
+
+  $ cat a c
+  expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
+  do not process $Id:
+  xxx $
+  $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
+  tests for different changenodes
+
+record chunk
+
+  $ python -c \
+  > 'l=open("a").readlines();l.insert(1,"foo\n");l.append("bar\n");open("a","w").writelines(l);'
+  $ hg record -d '1 10' -m rectest<<EOF
+  > y
+  > y
+  > n
+  > EOF
+  diff --git a/a b/a
+  2 hunks, 2 lines changed
+  examine changes to 'a'? [Ynsfdaq?] 
+  @@ -1,3 +1,4 @@
+   expand $Id$
+  +foo
+   do not process $Id:
+   xxx $
+  record change 1/2 to 'a'? [Ynsfdaq?] 
+  @@ -2,2 +3,3 @@
+   do not process $Id:
+   xxx $
+  +bar
+  record change 2/2 to 'a'? [Ynsfdaq?] 
+
+  $ hg identify
+  d17e03c92c97+ tip
+  $ hg status
+  M a
+
+Cat modified file a
+
+  $ cat a
+  expand $Id: a,v d17e03c92c97 1970/01/01 00:00:01 test $
+  foo
+  do not process $Id:
+  xxx $
+  bar
+
+Diff remaining chunk
+
+  $ hg diff
+  diff -r d17e03c92c97 a
+  --- a/a	Wed Dec 31 23:59:51 1969 -0000
+  +++ b/a	* (glob)
+  @@ -2,3 +2,4 @@
+   foo
+   do not process $Id:
+   xxx $
+  +bar
+
+  $ hg rollback
+  rolling back to revision 2 (undo commit)
+
+Record all chunks in file a
+
+  $ echo foo > msg
+
+ - do not use "hg record -m" here!
+
+  $ hg record -l msg -d '1 11'<<EOF
+  > y
+  > y
+  > y
+  > EOF
+  diff --git a/a b/a
+  2 hunks, 2 lines changed
+  examine changes to 'a'? [Ynsfdaq?] 
+  @@ -1,3 +1,4 @@
+   expand $Id$
+  +foo
+   do not process $Id:
+   xxx $
+  record change 1/2 to 'a'? [Ynsfdaq?] 
+  @@ -2,2 +3,3 @@
+   do not process $Id:
+   xxx $
+  +bar
+  record change 2/2 to 'a'? [Ynsfdaq?] 
+
+File a should be clean
+
+  $ hg status -A a
+  C a
+
+  $ rm msg
+  $ hg rollback
+  rolling back to revision 2 (undo commit)
+  $ hg update -C
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+Test patch queue repo
+
+  $ hg init --mq
+  $ hg qimport -r tip -n mqtest.diff
+  $ hg commit --mq -m mqtest
+
+Keywords should not be expanded in patch
+
+  $ cat .hg/patches/mqtest.diff
+  # HG changeset patch
+  # User User Name <user@example.com>
+  # Date 1 0
+  # Node ID 40a904bbbe4cd4ab0a1f28411e35db26341a40ad
+  # Parent  ef63ca68695bc9495032c6fda1350c71e6d256e9
+  cndiff
+  
+  diff -r ef63ca68695b -r 40a904bbbe4c c
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/c	Thu Jan 01 00:00:01 1970 +0000
+  @@ -0,0 +1,2 @@
+  +$Id$
+  +tests for different changenodes
+
+  $ hg qpop
+  popping mqtest.diff
+  patch queue now empty
+
+qgoto, implying qpush, should expand
+
+  $ hg qgoto mqtest.diff
+  applying mqtest.diff
+  now at: mqtest.diff
+  $ cat c
+  $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
+  tests for different changenodes
+  $ hg cat c
+  $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
+  tests for different changenodes
+
+Keywords should not be expanded in filelog
+
+  $ hg --config 'extensions.keyword=!' cat c
+  $Id$
+  tests for different changenodes
+
+qpop and move on
+
+  $ hg qpop
+  popping mqtest.diff
+  patch queue now empty
+
+Copy and show added kwfiles
+
+  $ hg cp a c
+  $ hg kwfiles
+  a
+  c
+
+Commit and show expansion in original and copy
+
+  $ hg --debug commit -ma2c -d '1 0' -u 'User Name <user@example.com>'
+  c
+   c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292
+  overwriting c expanding keywords
+  committed changeset 2:25736cf2f5cbe41f6be4e6784ef6ecf9f3bbcc7d
+  $ cat a c
+  expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
+  do not process $Id:
+  xxx $
+  expand $Id: c,v 25736cf2f5cb 1970/01/01 00:00:01 user $
+  do not process $Id:
+  xxx $
+
+Touch copied c and check its status
+
+  $ touch c
+  $ hg status
+
+Test different options of hg kwfiles
+
+  $ hg kwfiles
+  a
+  c
+  $ hg -v kwfiles --ignore
+  I b
+  I sym
+  $ hg kwfiles --all
+  K a
+  K c
+  I b
+  I sym
+
+Diff specific revision
+
+  $ hg diff --rev 1
+  diff -r ef63ca68695b c
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/c	* (glob)
+  @@ -0,0 +1,3 @@
+  +expand $Id$
+  +do not process $Id:
+  +xxx $
+
+Status after rollback:
+
+  $ hg rollback
+  rolling back to revision 1 (undo commit)
+  $ hg status
+  A c
+  $ hg update --clean
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+Custom keywordmaps as argument to kwdemo
+
+  $ hg --quiet kwdemo "Xinfo = {author}: {desc}"
+  [extensions]
+  keyword =
+  [keyword]
+  ** = 
+  b = ignore
+  demo.txt = 
+  [keywordmaps]
+  Xinfo = {author}: {desc}
+  $Xinfo: test: hg keyword configuration and expansion example $
+
+Configure custom keywordmaps
+
+  $ cat <<EOF >>$HGRCPATH
+  > [keywordmaps]
+  > Id = {file} {node|short} {date|rfc822date} {author|user}
+  > Xinfo = {author}: {desc}
+  > EOF
+
+Cat and hg cat files before custom expansion
+
+  $ cat a b
+  expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
+  do not process $Id:
+  xxx $
+  ignore $Id$
+  $ hg cat sym a b && echo
+  expand $Id: a ef63ca68695b Thu, 01 Jan 1970 00:00:00 +0000 user $
+  do not process $Id:
+  xxx $
+  ignore $Id$
+  a* (glob)
+
+Write custom keyword and prepare multiline commit message
+
+  $ echo '$Xinfo$' >> a
+  $ cat <<EOF >> log
+  > firstline
+  > secondline
+  > EOF
+
+Interrupted commit should not change state
+
+  $ hg commit
+  abort: empty commit message
+  [255]
+  $ hg status
+  M a
+  ? c
+  ? log
+
+Commit with multiline message and custom expansion
+
+  $ hg --debug commit -l log -d '2 0' -u 'User Name <user@example.com>'
+  a
+  overwriting a expanding keywords
+  committed changeset 2:bb948857c743469b22bbf51f7ec8112279ca5d83
+  $ rm log
+
+Stat, verify and show custom expansion (firstline)
+
+  $ hg status
+  ? c
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  3 files, 3 changesets, 4 total revisions
+  $ cat a b
+  expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
+  do not process $Id:
+  xxx $
+  $Xinfo: User Name <user@example.com>: firstline $
+  ignore $Id$
+  $ hg cat sym a b && echo
+  expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
+  do not process $Id:
+  xxx $
+  $Xinfo: User Name <user@example.com>: firstline $
+  ignore $Id$
+  a* (glob)
+
+annotate
+
+  $ hg annotate a
+  1: expand $Id$
+  1: do not process $Id:
+  1: xxx $
+  2: $Xinfo$
+
+remove with status checks
+
+  $ hg debugrebuildstate
+  $ hg remove a
+  $ hg --debug commit -m rma
+  committed changeset 3:d14c712653769de926994cf7fbb06c8fbd68f012
+  $ hg status
+  ? c
+
+Rollback, revert, and check expansion
+
+  $ hg rollback
+  rolling back to revision 2 (undo commit)
+  $ hg status
+  R a
+  ? c
+  $ hg revert --no-backup --rev tip a
+  $ cat a
+  expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
+  do not process $Id:
+  xxx $
+  $Xinfo: User Name <user@example.com>: firstline $
+
+Clone to test global and local configurations
+
+  $ cd ..
+
+Expansion in destinaton with global configuration
+
+  $ hg --quiet clone Test globalconf
+  $ cat globalconf/a
+  expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
+  do not process $Id:
+  xxx $
+  $Xinfo: User Name <user@example.com>: firstline $
+
+No expansion in destination with local configuration in origin only
+
+  $ hg --quiet --config 'keyword.**=ignore' clone Test localconf
+  $ cat localconf/a
+  expand $Id$
+  do not process $Id:
+  xxx $
+  $Xinfo$
+
+Clone to test incoming
+
+  $ hg clone -r1 Test Test-a
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 3 changes to 3 files
+  updating to branch default
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd Test-a
+  $ cat <<EOF >> .hg/hgrc
+  > [paths]
+  > default = ../Test
+  > EOF
+  $ hg incoming
+  comparing with *test-keyword.t/Test (glob)
+  searching for changes
+  changeset:   2:bb948857c743
+  tag:         tip
+  user:        User Name <user@example.com>
+  date:        Thu Jan 01 00:00:02 1970 +0000
+  summary:     firstline
+  
+Imported patch should not be rejected
+
+  $ sed -e 's/Id.*/& rejecttest/' a > a.new
+  $ mv a.new a
+  $ hg --debug commit -m'rejects?' -d '3 0' -u 'User Name <user@example.com>'
+  a
+  overwriting a expanding keywords
+  committed changeset 2:85e279d709ffc28c9fdd1b868570985fc3d87082
+  $ hg export -o ../rejecttest.diff tip
+  $ cd ../Test
+  $ hg import ../rejecttest.diff
+  applying ../rejecttest.diff
+  $ cat a b
+  expand $Id: a 4e0994474d25 Thu, 01 Jan 1970 00:00:03 +0000 user $ rejecttest
+  do not process $Id: rejecttest
+  xxx $
+  $Xinfo: User Name <user@example.com>: rejects? $
+  ignore $Id$
+
+  $ hg rollback
+  rolling back to revision 2 (undo commit)
+  $ hg update --clean
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+kwexpand/kwshrink on selected files
+
+  $ mkdir x
+  $ hg copy a x/a
+  $ hg --verbose kwexpand a
+  overwriting a expanding keywords
+
+kwexpand x/a should abort
+
+  $ hg --verbose kwexpand x/a
+  abort: outstanding uncommitted changes
+  [255]
+  $ cd x
+  $ hg --debug commit -m xa -d '3 0' -u 'User Name <user@example.com>'
+  x/a
+   x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e
+  overwriting x/a expanding keywords
+  committed changeset 3:b4560182a3f9a358179fd2d835c15e9da379c1e4
+  $ cat a
+  expand $Id: x/a b4560182a3f9 Thu, 01 Jan 1970 00:00:03 +0000 user $
+  do not process $Id:
+  xxx $
+  $Xinfo: User Name <user@example.com>: xa $
+
+kwshrink a inside directory x
+
+  $ hg --verbose kwshrink a
+  overwriting x/a shrinking keywords
+  $ cat a
+  expand $Id$
+  do not process $Id:
+  xxx $
+  $Xinfo$
+  $ cd ..
+
+kwexpand nonexistent
+
+  $ hg kwexpand nonexistent
+  nonexistent:* (glob)
+
+
+hg serve
+ - expand with hgweb file
+ - no expansion with hgweb annotate/changeset/filediff
+ - check errors
+
+  $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
+  $ cat hg.pid >> $DAEMON_PIDS
+  $ $TESTDIR/get-with-headers.py localhost:$HGPORT '/file/tip/a/?style=raw'
+  200 Script output follows
+  
+  expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
+  do not process $Id:
+  xxx $
+  $Xinfo: User Name <user@example.com>: firstline $
+  $ $TESTDIR/get-with-headers.py localhost:$HGPORT '/annotate/tip/a/?style=raw'
+  200 Script output follows
+  
+  
+  user@1: expand $Id$
+  user@1: do not process $Id:
+  user@1: xxx $
+  user@2: $Xinfo$
+  
+  
+  
+  
+  $ $TESTDIR/get-with-headers.py localhost:$HGPORT '/rev/tip/?style=raw'
+  200 Script output follows
+  
+  
+  # HG changeset patch
+  # User User Name <user@example.com>
+  # Date 3 0
+  # Node ID b4560182a3f9a358179fd2d835c15e9da379c1e4
+  # Parent  bb948857c743469b22bbf51f7ec8112279ca5d83
+  xa
+  
+  diff -r bb948857c743 -r b4560182a3f9 x/a
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/x/a	Thu Jan 01 00:00:03 1970 +0000
+  @@ -0,0 +1,4 @@
+  +expand $Id$
+  +do not process $Id:
+  +xxx $
+  +$Xinfo$
+  
+  $ $TESTDIR/get-with-headers.py localhost:$HGPORT '/diff/bb948857c743/a?style=raw'
+  200 Script output follows
+  
+  
+  diff -r ef63ca68695b -r bb948857c743 a
+  --- a/a	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/a	Thu Jan 01 00:00:02 1970 +0000
+  @@ -1,3 +1,4 @@
+   expand $Id$
+   do not process $Id:
+   xxx $
+  +$Xinfo$
+  
+  
+  
+  
+  $ cat errors.log
+
+Prepare merge and resolve tests
+
+  $ echo '$Id$' > m
+  $ hg add m
+  $ hg commit -m 4kw 
+  $ echo foo >> m
+  $ hg commit -m 5foo
+
+simplemerge
+
+  $ hg update 4
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo foo >> m
+  $ hg commit -m 6foo
+  created new head
+  $ hg merge
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg commit -m simplemerge
+  $ cat m
+  $Id: m 27d48ee14f67 Thu, 01 Jan 1970 00:00:00 +0000 test $
+  foo
+
+conflict: keyword should stay outside conflict zone
+
+  $ hg update 4
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo bar >> m
+  $ hg commit -m 8bar
+  created new head
+  $ hg merge
+  merging m
+  warning: conflicts during merge.
+  merging m failed!
+  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
+  [1]
+  $ cat m
+  $Id$
+  <<<<<<< local
+  bar
+  =======
+  foo
+  >>>>>>> other
+
+resolve to local
+
+  $ HGMERGE=internal:local hg resolve -a
+  $ hg commit -m localresolve
+  $ cat m
+  $Id: m 41efa6d38e9b Thu, 01 Jan 1970 00:00:00 +0000 test $
+  bar
+
+Test restricted mode with transplant -b
+
+  $ hg update 6
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg branch foo
+  marked working directory as branch foo
+  $ mv a a.bak
+  $ echo foobranch > a
+  $ cat a.bak >> a
+  $ rm a.bak
+  $ hg commit -m 9foobranch
+  $ hg update default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg -y transplant -b foo tip
+  applying 4aa30d025d50
+  4aa30d025d50 transplanted to 5a4da427c162
+
+Expansion in changeset but not in file
+
+  $ hg tip -p
+  changeset:   11:5a4da427c162
+  tag:         tip
+  parent:      9:41efa6d38e9b
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     9foobranch
+  
+  diff -r 41efa6d38e9b -r 5a4da427c162 a
+  --- a/a	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/a	Thu Jan 01 00:00:00 1970 +0000
+  @@ -1,3 +1,4 @@
+  +foobranch
+   expand $Id$
+   do not process $Id:
+   xxx $
+  
+  $ head -n 2 a
+  foobranch
+  expand $Id: a 5a4da427c162 Thu, 01 Jan 1970 00:00:00 +0000 test $
+
+Switch of expansion
+
+  $ hg -q rollback
+  $ hg -q update -C
+
+kwshrink with unknown file u
+
+  $ cp a u
+  $ hg --verbose kwshrink
+  overwriting a shrinking keywords
+  overwriting m shrinking keywords
+  overwriting x/a shrinking keywords
+
+Keywords shrunk in working directory, but not yet disabled
+ - cat shows unexpanded keywords
+ - hg cat shows expanded keywords
+
+  $ cat a b
+  expand $Id$
+  do not process $Id:
+  xxx $
+  $Xinfo$
+  ignore $Id$
+  $ hg cat sym a b && echo
+  expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
+  do not process $Id:
+  xxx $
+  $Xinfo: User Name <user@example.com>: firstline $
+  ignore $Id$
+  a* (glob)
+
+Now disable keyword expansion
+
+  $ rm "$HGRCPATH"
+  $ cat a b
+  expand $Id$
+  do not process $Id:
+  xxx $
+  $Xinfo$
+  ignore $Id$
+  $ hg cat sym a b && echo
+  expand $Id$
+  do not process $Id:
+  xxx $
+  $Xinfo$
+  ignore $Id$
+  a* (glob)
--- a/tests/test-locate	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-#!/bin/sh
-
-hglocate()
-{
-    echo "hg locate $@"
-    hg locate "$@"
-    ret=$?
-    echo
-    return $ret
-}
-
-mkdir t
-cd t
-hg init
-echo 0 > a
-echo 0 > b
-echo 0 > t.h
-mkdir t
-echo 0 > t/x
-echo 0 > t/b
-echo 0 > t/e.h
-mkdir dir.h
-echo 0 > dir.h/foo
-hg ci -A -m m -d "1000000 0"
-touch nottracked
-hglocate a && echo locate succeeded || echo locate failed
-hglocate NONEXISTENT && echo locate succeeded || echo locate failed
-hglocate
-hg rm a
-hg ci -m m -d "1000000 0"
-hglocate a
-hglocate NONEXISTENT
-hglocate relpath:NONEXISTENT
-hglocate
-hglocate -r 0 a
-hglocate -r 0 NONEXISTENT
-hglocate -r 0 relpath:NONEXISTENT
-hglocate -r 0
-echo % -I/-X with relative path should work
-cd t
-hglocate
-hglocate -I ../t
-# test issue294
-cd ..
-rm -r t
-hglocate 't/**'
-mkdir otherdir
-cd otherdir
-hglocate b
-hglocate '*.h'
-hglocate path:t/x
-hglocate 're:.*\.h$'
-hglocate -r 0 b
-hglocate -r 0 '*.h'
-hglocate -r 0 path:t/x
-hglocate -r 0 're:.*\.h$'
--- a/tests/test-locate.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +0,0 @@
-adding a
-adding b
-adding dir.h/foo
-adding t.h
-adding t/b
-adding t/e.h
-adding t/x
-hg locate a
-a
-
-locate succeeded
-hg locate NONEXISTENT
-
-locate failed
-hg locate 
-a
-b
-dir.h/foo
-t.h
-t/b
-t/e.h
-t/x
-
-hg locate a
-
-hg locate NONEXISTENT
-
-hg locate relpath:NONEXISTENT
-
-hg locate 
-b
-dir.h/foo
-t.h
-t/b
-t/e.h
-t/x
-
-hg locate -r 0 a
-a
-
-hg locate -r 0 NONEXISTENT
-
-hg locate -r 0 relpath:NONEXISTENT
-
-hg locate -r 0
-a
-b
-dir.h/foo
-t.h
-t/b
-t/e.h
-t/x
-
-% -I/-X with relative path should work
-hg locate 
-b
-dir.h/foo
-t.h
-t/b
-t/e.h
-t/x
-
-hg locate -I ../t
-t/b
-t/e.h
-t/x
-
-hg locate t/**
-t/b
-t/e.h
-t/x
-
-hg locate b
-../b
-../t/b
-
-hg locate *.h
-../t.h
-../t/e.h
-
-hg locate path:t/x
-../t/x
-
-hg locate re:.*\.h$
-../t.h
-../t/e.h
-
-hg locate -r 0 b
-../b
-../t/b
-
-hg locate -r 0 *.h
-../t.h
-../t/e.h
-
-hg locate -r 0 path:t/x
-../t/x
-
-hg locate -r 0 re:.*\.h$
-../t.h
-../t/e.h
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-locate.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,121 @@
+  $ mkdir t
+  $ cd t
+  $ hg init
+  $ echo 0 > a
+  $ echo 0 > b
+  $ echo 0 > t.h
+  $ mkdir t
+  $ echo 0 > t/x
+  $ echo 0 > t/b
+  $ echo 0 > t/e.h
+  $ mkdir dir.h
+  $ echo 0 > dir.h/foo
+
+  $ hg ci -A -m m
+  adding a
+  adding b
+  adding dir.h/foo
+  adding t.h
+  adding t/b
+  adding t/e.h
+  adding t/x
+
+  $ touch nottracked
+
+  $ hg locate a
+  a
+
+  $ hg locate NONEXISTENT
+  [1]
+
+  $ hg locate
+  a
+  b
+  dir.h/foo
+  t.h
+  t/b
+  t/e.h
+  t/x
+
+  $ hg rm a
+  $ hg ci -m m
+
+  $ hg locate a
+  [1]
+  $ hg locate NONEXISTENT
+  [1]
+  $ hg locate relpath:NONEXISTENT
+  [1]
+  $ hg locate
+  b
+  dir.h/foo
+  t.h
+  t/b
+  t/e.h
+  t/x
+  $ hg locate -r 0 a
+  a
+  $ hg locate -r 0 NONEXISTENT
+  [1]
+  $ hg locate -r 0 relpath:NONEXISTENT
+  [1]
+  $ hg locate -r 0
+  a
+  b
+  dir.h/foo
+  t.h
+  t/b
+  t/e.h
+  t/x
+
+-I/-X with relative path should work:
+
+  $ cd t
+  $ hg locate
+  b
+  dir.h/foo
+  t.h
+  t/b
+  t/e.h
+  t/x
+  $ hg locate -I ../t
+  t/b
+  t/e.h
+  t/x
+
+Test issue294:
+
+  $ cd ..
+  $ rm -r t
+
+  $ hg locate 't/**'
+  t/b
+  t/e.h
+  t/x
+
+  $ mkdir otherdir
+  $ cd otherdir
+
+  $ hg locate b
+  ../b
+  ../t/b
+  $ hg locate '*.h'
+  ../t.h
+  ../t/e.h
+  $ hg locate path:t/x
+  ../t/x
+  $ hg locate 're:.*\.h$'
+  ../t.h
+  ../t/e.h
+  $ hg locate -r 0 b
+  ../b
+  ../t/b
+  $ hg locate -r 0 '*.h'
+  ../t.h
+  ../t/e.h
+  $ hg locate -r 0 path:t/x
+  ../t/x
+  $ hg locate -r 0 're:.*\.h$'
+  ../t.h
+  ../t/e.h
+
--- a/tests/test-lock-badness	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-hg init a
-echo a > a/a
-hg --cwd a ci -A -m a
-hg clone a b
-echo b > b/b
-hg --cwd b ci -A -m b
-chmod 100 a/.hg/store
-hg --cwd b push ../a
-chmod 700 a/.hg/store
--- a/tests/test-lock-badness.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-adding a
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-adding b
-pushing to ../a
-abort: could not lock repository ../a: Permission denied
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-lock-badness.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,22 @@
+  $ hg init a
+  $ echo a > a/a
+  $ hg -R a ci -A -m a
+  adding a
+
+  $ hg clone a b
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ echo b > b/b
+  $ hg -R b ci -A -m b
+  adding b
+
+  $ chmod 100 a/.hg/store
+
+  $ hg -R b push a
+  pushing to a
+  abort: could not lock repository a: Permission denied
+  [255]
+
+  $ chmod 700 a/.hg/store
+
--- a/tests/test-log	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,198 +0,0 @@
-#!/bin/sh
-
-hg init a
-
-cd a
-echo a > a
-hg ci -Ama -d '1 0'
-
-hg cp a b
-hg ci -mb -d '2 0'
-
-mkdir dir
-hg mv b dir
-hg ci -mc -d '3 0'
-
-hg mv a b
-echo a > d
-hg add d
-hg ci -md -d '4 0'
-
-hg mv dir/b e
-hg ci -me -d '5 0'
-
-hg log a
-echo % -f, directory
-hg log -f dir
-echo % -f, but no args
-hg log -f
-echo % one rename
-hg log -vf a
-echo % many renames
-hg log -vf e
-
-echo % log -pf dir/b
-hg log -pf dir/b
-echo % log -vf dir/b
-hg log -vf dir/b
-
-echo '% log copies with --copies'
-hg log -vC --template '{rev} {file_copies}\n'
-echo '% log copies switch without --copies, with old filecopy template'
-hg log -v --template '{rev} {file_copies_switch%filecopy}\n'
-echo '% log copies switch with --copies'
-hg log -vC --template '{rev} {file_copies_switch}\n'
-
-echo '% log copies with hardcoded style and with --style=default'
-hg log -vC -r4
-hg log -vC -r4 --style=default
-
-echo % log copies, non-linear manifest
-hg up -C 3
-hg mv dir/b e
-echo foo > foo
-hg ci -Ame2 -d '6 0'
-hg log -v --template '{rev} {file_copies}\n' -r 5
-
-echo % log copies, execute bit set
-chmod +x e
-hg ci -me3 -d '7 0'
-hg log -v --template '{rev} {file_copies}\n' -r 6
-
-echo '% log -p d'
-hg log -pv d
-
-# log --follow tests
-hg init ../follow
-cd ../follow
-
-echo base > base
-hg ci -Ambase -d '1 0'
-
-echo r1 >> base
-hg ci -Amr1 -d '1 0'
-echo r2 >> base
-hg ci -Amr2 -d '1 0'
-
-hg up -C 1
-echo b1 > b1
-hg ci -Amb1 -d '1 0'
-
-echo % log -f
-hg log -f
-
-hg up -C 0
-echo b2 > b2
-hg ci -Amb2 -d '1 0'
-
-echo % log -f -r 1:tip
-hg log -f -r 1:tip
-
-hg up -C 3
-hg merge tip
-
-echo % log -r .  with two parents
-hg log -r .
-
-hg ci -mm12 -d '1 0'
-
-echo % log -r .  with one parent
-hg log -r .
-
-echo postm >> b1
-hg ci -Amb1.1 -d'1 0'
-
-echo % log --follow-first
-hg log --follow-first
-
-echo % log -P 2
-hg log -P 2
-
-echo '% log -r tip -p --git'
-hg log -r tip -p --git
-
-echo '% log -r ""'
-hg log -r ''
-
-echo '% log -r <some unknown node id>'
-hg log -r 1000000000000000000000000000000000000000
-
-echo '% log -k r1'
-hg log -k r1
-
-echo '% log -d -1'
-hg log -d -1
-
-echo '% log -p -l2 --color=always'
-hg --config extensions.color= --config color.mode=ansi \
-    log -p -l2 --color=always
-
-echo '% log -r tip --stat'
-hg log -r tip --stat
-
-cd ..
-
-hg init usertest
-cd usertest
-
-echo a > a
-hg ci -A -m "a" -u "User One <user1@example.org>"
-echo b > b
-hg ci -A -m "b" -u "User Two <user2@example.org>"
-
-hg log -u "User One <user1@example.org>"
-hg log -u "user1" -u "user2"
-hg log -u "user3"
-
-cd ..
-
-hg init branches
-cd branches
-
-echo a > a
-hg ci -A -m "commit on default"
-hg branch test
-echo b > b
-hg ci -A -m "commit on test"
-
-hg up default
-echo c > c
-hg ci -A -m "commit on default"
-hg up test
-echo c > c
-hg ci -A -m "commit on test"
-
-echo '% log -b default'
-hg log -b default
-
-echo '% log -b test'
-hg log -b test
-
-echo '% log -b dummy'
-hg log -b dummy
-
-echo '% log -b .'
-hg log -b .
-
-echo '% log -b default -b test'
-hg log -b default -b test
-
-echo '% log -b default -b .'
-hg log -b default -b .
-
-echo '% log -b . -b test'
-hg log -b . -b test
-
-echo '% log -b 2'
-hg log -b 2
-
-echo '% log -p --cwd dir (in subdir)'
-mkdir dir
-hg log -p --cwd dir
-
-echo '% log -p -R repo'
-cd dir
-hg log -p -R .. ../a
-
-
-exit 0
--- a/tests/test-log.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,587 +0,0 @@
-adding a
-changeset:   0:8580ff50825a
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-summary:     a
-
-% -f, directory
-abort: cannot follow nonexistent file: "dir"
-% -f, but no args
-changeset:   4:66c1345dc4f9
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:05 1970 +0000
-summary:     e
-
-changeset:   3:7c6c671bb7cc
-user:        test
-date:        Thu Jan 01 00:00:04 1970 +0000
-summary:     d
-
-changeset:   2:41dd4284081e
-user:        test
-date:        Thu Jan 01 00:00:03 1970 +0000
-summary:     c
-
-changeset:   1:784de7cef101
-user:        test
-date:        Thu Jan 01 00:00:02 1970 +0000
-summary:     b
-
-changeset:   0:8580ff50825a
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-summary:     a
-
-% one rename
-changeset:   0:8580ff50825a
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-files:       a
-description:
-a
-
-
-% many renames
-changeset:   4:66c1345dc4f9
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:05 1970 +0000
-files:       dir/b e
-description:
-e
-
-
-changeset:   2:41dd4284081e
-user:        test
-date:        Thu Jan 01 00:00:03 1970 +0000
-files:       b dir/b
-description:
-c
-
-
-changeset:   1:784de7cef101
-user:        test
-date:        Thu Jan 01 00:00:02 1970 +0000
-files:       b
-description:
-b
-
-
-changeset:   0:8580ff50825a
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-files:       a
-description:
-a
-
-
-% log -pf dir/b
-changeset:   2:41dd4284081e
-user:        test
-date:        Thu Jan 01 00:00:03 1970 +0000
-summary:     c
-
-diff -r 784de7cef101 -r 41dd4284081e dir/b
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/dir/b	Thu Jan 01 00:00:03 1970 +0000
-@@ -0,0 +1,1 @@
-+a
-
-changeset:   1:784de7cef101
-user:        test
-date:        Thu Jan 01 00:00:02 1970 +0000
-summary:     b
-
-diff -r 8580ff50825a -r 784de7cef101 b
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/b	Thu Jan 01 00:00:02 1970 +0000
-@@ -0,0 +1,1 @@
-+a
-
-changeset:   0:8580ff50825a
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-summary:     a
-
-diff -r 000000000000 -r 8580ff50825a a
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/a	Thu Jan 01 00:00:01 1970 +0000
-@@ -0,0 +1,1 @@
-+a
-
-% log -vf dir/b
-changeset:   2:41dd4284081e
-user:        test
-date:        Thu Jan 01 00:00:03 1970 +0000
-files:       b dir/b
-description:
-c
-
-
-changeset:   1:784de7cef101
-user:        test
-date:        Thu Jan 01 00:00:02 1970 +0000
-files:       b
-description:
-b
-
-
-changeset:   0:8580ff50825a
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-files:       a
-description:
-a
-
-
-% log copies with --copies
-4 e (dir/b)
-3 b (a)
-2 dir/b (b)
-1 b (a)
-0 
-% log copies switch without --copies, with old filecopy template
-4 
-3 
-2 
-1 
-0 
-% log copies switch with --copies
-4 e (dir/b)
-3 b (a)
-2 dir/b (b)
-1 b (a)
-0 
-% log copies with hardcoded style and with --style=default
-changeset:   4:66c1345dc4f9
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:05 1970 +0000
-files:       dir/b e
-copies:      e (dir/b)
-description:
-e
-
-
-changeset:   4:66c1345dc4f9
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:05 1970 +0000
-files:       dir/b e
-copies:      e (dir/b)
-description:
-e
-
-
-% log copies, non-linear manifest
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-adding foo
-created new head
-5 e (dir/b)
-% log copies, execute bit set
-6 
-% log -p d
-changeset:   3:7c6c671bb7cc
-user:        test
-date:        Thu Jan 01 00:00:04 1970 +0000
-files:       a b d
-description:
-d
-
-
-diff -r 41dd4284081e -r 7c6c671bb7cc d
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/d	Thu Jan 01 00:00:04 1970 +0000
-@@ -0,0 +1,1 @@
-+a
-
-adding base
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-adding b1
-created new head
-% log -f
-changeset:   3:e62f78d544b4
-tag:         tip
-parent:      1:3d5bf5654eda
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-summary:     b1
-
-changeset:   1:3d5bf5654eda
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-summary:     r1
-
-changeset:   0:67e992f2c4f3
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-summary:     base
-
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-adding b2
-created new head
-% log -f -r 1:tip
-changeset:   1:3d5bf5654eda
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-summary:     r1
-
-changeset:   2:60c670bf5b30
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-summary:     r2
-
-changeset:   3:e62f78d544b4
-parent:      1:3d5bf5654eda
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-summary:     b1
-
-2 files updated, 0 files merged, 1 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-% log -r . with two parents
-changeset:   3:e62f78d544b4
-parent:      1:3d5bf5654eda
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-summary:     b1
-
-% log -r . with one parent
-changeset:   5:302e9dd6890d
-tag:         tip
-parent:      3:e62f78d544b4
-parent:      4:ddb82e70d1a1
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-summary:     m12
-
-% log --follow-first
-changeset:   6:2404bbcab562
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-summary:     b1.1
-
-changeset:   5:302e9dd6890d
-parent:      3:e62f78d544b4
-parent:      4:ddb82e70d1a1
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-summary:     m12
-
-changeset:   3:e62f78d544b4
-parent:      1:3d5bf5654eda
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-summary:     b1
-
-changeset:   1:3d5bf5654eda
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-summary:     r1
-
-changeset:   0:67e992f2c4f3
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-summary:     base
-
-% log -P 2
-changeset:   6:2404bbcab562
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-summary:     b1.1
-
-changeset:   5:302e9dd6890d
-parent:      3:e62f78d544b4
-parent:      4:ddb82e70d1a1
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-summary:     m12
-
-changeset:   4:ddb82e70d1a1
-parent:      0:67e992f2c4f3
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-summary:     b2
-
-changeset:   3:e62f78d544b4
-parent:      1:3d5bf5654eda
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-summary:     b1
-
-% log -r tip -p --git
-changeset:   6:2404bbcab562
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-summary:     b1.1
-
-diff --git a/b1 b/b1
---- a/b1
-+++ b/b1
-@@ -1,1 +1,2 @@
- b1
-+postm
-
-% log -r ""
-hg: parse error: empty query
-% log -r <some unknown node id>
-abort: unknown revision '1000000000000000000000000000000000000000'!
-% log -k r1
-changeset:   1:3d5bf5654eda
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-summary:     r1
-
-% log -d -1
-% log -p -l2 --color=always
-changeset:   6:2404bbcab562
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-summary:     b1.1
-
-diff -r 302e9dd6890d -r 2404bbcab562 b1
---- a/b1	Thu Jan 01 00:00:01 1970 +0000
-+++ b/b1	Thu Jan 01 00:00:01 1970 +0000
-@@ -1,1 +1,2 @@
- b1
-+postm
-
-changeset:   5:302e9dd6890d
-parent:      3:e62f78d544b4
-parent:      4:ddb82e70d1a1
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-summary:     m12
-
-diff -r e62f78d544b4 -r 302e9dd6890d b2
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/b2	Thu Jan 01 00:00:01 1970 +0000
-@@ -0,0 +1,1 @@
-+b2
-
-% log -r tip --stat
-changeset:   6:2404bbcab562
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-summary:     b1.1
-
- b1 |  1 +
- 1 files changed, 1 insertions(+), 0 deletions(-)
-
-adding a
-adding b
-changeset:   0:29a4c94f1924
-user:        User One <user1@example.org>
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     a
-
-changeset:   1:e834b5e69c0e
-tag:         tip
-user:        User Two <user2@example.org>
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     b
-
-changeset:   0:29a4c94f1924
-user:        User One <user1@example.org>
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     a
-
-adding a
-marked working directory as branch test
-adding b
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-adding c
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-adding c
-% log -b default
-changeset:   2:c3a4f03cc9a7
-parent:      0:24427303d56f
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     commit on default
-
-changeset:   0:24427303d56f
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     commit on default
-
-% log -b test
-changeset:   3:f5d8de11c2e2
-branch:      test
-tag:         tip
-parent:      1:d32277701ccb
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     commit on test
-
-changeset:   1:d32277701ccb
-branch:      test
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     commit on test
-
-% log -b dummy
-abort: unknown revision 'dummy'!
-% log -b .
-changeset:   3:f5d8de11c2e2
-branch:      test
-tag:         tip
-parent:      1:d32277701ccb
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     commit on test
-
-changeset:   1:d32277701ccb
-branch:      test
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     commit on test
-
-% log -b default -b test
-changeset:   3:f5d8de11c2e2
-branch:      test
-tag:         tip
-parent:      1:d32277701ccb
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     commit on test
-
-changeset:   2:c3a4f03cc9a7
-parent:      0:24427303d56f
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     commit on default
-
-changeset:   1:d32277701ccb
-branch:      test
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     commit on test
-
-changeset:   0:24427303d56f
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     commit on default
-
-% log -b default -b .
-changeset:   3:f5d8de11c2e2
-branch:      test
-tag:         tip
-parent:      1:d32277701ccb
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     commit on test
-
-changeset:   2:c3a4f03cc9a7
-parent:      0:24427303d56f
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     commit on default
-
-changeset:   1:d32277701ccb
-branch:      test
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     commit on test
-
-changeset:   0:24427303d56f
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     commit on default
-
-% log -b . -b test
-changeset:   3:f5d8de11c2e2
-branch:      test
-tag:         tip
-parent:      1:d32277701ccb
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     commit on test
-
-changeset:   1:d32277701ccb
-branch:      test
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     commit on test
-
-% log -b 2
-changeset:   2:c3a4f03cc9a7
-parent:      0:24427303d56f
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     commit on default
-
-changeset:   0:24427303d56f
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     commit on default
-
-% log -p --cwd dir (in subdir)
-changeset:   3:f5d8de11c2e2
-branch:      test
-tag:         tip
-parent:      1:d32277701ccb
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     commit on test
-
-diff -r d32277701ccb -r f5d8de11c2e2 c
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/c	Thu Jan 01 00:00:00 1970 +0000
-@@ -0,0 +1,1 @@
-+c
-
-changeset:   2:c3a4f03cc9a7
-parent:      0:24427303d56f
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     commit on default
-
-diff -r 24427303d56f -r c3a4f03cc9a7 c
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/c	Thu Jan 01 00:00:00 1970 +0000
-@@ -0,0 +1,1 @@
-+c
-
-changeset:   1:d32277701ccb
-branch:      test
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     commit on test
-
-diff -r 24427303d56f -r d32277701ccb b
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/b	Thu Jan 01 00:00:00 1970 +0000
-@@ -0,0 +1,1 @@
-+b
-
-changeset:   0:24427303d56f
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     commit on default
-
-diff -r 000000000000 -r 24427303d56f a
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/a	Thu Jan 01 00:00:00 1970 +0000
-@@ -0,0 +1,1 @@
-+a
-
-% log -p -R repo
-changeset:   0:24427303d56f
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     commit on default
-
-diff -r 000000000000 -r 24427303d56f a
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/a	Thu Jan 01 00:00:00 1970 +0000
-@@ -0,0 +1,1 @@
-+a
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-log.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,1021 @@
+  $ hg init a
+
+  $ cd a
+  $ echo a > a
+  $ hg ci -Ama -d '1 0'
+  adding a
+
+  $ hg cp a b
+  $ hg ci -mb -d '2 0'
+
+  $ mkdir dir
+  $ hg mv b dir
+  $ hg ci -mc -d '3 0'
+
+  $ hg mv a b
+  $ echo a > d
+  $ hg add d
+  $ hg ci -md -d '4 0'
+
+  $ hg mv dir/b e
+  $ hg ci -me -d '5 0'
+
+  $ hg log a
+  changeset:   0:8580ff50825a
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  summary:     a
+  
+
+-f, directory
+
+  $ hg log -f dir
+  abort: cannot follow nonexistent file: "dir"
+  [255]
+
+-f, but no args
+
+  $ hg log -f
+  changeset:   4:66c1345dc4f9
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:05 1970 +0000
+  summary:     e
+  
+  changeset:   3:7c6c671bb7cc
+  user:        test
+  date:        Thu Jan 01 00:00:04 1970 +0000
+  summary:     d
+  
+  changeset:   2:41dd4284081e
+  user:        test
+  date:        Thu Jan 01 00:00:03 1970 +0000
+  summary:     c
+  
+  changeset:   1:784de7cef101
+  user:        test
+  date:        Thu Jan 01 00:00:02 1970 +0000
+  summary:     b
+  
+  changeset:   0:8580ff50825a
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  summary:     a
+  
+
+one rename
+
+  $ hg log -vf a
+  changeset:   0:8580ff50825a
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  files:       a
+  description:
+  a
+  
+  
+
+many renames
+
+  $ hg log -vf e
+  changeset:   4:66c1345dc4f9
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:05 1970 +0000
+  files:       dir/b e
+  description:
+  e
+  
+  
+  changeset:   2:41dd4284081e
+  user:        test
+  date:        Thu Jan 01 00:00:03 1970 +0000
+  files:       b dir/b
+  description:
+  c
+  
+  
+  changeset:   1:784de7cef101
+  user:        test
+  date:        Thu Jan 01 00:00:02 1970 +0000
+  files:       b
+  description:
+  b
+  
+  
+  changeset:   0:8580ff50825a
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  files:       a
+  description:
+  a
+  
+  
+
+
+log -pf dir/b
+
+  $ hg log -pf dir/b
+  changeset:   2:41dd4284081e
+  user:        test
+  date:        Thu Jan 01 00:00:03 1970 +0000
+  summary:     c
+  
+  diff -r 784de7cef101 -r 41dd4284081e dir/b
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/dir/b	Thu Jan 01 00:00:03 1970 +0000
+  @@ -0,0 +1,1 @@
+  +a
+  
+  changeset:   1:784de7cef101
+  user:        test
+  date:        Thu Jan 01 00:00:02 1970 +0000
+  summary:     b
+  
+  diff -r 8580ff50825a -r 784de7cef101 b
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/b	Thu Jan 01 00:00:02 1970 +0000
+  @@ -0,0 +1,1 @@
+  +a
+  
+  changeset:   0:8580ff50825a
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  summary:     a
+  
+  diff -r 000000000000 -r 8580ff50825a a
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/a	Thu Jan 01 00:00:01 1970 +0000
+  @@ -0,0 +1,1 @@
+  +a
+  
+
+log -vf dir/b
+
+  $ hg log -vf dir/b
+  changeset:   2:41dd4284081e
+  user:        test
+  date:        Thu Jan 01 00:00:03 1970 +0000
+  files:       b dir/b
+  description:
+  c
+  
+  
+  changeset:   1:784de7cef101
+  user:        test
+  date:        Thu Jan 01 00:00:02 1970 +0000
+  files:       b
+  description:
+  b
+  
+  
+  changeset:   0:8580ff50825a
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  files:       a
+  description:
+  a
+  
+  
+
+
+log copies with --copies
+
+  $ hg log -vC --template '{rev} {file_copies}\n'
+  4 e (dir/b)
+  3 b (a)
+  2 dir/b (b)
+  1 b (a)
+  0 
+
+log copies switch without --copies, with old filecopy template
+
+  $ hg log -v --template '{rev} {file_copies_switch%filecopy}\n'
+  4 
+  3 
+  2 
+  1 
+  0 
+
+log copies switch with --copies
+
+  $ hg log -vC --template '{rev} {file_copies_switch}\n'
+  4 e (dir/b)
+  3 b (a)
+  2 dir/b (b)
+  1 b (a)
+  0 
+
+
+log copies with hardcoded style and with --style=default
+
+  $ hg log -vC -r4
+  changeset:   4:66c1345dc4f9
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:05 1970 +0000
+  files:       dir/b e
+  copies:      e (dir/b)
+  description:
+  e
+  
+  
+  $ hg log -vC -r4 --style=default
+  changeset:   4:66c1345dc4f9
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:05 1970 +0000
+  files:       dir/b e
+  copies:      e (dir/b)
+  description:
+  e
+  
+  
+
+
+log copies, non-linear manifest
+
+  $ hg up -C 3
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg mv dir/b e
+  $ echo foo > foo
+  $ hg ci -Ame2 -d '6 0'
+  adding foo
+  created new head
+  $ hg log -v --template '{rev} {file_copies}\n' -r 5
+  5 e (dir/b)
+
+
+log copies, execute bit set
+
+  $ chmod +x e
+  $ hg ci -me3 -d '7 0'
+  $ hg log -v --template '{rev} {file_copies}\n' -r 6
+  6 
+
+
+log -p d
+
+  $ hg log -pv d
+  changeset:   3:7c6c671bb7cc
+  user:        test
+  date:        Thu Jan 01 00:00:04 1970 +0000
+  files:       a b d
+  description:
+  d
+  
+  
+  diff -r 41dd4284081e -r 7c6c671bb7cc d
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/d	Thu Jan 01 00:00:04 1970 +0000
+  @@ -0,0 +1,1 @@
+  +a
+  
+
+
+log --removed file
+
+  $ hg log --removed -v a
+  changeset:   3:7c6c671bb7cc
+  user:        test
+  date:        Thu Jan 01 00:00:04 1970 +0000
+  files:       a b d
+  description:
+  d
+  
+  
+  changeset:   0:8580ff50825a
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  files:       a
+  description:
+  a
+  
+  
+
+log --removed revrange file
+
+  $ hg log --removed -v -r0:2 a
+  changeset:   0:8580ff50825a
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  files:       a
+  description:
+  a
+  
+  
+
+
+log --follow tests
+
+  $ hg init ../follow
+  $ cd ../follow
+
+  $ echo base > base
+  $ hg ci -Ambase -d '1 0'
+  adding base
+
+  $ echo r1 >> base
+  $ hg ci -Amr1 -d '1 0'
+  $ echo r2 >> base
+  $ hg ci -Amr2 -d '1 0'
+
+  $ hg up -C 1
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo b1 > b1
+  $ hg ci -Amb1 -d '1 0'
+  adding b1
+  created new head
+
+
+log -f
+
+  $ hg log -f
+  changeset:   3:e62f78d544b4
+  tag:         tip
+  parent:      1:3d5bf5654eda
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  summary:     b1
+  
+  changeset:   1:3d5bf5654eda
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  summary:     r1
+  
+  changeset:   0:67e992f2c4f3
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  summary:     base
+  
+
+
+log -f -r 1:tip
+
+  $ hg up -C 0
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo b2 > b2
+  $ hg ci -Amb2 -d '1 0'
+  adding b2
+  created new head
+  $ hg log -f -r 1:tip
+  changeset:   1:3d5bf5654eda
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  summary:     r1
+  
+  changeset:   2:60c670bf5b30
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  summary:     r2
+  
+  changeset:   3:e62f78d544b4
+  parent:      1:3d5bf5654eda
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  summary:     b1
+  
+
+
+log -r .  with two parents
+
+  $ hg up -C 3
+  2 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg merge tip
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg log -r .
+  changeset:   3:e62f78d544b4
+  parent:      1:3d5bf5654eda
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  summary:     b1
+  
+
+
+log -r .  with one parent
+
+  $ hg ci -mm12 -d '1 0'
+  $ hg log -r .
+  changeset:   5:302e9dd6890d
+  tag:         tip
+  parent:      3:e62f78d544b4
+  parent:      4:ddb82e70d1a1
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  summary:     m12
+  
+
+  $ echo postm >> b1
+  $ hg ci -Amb1.1 -d'1 0'
+
+
+log --follow-first
+
+  $ hg log --follow-first
+  changeset:   6:2404bbcab562
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  summary:     b1.1
+  
+  changeset:   5:302e9dd6890d
+  parent:      3:e62f78d544b4
+  parent:      4:ddb82e70d1a1
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  summary:     m12
+  
+  changeset:   3:e62f78d544b4
+  parent:      1:3d5bf5654eda
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  summary:     b1
+  
+  changeset:   1:3d5bf5654eda
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  summary:     r1
+  
+  changeset:   0:67e992f2c4f3
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  summary:     base
+  
+
+
+log -P 2
+
+  $ hg log -P 2
+  changeset:   6:2404bbcab562
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  summary:     b1.1
+  
+  changeset:   5:302e9dd6890d
+  parent:      3:e62f78d544b4
+  parent:      4:ddb82e70d1a1
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  summary:     m12
+  
+  changeset:   4:ddb82e70d1a1
+  parent:      0:67e992f2c4f3
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  summary:     b2
+  
+  changeset:   3:e62f78d544b4
+  parent:      1:3d5bf5654eda
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  summary:     b1
+  
+
+
+log -r tip -p --git
+
+  $ hg log -r tip -p --git
+  changeset:   6:2404bbcab562
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  summary:     b1.1
+  
+  diff --git a/b1 b/b1
+  --- a/b1
+  +++ b/b1
+  @@ -1,1 +1,2 @@
+   b1
+  +postm
+  
+
+
+log -r ""
+
+  $ hg log -r ''
+  hg: parse error: empty query
+  [255]
+
+log -r <some unknown node id>
+
+  $ hg log -r 1000000000000000000000000000000000000000
+  abort: unknown revision '1000000000000000000000000000000000000000'!
+  [255]
+
+log -k r1
+
+  $ hg log -k r1
+  changeset:   1:3d5bf5654eda
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  summary:     r1
+  
+
+
+log -d -1
+
+  $ hg log -d -1
+
+
+log -p -l2 --color=always
+
+  $ hg --config extensions.color= --config color.mode=ansi \
+  >  log -p -l2 --color=always
+  changeset:   6:2404bbcab562
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  summary:     b1.1
+  
+  diff -r 302e9dd6890d -r 2404bbcab562 b1
+  --- a/b1	Thu Jan 01 00:00:01 1970 +0000
+  +++ b/b1	Thu Jan 01 00:00:01 1970 +0000
+  @@ -1,1 +1,2 @@
+   b1
+  +postm
+  
+  changeset:   5:302e9dd6890d
+  parent:      3:e62f78d544b4
+  parent:      4:ddb82e70d1a1
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  summary:     m12
+  
+  diff -r e62f78d544b4 -r 302e9dd6890d b2
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/b2	Thu Jan 01 00:00:01 1970 +0000
+  @@ -0,0 +1,1 @@
+  +b2
+  
+
+
+log -r tip --stat
+
+  $ hg log -r tip --stat
+  changeset:   6:2404bbcab562
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  summary:     b1.1
+  
+   b1 |  1 +
+   1 files changed, 1 insertions(+), 0 deletions(-)
+  
+
+  $ cd ..
+
+  $ hg init usertest
+  $ cd usertest
+
+  $ echo a > a
+  $ hg ci -A -m "a" -u "User One <user1@example.org>"
+  adding a
+  $ echo b > b
+  $ hg ci -A -m "b" -u "User Two <user2@example.org>"
+  adding b
+
+  $ hg log -u "User One <user1@example.org>"
+  changeset:   0:29a4c94f1924
+  user:        User One <user1@example.org>
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     a
+  
+  $ hg log -u "user1" -u "user2"
+  changeset:   1:e834b5e69c0e
+  tag:         tip
+  user:        User Two <user2@example.org>
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     b
+  
+  changeset:   0:29a4c94f1924
+  user:        User One <user1@example.org>
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     a
+  
+  $ hg log -u "user3"
+
+  $ cd ..
+
+  $ hg init branches
+  $ cd branches
+
+  $ echo a > a
+  $ hg ci -A -m "commit on default"
+  adding a
+  $ hg branch test
+  marked working directory as branch test
+  $ echo b > b
+  $ hg ci -A -m "commit on test"
+  adding b
+
+  $ hg up default
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo c > c
+  $ hg ci -A -m "commit on default"
+  adding c
+  $ hg up test
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo c > c
+  $ hg ci -A -m "commit on test"
+  adding c
+
+
+log -b default
+
+  $ hg log -b default
+  changeset:   2:c3a4f03cc9a7
+  parent:      0:24427303d56f
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     commit on default
+  
+  changeset:   0:24427303d56f
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     commit on default
+  
+
+
+log -b test
+
+  $ hg log -b test
+  changeset:   3:f5d8de11c2e2
+  branch:      test
+  tag:         tip
+  parent:      1:d32277701ccb
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     commit on test
+  
+  changeset:   1:d32277701ccb
+  branch:      test
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     commit on test
+  
+
+
+log -b dummy
+
+  $ hg log -b dummy
+  abort: unknown revision 'dummy'!
+  [255]
+
+
+log -b .
+
+  $ hg log -b .
+  changeset:   3:f5d8de11c2e2
+  branch:      test
+  tag:         tip
+  parent:      1:d32277701ccb
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     commit on test
+  
+  changeset:   1:d32277701ccb
+  branch:      test
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     commit on test
+  
+
+
+log -b default -b test
+
+  $ hg log -b default -b test
+  changeset:   3:f5d8de11c2e2
+  branch:      test
+  tag:         tip
+  parent:      1:d32277701ccb
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     commit on test
+  
+  changeset:   2:c3a4f03cc9a7
+  parent:      0:24427303d56f
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     commit on default
+  
+  changeset:   1:d32277701ccb
+  branch:      test
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     commit on test
+  
+  changeset:   0:24427303d56f
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     commit on default
+  
+
+
+log -b default -b .
+
+  $ hg log -b default -b .
+  changeset:   3:f5d8de11c2e2
+  branch:      test
+  tag:         tip
+  parent:      1:d32277701ccb
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     commit on test
+  
+  changeset:   2:c3a4f03cc9a7
+  parent:      0:24427303d56f
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     commit on default
+  
+  changeset:   1:d32277701ccb
+  branch:      test
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     commit on test
+  
+  changeset:   0:24427303d56f
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     commit on default
+  
+
+
+log -b . -b test
+
+  $ hg log -b . -b test
+  changeset:   3:f5d8de11c2e2
+  branch:      test
+  tag:         tip
+  parent:      1:d32277701ccb
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     commit on test
+  
+  changeset:   1:d32277701ccb
+  branch:      test
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     commit on test
+  
+
+
+log -b 2
+
+  $ hg log -b 2
+  changeset:   2:c3a4f03cc9a7
+  parent:      0:24427303d56f
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     commit on default
+  
+  changeset:   0:24427303d56f
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     commit on default
+  
+
+
+log -p --cwd dir (in subdir)
+
+  $ mkdir dir
+  $ hg log -p --cwd dir
+  changeset:   3:f5d8de11c2e2
+  branch:      test
+  tag:         tip
+  parent:      1:d32277701ccb
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     commit on test
+  
+  diff -r d32277701ccb -r f5d8de11c2e2 c
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/c	Thu Jan 01 00:00:00 1970 +0000
+  @@ -0,0 +1,1 @@
+  +c
+  
+  changeset:   2:c3a4f03cc9a7
+  parent:      0:24427303d56f
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     commit on default
+  
+  diff -r 24427303d56f -r c3a4f03cc9a7 c
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/c	Thu Jan 01 00:00:00 1970 +0000
+  @@ -0,0 +1,1 @@
+  +c
+  
+  changeset:   1:d32277701ccb
+  branch:      test
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     commit on test
+  
+  diff -r 24427303d56f -r d32277701ccb b
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/b	Thu Jan 01 00:00:00 1970 +0000
+  @@ -0,0 +1,1 @@
+  +b
+  
+  changeset:   0:24427303d56f
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     commit on default
+  
+  diff -r 000000000000 -r 24427303d56f a
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/a	Thu Jan 01 00:00:00 1970 +0000
+  @@ -0,0 +1,1 @@
+  +a
+  
+
+
+log -p -R repo
+
+  $ cd dir
+  $ hg log -p -R .. ../a
+  changeset:   0:24427303d56f
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     commit on default
+  
+  diff -r 000000000000 -r 24427303d56f a
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/a	Thu Jan 01 00:00:00 1970 +0000
+  @@ -0,0 +1,1 @@
+  +a
+  
+
+
+  $ cd ..
+  $ hg init follow2
+  $ cd follow2
+
+
+# Build the following history:
+# tip - o - x - o - x - x
+#    \                 /
+#     o - o - o - x
+#      \     /
+#         o
+#
+# Where "o" is a revision containing "foo" and
+# "x" is a revision without "foo"
+
+  $ touch init
+  $ hg ci -A -m "init, unrelated"
+  adding init
+  $ echo 'foo' > init
+  $ hg ci -m "change, unrelated"
+  $ echo 'foo' > foo
+  $ hg ci -A -m "add unrelated old foo"
+  adding foo
+  $ hg rm foo
+  $ hg ci -m "delete foo, unrelated"
+  $ echo 'related' > foo
+  $ hg ci -A -m "add foo, related"
+  adding foo
+
+  $ hg up 0
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ touch branch
+  $ hg ci -A -m "first branch, unrelated"
+  adding branch
+  created new head
+  $ touch foo
+  $ hg ci -A -m "create foo, related"
+  adding foo
+  $ echo 'change' > foo
+  $ hg ci -m "change foo, related"
+
+  $ hg up 6
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo 'change foo in branch' > foo
+  $ hg ci -m "change foo in branch, related"
+  created new head
+  $ hg merge 7
+  merging foo
+  warning: conflicts during merge.
+  merging foo failed!
+  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
+  [1]
+  $ echo 'merge 1' > foo
+  $ hg resolve -m foo
+  $ hg ci -m "First merge, related"
+
+  $ hg merge 4
+  merging foo
+  warning: conflicts during merge.
+  merging foo failed!
+  1 files updated, 0 files merged, 0 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
+  [1]
+  $ echo 'merge 2' > foo
+  $ hg resolve -m foo
+  $ hg ci -m "Last merge, related"
+
+  $ hg --config "extensions.graphlog=" glog
+  @    changeset:   10:4dae8563d2c5
+  |\   tag:         tip
+  | |  parent:      9:7b35701b003e
+  | |  parent:      4:88176d361b69
+  | |  user:        test
+  | |  date:        Thu Jan 01 00:00:00 1970 +0000
+  | |  summary:     Last merge, related
+  | |
+  | o    changeset:   9:7b35701b003e
+  | |\   parent:      8:e5416ad8a855
+  | | |  parent:      7:87fe3144dcfa
+  | | |  user:        test
+  | | |  date:        Thu Jan 01 00:00:00 1970 +0000
+  | | |  summary:     First merge, related
+  | | |
+  | | o  changeset:   8:e5416ad8a855
+  | | |  parent:      6:dc6c325fe5ee
+  | | |  user:        test
+  | | |  date:        Thu Jan 01 00:00:00 1970 +0000
+  | | |  summary:     change foo in branch, related
+  | | |
+  | o |  changeset:   7:87fe3144dcfa
+  | |/   user:        test
+  | |    date:        Thu Jan 01 00:00:00 1970 +0000
+  | |    summary:     change foo, related
+  | |
+  | o  changeset:   6:dc6c325fe5ee
+  | |  user:        test
+  | |  date:        Thu Jan 01 00:00:00 1970 +0000
+  | |  summary:     create foo, related
+  | |
+  | o  changeset:   5:73db34516eb9
+  | |  parent:      0:e87515fd044a
+  | |  user:        test
+  | |  date:        Thu Jan 01 00:00:00 1970 +0000
+  | |  summary:     first branch, unrelated
+  | |
+  o |  changeset:   4:88176d361b69
+  | |  user:        test
+  | |  date:        Thu Jan 01 00:00:00 1970 +0000
+  | |  summary:     add foo, related
+  | |
+  o |  changeset:   3:dd78ae4afb56
+  | |  user:        test
+  | |  date:        Thu Jan 01 00:00:00 1970 +0000
+  | |  summary:     delete foo, unrelated
+  | |
+  o |  changeset:   2:c4c64aedf0f7
+  | |  user:        test
+  | |  date:        Thu Jan 01 00:00:00 1970 +0000
+  | |  summary:     add unrelated old foo
+  | |
+  o |  changeset:   1:e5faa7440653
+  |/   user:        test
+  |    date:        Thu Jan 01 00:00:00 1970 +0000
+  |    summary:     change, unrelated
+  |
+  o  changeset:   0:e87515fd044a
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     init, unrelated
+  
+
+  $ hg --traceback log -f foo
+  changeset:   10:4dae8563d2c5
+  tag:         tip
+  parent:      9:7b35701b003e
+  parent:      4:88176d361b69
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     Last merge, related
+  
+  changeset:   9:7b35701b003e
+  parent:      8:e5416ad8a855
+  parent:      7:87fe3144dcfa
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     First merge, related
+  
+  changeset:   8:e5416ad8a855
+  parent:      6:dc6c325fe5ee
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     change foo in branch, related
+  
+  changeset:   7:87fe3144dcfa
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     change foo, related
+  
+  changeset:   6:dc6c325fe5ee
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     create foo, related
+  
+  changeset:   4:88176d361b69
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add foo, related
+  
--- a/tests/test-manifest	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-#!/bin/sh
-
-# Source bundle was generated with the following script.
-#
-# hg init
-# echo a > a
-# ln -s a l
-# hg ci -Ama -d'0 0'
-# mkdir b
-# echo a > b/a
-# chmod +x b/a
-# hg ci -Amb -d'1 0'
-
-hg init
-hg -q pull "$TESTDIR/test-manifest.hg"
-
-echo % should be empty
-hg manifest
-
-hg co
-hg manifest
-hg manifest -v
-hg manifest --debug
-hg manifest -r 0
-hg manifest -r 1
-hg manifest -r tip
-
-echo % should fail
-hg manifest -r 2
-hg manifest -r tip tip
-
-hg manifest tip
--- a/tests/test-manifest-merging	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-#!/bin/sh
-
-echo % init foo-base
-hg init foo-base
-
-echo % create alpha in first repo
-cd foo-base
-echo 'alpha' > alpha
-hg ci -A -m 'add alpha' -d '1 0'
-cd ..
-
-echo % clone foo-base to foo-work
-hg clone foo-base foo-work
-
-echo % create beta in second repo
-cd foo-work
-echo 'beta' > beta
-hg ci -A -m 'add beta' -d '2 0'
-cd ..
-
-echo % create gamma in first repo
-cd foo-base
-echo 'gamma' > gamma
-hg ci -A -m 'add gamma' -d '3 0'
-cd ..
-
-echo % pull into work and merge
-cd foo-work
-hg pull -q
-hg merge
-
-echo % revert to changeset 1 to simulate a failed merge
-rm alpha beta gamma
-hg up -C 1
--- a/tests/test-manifest-merging.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-% init foo-base
-% create alpha in first repo
-adding alpha
-% clone foo-base to foo-work
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% create beta in second repo
-adding beta
-% create gamma in first repo
-adding gamma
-% pull into work and merge
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-% revert to changeset 1 to simulate a failed merge
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-manifest-merging.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,36 @@
+  $ hg init base
+
+  $ cd base
+  $ echo 'alpha' > alpha
+  $ hg ci -A -m 'add alpha'
+  adding alpha
+  $ cd ..
+
+  $ hg clone base work
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ cd work
+  $ echo 'beta' > beta
+  $ hg ci -A -m 'add beta'
+  adding beta
+  $ cd ..
+
+  $ cd base
+  $ echo 'gamma' > gamma
+  $ hg ci -A -m 'add gamma'
+  adding gamma
+  $ cd ..
+
+  $ cd work
+  $ hg pull -q
+  $ hg merge
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+Update --clean to revision 1 to simulate a failed merge:
+
+  $ rm alpha beta gamma
+  $ hg update --clean 1
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
--- a/tests/test-manifest.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-% should be empty
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-a
-b/a
-l
-644   a
-755 * b/a
-644 @ l
-b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 644   a
-b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 755 * b/a
-047b75c6d7a3ef6a2243bd0e99f94f6ea6683597 644 @ l
-a
-l
-a
-b/a
-l
-a
-b/a
-l
-% should fail
-abort: unknown revision '2'!
-abort: please specify just one revision
-a
-b/a
-l
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-manifest.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,65 @@
+Source bundle was generated with the following script:
+
+# hg init
+# echo a > a
+# ln -s a l
+# hg ci -Ama -d'0 0'
+# mkdir b
+# echo a > b/a
+# chmod +x b/a
+# hg ci -Amb -d'1 0'
+
+  $ hg init
+  $ hg -q pull "$TESTDIR/test-manifest.hg"
+
+The next call is expected to return nothing:
+
+  $ hg manifest
+
+  $ hg co
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ hg manifest
+  a
+  b/a
+  l
+
+  $ hg manifest -v
+  644   a
+  755 * b/a
+  644 @ l
+
+  $ hg manifest --debug
+  b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 644   a
+  b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 755 * b/a
+  047b75c6d7a3ef6a2243bd0e99f94f6ea6683597 644 @ l
+
+  $ hg manifest -r 0
+  a
+  l
+
+  $ hg manifest -r 1
+  a
+  b/a
+  l
+
+  $ hg manifest -r tip
+  a
+  b/a
+  l
+
+  $ hg manifest tip
+  a
+  b/a
+  l
+
+
+The next two calls are expected to abort:
+
+  $ hg manifest -r 2
+  abort: unknown revision '2'!
+  [255]
+
+  $ hg manifest -r tip tip
+  abort: please specify just one revision
+  [255]
--- a/tests/test-merge-closedheads	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-#!/bin/sh
-
-hgcommit() {
-    hg commit -u user -d '0 0' "$@"
-}
-
-hg init clhead
-cd clhead
-
-
-touch foo && hg add && hgcommit -m 'foo'
-touch bar && hg add && hgcommit -m 'bar'
-touch baz && hg add && hgcommit -m 'baz'
-
-echo "flub" > foo
-hgcommit -m "flub"
-echo "nub" > foo
-hgcommit -m "nub"
-
-hg up -C 2
-
-echo "c1" > c1
-hg add c1
-hgcommit -m "c1"
-echo "c2" > c1
-hgcommit -m "c2"
-
-hg up -C 2
-
-echo "d1" > d1
-hg add d1
-hgcommit -m "d1"
-echo "d2" > d1
-hgcommit -m "d2"
-hg tag -l good
-
-echo '% fail with three heads'
-hg up -C good
-hg merge
-
-echo '% close one of the heads'
-hg up -C 6
-hgcommit -m 'close this head' --close-branch
-
-echo '% succeed with two open heads'
-hg up -C good
-hg up -C good
-hg merge
-hgcommit -m 'merged heads'
-
-echo '% hg update -C 8'
-hg update -C 8
-
-echo '% hg branch some-branch'
-hg branch some-branch
-echo '% hg commit'
-hgcommit -m 'started some-branch'
-echo '% hg commit --close-branch'
-hgcommit --close-branch -m 'closed some-branch'
-
-echo '% hg update default'
-hg update default
-echo '% hg merge some-branch'
-hg merge some-branch
-echo '% hg commit (no reopening of some-branch)'
-hgcommit -m 'merge with closed branch'
-
-cat >> $HGRCPATH <<EOF
-[extensions]
-graphlog =
-EOF
-
-#hg glog
--- a/tests/test-merge-closedheads.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-adding foo
-adding bar
-adding baz
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-created new head
-% fail with three heads
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-abort: branch 'default' has 3 heads - please merge with an explicit rev
-(run 'hg heads .' to see heads)
-% close one of the heads
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-% succeed with two open heads
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-% hg update -C 8
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% hg branch some-branch
-marked working directory as branch some-branch
-% hg commit
-% hg commit --close-branch
-% hg update default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% hg merge some-branch
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-% hg commit (no reopening of some-branch)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-merge-closedheads.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,85 @@
+  $ hgcommit() {
+  >    hg commit -u user "$@"
+  > }
+
+  $ hg init clhead
+  $ cd clhead
+
+  $ touch foo && hg add && hgcommit -m 'foo'
+  adding foo
+  $ touch bar && hg add && hgcommit -m 'bar'
+  adding bar
+  $ touch baz && hg add && hgcommit -m 'baz'
+  adding baz
+
+  $ echo "flub" > foo
+  $ hgcommit -m "flub"
+  $ echo "nub" > foo
+  $ hgcommit -m "nub"
+
+  $ hg up -C 2
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ echo "c1" > c1
+  $ hg add c1
+  $ hgcommit -m "c1"
+  created new head
+  $ echo "c2" > c1
+  $ hgcommit -m "c2"
+
+  $ hg up -C 2
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+  $ echo "d1" > d1
+  $ hg add d1
+  $ hgcommit -m "d1"
+  created new head
+  $ echo "d2" > d1
+  $ hgcommit -m "d2"
+  $ hg tag -l good
+
+fail with three heads
+  $ hg up -C good
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg merge
+  abort: branch 'default' has 3 heads - please merge with an explicit rev
+  (run 'hg heads .' to see heads)
+  [255]
+
+close one of the heads
+  $ hg up -C 6
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hgcommit -m 'close this head' --close-branch
+
+succeed with two open heads
+  $ hg up -C good
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg up -C good
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg merge
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hgcommit -m 'merged heads'
+
+hg update -C 8
+  $ hg update -C 8
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+hg branch some-branch
+  $ hg branch some-branch
+  marked working directory as branch some-branch
+hg commit
+  $ hgcommit -m 'started some-branch'
+hg commit --close-branch
+  $ hgcommit --close-branch -m 'closed some-branch'
+
+hg update default
+  $ hg update default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+hg merge some-branch
+  $ hg merge some-branch
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+hg commit (no reopening of some-branch)
+  $ hgcommit -m 'merge with closed branch'
+
--- a/tests/test-merge-commit	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-#!/bin/sh
-# check that renames are correctly saved by a commit after a merge
-
-# test with the merge on 3 having the rename on the local parent
-hg init a
-cd a
-
-echo line1 > foo
-hg add foo
-hg ci -m '0: add foo'
-
-echo line2 >> foo
-hg ci -m '1: change foo'
-
-hg up -C 0
-hg mv foo bar
-rm bar
-echo line0 > bar
-echo line1 >> bar
-hg ci -m '2: mv foo bar; change bar'
-
-hg merge 1
-echo '% contents of bar should be line0 line1 line2'
-cat bar
-hg ci -m '3: merge with local rename'
-hg debugindex .hg/store/data/bar.i
-hg debugrename bar
-hg debugindex .hg/store/data/foo.i
-
-# revert the content change from rev 2
-hg up -C 2
-rm bar
-echo line1 > bar
-hg ci -m '4: revert content change from rev 2'
-
-hg log --template '{rev}:{node|short} {parents}\n'
-echo '% this should use bar@rev2 as the ancestor'
-hg --debug merge 3
-echo '% contents of bar should be line1 line2'
-cat bar
-hg ci -m '5: merge'
-hg debugindex .hg/store/data/bar.i
-
-
-# same thing, but with the merge on 3 having the rename on the remote parent
-echo
-echo
-cd ..
-hg clone -U -r 1 -r 2 a b
-cd b
-
-hg up -C 1
-hg merge 2
-echo '% contents of bar should be line0 line1 line2'
-cat bar
-hg ci -m '3: merge with remote rename'
-hg debugindex .hg/store/data/bar.i
-hg debugrename bar
-hg debugindex .hg/store/data/foo.i
-
-# revert the content change from rev 2
-hg up -C 2
-rm bar
-echo line1 > bar
-hg ci -m '4: revert content change from rev 2'
-
-hg log --template '{rev}:{node|short} {parents}\n'
-echo '% this should use bar@rev2 as the ancestor'
-hg --debug merge 3
-echo '% contents of bar should be line1 line2'
-cat bar
-hg ci -m '5: merge'
-hg debugindex .hg/store/data/bar.i
-
--- a/tests/test-merge-commit.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +0,0 @@
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-merging bar and foo to bar
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-% contents of bar should be line0 line1 line2
-line0
-line1
-line2
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0      77      0       2 d35118874825 000000000000 000000000000
-     1        77      76      0       3 5345f5ab8abd 000000000000 d35118874825
-bar renamed from foo:9e25c27b87571a1edee5ae4dddee5687746cc8e2
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0       7      0       0 690b295714ae 000000000000 000000000000
-     1         7      13      1       1 9e25c27b8757 690b295714ae 000000000000
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-4:2263c1be0967 2:0f2ff26688b9 
-3:0555950ead28 2:0f2ff26688b9 1:5cd961e4045d 
-2:0f2ff26688b9 0:2665aaee66e9 
-1:5cd961e4045d 
-0:2665aaee66e9 
-% this should use bar@rev2 as the ancestor
-  searching for copies back to rev 1
-resolving manifests
- overwrite None partial False
- ancestor 0f2ff26688b9 local 2263c1be0967+ remote 0555950ead28
- bar: versions differ -> m
-preserving bar for resolve of bar
-updating: bar 1/1 files (100.00%)
-picked tool 'internal:merge' for bar (binary False symlink False)
-merging bar
-my bar@2263c1be0967+ other bar@0555950ead28 ancestor bar@0f2ff26688b9
- premerge successful
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-% contents of bar should be line1 line2
-line1
-line2
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0      77      0       2 d35118874825 000000000000 000000000000
-     1        77      76      0       3 5345f5ab8abd 000000000000 d35118874825
-     2       153       7      2       4 ff4b45017382 d35118874825 000000000000
-     3       160      13      3       5 3701b4893544 ff4b45017382 5345f5ab8abd
-
-
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 3 changesets with 3 changes to 2 files (+1 heads)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-merging foo and bar to bar
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-% contents of bar should be line0 line1 line2
-line0
-line1
-line2
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0      77      0       2 d35118874825 000000000000 000000000000
-     1        77      76      0       3 5345f5ab8abd 000000000000 d35118874825
-bar renamed from foo:9e25c27b87571a1edee5ae4dddee5687746cc8e2
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0       7      0       0 690b295714ae 000000000000 000000000000
-     1         7      13      1       1 9e25c27b8757 690b295714ae 000000000000
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-4:2263c1be0967 2:0f2ff26688b9 
-3:3ffa6b9e35f0 1:5cd961e4045d 2:0f2ff26688b9 
-2:0f2ff26688b9 0:2665aaee66e9 
-1:5cd961e4045d 
-0:2665aaee66e9 
-% this should use bar@rev2 as the ancestor
-  searching for copies back to rev 1
-resolving manifests
- overwrite None partial False
- ancestor 0f2ff26688b9 local 2263c1be0967+ remote 3ffa6b9e35f0
- bar: versions differ -> m
-preserving bar for resolve of bar
-updating: bar 1/1 files (100.00%)
-picked tool 'internal:merge' for bar (binary False symlink False)
-merging bar
-my bar@2263c1be0967+ other bar@3ffa6b9e35f0 ancestor bar@0f2ff26688b9
- premerge successful
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-% contents of bar should be line1 line2
-line1
-line2
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0      77      0       2 d35118874825 000000000000 000000000000
-     1        77      76      0       3 5345f5ab8abd 000000000000 d35118874825
-     2       153       7      2       4 ff4b45017382 d35118874825 000000000000
-     3       160      13      3       5 3701b4893544 ff4b45017382 5345f5ab8abd
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-merge-commit.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,184 @@
+Check that renames are correctly saved by a commit after a merge
+
+Test with the merge on 3 having the rename on the local parent
+
+  $ hg init a
+  $ cd a
+
+  $ echo line1 > foo
+  $ hg add foo
+  $ hg ci -m '0: add foo'
+
+  $ echo line2 >> foo
+  $ hg ci -m '1: change foo'
+
+  $ hg up -C 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ hg mv foo bar
+  $ rm bar
+  $ echo line0 > bar
+  $ echo line1 >> bar
+  $ hg ci -m '2: mv foo bar; change bar'
+  created new head
+
+  $ hg merge 1
+  merging bar and foo to bar
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+  $ cat bar
+  line0
+  line1
+  line2
+
+  $ hg ci -m '3: merge with local rename'
+
+  $ hg debugindex .hg/store/data/bar.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0      77      0       2 d35118874825 000000000000 000000000000
+       1        77      76      0       3 5345f5ab8abd 000000000000 d35118874825
+
+  $ hg debugrename bar
+  bar renamed from foo:9e25c27b87571a1edee5ae4dddee5687746cc8e2
+
+  $ hg debugindex .hg/store/data/foo.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0       7      0       0 690b295714ae 000000000000 000000000000
+       1         7      13      1       1 9e25c27b8757 690b295714ae 000000000000
+
+
+Revert the content change from rev 2:
+
+  $ hg up -C 2
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm bar
+  $ echo line1 > bar
+  $ hg ci -m '4: revert content change from rev 2'
+  created new head
+
+  $ hg log --template '{rev}:{node|short} {parents}\n'
+  4:2263c1be0967 2:0f2ff26688b9 
+  3:0555950ead28 2:0f2ff26688b9 1:5cd961e4045d 
+  2:0f2ff26688b9 0:2665aaee66e9 
+  1:5cd961e4045d 
+  0:2665aaee66e9 
+
+This should use bar@rev2 as the ancestor:
+
+  $ hg --debug merge 3
+    searching for copies back to rev 1
+  resolving manifests
+   overwrite None partial False
+   ancestor 0f2ff26688b9 local 2263c1be0967+ remote 0555950ead28
+   bar: versions differ -> m
+  preserving bar for resolve of bar
+  updating: bar 1/1 files (100.00%)
+  picked tool 'internal:merge' for bar (binary False symlink False)
+  merging bar
+  my bar@2263c1be0967+ other bar@0555950ead28 ancestor bar@0f2ff26688b9
+   premerge successful
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+  $ cat bar
+  line1
+  line2
+
+  $ hg ci -m '5: merge'
+
+  $ hg debugindex .hg/store/data/bar.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0      77      0       2 d35118874825 000000000000 000000000000
+       1        77      76      0       3 5345f5ab8abd 000000000000 d35118874825
+       2       153       7      2       4 ff4b45017382 d35118874825 000000000000
+       3       160      13      3       5 3701b4893544 ff4b45017382 5345f5ab8abd
+
+
+Same thing, but with the merge on 3 having the rename
+on the remote parent:
+
+  $ cd ..
+  $ hg clone -U -r 1 -r 2 a b
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 3 changesets with 3 changes to 2 files (+1 heads)
+  $ cd b
+
+  $ hg up -C 1
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ hg merge 2
+  merging foo and bar to bar
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+  $ cat bar
+  line0
+  line1
+  line2
+
+  $ hg ci -m '3: merge with remote rename'
+
+  $ hg debugindex .hg/store/data/bar.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0      77      0       2 d35118874825 000000000000 000000000000
+       1        77      76      0       3 5345f5ab8abd 000000000000 d35118874825
+
+  $ hg debugrename bar
+  bar renamed from foo:9e25c27b87571a1edee5ae4dddee5687746cc8e2
+
+  $ hg debugindex .hg/store/data/foo.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0       7      0       0 690b295714ae 000000000000 000000000000
+       1         7      13      1       1 9e25c27b8757 690b295714ae 000000000000
+
+
+Revert the content change from rev 2:
+
+  $ hg up -C 2
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm bar
+  $ echo line1 > bar
+  $ hg ci -m '4: revert content change from rev 2'
+  created new head
+
+  $ hg log --template '{rev}:{node|short} {parents}\n'
+  4:2263c1be0967 2:0f2ff26688b9 
+  3:3ffa6b9e35f0 1:5cd961e4045d 2:0f2ff26688b9 
+  2:0f2ff26688b9 0:2665aaee66e9 
+  1:5cd961e4045d 
+  0:2665aaee66e9 
+
+This should use bar@rev2 as the ancestor:
+
+  $ hg --debug merge 3
+    searching for copies back to rev 1
+  resolving manifests
+   overwrite None partial False
+   ancestor 0f2ff26688b9 local 2263c1be0967+ remote 3ffa6b9e35f0
+   bar: versions differ -> m
+  preserving bar for resolve of bar
+  updating: bar 1/1 files (100.00%)
+  picked tool 'internal:merge' for bar (binary False symlink False)
+  merging bar
+  my bar@2263c1be0967+ other bar@3ffa6b9e35f0 ancestor bar@0f2ff26688b9
+   premerge successful
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+  $ cat bar
+  line1
+  line2
+
+  $ hg ci -m '5: merge'
+
+  $ hg debugindex .hg/store/data/bar.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0      77      0       2 d35118874825 000000000000 000000000000
+       1        77      76      0       3 5345f5ab8abd 000000000000 d35118874825
+       2       153       7      2       4 ff4b45017382 d35118874825 000000000000
+       3       160      13      3       5 3701b4893544 ff4b45017382 5345f5ab8abd
+
--- a/tests/test-merge-default	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-#!/bin/sh
-
-hg init
-echo a > a
-hg commit -A -ma
-
-echo b >> a
-hg commit -mb
-
-echo c >> a
-hg commit -mc
-
-hg up 1
-echo d >> a
-hg commit -md
-
-hg up 1
-echo e >> a
-hg commit -me
-
-hg up 1
-echo % should fail because not at a head
-hg merge
-
-hg up
-echo % should fail because \> 2 heads
-HGMERGE=internal:other; export HGMERGE
-hg merge
-
-echo % should succeed
-hg merge 2
-hg commit -mm1
-
-echo % should succeed - 2 heads
-hg merge -P
-hg merge
-hg commit -mm2
-
-echo % should fail because at tip
-hg merge
-
-hg up 0
-echo % should fail because 1 head
-hg merge
-
-hg up 3
-echo f >> a
-hg branch foobranch
-hg commit -mf
-echo % should fail because merge with other branch
-hg merge
-
-# Test for issue2043: ensure that 'merge -P' shows ancestors of 6 that
-# are not ancestors of 7, regardless of where their least common
-# ancestor is.
-echo % merge preview not affected by common ancestor
-hg up -q 7
-hg merge -q -P 6         # expect: 2, 4, 5, 6
-
-true
--- a/tests/test-merge-default.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-adding a
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% should fail because not at a head
-abort: branch 'default' has 3 heads - please merge with an explicit rev
-(run 'hg heads .' to see heads)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% should fail because > 2 heads
-abort: branch 'default' has 3 heads - please merge with an explicit rev
-(run 'hg heads .' to see heads)
-% should succeed
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-% should succeed - 2 heads
-changeset:   3:ea9ff125ff88
-parent:      1:1846eede8b68
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     d
-
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-% should fail because at tip
-abort: there is nothing to merge
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% should fail because 1 head
-abort: there is nothing to merge - use "hg update" instead
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-marked working directory as branch foobranch
-% should fail because merge with other branch
-abort: branch 'foobranch' has one head - please merge with an explicit rev
-(run 'hg heads' to see all heads)
-% merge preview not affected by common ancestor
-2:2d95304fed5d
-4:f25cbe84d8b3
-5:a431fabd6039
-6:e88e33f3bf62
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-merge-default.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,109 @@
+  $ hg init
+  $ echo a > a
+  $ hg commit -A -ma
+  adding a
+
+  $ echo b >> a
+  $ hg commit -mb
+
+  $ echo c >> a
+  $ hg commit -mc
+
+  $ hg up 1
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo d >> a
+  $ hg commit -md
+  created new head
+
+  $ hg up 1
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo e >> a
+  $ hg commit -me
+  created new head
+
+  $ hg up 1
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+Should fail because not at a head:
+
+  $ hg merge
+  abort: branch 'default' has 3 heads - please merge with an explicit rev
+  (run 'hg heads .' to see heads)
+  [255]
+
+  $ hg up
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+Should fail because > 2 heads:
+
+  $ HGMERGE=internal:other; export HGMERGE
+  $ hg merge
+  abort: branch 'default' has 3 heads - please merge with an explicit rev
+  (run 'hg heads .' to see heads)
+  [255]
+
+Should succeed:
+
+  $ hg merge 2
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg commit -mm1
+
+Should succeed - 2 heads:
+
+  $ hg merge -P
+  changeset:   3:ea9ff125ff88
+  parent:      1:1846eede8b68
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     d
+  
+  $ hg merge
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg commit -mm2
+
+Should fail because at tip:
+
+  $ hg merge
+  abort: there is nothing to merge
+  [255]
+
+  $ hg up 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+Should fail because there is only one head:
+
+  $ hg merge
+  abort: there is nothing to merge - use "hg update" instead
+  [255]
+
+  $ hg up 3
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ echo f >> a
+  $ hg branch foobranch
+  marked working directory as branch foobranch
+  $ hg commit -mf
+
+Should fail because merge with other branch:
+
+  $ hg merge
+  abort: branch 'foobranch' has one head - please merge with an explicit rev
+  (run 'hg heads' to see all heads)
+  [255]
+
+
+Test for issue2043: ensure that 'merge -P' shows ancestors of 6 that
+are not ancestors of 7, regardless of where their least common
+ancestor is.
+
+Merge preview not affected by common ancestor:
+
+  $ hg up -q 7
+  $ hg merge -q -P 6
+  2:2d95304fed5d
+  4:f25cbe84d8b3
+  5:a431fabd6039
+  6:e88e33f3bf62
+
--- a/tests/test-merge-force	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-#!/bin/sh
-
-hg init repo
-cd repo
-
-echo a > a
-hg ci -qAm 'add a'
-
-echo b > b
-hg ci -qAm 'add b'
-
-hg up -qC 0
-hg rm a
-hg ci -m 'rm a'
-
-hg up -qC 1
-rm a
-
-echo '% local deleted a file, remote removed'
-hg merge # should fail, since there are deleted files
-hg -v merge --force
-echo % should show a as removed
-hg st
-
-hg ci -m merge
-echo % manifest. should not have a:
-hg manifest
--- a/tests/test-merge-force.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-created new head
-% local deleted a file, remote removed
-abort: outstanding uncommitted changes (use 'hg status' to list changes)
-resolving manifests
-removing a
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-% should show a as removed
-R a
-% manifest. should not have a:
-b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-merge-force.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,44 @@
+  $ hg init
+
+  $ echo a > a
+  $ hg ci -qAm 'add a'
+
+  $ echo b > b
+  $ hg ci -qAm 'add b'
+
+  $ hg up -qC 0
+  $ hg rm a
+  $ hg ci -m 'rm a'
+  created new head
+
+  $ hg up -qC 1
+  $ rm a
+
+Local deleted a file, remote removed
+
+Should fail, since there are deleted files:
+
+  $ hg merge
+  abort: outstanding uncommitted changes (use 'hg status' to list changes)
+  [255]
+
+Should succeed with --force:
+
+  $ hg -v merge --force
+  resolving manifests
+  removing a
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+Should show 'a' as removed:
+
+  $ hg status
+  R a
+
+  $ hg ci -m merge
+
+Should not show 'a':
+
+  $ hg manifest
+  b
+
--- a/tests/test-merge-internal-tools-pattern	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-#!/bin/sh
-
-# make sure that the internal merge tools (internal:fail, internal:local, and
-# internal:other) are used when matched by a merge-pattern in hgrc
-
-unset HGMERGE # make sure HGMERGE doesn't interfere with the test
-
-hg init
-
-echo "# initial file contents"
-echo "line 1" > f
-echo "line 2" >> f
-echo "line 3" >> f
-hg commit -Am "revision 0" -d "1000000 0"
-cat f
-echo "# branch 1: editing line 1"
-sed 's/line 1/first line/' f > f.new
-mv f.new f
-hg commit -Am "edited first line" -d "1000000 0"
-
-echo "# branch 2: editing line 3"
-hg update 0
-sed 's/line 3/third line/' f > f.new
-mv f.new f
-hg commit -Am "edited third line" -d "1000000 0"
-
-echo "# merge using internal:fail tool"
-echo "[merge-patterns]" > .hg/hgrc
-echo "* = internal:fail" >> .hg/hgrc
-hg merge
-cat f
-hg stat
-
-echo "# merge using internal:local tool"
-hg update -C 2
-sed 's/internal:fail/internal:local/' .hg/hgrc > .hg/hgrc.new
-mv .hg/hgrc.new .hg/hgrc
-hg merge
-cat f
-hg stat
-
-echo "# merge using internal:other tool"
-hg update -C 2
-sed 's/internal:local/internal:other/' .hg/hgrc > .hg/hgrc.new
-mv .hg/hgrc.new .hg/hgrc
-hg merge
-cat f
-hg stat
-
-echo "# merge using default tool"
-hg update -C 2
-rm .hg/hgrc
-hg merge
-cat f
-hg stat
-
--- a/tests/test-merge-internal-tools-pattern.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-# initial file contents
-adding f
-line 1
-line 2
-line 3
-# branch 1: editing line 1
-# branch 2: editing line 3
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-# merge using internal:fail tool
-0 files updated, 0 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
-line 1
-line 2
-third line
-M f
-# merge using internal:local tool
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-line 1
-line 2
-third line
-M f
-# merge using internal:other tool
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-first line
-line 2
-line 3
-M f
-# merge using default tool
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-merging f
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-first line
-line 2
-third line
-M f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-merge-internal-tools-pattern.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,112 @@
+Make sure that the internal merge tools (internal:fail, internal:local, and
+internal:other) are used when matched by a merge-pattern in hgrc
+
+Make sure HGMERGE doesn't interfere with the test:
+
+  $ unset HGMERGE
+
+  $ hg init
+
+Initial file contents:
+
+  $ echo "line 1" > f
+  $ echo "line 2" >> f
+  $ echo "line 3" >> f
+  $ hg ci -Am "revision 0"
+  adding f
+
+  $ cat f
+  line 1
+  line 2
+  line 3
+
+Branch 1: editing line 1:
+
+  $ sed 's/line 1/first line/' f > f.new
+  $ mv f.new f
+  $ hg ci -Am "edited first line"
+
+Branch 2: editing line 3:
+
+  $ hg update 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ sed 's/line 3/third line/' f > f.new
+  $ mv f.new f
+  $ hg ci -Am "edited third line"
+  created new head
+
+Merge using internal:fail tool:
+
+  $ echo "[merge-patterns]" > .hg/hgrc
+  $ echo "* = internal:fail" >> .hg/hgrc
+
+  $ hg merge
+  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
+  [1]
+
+  $ cat f
+  line 1
+  line 2
+  third line
+
+  $ hg stat
+  M f
+
+Merge using internal:local tool:
+
+  $ hg update -C 2
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ sed 's/internal:fail/internal:local/' .hg/hgrc > .hg/hgrc.new
+  $ mv .hg/hgrc.new .hg/hgrc
+
+  $ hg merge
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+  $ cat f
+  line 1
+  line 2
+  third line
+
+  $ hg stat
+  M f
+
+Merge using internal:other tool:
+
+  $ hg update -C 2
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ sed 's/internal:local/internal:other/' .hg/hgrc > .hg/hgrc.new
+  $ mv .hg/hgrc.new .hg/hgrc
+
+  $ hg merge
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+  $ cat f
+  first line
+  line 2
+  line 3
+
+  $ hg stat
+  M f
+
+Merge using default tool:
+
+  $ hg update -C 2
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm .hg/hgrc
+
+  $ hg merge
+  merging f
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+  $ cat f
+  first line
+  line 2
+  third line
+
+  $ hg stat
+  M f
+
--- a/tests/test-merge-local	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-#!/bin/sh
-
-hg init
-
-echo "# revision 0"
-echo "unchanged" > unchanged
-echo "remove me" > remove
-echo "copy me" > copy
-echo "move me" > move
-for i in 1 2 3 4 5 6 7 8 9; do
-    echo "merge ok $i" >> zzz1_merge_ok
-done
-echo "merge bad" > zzz2_merge_bad
-hg ci -Am "revision 0" -d "1000000 0"
-
-echo "# revision 1"
-hg rm remove
-hg mv move moved
-hg cp copy copied
-echo "added" > added
-hg add added
-echo "new first line" > zzz1_merge_ok
-hg cat zzz1_merge_ok >> zzz1_merge_ok
-echo "new last line" >> zzz2_merge_bad
-hg ci -m "revision 1" -d "1000000 0"
-
-echo "# local changes to revision 0"
-hg co 0
-echo "new last line" >> zzz1_merge_ok
-echo "another last line" >> zzz2_merge_bad
-hg diff --nodates | grep "^[+-][^<>]"
-hg st
-
-echo "# local merge with bad merge tool"
-HGMERGE=false hg co
-hg co 0
-hg diff --nodates | grep "^[+-][^<>]"
-hg st
-
-echo "# local merge with conflicts"
-hg co
-hg co 0
-hg diff --nodates | grep "^[+-][^<>]"
-hg st
-
-echo "# local merge without conflicts"
-hg revert zzz2_merge_bad
-hg co
-hg diff --nodates | grep "^[+-][^<>]"
-hg st
--- a/tests/test-merge-local.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-# revision 0
-adding copy
-adding move
-adding remove
-adding unchanged
-adding zzz1_merge_ok
-adding zzz2_merge_bad
-# revision 1
-# local changes to revision 0
-4 files updated, 0 files merged, 3 files removed, 0 files unresolved
---- a/zzz1_merge_ok
-+++ b/zzz1_merge_ok
-+new last line
---- a/zzz2_merge_bad
-+++ b/zzz2_merge_bad
-+another last line
-M zzz1_merge_ok
-M zzz2_merge_bad
-# local merge with bad merge tool
-merging zzz1_merge_ok
-merging zzz2_merge_bad
-merging zzz2_merge_bad failed!
-3 files updated, 1 files merged, 2 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges
-merging zzz1_merge_ok
-merging zzz2_merge_bad
-warning: conflicts during merge.
-merging zzz2_merge_bad failed!
-2 files updated, 1 files merged, 3 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges
---- a/zzz1_merge_ok
-+++ b/zzz1_merge_ok
-+new last line
---- a/zzz2_merge_bad
-+++ b/zzz2_merge_bad
-+another last line
-+=======
-M zzz1_merge_ok
-M zzz2_merge_bad
-? zzz2_merge_bad.orig
-# local merge with conflicts
-merging zzz1_merge_ok
-merging zzz2_merge_bad
-warning: conflicts during merge.
-merging zzz2_merge_bad failed!
-3 files updated, 1 files merged, 2 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges
-merging zzz1_merge_ok
-merging zzz2_merge_bad
-warning: conflicts during merge.
-merging zzz2_merge_bad failed!
-2 files updated, 1 files merged, 3 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges
---- a/zzz1_merge_ok
-+++ b/zzz1_merge_ok
-+new last line
---- a/zzz2_merge_bad
-+++ b/zzz2_merge_bad
-+another last line
-+=======
-+=======
-+new last line
-+=======
-M zzz1_merge_ok
-M zzz2_merge_bad
-? zzz2_merge_bad.orig
-# local merge without conflicts
-merging zzz1_merge_ok
-4 files updated, 1 files merged, 2 files removed, 0 files unresolved
---- a/zzz1_merge_ok
-+++ b/zzz1_merge_ok
-+new last line
-M zzz1_merge_ok
-? zzz2_merge_bad.orig
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-merge-local.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,138 @@
+  $ hg init
+
+Revision 0:
+
+  $ echo "unchanged" > unchanged
+  $ echo "remove me" > remove
+  $ echo "copy me" > copy
+  $ echo "move me" > move
+  $ for i in 1 2 3 4 5 6 7 8 9; do
+  >     echo "merge ok $i" >> zzz1_merge_ok
+  > done
+  $ echo "merge bad" > zzz2_merge_bad
+  $ hg ci -Am "revision 0"
+  adding copy
+  adding move
+  adding remove
+  adding unchanged
+  adding zzz1_merge_ok
+  adding zzz2_merge_bad
+
+Revision 1:
+
+  $ hg rm remove
+  $ hg mv move moved
+  $ hg cp copy copied
+  $ echo "added" > added
+  $ hg add added
+  $ echo "new first line" > zzz1_merge_ok
+  $ hg cat zzz1_merge_ok >> zzz1_merge_ok
+  $ echo "new last line" >> zzz2_merge_bad
+  $ hg ci -m "revision 1"
+
+Local changes to revision 0:
+
+  $ hg co 0
+  4 files updated, 0 files merged, 3 files removed, 0 files unresolved
+  $ echo "new last line" >> zzz1_merge_ok
+  $ echo "another last line" >> zzz2_merge_bad
+
+  $ hg diff --nodates | grep "^[+-][^<>]"
+  --- a/zzz1_merge_ok
+  +++ b/zzz1_merge_ok
+  +new last line
+  --- a/zzz2_merge_bad
+  +++ b/zzz2_merge_bad
+  +another last line
+
+  $ hg st
+  M zzz1_merge_ok
+  M zzz2_merge_bad
+
+Local merge with bad merge tool:
+
+  $ HGMERGE=false hg co
+  merging zzz1_merge_ok
+  merging zzz2_merge_bad
+  merging zzz2_merge_bad failed!
+  3 files updated, 1 files merged, 2 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges
+  [1]
+
+  $ hg co 0
+  merging zzz1_merge_ok
+  merging zzz2_merge_bad
+  warning: conflicts during merge.
+  merging zzz2_merge_bad failed!
+  2 files updated, 1 files merged, 3 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges
+  [1]
+
+  $ hg diff --nodates | grep "^[+-][^<>]"
+  --- a/zzz1_merge_ok
+  +++ b/zzz1_merge_ok
+  +new last line
+  --- a/zzz2_merge_bad
+  +++ b/zzz2_merge_bad
+  +another last line
+  +=======
+
+  $ hg st
+  M zzz1_merge_ok
+  M zzz2_merge_bad
+  ? zzz2_merge_bad.orig
+
+Local merge with conflicts:
+
+  $ hg co
+  merging zzz1_merge_ok
+  merging zzz2_merge_bad
+  warning: conflicts during merge.
+  merging zzz2_merge_bad failed!
+  3 files updated, 1 files merged, 2 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges
+  [1]
+
+  $ hg co 0
+  merging zzz1_merge_ok
+  merging zzz2_merge_bad
+  warning: conflicts during merge.
+  merging zzz2_merge_bad failed!
+  2 files updated, 1 files merged, 3 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges
+  [1]
+
+  $ hg diff --nodates | grep "^[+-][^<>]"
+  --- a/zzz1_merge_ok
+  +++ b/zzz1_merge_ok
+  +new last line
+  --- a/zzz2_merge_bad
+  +++ b/zzz2_merge_bad
+  +another last line
+  +=======
+  +=======
+  +new last line
+  +=======
+
+  $ hg st
+  M zzz1_merge_ok
+  M zzz2_merge_bad
+  ? zzz2_merge_bad.orig
+
+Local merge without conflicts:
+
+  $ hg revert zzz2_merge_bad
+
+  $ hg co
+  merging zzz1_merge_ok
+  4 files updated, 1 files merged, 2 files removed, 0 files unresolved
+
+  $ hg diff --nodates | grep "^[+-][^<>]"
+  --- a/zzz1_merge_ok
+  +++ b/zzz1_merge_ok
+  +new last line
+
+  $ hg st
+  M zzz1_merge_ok
+  ? zzz2_merge_bad.orig
+
--- a/tests/test-merge-prompt	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-#!/bin/sh
-#
-# Test for b5605d88dc27
-#  Make ui.prompt repeat on "unrecognized response" again (issue897)
-# and for 840e2b315c1f
-#  Fix misleading error and prompts during update/merge (issue556)
-
-status() {
-    [ $? -ne 0 ] && echo "failed."
-    echo "status:"
-    hg st -A file1 file2
-    for file in file1 file2; do
-        if [ -f $file ]; then
-            echo "$file:"
-            cat $file
-        else
-            echo "$file does not exist"
-        fi
-    done
-}
-
-hg init repo
-cd repo
-echo 1 > file1
-echo 2 > file2
-hg ci -Am 'added file1 and file2' # rev 0
-
-hg rm file1
-echo changed >> file2
-hg ci -m 'removed file1, changed file2' # rev 1
-
-hg co 0
-echo changed >> file1
-hg rm file2
-hg ci -m 'changed file1, removed file2' # rev 2
-
-echo
-echo "# non-interactive merge"
-hg merge -y || echo "failed"
-status
-
-echo
-echo "# interactive merge"
-hg co -C
-hg merge --config ui.interactive=true <<EOF || echo "failed"
-c
-d
-EOF
-status
-
-echo
-echo "# interactive merge with bad input"
-hg co -C
-hg merge --config ui.interactive=true <<EOF || echo "failed"
-foo
-bar
-d
-baz
-c
-EOF
-status
-
-echo
-echo "# interactive merge with not enough input"
-hg co -C
-hg merge --config ui.interactive=true <<EOF || echo "failed"
-d
-EOF
-status
--- a/tests/test-merge-prompt.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-adding file1
-adding file2
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-
-# non-interactive merge
- local changed file1 which remote deleted
-use (c)hanged version or (d)elete? c
-remote changed file2 which local deleted
-use (c)hanged version or leave (d)eleted? c
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-status:
-M file2
-C file1
-file1:
-1
-changed
-file2:
-2
-changed
-
-# interactive merge
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
- local changed file1 which remote deleted
-use (c)hanged version or (d)elete? remote changed file2 which local deleted
-use (c)hanged version or leave (d)eleted? 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-status:
-file2: No such file or directory
-C file1
-file1:
-1
-changed
-file2 does not exist
-
-# interactive merge with bad input
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
- local changed file1 which remote deleted
-use (c)hanged version or (d)elete? unrecognized response
- local changed file1 which remote deleted
-use (c)hanged version or (d)elete? unrecognized response
- local changed file1 which remote deleted
-use (c)hanged version or (d)elete? remote changed file2 which local deleted
-use (c)hanged version or leave (d)eleted? unrecognized response
-remote changed file2 which local deleted
-use (c)hanged version or leave (d)eleted? 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-status:
-M file2
-R file1
-file1 does not exist
-file2:
-2
-changed
-
-# interactive merge with not enough input
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
- local changed file1 which remote deleted
-use (c)hanged version or (d)elete? remote changed file2 which local deleted
-use (c)hanged version or leave (d)eleted? abort: response expected
-failed
-status:
-file2: No such file or directory
-C file1
-file1:
-1
-changed
-file2 does not exist
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-merge-prompt.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,142 @@
+Test for
+b5605d88dc27: Make ui.prompt repeat on "unrecognized response" again
+ (issue897)
+
+840e2b315c1f: Fix misleading error and prompts during update/merge
+ (issue556)
+
+  $ status() {
+  >     echo "--- status ---"
+  >     hg st -A file1 file2
+  >     for file in file1 file2; do
+  >         if [ -f $file ]; then
+  >             echo "--- $file ---"
+  >             cat $file
+  >         else
+  >             echo "*** $file does not exist"
+  >         fi
+  >     done
+  > }
+
+  $ hg init
+
+  $ echo 1 > file1
+  $ echo 2 > file2
+  $ hg ci -Am 'added file1 and file2'
+  adding file1
+  adding file2
+
+  $ hg rm file1
+  $ echo changed >> file2
+  $ hg ci -m 'removed file1, changed file2'
+
+  $ hg co 0
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ echo changed >> file1
+  $ hg rm file2
+  $ hg ci -m 'changed file1, removed file2'
+  created new head
+
+
+Non-interactive merge:
+
+  $ hg merge -y
+   local changed file1 which remote deleted
+  use (c)hanged version or (d)elete? c
+  remote changed file2 which local deleted
+  use (c)hanged version or leave (d)eleted? c
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+  $ status
+  --- status ---
+  M file2
+  C file1
+  --- file1 ---
+  1
+  changed
+  --- file2 ---
+  2
+  changed
+
+
+Interactive merge:
+
+  $ hg co -C
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+  $ hg merge --config ui.interactive=true <<EOF
+  > c
+  > d
+  > EOF
+   local changed file1 which remote deleted
+  use (c)hanged version or (d)elete? remote changed file2 which local deleted
+  use (c)hanged version or leave (d)eleted? 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+  $ status
+  --- status ---
+  file2: No such file or directory
+  C file1
+  --- file1 ---
+  1
+  changed
+  *** file2 does not exist
+
+
+Interactive merge with bad input:
+
+  $ hg co -C
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ hg merge --config ui.interactive=true <<EOF
+  > foo
+  > bar
+  > d
+  > baz
+  > c
+  > EOF
+   local changed file1 which remote deleted
+  use (c)hanged version or (d)elete? unrecognized response
+   local changed file1 which remote deleted
+  use (c)hanged version or (d)elete? unrecognized response
+   local changed file1 which remote deleted
+  use (c)hanged version or (d)elete? remote changed file2 which local deleted
+  use (c)hanged version or leave (d)eleted? unrecognized response
+  remote changed file2 which local deleted
+  use (c)hanged version or leave (d)eleted? 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+  $ status
+  --- status ---
+  M file2
+  R file1
+  *** file1 does not exist
+  --- file2 ---
+  2
+  changed
+
+
+Interactive merge with not enough input:
+
+  $ hg co -C
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+  $ hg merge --config ui.interactive=true <<EOF
+  > d
+  > EOF
+   local changed file1 which remote deleted
+  use (c)hanged version or (d)elete? remote changed file2 which local deleted
+  use (c)hanged version or leave (d)eleted? abort: response expected
+  [255]
+
+  $ status
+  --- status ---
+  file2: No such file or directory
+  C file1
+  --- file1 ---
+  1
+  changed
+  *** file2 does not exist
+
--- a/tests/test-merge-remove	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-#!/bin/sh
-
-hg init repo
-cd repo
-
-echo foo > foo
-echo bar > bar
-hg ci -qAm 'add foo bar'
-
-echo foo2 >> foo
-echo bleh > bar
-hg ci -m 'change foo bar'
-
-hg up -qC 0
-hg mv foo foo1
-echo foo1 > foo1
-hg cat foo >> foo1
-hg ci -m 'mv foo foo1'
-
-hg merge
-hg debugstate --nodates
-hg st -q
-
-echo '% removing foo1 and bar'
-cp foo1 F
-cp bar B
-hg rm -f foo1 bar
-hg debugstate --nodates
-hg st -qC
-
-echo '% readding foo1 and bar'
-cp F foo1
-cp B bar
-hg add -v foo1 bar
-hg debugstate --nodates
-hg st -qC
-
-echo '% reverting foo1 and bar'
-hg revert -vr . foo1 bar
-hg debugstate --nodates
-hg st -qC
-hg diff
-
--- a/tests/test-merge-remove.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-created new head
-merging foo1 and foo to foo1
-1 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-n   0         -2 bar
-m 644         14 foo1
-copy: foo -> foo1
-M bar
-M foo1
-% removing foo1 and bar
-r   0         -2 bar
-r   0         -1 foo1
-copy: foo -> foo1
-R bar
-R foo1
-% readding foo1 and bar
-adding bar
-adding foo1
-n   0         -2 bar
-m 644         14 foo1
-copy: foo -> foo1
-M bar
-M foo1
-  foo
-% reverting foo1 and bar
-saving current version of bar as bar.orig
-reverting bar
-saving current version of foo1 as foo1.orig
-reverting foo1
-n   0         -2 bar
-m 644         14 foo1
-copy: foo -> foo1
-M bar
-M foo1
-  foo
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-merge-remove.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,87 @@
+  $ hg init
+
+  $ echo foo > foo
+  $ echo bar > bar
+  $ hg ci -qAm 'add foo bar'
+
+  $ echo foo2 >> foo
+  $ echo bleh > bar
+  $ hg ci -m 'change foo bar'
+
+  $ hg up -qC 0
+  $ hg mv foo foo1
+  $ echo foo1 > foo1
+  $ hg cat foo >> foo1
+  $ hg ci -m 'mv foo foo1'
+  created new head
+
+  $ hg merge
+  merging foo1 and foo to foo1
+  1 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+  $ hg debugstate --nodates
+  n   0         -2 bar
+  m 644         14 foo1
+  copy: foo -> foo1
+
+  $ hg st -q
+  M bar
+  M foo1
+
+
+Removing foo1 and bar:
+
+  $ cp foo1 F
+  $ cp bar B
+  $ hg rm -f foo1 bar
+
+  $ hg debugstate --nodates
+  r   0         -2 bar
+  r   0         -1 foo1
+  copy: foo -> foo1
+
+  $ hg st -qC
+  R bar
+  R foo1
+
+
+Re-adding foo1 and bar:
+
+  $ cp F foo1
+  $ cp B bar
+  $ hg add -v foo1 bar
+  adding bar
+  adding foo1
+
+  $ hg debugstate --nodates
+  n   0         -2 bar
+  m 644         14 foo1
+  copy: foo -> foo1
+
+  $ hg st -qC
+  M bar
+  M foo1
+    foo
+
+
+Reverting foo1 and bar:
+
+  $ hg revert -vr . foo1 bar
+  saving current version of bar as bar.orig
+  reverting bar
+  saving current version of foo1 as foo1.orig
+  reverting foo1
+
+  $ hg debugstate --nodates
+  n   0         -2 bar
+  m 644         14 foo1
+  copy: foo -> foo1
+
+  $ hg st -qC
+  M bar
+  M foo1
+    foo
+
+  $ hg diff
+
--- a/tests/test-merge-revert	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-#!/bin/sh
-
-mkdir t
-cd t
-hg init
-echo "added file1" > file1
-echo "added file2" > file2
-hg add file1 file2
-hg commit -m "added file1 and file2" -d "1000000 0" -u user
-echo "changed file1" >> file1
-hg commit -m "changed file1" -d "1000000 0" -u user
-hg -q log
-hg id
-hg update -C 0
-hg id
-echo "changed file1" >> file1
-hg id
-hg revert --all
-hg diff
-hg status
-hg id
-hg update
-hg diff
-hg status
-hg id
-hg update -C 0
-echo "changed file1" >> file1
-hg update
-hg diff
-hg status
-hg id
-hg revert --all
-hg diff
-hg status
-hg id
-hg revert -r tip --all
-hg diff
-hg status
-hg id
-hg update -C
-hg diff
-hg status
-hg id
-
--- a/tests/test-merge-revert.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-1:016807e6fdaf
-0:eb43f19ff115
-016807e6fdaf tip
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-eb43f19ff115
-eb43f19ff115+
-reverting file1
-? file1.orig
-eb43f19ff115
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-? file1.orig
-016807e6fdaf tip
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-? file1.orig
-016807e6fdaf tip
-? file1.orig
-016807e6fdaf tip
-? file1.orig
-016807e6fdaf tip
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-? file1.orig
-016807e6fdaf tip
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-merge-revert.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,74 @@
+  $ hg init
+
+  $ echo "added file1" > file1
+  $ echo "added file2" > file2
+  $ hg add file1 file2
+  $ hg commit -m "added file1 and file2"
+
+  $ echo "changed file1" >> file1
+  $ hg commit -m "changed file1"
+
+  $ hg -q log
+  1:08a16e8e4408
+  0:d29c767a4b52
+  $ hg id
+  08a16e8e4408 tip
+
+  $ hg update -C 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg id
+  d29c767a4b52
+  $ echo "changed file1" >> file1
+  $ hg id
+  d29c767a4b52+
+
+  $ hg revert --all
+  reverting file1
+  $ hg diff
+  $ hg status
+  ? file1.orig
+  $ hg id
+  d29c767a4b52
+
+  $ hg update
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg diff
+  $ hg status
+  ? file1.orig
+  $ hg id
+  08a16e8e4408 tip
+
+  $ hg update -C 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo "changed file1" >> file1
+
+  $ hg update
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg diff
+  $ hg status
+  ? file1.orig
+  $ hg id
+  08a16e8e4408 tip
+
+  $ hg revert --all
+  $ hg diff
+  $ hg status
+  ? file1.orig
+  $ hg id
+  08a16e8e4408 tip
+
+  $ hg revert -r tip --all
+  $ hg diff
+  $ hg status
+  ? file1.orig
+  $ hg id
+  08a16e8e4408 tip
+
+  $ hg update -C
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg diff
+  $ hg status
+  ? file1.orig
+  $ hg id
+  08a16e8e4408 tip
+
--- a/tests/test-merge-revert2	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-#!/bin/sh
-
-mkdir t
-cd t
-hg init
-echo "added file1" > file1
-echo "another line of text" >> file1
-echo "added file2" > file2
-hg add file1 file2
-hg commit -m "added file1 and file2" -d "1000000 0" -u user
-echo "changed file1" >> file1
-hg commit -m "changed file1" -d "1000000 0" -u user
-hg -q log
-hg id
-hg update -C 0
-hg id
-echo "changed file1" >> file1
-hg id
-hg revert --no-backup --all
-hg diff
-hg status
-hg id
-hg update
-hg diff
-hg status
-hg id
-hg update -C 0
-echo "changed file1 different" >> file1
-hg update
-hg diff --nodates
-hg status
-hg id
-hg revert --no-backup --all
-hg diff
-hg status
-hg id
-hg revert -r tip --no-backup --all
-hg diff
-hg status
-hg id
-hg update -C
-hg diff
-hg status
-hg id
-
--- a/tests/test-merge-revert2.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-1:f248da0d4c3e
-0:9eca13a34789
-f248da0d4c3e tip
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-9eca13a34789
-9eca13a34789+
-reverting file1
-9eca13a34789
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-f248da0d4c3e tip
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-merging file1
-warning: conflicts during merge.
-merging file1 failed!
-0 files updated, 0 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges
-diff -r f248da0d4c3e file1
---- a/file1
-+++ b/file1
-@@ -1,3 +1,7 @@
- added file1
- another line of text
-+<<<<<<< local
-+changed file1 different
-+=======
- changed file1
-+>>>>>>> other
-M file1
-? file1.orig
-f248da0d4c3e+ tip
-reverting file1
-? file1.orig
-f248da0d4c3e tip
-? file1.orig
-f248da0d4c3e tip
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-? file1.orig
-f248da0d4c3e tip
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-merge-revert2.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,94 @@
+  $ hg init
+
+  $ echo "added file1" > file1
+  $ echo "another line of text" >> file1
+  $ echo "added file2" > file2
+  $ hg add file1 file2
+  $ hg commit -m "added file1 and file2"
+
+  $ echo "changed file1" >> file1
+  $ hg commit -m "changed file1"
+
+  $ hg -q log
+  1:dfab7f3c2efb
+  0:c3fa057dd86f
+  $ hg id
+  dfab7f3c2efb tip
+
+  $ hg update -C 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg id
+  c3fa057dd86f
+
+  $ echo "changed file1" >> file1
+  $ hg id
+  c3fa057dd86f+
+
+  $ hg revert --no-backup --all
+  reverting file1
+  $ hg diff
+  $ hg status
+  $ hg id
+  c3fa057dd86f
+
+  $ hg update
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg diff
+  $ hg status
+  $ hg id
+  dfab7f3c2efb tip
+
+  $ hg update -C 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo "changed file1 different" >> file1
+
+  $ hg update
+  merging file1
+  warning: conflicts during merge.
+  merging file1 failed!
+  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges
+  [1]
+
+  $ hg diff --nodates
+  diff -r dfab7f3c2efb file1
+  --- a/file1
+  +++ b/file1
+  @@ -1,3 +1,7 @@
+   added file1
+   another line of text
+  +<<<<<<< local
+  +changed file1 different
+  +=======
+   changed file1
+  +>>>>>>> other
+
+  $ hg status
+  M file1
+  ? file1.orig
+  $ hg id
+  dfab7f3c2efb+ tip
+
+  $ hg revert --no-backup --all
+  reverting file1
+  $ hg diff
+  $ hg status
+  ? file1.orig
+  $ hg id
+  dfab7f3c2efb tip
+
+  $ hg revert -r tip --no-backup --all
+  $ hg diff
+  $ hg status
+  ? file1.orig
+  $ hg id
+  dfab7f3c2efb tip
+
+  $ hg update -C
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg diff
+  $ hg status
+  ? file1.orig
+  $ hg id
+  dfab7f3c2efb tip
+
--- a/tests/test-merge-tools	Wed Sep 22 17:13:49 2010 -0500
+++ b/tests/test-merge-tools	Wed Sep 22 18:29:41 2010 -0500
@@ -9,23 +9,23 @@
 echo "# revision 0"
 echo "revision 0" > f
 echo "space" >> f
-hg commit -Am "revision 0" -d "1000000 0"
+hg commit -Am "revision 0"
 
 echo "# revision 1"
 echo "revision 1" > f
 echo "space" >> f
-hg commit -Am "revision 1" -d "1000000 0"
+hg commit -Am "revision 1"
 
 hg update 0 > /dev/null
 echo "# revision 2"
 echo "revision 2" > f
 echo "space" >> f
-hg commit -Am "revision 2" -d "1000000 0"
+hg commit -Am "revision 2"
 
 hg update 0 > /dev/null
 echo "# revision 3 - simple to merge"
 echo "revision 3" >> f
-hg commit -Am "revision 3" -d "1000000 0"
+hg commit -Am "revision 3"
 
 
 echo "[merge-tools]" > .hg/hgrc
--- a/tests/test-merge-tools.out	Wed Sep 22 17:13:49 2010 -0500
+++ b/tests/test-merge-tools.out	Wed Sep 22 18:29:41 2010 -0500
@@ -17,7 +17,7 @@
 warning: conflicts during merge.
 merging f failed!
 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
+use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
 # cat f
 <<<<<<< local
 revision 1
@@ -37,7 +37,7 @@
 merging f
 merging f failed!
 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
+use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
 # cat f
 revision 1
 space
@@ -69,7 +69,7 @@
 merging f
 merging f failed!
 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
+use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
 # cat f
 revision 1
 space
@@ -86,7 +86,7 @@
 merging f
 merging f failed!
 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
+use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
 # cat f
 revision 1
 space
@@ -103,7 +103,7 @@
 merging f
 merging f failed!
 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
+use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
 # cat f
 revision 1
 space
@@ -120,7 +120,7 @@
 merging f
 merging f failed!
 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
+use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
 # cat f
 revision 1
 space
@@ -185,7 +185,7 @@
 merging f
 merging f failed!
 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
+use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
 # cat f
 revision 1
 space
@@ -204,7 +204,7 @@
 merging f
 merging f failed!
 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
+use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
 # cat f
 revision 1
 space
@@ -223,7 +223,7 @@
 merging f
 merging f failed!
 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
+use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
 # cat f
 revision 1
 space
@@ -244,7 +244,7 @@
 merging f
 merging f failed!
 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
+use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
 # cat f
 revision 1
 space
@@ -260,7 +260,7 @@
 # hg update -C 1
 # hg merge -r 2 --config ui.merge=internal:fail
 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
+use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
 # cat f
 revision 1
 space
@@ -323,7 +323,7 @@
 # hg merge -r 2 --config ui.merge=internal:dump
 merging f
 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
+use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
 # cat f
 revision 1
 space
@@ -354,7 +354,7 @@
 merging f
 merging f failed!
 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
+use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
 # cat f
 revision 1
 space
@@ -537,7 +537,7 @@
 was merge successful (yn)? n
 merging f failed!
 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
+use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
 # cat f
 revision 1
 space
--- a/tests/test-merge-types	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-#!/bin/sh
-
-hg init
-echo a > a
-hg ci -Amadd       # 0
-
-chmod +x a
-hg ci -mexecutable # 1
-
-hg up 0
-rm a
-ln -s symlink a
-hg ci -msymlink    # 2
-hg merge --debug
-
-echo % symlink is local parent, executable is other
-
-if [ -h a ]; then
-    echo a is a symlink
-    $TESTDIR/readlink.py a
-elif [ -x a ]; then
-    echo a is executable
-else
-    echo "a has no flags (default for conflicts)"
-fi
-
-hg update -C 1
-hg merge --debug
-
-echo % symlink is other parent, executable is local
-
-if [ -h a ]; then
-    echo a is a symlink
-    $TESTDIR/readlink.py a
-elif [ -x a ]; then
-    echo a is executable
-else
-    echo "a has no flags (default for conflicts)"
-fi
--- a/tests/test-merge-types.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-adding a
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-  searching for copies back to rev 1
-resolving manifests
- overwrite None partial False
- ancestor c334dc3be0da local 521a1e40188f+ remote 3574f3e69b1c
- conflicting flags for a
-(n)one, e(x)ec or sym(l)ink? n
- a: update permissions -> e
-updating: a 1/1 files (100.00%)
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-% symlink is local parent, executable is other
-a has no flags (default for conflicts)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  searching for copies back to rev 1
-resolving manifests
- overwrite None partial False
- ancestor c334dc3be0da local 3574f3e69b1c+ remote 521a1e40188f
- conflicting flags for a
-(n)one, e(x)ec or sym(l)ink? n
- a: remote is newer -> g
-updating: a 1/1 files (100.00%)
-getting a
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-% symlink is other parent, executable is local
-a has no flags (default for conflicts)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-merge-types.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,70 @@
+  $ hg init
+
+  $ echo a > a
+  $ hg ci -Amadd
+  adding a
+
+  $ chmod +x a
+  $ hg ci -mexecutable
+
+  $ hg up 0
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm a
+  $ ln -s symlink a
+  $ hg ci -msymlink
+  created new head
+
+  $ hg merge --debug
+    searching for copies back to rev 1
+  resolving manifests
+   overwrite None partial False
+   ancestor c334dc3be0da local 521a1e40188f+ remote 3574f3e69b1c
+   conflicting flags for a
+  (n)one, e(x)ec or sym(l)ink? n
+   a: update permissions -> e
+  updating: a 1/1 files (100.00%)
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+
+Symlink is local parent, executable is other:
+
+  $ if [ -h a ]; then
+  >     echo a is a symlink
+  >     $TESTDIR/readlink.py a
+  > elif [ -x a ]; then
+  >     echo a is executable
+  > else
+  >     echo "a has no flags (default for conflicts)"
+  > fi
+  a has no flags (default for conflicts)
+
+  $ hg update -C 1
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ hg merge --debug
+    searching for copies back to rev 1
+  resolving manifests
+   overwrite None partial False
+   ancestor c334dc3be0da local 3574f3e69b1c+ remote 521a1e40188f
+   conflicting flags for a
+  (n)one, e(x)ec or sym(l)ink? n
+   a: remote is newer -> g
+  updating: a 1/1 files (100.00%)
+  getting a
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+
+Symlink is other parent, executable is local:
+
+  $ if [ -h a ]; then
+  >    echo a is a symlink
+  >    $TESTDIR/readlink.py a
+  > elif [ -x a ]; then
+  >     echo a is executable
+  > else
+  >     echo "a has no flags (default for conflicts)"
+  > fi
+  a has no flags (default for conflicts)
+
--- a/tests/test-merge1	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,112 +0,0 @@
-#!/bin/sh
-
-cat <<EOF > merge
-import sys, os
-
-try:
-    import msvcrt
-    msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
-    msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY)
-except ImportError:
-    pass
-
-print "merging for", os.path.basename(sys.argv[1])
-EOF
-HGMERGE="python ../merge"; export HGMERGE
-
-mkdir t
-cd t
-hg init
-echo This is file a1 > a
-hg add a
-hg commit -m "commit #0" -d "1000000 0"
-echo This is file b1 > b
-hg add b
-hg commit -m "commit #1" -d "1000000 0"
-
-hg update 0
-echo This is file c1 > c
-hg add c
-hg commit -m "commit #2" -d "1000000 0"
-echo This is file b1 > b
-echo %% no merges expected
-hg merge -P 1
-hg merge 1
-hg diff --nodates
-hg status
-cd ..; rm -r t
-
-mkdir t
-cd t
-hg init
-echo This is file a1 > a
-hg add a
-hg commit -m "commit #0" -d "1000000 0"
-echo This is file b1 > b
-hg add b
-hg commit -m "commit #1" -d "1000000 0"
-
-hg update 0
-echo This is file c1 > c
-hg add c
-hg commit -m "commit #2" -d "1000000 0"
-echo This is file b2 > b
-echo %% merge should fail
-hg merge 1
-echo %% merge of b expected
-hg merge -f 1
-hg diff --nodates
-hg status
-cd ..; rm -r t
-echo %%
-
-mkdir t
-cd t
-hg init
-echo This is file a1 > a
-hg add a
-hg commit -m "commit #0" -d "1000000 0"
-echo This is file b1 > b
-hg add b
-hg commit -m "commit #1" -d "1000000 0"
-echo This is file b22 > b
-hg commit -m "commit #2" -d "1000000 0"
-hg update 1
-echo This is file c1 > c
-hg add c
-hg commit -m "commit #3" -d "1000000 0"
-
-echo 'Contents of b should be "this is file b1"'
-cat b
-
-echo This is file b22 > b
-echo %% merge fails
-hg merge 2
-echo %% merge expected!
-hg merge -f 2
-hg diff --nodates
-hg status
-cd ..; rm -r t
-
-mkdir t
-cd t
-hg init
-echo This is file a1 > a
-hg add a
-hg commit -m "commit #0" -d "1000000 0"
-echo This is file b1 > b
-hg add b
-hg commit -m "commit #1" -d "1000000 0"
-echo This is file b22 > b
-hg commit -m "commit #2" -d "1000000 0"
-hg update 1
-echo This is file c1 > c
-hg add c
-hg commit -m "commit #3" -d "1000000 0"
-echo This is file b33 > b
-echo %% merge of b should fail
-hg merge 2
-echo %% merge of b expected
-hg merge -f 2
-hg diff --nodates
-hg status
--- a/tests/test-merge1.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-created new head
-%% no merges expected
-changeset:   1:4ee19afe4659
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     commit #1
-
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-diff -r d9e5953b9dec b
---- /dev/null
-+++ b/b
-@@ -0,0 +1,1 @@
-+This is file b1
-M b
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-created new head
-%% merge should fail
-abort: untracked file in working directory differs from file in requested revision: 'b'
-%% merge of b expected
-merging for b
-merging b
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-diff -r d9e5953b9dec b
---- /dev/null
-+++ b/b
-@@ -0,0 +1,1 @@
-+This is file b2
-M b
-%%
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-Contents of b should be "this is file b1"
-This is file b1
-%% merge fails
-abort: outstanding uncommitted changes (use 'hg status' to list changes)
-%% merge expected!
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-diff -r c1dd73cbf59f b
---- a/b
-+++ b/b
-@@ -1,1 +1,1 @@
--This is file b1
-+This is file b22
-M b
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-%% merge of b should fail
-abort: outstanding uncommitted changes (use 'hg status' to list changes)
-%% merge of b expected
-merging for b
-merging b
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-diff -r c1dd73cbf59f b
---- a/b
-+++ b/b
-@@ -1,1 +1,1 @@
--This is file b1
-+This is file b33
-M b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-merge1.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,168 @@
+  $ cat <<EOF > merge
+  > import sys, os
+  > 
+  > try:
+  >     import msvcrt
+  >     msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
+  >     msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY)
+  > except ImportError:
+  >     pass
+  > 
+  > print "merging for", os.path.basename(sys.argv[1])
+  > EOF
+  $ HGMERGE="python ../merge"; export HGMERGE
+
+  $ mkdir t
+  $ cd t
+  $ hg init
+  $ echo This is file a1 > a
+  $ hg add a
+  $ hg commit -m "commit #0"
+  $ echo This is file b1 > b
+  $ hg add b
+  $ hg commit -m "commit #1"
+
+  $ hg update 0
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo This is file c1 > c
+  $ hg add c
+  $ hg commit -m "commit #2"
+  created new head
+  $ echo This is file b1 > b
+no merges expected
+  $ hg merge -P 1
+  changeset:   1:b8bb4a988f25
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     commit #1
+  
+  $ hg merge 1
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg diff --nodates
+  diff -r 49035e18a8e6 b
+  --- /dev/null
+  +++ b/b
+  @@ -0,0 +1,1 @@
+  +This is file b1
+  $ hg status
+  M b
+  $ cd ..; rm -r t
+
+  $ mkdir t
+  $ cd t
+  $ hg init
+  $ echo This is file a1 > a
+  $ hg add a
+  $ hg commit -m "commit #0"
+  $ echo This is file b1 > b
+  $ hg add b
+  $ hg commit -m "commit #1"
+
+  $ hg update 0
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo This is file c1 > c
+  $ hg add c
+  $ hg commit -m "commit #2"
+  created new head
+  $ echo This is file b2 > b
+merge should fail
+  $ hg merge 1
+  abort: untracked file in working directory differs from file in requested revision: 'b'
+  [255]
+merge of b expected
+  $ hg merge -f 1
+  merging for b
+  merging b
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg diff --nodates
+  diff -r 49035e18a8e6 b
+  --- /dev/null
+  +++ b/b
+  @@ -0,0 +1,1 @@
+  +This is file b2
+  $ hg status
+  M b
+  $ cd ..; rm -r t
+
+  $ mkdir t
+  $ cd t
+  $ hg init
+  $ echo This is file a1 > a
+  $ hg add a
+  $ hg commit -m "commit #0"
+  $ echo This is file b1 > b
+  $ hg add b
+  $ hg commit -m "commit #1"
+  $ echo This is file b22 > b
+  $ hg commit -m "commit #2"
+  $ hg update 1
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo This is file c1 > c
+  $ hg add c
+  $ hg commit -m "commit #3"
+  created new head
+
+Contents of b should be "this is file b1"
+  $ cat b
+  This is file b1
+
+  $ echo This is file b22 > b
+merge fails
+  $ hg merge 2
+  abort: outstanding uncommitted changes (use 'hg status' to list changes)
+  [255]
+  $ echo %% merge expected!
+  %% merge expected!
+  $ hg merge -f 2
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg diff --nodates
+  diff -r 85de557015a8 b
+  --- a/b
+  +++ b/b
+  @@ -1,1 +1,1 @@
+  -This is file b1
+  +This is file b22
+  $ hg status
+  M b
+  $ cd ..; rm -r t
+
+  $ mkdir t
+  $ cd t
+  $ hg init
+  $ echo This is file a1 > a
+  $ hg add a
+  $ hg commit -m "commit #0"
+  $ echo This is file b1 > b
+  $ hg add b
+  $ hg commit -m "commit #1"
+  $ echo This is file b22 > b
+  $ hg commit -m "commit #2"
+  $ hg update 1
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo This is file c1 > c
+  $ hg add c
+  $ hg commit -m "commit #3"
+  created new head
+  $ echo This is file b33 > b
+merge of b should fail
+  $ hg merge 2
+  abort: outstanding uncommitted changes (use 'hg status' to list changes)
+  [255]
+merge of b expected
+  $ hg merge -f 2
+  merging for b
+  merging b
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg diff --nodates
+  diff -r 85de557015a8 b
+  --- a/b
+  +++ b/b
+  @@ -1,1 +1,1 @@
+  -This is file b1
+  +This is file b33
+  $ hg status
+  M b
--- a/tests/test-merge10	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-#!/bin/sh
-
-# Test for changeset 9fe267f77f56ff127cf7e65dc15dd9de71ce8ceb
-# (merge correctly when all the files in a directory are moved
-# but then local changes are added in the same directory)
-
-hg init a
-cd a
-mkdir -p testdir
-echo a > testdir/a
-hg add testdir/a
-hg commit -d '1000000 0' -m a
-cd ..
-
-hg clone a b
-cd a
-echo alpha > testdir/a
-hg commit -d '1000000 0' -m remote-change
-cd ..
-
-cd b
-mkdir testdir/subdir
-hg mv testdir/a testdir/subdir/a
-hg commit -d '1000000 0' -m move
-mkdir newdir
-echo beta > newdir/beta
-hg add newdir/beta
-hg commit -d '1000000 0' -m local-addition
-hg pull ../a
-hg up -C 2
-hg merge
-hg stat
-hg diff --nodates
--- a/tests/test-merge10.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-pulling from ../a
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files (+1 heads)
-(run 'hg heads' to see heads, 'hg merge' to merge)
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-merging testdir/subdir/a and testdir/a to testdir/subdir/a
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-M testdir/subdir/a
-diff -r f7459795031e testdir/subdir/a
---- a/testdir/subdir/a
-+++ b/testdir/subdir/a
-@@ -1,1 +1,1 @@
--a
-+alpha
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-merge10.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,51 @@
+Test for changeset 9fe267f77f56ff127cf7e65dc15dd9de71ce8ceb
+(merge correctly when all the files in a directory are moved
+but then local changes are added in the same directory)
+
+  $ hg init a
+  $ cd a
+  $ mkdir -p testdir
+  $ echo a > testdir/a
+  $ hg add testdir/a
+  $ hg commit -m a
+  $ cd ..
+
+  $ hg clone a b
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd a
+  $ echo alpha > testdir/a
+  $ hg commit -m remote-change
+  $ cd ..
+
+  $ cd b
+  $ mkdir testdir/subdir
+  $ hg mv testdir/a testdir/subdir/a
+  $ hg commit -m move
+  $ mkdir newdir
+  $ echo beta > newdir/beta
+  $ hg add newdir/beta
+  $ hg commit -m local-addition
+  $ hg pull ../a
+  pulling from ../a
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files (+1 heads)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+  $ hg up -C 2
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg merge
+  merging testdir/subdir/a and testdir/a to testdir/subdir/a
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg stat
+  M testdir/subdir/a
+  $ hg diff --nodates
+  diff -r bc21c9773bfa testdir/subdir/a
+  --- a/testdir/subdir/a
+  +++ b/testdir/subdir/a
+  @@ -1,1 +1,1 @@
+  -a
+  +alpha
--- a/tests/test-merge2	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-#!/bin/sh
-
-mkdir t
-cd t
-hg init
-echo This is file a1 > a
-hg add a
-hg commit -m "commit #0" -d "1000000 0"
-echo This is file b1 > b
-hg add b
-hg commit -m "commit #1" -d "1000000 0"
-rm b
-hg update 0
-echo This is file b2 > b
-hg add b
-hg commit -m "commit #2" -d "1000000 0"
-cd ..; rm -r t
-
-mkdir t
-cd t
-hg init
-echo This is file a1 > a
-hg add a
-hg commit -m "commit #0" -d "1000000 0"
-echo This is file b1 > b
-hg add b
-hg commit -m "commit #1" -d "1000000 0"
-rm b
-hg update 0
-echo This is file b2 > b
-hg commit -A -m "commit #2" -d "1000000 0"
-cd ..; rm -r t
-
-mkdir t
-cd t
-hg init
-echo This is file a1 > a
-hg add a
-hg commit -m "commit #0" -d "1000000 0"
-echo This is file b1 > b
-hg add b
-hg commit -m "commit #1" -d "1000000 0"
-rm b
-hg remove b
-hg update 0
-echo This is file b2 > b
-hg commit -A -m "commit #2" -d "1000000 0"
--- a/tests/test-merge2.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-adding b
-created new head
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-adding b
-created new head
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-merge2.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,53 @@
+  $ mkdir t
+  $ cd t
+  $ hg init
+  $ echo This is file a1 > a
+  $ hg add a
+  $ hg commit -m "commit #0"
+  $ echo This is file b1 > b
+  $ hg add b
+  $ hg commit -m "commit #1"
+  $ rm b
+  $ hg update 0
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo This is file b2 > b
+  $ hg add b
+  $ hg commit -m "commit #2"
+  created new head
+  $ cd ..; rm -r t
+
+  $ mkdir t
+  $ cd t
+  $ hg init
+  $ echo This is file a1 > a
+  $ hg add a
+  $ hg commit -m "commit #0"
+  $ echo This is file b1 > b
+  $ hg add b
+  $ hg commit -m "commit #1"
+  $ rm b
+  $ hg update 0
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo This is file b2 > b
+  $ hg commit -A -m "commit #2"
+  adding b
+  created new head
+  $ cd ..; rm -r t
+
+  $ mkdir t
+  $ cd t
+  $ hg init
+  $ echo This is file a1 > a
+  $ hg add a
+  $ hg commit -m "commit #0"
+  $ echo This is file b1 > b
+  $ hg add b
+  $ hg commit -m "commit #1"
+  $ rm b
+  $ hg remove b
+  $ hg update 0
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo This is file b2 > b
+  $ hg commit -A -m "commit #2"
+  adding b
+  created new head
--- a/tests/test-merge4	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-#!/bin/sh
-
-hg init
-echo This is file a1 > a
-hg add a
-hg commit -m "commit #0" -d "1000000 0"
-echo This is file b1 > b
-hg add b
-hg commit -m "commit #1" -d "1000000 0"
-hg update 0
-echo This is file c1 > c
-hg add c
-hg commit -m "commit #2" -d "1000000 0"
-hg merge 1
-rm b
-echo This is file c22 > c
-hg commit -m "commit #3" -d "1000000 0"
--- a/tests/test-merge4.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-created new head
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-merge4.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,20 @@
+  $ hg init
+  $ echo This is file a1 > a
+  $ hg add a
+  $ hg commit -m "commit #0"
+  $ echo This is file b1 > b
+  $ hg add b
+  $ hg commit -m "commit #1"
+  $ hg update 0
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo This is file c1 > c
+  $ hg add c
+  $ hg commit -m "commit #2"
+  created new head
+  $ hg merge 1
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ rm b
+  $ echo This is file c22 > c
+  $ hg commit -m "commit #3"
+
--- a/tests/test-merge5	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-#!/bin/sh
-
-mkdir t
-cd t
-hg init
-echo This is file a1 > a
-echo This is file b1 > b
-hg add a b
-hg commit -m "commit #0" -d "1000000 0"
-echo This is file b22 > b
-hg commit -m"comment #1" -d "1000000 0"
-hg update 0
-rm b
-hg commit -A -m"comment #2" -d "1000000 0"
-mv a c
-# in theory, we shouldn't need the "-y" below, but it prevents
-# this test from hanging when "hg update" erroneously prompts the
-# user for "keep or delete"
-echo % should abort
-hg update -y 1
-mv c a
-echo % should succeed
-hg update -y 1
-
-exit 0
--- a/tests/test-merge5.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-removing b
-created new head
-% should abort
-abort: crosses branches (use 'hg merge' to merge or use 'hg update -C' to discard changes)
-% should succeed
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-merge5.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,37 @@
+  $ hg init
+  $ echo This is file a1 > a
+  $ echo This is file b1 > b
+  $ hg add a b
+  $ hg commit -m "commit #0"
+  $ echo This is file b22 > b
+  $ hg commit -m "comment #1"
+  $ hg update 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm b
+  $ hg commit -A -m "comment #2"
+  removing b
+  created new head
+  $ hg update 1
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg update
+  abort: crosses branches (use 'hg merge' or use 'hg update -c')
+  [255]
+  $ hg update -c
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ mv a c
+
+In theory, we shouldn't need the "-y" below, but it prevents this test
+from hanging when "hg update" erroneously prompts the user for "keep
+or delete".
+
+Should abort:
+
+  $ hg update -y 1
+  abort: crosses branches (use 'hg merge' to merge or use 'hg update -C' to discard changes)
+  [255]
+  $ mv c a
+
+Should succeed:
+
+  $ hg update -y 1
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
--- a/tests/test-merge6	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-#!/bin/sh
-
-cat <<EOF > merge
-import sys, os
-print "merging for", os.path.basename(sys.argv[1])
-EOF
-HGMERGE="python ../merge"; export HGMERGE
-
-mkdir A1
-cd A1
-hg init
-echo This is file foo1 > foo
-echo This is file bar1 > bar
-hg add foo bar
-hg commit -m "commit text" -d "1000000 0"
-
-cd ..
-hg clone A1 B1
-
-cd A1
-rm bar
-hg remove bar
-hg commit -m "commit test" -d "1000000 0"
-
-cd ../B1
-echo This is file foo22 > foo
-hg commit -m "commit test" -d "1000000 0"
-
-cd ..
-hg clone A1 A2
-hg clone B1 B2
-
-cd A1
-hg pull ../B1
-hg merge
-hg commit -m "commit test" -d "1000000 0"
-echo bar should remain deleted.
-hg manifest --debug
-
-cd ../B2
-hg pull ../A2
-hg merge
-hg commit -m "commit test" -d "1000000 0"
-echo bar should remain deleted.
-hg manifest --debug
--- a/tests/test-merge6.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-updating to branch default
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-updating to branch default
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-pulling from ../B1
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files (+1 heads)
-(run 'hg heads' to see heads, 'hg merge' to merge)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-bar should remain deleted.
-f9b0e817f6a48de3564c6b2957687c5e7297c5a0 644   foo
-pulling from ../A2
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 0 changes to 0 files (+1 heads)
-(run 'hg heads' to see heads, 'hg merge' to merge)
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-bar should remain deleted.
-f9b0e817f6a48de3564c6b2957687c5e7297c5a0 644   foo
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-merge6.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,69 @@
+  $ cat <<EOF > merge
+  > import sys, os
+  > print "merging for", os.path.basename(sys.argv[1])
+  > EOF
+  $ HGMERGE="python ../merge"; export HGMERGE
+
+  $ mkdir A1
+  $ cd A1
+  $ hg init
+  $ echo This is file foo1 > foo
+  $ echo This is file bar1 > bar
+  $ hg add foo bar
+  $ hg commit -m "commit text"
+
+  $ cd ..
+  $ hg clone A1 B1
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ cd A1
+  $ rm bar
+  $ hg remove bar
+  $ hg commit -m "commit test"
+
+  $ cd ../B1
+  $ echo This is file foo22 > foo
+  $ hg commit -m "commit test"
+
+  $ cd ..
+  $ hg clone A1 A2
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg clone B1 B2
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ cd A1
+  $ hg pull ../B1
+  pulling from ../B1
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files (+1 heads)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+  $ hg merge
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg commit -m "commit test"
+bar should remain deleted.
+  $ hg manifest --debug
+  f9b0e817f6a48de3564c6b2957687c5e7297c5a0 644   foo
+
+  $ cd ../B2
+  $ hg pull ../A2
+  pulling from ../A2
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 0 changes to 0 files (+1 heads)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+  $ hg merge
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg commit -m "commit test"
+bar should remain deleted.
+  $ hg manifest --debug
+  f9b0e817f6a48de3564c6b2957687c5e7297c5a0 644   foo
--- a/tests/test-merge7	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-#!/bin/sh
-
-# initial
-hg init test-a
-cd test-a
-cat >test.txt <<"EOF"
-1
-2
-3
-EOF
-hg add test.txt
-hg commit -m "Initial" -d "1000000 0"
-
-# clone
-cd ..
-hg clone test-a test-b
-
-# change test-a
-cd test-a
-cat >test.txt <<"EOF"
-one
-two
-three
-EOF
-hg commit -m "Numbers as words" -d "1000000 0"
-
-# change test-b
-cd ../test-b
-cat >test.txt <<"EOF"
-1
-2.5
-3
-EOF
-hg commit -m "2 -> 2.5" -d "1000000 0"
-
-# now pull and merge from test-a
-hg pull ../test-a
-hg merge
-# resolve conflict
-cat >test.txt <<"EOF"
-one
-two-point-five
-three
-EOF
-rm -f *.orig
-hg resolve -m test.txt
-hg commit -m "Merge 1" -d "1000000 0"
-
-# change test-a again
-cd ../test-a
-cat >test.txt <<"EOF"
-one
-two-point-one
-three
-EOF
-hg commit -m "two -> two-point-one" -d "1000000 0"
-
-# pull and merge from test-a again
-cd ../test-b
-hg pull ../test-a
-hg merge --debug
-
-cat test.txt
-
-hg debugindex .hg/store/data/test.txt.i
-
-hg log
--- a/tests/test-merge7.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-pulling from ../test-a
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files (+1 heads)
-(run 'hg heads' to see heads, 'hg merge' to merge)
-merging test.txt
-warning: conflicts during merge.
-merging test.txt failed!
-0 files updated, 0 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
-pulling from ../test-a
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files (+1 heads)
-(run 'hg heads' to see heads, 'hg merge' to merge)
-  searching for copies back to rev 1
-resolving manifests
- overwrite None partial False
- ancestor faaea63e63a9 local 451c744aabcc+ remote a070d41e8360
- test.txt: versions differ -> m
-preserving test.txt for resolve of test.txt
-updating: test.txt 1/1 files (100.00%)
-picked tool 'internal:merge' for test.txt (binary False symlink False)
-merging test.txt
-my test.txt@451c744aabcc+ other test.txt@a070d41e8360 ancestor test.txt@faaea63e63a9
-warning: conflicts during merge.
-merging test.txt failed!
-0 files updated, 0 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
-one
-<<<<<<< local
-two-point-five
-=======
-two-point-one
->>>>>>> other
-three
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0       7      0       0 01365c4cca56 000000000000 000000000000
-     1         7       9      1       1 7b013192566a 01365c4cca56 000000000000
-     2        16      15      2       2 8fe46a3eb557 01365c4cca56 000000000000
-     3        31      27      2       3 fc3148072371 7b013192566a 8fe46a3eb557
-     4        58      25      4       4 d40249267ae3 8fe46a3eb557 000000000000
-changeset:   4:a070d41e8360
-tag:         tip
-parent:      2:faaea63e63a9
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     two -> two-point-one
-
-changeset:   3:451c744aabcc
-parent:      1:e409be6afcc0
-parent:      2:faaea63e63a9
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     Merge 1
-
-changeset:   2:faaea63e63a9
-parent:      0:095c92b91f1a
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     Numbers as words
-
-changeset:   1:e409be6afcc0
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     2 -> 2.5
-
-changeset:   0:095c92b91f1a
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     Initial
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-merge7.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,145 @@
+initial
+  $ hg init test-a
+  $ cd test-a
+  $ cat >test.txt <<"EOF"
+  > 1
+  > 2
+  > 3
+  > EOF
+  $ hg add test.txt
+  $ hg commit -m "Initial"
+
+clone
+  $ cd ..
+  $ hg clone test-a test-b
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+change test-a
+  $ cd test-a
+  $ cat >test.txt <<"EOF"
+  > one
+  > two
+  > three
+  > EOF
+  $ hg commit -m "Numbers as words"
+
+change test-b
+  $ cd ../test-b
+  $ cat >test.txt <<"EOF"
+  > 1
+  > 2.5
+  > 3
+  > EOF
+  $ hg commit -m "2 -> 2.5"
+
+now pull and merge from test-a
+  $ hg pull ../test-a
+  pulling from ../test-a
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files (+1 heads)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+  $ hg merge
+  merging test.txt
+  warning: conflicts during merge.
+  merging test.txt failed!
+  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
+  [1]
+resolve conflict
+  $ cat >test.txt <<"EOF"
+  > one
+  > two-point-five
+  > three
+  > EOF
+  $ rm -f *.orig
+  $ hg resolve -m test.txt
+  $ hg commit -m "Merge 1"
+
+change test-a again
+  $ cd ../test-a
+  $ cat >test.txt <<"EOF"
+  > one
+  > two-point-one
+  > three
+  > EOF
+  $ hg commit -m "two -> two-point-one"
+
+pull and merge from test-a again
+  $ cd ../test-b
+  $ hg pull ../test-a
+  pulling from ../test-a
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files (+1 heads)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+  $ hg merge --debug
+    searching for copies back to rev 1
+  resolving manifests
+   overwrite None partial False
+   ancestor 96b70246a118 local 50c3a7e29886+ remote 40d11a4173a8
+   test.txt: versions differ -> m
+  preserving test.txt for resolve of test.txt
+  updating: test.txt 1/1 files (100.00%)
+  picked tool 'internal:merge' for test.txt (binary False symlink False)
+  merging test.txt
+  my test.txt@50c3a7e29886+ other test.txt@40d11a4173a8 ancestor test.txt@96b70246a118
+  warning: conflicts during merge.
+  merging test.txt failed!
+  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
+  [1]
+
+  $ cat test.txt
+  one
+  <<<<<<< local
+  two-point-five
+  =======
+  two-point-one
+  >>>>>>> other
+  three
+
+  $ hg debugindex .hg/store/data/test.txt.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0       7      0       0 01365c4cca56 000000000000 000000000000
+       1         7       9      1       1 7b013192566a 01365c4cca56 000000000000
+       2        16      15      2       2 8fe46a3eb557 01365c4cca56 000000000000
+       3        31      27      2       3 fc3148072371 7b013192566a 8fe46a3eb557
+       4        58      25      4       4 d40249267ae3 8fe46a3eb557 000000000000
+
+  $ hg log
+  changeset:   4:40d11a4173a8
+  tag:         tip
+  parent:      2:96b70246a118
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     two -> two-point-one
+  
+  changeset:   3:50c3a7e29886
+  parent:      1:d1e159716d41
+  parent:      2:96b70246a118
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     Merge 1
+  
+  changeset:   2:96b70246a118
+  parent:      0:b1832b9d912a
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     Numbers as words
+  
+  changeset:   1:d1e159716d41
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     2 -> 2.5
+  
+  changeset:   0:b1832b9d912a
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     Initial
+  
--- a/tests/test-merge8	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-#!/bin/sh
-
-# Test for changeset ba7c74081861
-# (update dirstate correctly for non-branchmerge updates)
-hg init a
-cd a
-echo a > a
-hg add a
-hg commit -m a
-cd ..
-hg clone a b
-cd a
-hg mv a b
-hg commit -m move
-echo b >> b
-hg commit -m b
-cd ../b
-hg pull ../a
-hg update
--- a/tests/test-merge8.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-pulling from ../a
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 2 changes to 1 files
-(run 'hg update' to get a working copy)
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-merge8.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,27 @@
+Test for changeset ba7c74081861
+(update dirstate correctly for non-branchmerge updates)
+  $ hg init a
+  $ cd a
+  $ echo a > a
+  $ hg add a
+  $ hg commit -m a
+  $ cd ..
+  $ hg clone a b
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd a
+  $ hg mv a b
+  $ hg commit -m move
+  $ echo b >> b
+  $ hg commit -m b
+  $ cd ../b
+  $ hg pull ../a
+  pulling from ../a
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 1 files
+  (run 'hg update' to get a working copy)
+  $ hg update
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
--- a/tests/test-merge9	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-#!/bin/sh
-
-# test that we don't interrupt the merge session if
-# a file-level merge failed
-
-hg init repo
-cd repo
-
-echo foo > foo
-echo a > bar
-hg ci -Am 'add foo'
-
-hg mv foo baz
-echo b >> bar
-echo quux > quux1
-hg ci -Am 'mv foo baz'
-
-hg up -qC 0
-echo >> foo
-echo c >> bar
-echo quux > quux2
-hg ci -Am 'change foo'
-
-# test with the rename on the remote side
-HGMERGE=false hg merge
-hg resolve -l
-
-# test with the rename on the local side
-hg up -C 1
-HGMERGE=false hg merge
-
-echo % show unresolved
-hg resolve -l
-
-echo % unmark baz
-hg resolve -u baz
-
-echo % show
-hg resolve -l
-hg st
-
-echo % re-resolve baz
-hg resolve baz
-
-echo % after
-hg resolve -l
-
-echo % resolve all warning
-hg resolve
-
-echo % resolve all
-hg resolve -a
-
-echo % after
-hg resolve -l
-
-true
--- a/tests/test-merge9.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-adding bar
-adding foo
-adding quux1
-adding quux2
-created new head
-merging bar
-merging bar failed!
-merging foo and baz to baz
-1 files updated, 1 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
-U bar
-R baz
-3 files updated, 0 files merged, 1 files removed, 0 files unresolved
-merging bar
-merging bar failed!
-merging baz and foo to baz
-1 files updated, 1 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
-% show unresolved
-U bar
-R baz
-% unmark baz
-% show
-U bar
-U baz
-M bar
-M baz
-M quux2
-? bar.orig
-% re-resolve baz
-merging baz and foo to baz
-% after
-U bar
-R baz
-% resolve all warning
-abort: no files or directories specified; use --all to remerge all files
-% resolve all
-merging bar
-warning: conflicts during merge.
-merging bar failed!
-% after
-U bar
-R baz
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-merge9.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,92 @@
+test that we don't interrupt the merge session if
+a file-level merge failed
+
+  $ hg init repo
+  $ cd repo
+
+  $ echo foo > foo
+  $ echo a > bar
+  $ hg ci -Am 'add foo'
+  adding bar
+  adding foo
+
+  $ hg mv foo baz
+  $ echo b >> bar
+  $ echo quux > quux1
+  $ hg ci -Am 'mv foo baz'
+  adding quux1
+
+  $ hg up -qC 0
+  $ echo >> foo
+  $ echo c >> bar
+  $ echo quux > quux2
+  $ hg ci -Am 'change foo'
+  adding quux2
+  created new head
+
+test with the rename on the remote side
+  $ HGMERGE=false hg merge
+  merging bar
+  merging bar failed!
+  merging foo and baz to baz
+  1 files updated, 1 files merged, 0 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
+  [1]
+  $ hg resolve -l
+  U bar
+  R baz
+
+test with the rename on the local side
+  $ hg up -C 1
+  3 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ HGMERGE=false hg merge
+  merging bar
+  merging bar failed!
+  merging baz and foo to baz
+  1 files updated, 1 files merged, 0 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
+  [1]
+
+show unresolved
+  $ hg resolve -l
+  U bar
+  R baz
+
+unmark baz
+  $ hg resolve -u baz
+
+show
+  $ hg resolve -l
+  U bar
+  U baz
+  $ hg st
+  M bar
+  M baz
+  M quux2
+  ? bar.orig
+
+re-resolve baz
+  $ hg resolve baz
+  merging baz and foo to baz
+
+after resolve
+  $ hg resolve -l
+  U bar
+  R baz
+
+resolve all warning
+  $ hg resolve
+  abort: no files or directories specified; use --all to remerge all files
+  [255]
+
+resolve all
+  $ hg resolve -a
+  merging bar
+  warning: conflicts during merge.
+  merging bar failed!
+  [1]
+
+after
+  $ hg resolve -l
+  U bar
+  R baz
--- a/tests/test-mq	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,642 +0,0 @@
-#!/bin/sh
-
-. $TESTDIR/helpers.sh
-
-checkundo()
-{
-    if [ -f .hg/store/undo ]; then
-	echo ".hg/store/undo still exists after $1"
-    fi
-}
-
-echo "[extensions]" >> $HGRCPATH
-echo "mq=" >> $HGRCPATH
-
-echo "[mq]" >> $HGRCPATH
-echo "plain=true" >> $HGRCPATH
-
-echo % help
-hg help mq
-
-hg init a
-cd a
-echo a > a
-hg ci -Ama
-
-hg clone . ../k
-
-mkdir b
-echo z > b/z
-hg ci -Ama
-
-echo % qinit
-
-hg qinit
-
-cd ..
-hg init b
-
-echo % -R qinit
-
-hg -R b qinit
-
-hg init c
-
-echo % qinit -c
-
-hg --cwd c qinit -c
-hg -R c/.hg/patches st
-
-echo '% qinit; qinit -c'
-hg init d
-cd d
-hg qinit
-hg qinit -c
-# qinit -c should create both files if they don't exist
-echo '  .hgignore:'
-cat .hg/patches/.hgignore
-echo '  series:'
-cat .hg/patches/series
-hg qinit -c 2>&1 | sed -e 's/repository.*already/repository already/'
-cd ..
-
-echo '% qinit; <stuff>; qinit -c'
-hg init e
-cd e
-hg qnew A
-checkundo qnew
-echo foo > foo
-hg add foo
-hg qrefresh
-hg qnew B
-echo >> foo
-hg qrefresh
-echo status >> .hg/patches/.hgignore
-echo bleh >> .hg/patches/.hgignore
-hg qinit -c
-hg -R .hg/patches status
-# qinit -c shouldn't touch these files if they already exist
-echo '  .hgignore:'
-cat .hg/patches/.hgignore
-echo '  series:'
-cat .hg/patches/series
-
-echo '% status --mq with color (issue2096)'
-hg status --mq --config extensions.color= --color=always
-cd ..
-
-echo '% init --mq without repo'
-mkdir f
-cd f
-hg init --mq
-cd ..
-
-echo '% init --mq with repo path'
-hg init g
-hg init --mq g
-test -d g/.hg/patches/.hg && echo "ok" || echo "failed"
-
-echo '% init --mq with nonexistent directory'
-hg init --mq nonexistentdir
-
-echo '% init --mq with bundle (non "local")'
-hg -R a bundle --all a.bundle >/dev/null
-hg init --mq a.bundle
-
-cd a
-
-hg qnew -m 'foo bar' test.patch
-
-echo '# comment' > .hg/patches/series.tmp
-echo >> .hg/patches/series.tmp # empty line
-cat .hg/patches/series >> .hg/patches/series.tmp
-mv .hg/patches/series.tmp .hg/patches/series
-
-echo % qrefresh
-
-echo a >> a
-hg qrefresh
-sed -e "s/^\(diff -r \)\([a-f0-9]* \)/\1 x/" \
-    -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
-    -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" .hg/patches/test.patch
-
-echo % empty qrefresh
-
-hg qrefresh -X a
-echo 'revision:'
-hg diff -r -2 -r -1
-echo 'patch:'
-cat .hg/patches/test.patch
-echo 'working dir diff:'
-hg diff --nodates -q
-# restore things
-hg qrefresh
-checkundo qrefresh
-
-echo % qpop
-
-hg qpop
-checkundo qpop
-
-echo % qpush with dump of tag cache
-
-# Dump the tag cache to ensure that it has exactly one head after qpush.
-rm -f .hg/tags.cache
-hg tags > /dev/null
-echo ".hg/tags.cache (pre qpush):"
-sed 's/ [0-9a-f]*//' .hg/tags.cache
-hg qpush
-hg tags > /dev/null
-echo ".hg/tags.cache (post qpush):"
-sed 's/ [0-9a-f]*//' .hg/tags.cache
-
-checkundo qpush
-
-cd ..
-
-echo % pop/push outside repo
-
-hg -R a qpop
-hg -R a qpush
-
-cd a
-hg qnew test2.patch
-
-echo % qrefresh in subdir
-
-cd b
-echo a > a
-hg add a
-hg qrefresh
-
-echo % pop/push -a in subdir
-
-hg qpop -a
-hg --traceback qpush -a
-
-# setting columns & formatted tests truncating (issue1912)
-echo % qseries
-COLUMNS=4 hg qseries --config ui.formatted=true
-COLUMNS=20 hg qseries --config ui.formatted=true -vs
-hg qpop
-hg qseries -vs
-hg sum | grep mq
-hg qpush
-hg sum | grep mq
-
-echo % qapplied
-hg qapplied
-
-echo % qtop
-hg qtop
-
-echo % prev
-hg qapp -1
-
-echo % next
-hg qunapp -1
-
-hg qpop
-echo % commit should fail
-hg commit
-
-echo % push should fail
-hg push ../../k
-
-echo % import should fail
-hg st .
-echo foo >> ../a
-hg diff > ../../import.diff
-hg revert --no-backup ../a
-hg import ../../import.diff
-hg st
-echo % import --no-commit should succeed
-hg import --no-commit ../../import.diff
-hg st
-hg revert --no-backup ../a
-
-echo % qunapplied
-hg qunapplied
-
-echo % qpush/qpop with index
-hg qnew test1b.patch
-echo 1b > 1b
-hg add 1b
-hg qrefresh
-hg qpush 2
-hg qpop 0
-hg qpush test.patch+1
-hg qpush test.patch+2
-hg qpop test2.patch-1
-hg qpop test2.patch-2
-hg qpush test1b.patch+1
-
-echo % qpush --move
-hg qpop -a
-hg qguard test1b.patch -- -negguard
-hg qguard test2.patch -- +posguard
-hg qpush --move test2.patch # can't move guarded patch
-hg qselect posguard
-hg qpush --move test2.patch # move to front
-hg qpush --move test1b.patch # negative guard unselected
-hg qpush --move test.patch # noop move
-hg qseries -v
-hg qpop -a
-# cleaning up
-hg qselect --none
-hg qguard --none test1b.patch
-hg qguard --none test2.patch
-hg qpush --move test.patch
-hg qpush --move test1b.patch
-hg qpush --move bogus # nonexistent patch
-hg qpush --move # no patch
-hg qpush --move test.patch # already applied
-hg qpush
-
-echo % series after move
-cat `hg root`/.hg/patches/series
-
-echo % pop, qapplied, qunapplied
-hg qseries -v
-echo % qapplied -1 test.patch
-hg qapplied -1 test.patch
-echo % qapplied -1 test1b.patch
-hg qapplied -1 test1b.patch
-echo % qapplied -1 test2.patch
-hg qapplied -1 test2.patch
-echo % qapplied -1
-hg qapplied -1
-echo % qapplied
-hg qapplied
-echo % qapplied test1b.patch
-hg qapplied test1b.patch
-echo % qunapplied -1
-hg qunapplied -1
-echo % qunapplied
-hg qunapplied
-echo % popping
-hg qpop
-echo % qunapplied -1
-hg qunapplied -1
-echo % qunapplied
-hg qunapplied
-echo % qunapplied test2.patch
-hg qunapplied test2.patch
-echo % qunapplied -1 test2.patch
-hg qunapplied -1 test2.patch
-echo % popping -a
-hg qpop -a
-echo % qapplied
-hg qapplied
-echo % qapplied -1
-hg qapplied -1
-hg qpush
-
-echo % push should succeed
-hg qpop -a
-hg push ../../k
-
-echo % qpush/qpop error codes
-errorcode()
-{
-    hg "$@" && echo "  $@ succeeds" || echo "  $@ fails"
-}
-
-# we want to start with some patches applied
-hg qpush -a
-echo "  % pops all patches and succeeds"
-errorcode qpop -a
-echo "  % does nothing and succeeds"
-errorcode qpop -a
-echo "  % fails - nothing else to pop"
-errorcode qpop
-echo "  % pushes a patch and succeeds"
-errorcode qpush
-echo "  % pops a patch and succeeds"
-errorcode qpop
-echo "  % pushes up to test1b.patch and succeeds"
-errorcode qpush test1b.patch
-echo "  % does nothing and succeeds"
-errorcode qpush test1b.patch
-echo "  % does nothing and succeeds"
-errorcode qpop test1b.patch
-echo "  % fails - can't push to this patch"
-errorcode qpush test.patch
-echo "  % fails - can't pop to this patch"
-errorcode qpop test2.patch
-echo "  % pops up to test.patch and succeeds"
-errorcode qpop test.patch
-echo "  % pushes all patches and succeeds"
-errorcode qpush -a
-echo "  % does nothing and succeeds"
-errorcode qpush -a
-echo "  % fails - nothing else to push"
-errorcode qpush
-echo "  % does nothing and succeeds"
-errorcode qpush test2.patch
-
-
-echo % strip
-cd ../../b
-echo x>x
-hg ci -Ama
-hg strip tip | hidebackup
-hg unbundle .hg/strip-backup/*
-
-echo % strip with local changes, should complain
-hg up
-echo y>y
-hg add y
-hg strip tip | hidebackup
-echo % --force strip with local changes
-hg strip -f tip | hidebackup
-
-echo '% cd b; hg qrefresh'
-hg init refresh
-cd refresh
-echo a > a
-hg ci -Ama
-hg qnew -mfoo foo
-echo a >> a
-hg qrefresh
-mkdir b
-cd b
-echo f > f
-hg add f
-hg qrefresh
-sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
-    -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" ../.hg/patches/foo
-echo % hg qrefresh .
-hg qrefresh .
-sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
-    -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" ../.hg/patches/foo
-hg status
-
-echo % qpush failure
-cd ..
-hg qrefresh
-hg qnew -mbar bar
-echo foo > foo
-echo bar > bar
-hg add foo bar
-hg qrefresh
-hg qpop -a
-echo bar > foo
-hg qpush -a
-hg st
-
-echo % mq tags
-hg log --template '{rev} {tags}\n' -r qparent:qtip
-
-echo % bad node in status
-hg qpop
-hg strip -qn tip
-hg tip 2>&1 | sed -e 's/unknown node .*/unknown node/'
-hg branches 2>&1 | sed -e 's/unknown node .*/unknown node/'
-hg qpop 2>&1 | sed -e 's/unknown node .*/unknown node/'
-
-cat >>$HGRCPATH <<EOF
-[diff]
-git = True
-EOF
-cd ..
-hg init git
-cd git
-hg qinit
-
-hg qnew -m'new file' new
-echo foo > new
-chmod +x new
-hg add new
-hg qrefresh
-sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
-    -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" .hg/patches/new
-
-hg qnew -m'copy file' copy
-hg cp new copy
-hg qrefresh
-sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
-    -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" .hg/patches/copy
-
-hg qpop
-hg qpush
-hg qdiff
-cat >>$HGRCPATH <<EOF
-[diff]
-git = False
-EOF
-hg qdiff --git
-cd ..
-
-echo % test file addition in slow path
-hg init slow
-cd slow
-hg qinit
-echo foo > foo
-hg add foo
-hg ci -m 'add foo'
-hg qnew bar
-echo bar > bar
-hg add bar
-hg mv foo baz
-hg qrefresh --git
-hg up -C 0
-echo >> foo
-hg ci -m 'change foo'
-hg up -C 1
-hg qrefresh --git 2>&1 | grep -v 'saving bundle'
-cat .hg/patches/bar
-hg log -v --template '{rev} {file_copies}\n' -r .
-hg qrefresh --git
-cat .hg/patches/bar
-hg log -v --template '{rev} {file_copies}\n' -r .
-hg qrefresh
-grep 'diff --git' .hg/patches/bar
-
-echo % test file move chains in the slow path
-hg up -C 1
-echo >> foo
-hg ci -m 'change foo again'
-hg up -C 2
-hg mv bar quux
-hg mv baz bleh
-hg qrefresh --git 2>&1 | grep -v 'saving bundle'
-cat .hg/patches/bar
-hg log -v --template '{rev} {file_copies}\n' -r .
-hg mv quux fred
-hg mv bleh barney
-hg qrefresh --git
-cat .hg/patches/bar
-hg log -v --template '{rev} {file_copies}\n' -r .
-
-echo % refresh omitting an added file
-hg qnew baz
-echo newfile > newfile
-hg add newfile
-hg qrefresh
-hg st -A newfile
-hg qrefresh -X newfile
-hg st -A newfile
-hg revert newfile
-rm newfile
-hg qpop
-hg qdel baz
-
-echo % create a git patch
-echo a > alexander
-hg add alexander
-hg qnew -f --git addalexander
-grep diff .hg/patches/addalexander
-
-echo % create a git binary patch
-cat > writebin.py <<EOF
-import sys
-path = sys.argv[1]
-open(path, 'wb').write('BIN\x00ARY')
-EOF
-python writebin.py bucephalus
-
-python "$TESTDIR/md5sum.py" bucephalus
-hg add bucephalus
-hg qnew -f --git addbucephalus
-grep diff .hg/patches/addbucephalus
-
-echo % check binary patches can be popped and pushed
-hg qpop
-test -f bucephalus && echo % bucephalus should not be there
-hg qpush
-test -f bucephalus || echo % bucephalus should be there
-python "$TESTDIR/md5sum.py" bucephalus
-
-
-echo '% strip again'
-cd ..
-hg init strip
-cd strip
-touch foo
-hg add foo
-hg ci -m 'add foo'
-echo >> foo
-hg ci -m 'change foo 1'
-hg up -C 0
-echo 1 >> foo
-hg ci -m 'change foo 2'
-HGMERGE=true hg merge
-hg ci -m merge
-hg log
-hg strip 1 | hidebackup
-checkundo strip
-hg log
-cd ..
-
-echo '% qclone'
-qlog()
-{
-    echo 'main repo:'
-    hg log --template '    rev {rev}: {desc}\n'
-    echo 'patch repo:'
-    hg -R .hg/patches log --template '    rev {rev}: {desc}\n'
-}
-hg init qclonesource
-cd qclonesource
-echo foo > foo
-hg add foo
-hg ci -m 'add foo'
-hg qinit
-hg qnew patch1
-echo bar >> foo
-hg qrefresh -m 'change foo'
-cd ..
-
-# repo with unversioned patch dir
-hg qclone qclonesource failure
-
-cd qclonesource
-hg qinit -c
-hg qci -m checkpoint
-qlog
-cd ..
-
-# repo with patches applied
-hg qclone qclonesource qclonedest
-cd qclonedest
-qlog
-cd ..
-
-# repo with patches unapplied
-cd qclonesource
-hg qpop -a
-qlog
-cd ..
-hg qclone qclonesource qclonedest2
-cd qclonedest2
-qlog
-cd ..
-
-echo % 'test applying on an empty file (issue 1033)'
-hg init empty
-cd empty
-touch a
-hg ci -Am addempty
-echo a > a
-hg qnew -f -e changea
-hg qpop
-hg qpush
-cd ..
-
-echo % test qpush with --force, issue1087
-hg init forcepush
-cd forcepush
-echo hello > hello.txt
-echo bye > bye.txt
-hg ci -Ama
-hg qnew -d '0 0' empty
-hg qpop
-echo world >> hello.txt
-
-echo % qpush should fail, local changes
-hg qpush
-
-echo % apply force, should not discard changes with empty patch
-hg qpush -f 2>&1 | sed 's,^.*/patch,patch,g'
-hg diff --config diff.nodates=True
-hg qdiff --config diff.nodates=True
-hg log -l1 -p
-hg qref -d '0 0'
-hg qpop
-echo universe >> hello.txt
-echo universe >> bye.txt
-
-echo % qpush should fail, local changes
-hg qpush
-
-echo % apply force, should discard changes in hello, but not bye
-hg qpush -f
-hg st
-hg diff --config diff.nodates=True
-hg qdiff --config diff.nodates=True
-
-echo % test popping revisions not in working dir ancestry
-hg qseries -v
-hg up qparent
-hg qpop
-
-cd ..
-hg init deletion-order
-cd deletion-order
-
-touch a
-hg ci -Aqm0
-
-hg qnew rename-dir
-hg rm a
-hg qrefresh
-
-mkdir a b
-touch a/a b/b
-hg add -q a b
-hg qrefresh
-
-echo % test popping must remove files added in subdirectories first
-hg qpop
-cd ..
--- a/tests/test-mq-caches	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-#!/bin/sh
-
-branches=.hg/branchheads.cache
-echo '[extensions]' >> $HGRCPATH
-echo 'mq =' >> $HGRCPATH
-
-show_branch_cache()
-{
-    # force cache (re)generation
-    hg log -r does-not-exist 2> /dev/null
-    hg log -r tip --template 'tip: {rev}\n'
-    if [ -f $branches ]; then
-	sort $branches
-    else
-	echo No branch cache
-    fi
-    if [ "$1" = 1 ]; then
-	for b in foo bar; do
-	    hg log -r $b --template "branch $b: "'{rev}\n'
-	done
-    fi
-}
-
-hg init a
-cd a
-hg qinit -c
-
-echo '# mq patch on an empty repo'
-hg qnew p1
-show_branch_cache
-
-echo > pfile
-hg add pfile
-hg qrefresh -m 'patch 1'
-show_branch_cache
-
-echo
-echo '# some regular revisions'
-hg qpop
-echo foo > foo
-hg add foo
-echo foo > .hg/branch
-hg ci -m 'branch foo' -d '1000000 0'
-
-echo bar > bar
-hg add bar
-echo bar > .hg/branch
-hg ci -m 'branch bar' -d '1000000 0'
-show_branch_cache
-
-echo
-echo '# add some mq patches'
-hg qpush
-show_branch_cache
-
-hg qnew p2
-echo foo > .hg/branch
-echo foo2 >> foo
-hg qrefresh -m 'patch 2'
-show_branch_cache 1
-
-echo
-echo '# removing the cache'
-rm $branches
-show_branch_cache 1
-
-echo
-echo '# importing rev 1 (the cache now ends in one of the patches)'
-hg qimport -r 1 -n p0
-show_branch_cache 1
-hg log -r qbase --template 'qbase: {rev}\n'
-
-echo
-echo '# detect an invalid cache'
-hg qpop -a
-hg qpush -a
-show_branch_cache
-
--- a/tests/test-mq-caches.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-# mq patch on an empty repo
-tip: 0
-No branch cache
-tip: 0
-No branch cache
-
-# some regular revisions
-popping p1
-patch queue now empty
-tip: 1
-3f910abad313ff802d3a23a7529433872df9b3ae 1
-3f910abad313ff802d3a23a7529433872df9b3ae bar
-9539f35bdc80732cc9a3f84e46508f1ed1ec8cff foo
-
-# add some mq patches
-applying p1
-now at: p1
-tip: 2
-3f910abad313ff802d3a23a7529433872df9b3ae 1
-3f910abad313ff802d3a23a7529433872df9b3ae bar
-9539f35bdc80732cc9a3f84e46508f1ed1ec8cff foo
-tip: 3
-3f910abad313ff802d3a23a7529433872df9b3ae 1
-3f910abad313ff802d3a23a7529433872df9b3ae bar
-9539f35bdc80732cc9a3f84e46508f1ed1ec8cff foo
-branch foo: 3
-branch bar: 2
-
-# removing the cache
-tip: 3
-3f910abad313ff802d3a23a7529433872df9b3ae 1
-3f910abad313ff802d3a23a7529433872df9b3ae bar
-9539f35bdc80732cc9a3f84e46508f1ed1ec8cff foo
-branch foo: 3
-branch bar: 2
-
-# importing rev 1 (the cache now ends in one of the patches)
-tip: 3
-3f910abad313ff802d3a23a7529433872df9b3ae 1
-3f910abad313ff802d3a23a7529433872df9b3ae bar
-9539f35bdc80732cc9a3f84e46508f1ed1ec8cff foo
-branch foo: 3
-branch bar: 2
-qbase: 1
-
-# detect an invalid cache
-popping p2
-popping p1
-popping p0
-patch queue now empty
-applying p0
-applying p1
-applying p2
-now at: p2
-tip: 3
-9539f35bdc80732cc9a3f84e46508f1ed1ec8cff 0
-9539f35bdc80732cc9a3f84e46508f1ed1ec8cff foo
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-mq-caches.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,124 @@
+  $ branches=.hg/branchheads.cache
+  $ echo '[extensions]' >> $HGRCPATH
+  $ echo 'mq =' >> $HGRCPATH
+
+  $ show_branch_cache()
+  > {
+  >     # force cache (re)generation
+  >     hg log -r does-not-exist 2> /dev/null
+  >     hg log -r tip --template 'tip: {rev}\n'
+  >     if [ -f $branches ]; then
+  >       sort $branches
+  >     else
+  >       echo No branch cache
+  >     fi
+  >     if [ "$1" = 1 ]; then
+  >       for b in foo bar; do
+  >         hg log -r $b --template "branch $b: "'{rev}\n'
+  >       done
+  >     fi
+  > }
+
+  $ hg init a
+  $ cd a
+  $ hg qinit -c
+
+
+mq patch on an empty repo
+
+  $ hg qnew p1
+  $ show_branch_cache
+  tip: 0
+  No branch cache
+
+  $ echo > pfile
+  $ hg add pfile
+  $ hg qrefresh -m 'patch 1'
+  $ show_branch_cache
+  tip: 0
+  No branch cache
+
+some regular revisions
+
+  $ hg qpop
+  popping p1
+  patch queue now empty
+  $ echo foo > foo
+  $ hg add foo
+  $ echo foo > .hg/branch
+  $ hg ci -m 'branch foo'
+
+  $ echo bar > bar
+  $ hg add bar
+  $ echo bar > .hg/branch
+  $ hg ci -m 'branch bar'
+  $ show_branch_cache
+  tip: 1
+  c229711f16da3d7591f89b1b8d963b79bda22714 1
+  c229711f16da3d7591f89b1b8d963b79bda22714 bar
+  dc25e3827021582e979f600811852e36cbe57341 foo
+
+add some mq patches
+
+  $ hg qpush
+  applying p1
+  now at: p1
+  $ show_branch_cache
+  tip: 2
+  c229711f16da3d7591f89b1b8d963b79bda22714 1
+  c229711f16da3d7591f89b1b8d963b79bda22714 bar
+  dc25e3827021582e979f600811852e36cbe57341 foo
+
+  $ hg qnew p2
+  $ echo foo > .hg/branch
+  $ echo foo2 >> foo
+  $ hg qrefresh -m 'patch 2'
+  $ show_branch_cache 1
+  tip: 3
+  c229711f16da3d7591f89b1b8d963b79bda22714 1
+  c229711f16da3d7591f89b1b8d963b79bda22714 bar
+  dc25e3827021582e979f600811852e36cbe57341 foo
+  branch foo: 3
+  branch bar: 2
+
+removing the cache
+
+  $ rm $branches
+  $ show_branch_cache 1
+  tip: 3
+  c229711f16da3d7591f89b1b8d963b79bda22714 1
+  c229711f16da3d7591f89b1b8d963b79bda22714 bar
+  dc25e3827021582e979f600811852e36cbe57341 foo
+  branch foo: 3
+  branch bar: 2
+
+importing rev 1 (the cache now ends in one of the patches)
+
+  $ hg qimport -r 1 -n p0
+  $ show_branch_cache 1
+  tip: 3
+  c229711f16da3d7591f89b1b8d963b79bda22714 1
+  c229711f16da3d7591f89b1b8d963b79bda22714 bar
+  dc25e3827021582e979f600811852e36cbe57341 foo
+  branch foo: 3
+  branch bar: 2
+  $ hg log -r qbase --template 'qbase: {rev}\n'
+  qbase: 1
+
+detect an invalid cache
+
+  $ hg qpop -a
+  popping p2
+  popping p1
+  popping p0
+  patch queue now empty
+  $ hg qpush -a
+  applying p0
+  applying p1
+  applying p2
+  now at: p2
+  $ show_branch_cache
+  tip: 3
+  dc25e3827021582e979f600811852e36cbe57341 0
+  dc25e3827021582e979f600811852e36cbe57341 foo
+
--- a/tests/test-mq-eol	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-#!/bin/sh
-
-# Test interactions between mq and patch.eol
-
-echo "[extensions]" >> $HGRCPATH
-echo "mq=" >> $HGRCPATH
-echo "[diff]" >> $HGRCPATH
-echo "nodates=1" >> $HGRCPATH
-
-cat > makepatch.py <<EOF
-f = file('eol.diff', 'wb')
-w = f.write
-w('test message\n')
-w('diff --git a/a b/a\n')
-w('--- a/a\n')
-w('+++ b/a\n')
-w('@@ -1,5 +1,5 @@\n')
-w(' a\n')
-w('-b\r\n')
-w('+y\r\n')
-w(' c\r\n')
-w(' d\n')
-w('-e\n')
-w('\ No newline at end of file\n')
-w('+z\r\n')
-w('\ No newline at end of file\r\n')
-EOF
-
-cat > cateol.py <<EOF
-import sys
-for line in file(sys.argv[1], 'rb'):
-    line = line.replace('\r', '<CR>')
-    line = line.replace('\n', '<LF>')
-    print line
-EOF
-
-hg init repo
-cd repo
-echo '\.diff' > .hgignore
-echo '\.rej' >> .hgignore
-
-# Test different --eol values
-python -c 'file("a", "wb").write("a\nb\nc\nd\ne")'
-hg ci -Am adda
-python ../makepatch.py
-hg qimport eol.diff
-echo % should fail in strict mode
-hg qpush
-hg qpop
-echo % invalid eol
-hg --config patch.eol='LFCR' qpush
-hg qpop
-echo % force LF
-hg --config patch.eol='CRLF' qpush
-hg qrefresh
-python ../cateol.py .hg/patches/eol.diff
-python ../cateol.py a
-hg qpop
-echo % push again forcing LF and compare revisions
-hg --config patch.eol='CRLF' qpush
-python ../cateol.py a
-hg qpop
-echo % push again without LF and compare revisions
-hg qpush
-python ../cateol.py a
-hg qpop
--- a/tests/test-mq-eol.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-adding .hgignore
-adding a
-adding eol.diff to series file
-% should fail in strict mode
-applying eol.diff
-patching file a
-Hunk #1 FAILED at 0
-1 out of 1 hunks FAILED -- saving rejects to file a.rej
-patch failed, unable to continue (try -v)
-patch failed, rejects left in working dir
-errors during apply, please fix and refresh eol.diff
-popping eol.diff
-patch queue now empty
-% invalid eol
-applying eol.diff
-patch failed, unable to continue (try -v)
-patch failed, rejects left in working dir
-errors during apply, please fix and refresh eol.diff
-popping eol.diff
-patch queue now empty
-% force LF
-applying eol.diff
-now at: eol.diff
-test message<LF>
-<LF>
-diff -r 0d0bf99a8b7a a<LF>
---- a/a<LF>
-+++ b/a<LF>
-@@ -1,5 +1,5 @@<LF>
--a<LF>
--b<LF>
--c<LF>
--d<LF>
--e<LF>
-\ No newline at end of file<LF>
-+a<CR><LF>
-+y<CR><LF>
-+c<CR><LF>
-+d<CR><LF>
-+z<LF>
-\ No newline at end of file<LF>
-a<CR><LF>
-y<CR><LF>
-c<CR><LF>
-d<CR><LF>
-z
-popping eol.diff
-patch queue now empty
-% push again forcing LF and compare revisions
-applying eol.diff
-now at: eol.diff
-a<CR><LF>
-y<CR><LF>
-c<CR><LF>
-d<CR><LF>
-z
-popping eol.diff
-patch queue now empty
-% push again without LF and compare revisions
-applying eol.diff
-now at: eol.diff
-a<CR><LF>
-y<CR><LF>
-c<CR><LF>
-d<CR><LF>
-z
-popping eol.diff
-patch queue now empty
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-mq-eol.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,143 @@
+
+Test interactions between mq and patch.eol
+
+
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "mq=" >> $HGRCPATH
+  $ echo "[diff]" >> $HGRCPATH
+  $ echo "nodates=1" >> $HGRCPATH
+
+  $ cat > makepatch.py <<EOF
+  > f = file('eol.diff', 'wb')
+  > w = f.write
+  > w('test message\n')
+  > w('diff --git a/a b/a\n')
+  > w('--- a/a\n')
+  > w('+++ b/a\n')
+  > w('@@ -1,5 +1,5 @@\n')
+  > w(' a\n')
+  > w('-b\r\n')
+  > w('+y\r\n')
+  > w(' c\r\n')
+  > w(' d\n')
+  > w('-e\n')
+  > w('\ No newline at end of file\n')
+  > w('+z\r\n')
+  > w('\ No newline at end of file\r\n')
+  > EOF
+
+  $ cat > cateol.py <<EOF
+  > import sys
+  > for line in file(sys.argv[1], 'rb'):
+  >     line = line.replace('\r', '<CR>')
+  >     line = line.replace('\n', '<LF>')
+  >     print line
+  > EOF
+
+  $ hg init repo
+  $ cd repo
+  $ echo '\.diff' > .hgignore
+  $ echo '\.rej' >> .hgignore
+
+
+Test different --eol values
+
+  $ python -c 'file("a", "wb").write("a\nb\nc\nd\ne")'
+  $ hg ci -Am adda
+  adding .hgignore
+  adding a
+  $ python ../makepatch.py
+  $ hg qimport eol.diff
+  adding eol.diff to series file
+
+should fail in strict mode
+
+  $ hg qpush
+  applying eol.diff
+  patching file a
+  Hunk #1 FAILED at 0
+  1 out of 1 hunks FAILED -- saving rejects to file a.rej
+  patch failed, unable to continue (try -v)
+  patch failed, rejects left in working dir
+  errors during apply, please fix and refresh eol.diff
+  [2]
+  $ hg qpop
+  popping eol.diff
+  patch queue now empty
+
+invalid eol
+
+  $ hg --config patch.eol='LFCR' qpush
+  applying eol.diff
+  patch failed, unable to continue (try -v)
+  patch failed, rejects left in working dir
+  errors during apply, please fix and refresh eol.diff
+  [2]
+  $ hg qpop
+  popping eol.diff
+  patch queue now empty
+
+force LF
+
+  $ hg --config patch.eol='CRLF' qpush
+  applying eol.diff
+  now at: eol.diff
+  $ hg qrefresh
+  $ python ../cateol.py .hg/patches/eol.diff
+  test message<LF>
+  <LF>
+  diff -r 0d0bf99a8b7a a<LF>
+  --- a/a<LF>
+  +++ b/a<LF>
+  @@ -1,5 +1,5 @@<LF>
+  -a<LF>
+  -b<LF>
+  -c<LF>
+  -d<LF>
+  -e<LF>
+  \ No newline at end of file<LF>
+  +a<CR><LF>
+  +y<CR><LF>
+  +c<CR><LF>
+  +d<CR><LF>
+  +z<LF>
+  \ No newline at end of file<LF>
+  $ python ../cateol.py a
+  a<CR><LF>
+  y<CR><LF>
+  c<CR><LF>
+  d<CR><LF>
+  z
+  $ hg qpop
+  popping eol.diff
+  patch queue now empty
+
+push again forcing LF and compare revisions
+
+  $ hg --config patch.eol='CRLF' qpush
+  applying eol.diff
+  now at: eol.diff
+  $ python ../cateol.py a
+  a<CR><LF>
+  y<CR><LF>
+  c<CR><LF>
+  d<CR><LF>
+  z
+  $ hg qpop
+  popping eol.diff
+  patch queue now empty
+
+push again without LF and compare revisions
+
+  $ hg qpush
+  applying eol.diff
+  now at: eol.diff
+  $ python ../cateol.py a
+  a<CR><LF>
+  y<CR><LF>
+  c<CR><LF>
+  d<CR><LF>
+  z
+  $ hg qpop
+  popping eol.diff
+  patch queue now empty
--- a/tests/test-mq-git	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-#!/bin/sh
-
-# Test the plumbing of mq.git option
-# Automatic upgrade itself is tested elsewhere.
-
-echo "[extensions]" >> $HGRCPATH
-echo "mq=" >> $HGRCPATH
-echo "[diff]" >> $HGRCPATH
-echo "nodates=1" >> $HGRCPATH
-
-hg init repo-auto
-cd repo-auto
-echo '% git=auto: regular patch creation'
-echo a > a
-hg add a
-hg qnew -d '0 0' -f adda
-cat .hg/patches/adda
-echo '% git=auto: git patch creation with copy'
-hg cp a b
-hg qnew -d '0 0' -f copy
-cat .hg/patches/copy
-echo '% git=auto: git patch when using --git'
-echo regular > regular
-hg add regular
-hg qnew -d '0 0' --git -f git
-cat .hg/patches/git
-echo '% git=auto: regular patch after qrefresh without --git'
-hg qrefresh -d '0 0'
-cat .hg/patches/git
-cd ..
-
-hg init repo-keep
-cd repo-keep
-echo '[mq]' > .hg/hgrc
-echo 'git = KEEP' >> .hg/hgrc
-echo '% git=keep: git patch with --git'
-echo a > a
-hg add a
-hg qnew -d '0 0' -f --git git
-cat .hg/patches/git
-echo '% git=keep: git patch after qrefresh without --git'
-echo a >> a
-hg qrefresh -d '0 0'
-cat .hg/patches/git
-cd ..
-
-hg init repo-yes
-cd repo-yes
-echo '[mq]' > .hg/hgrc
-echo 'git = yes' >> .hg/hgrc
-echo '% git=yes: git patch'
-echo a > a
-hg add a
-hg qnew -d '0 0' -f git
-cat .hg/patches/git
-echo '% git=yes: git patch after qrefresh'
-echo a >> a
-hg qrefresh -d '0 0'
-cat .hg/patches/git
-cd ..
-
-hg init repo-no
-cd repo-no
-echo '[diff]' > .hg/hgrc
-echo 'git = True' >> .hg/hgrc
-echo '[mq]' > .hg/hgrc
-echo 'git = False' >> .hg/hgrc
-echo '% git=no: regular patch with copy'
-echo a > a
-hg add a
-hg qnew -d '0 0' -f adda
-hg cp a b
-hg qnew -d '0 0' -f regular
-cat .hg/patches/regular
-echo '% git=no: regular patch after qrefresh with copy'
-hg cp a c
-hg qrefresh -d '0 0'
-cat .hg/patches/regular
-cd ..
--- a/tests/test-mq-git.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +0,0 @@
-% git=auto: regular patch creation
-# HG changeset patch
-# Parent 0000000000000000000000000000000000000000
-# Date 0 0
-
-diff -r 000000000000 -r ef8dafc9fa4c a
---- /dev/null
-+++ b/a
-@@ -0,0 +1,1 @@
-+a
-% git=auto: git patch creation with copy
-# HG changeset patch
-# Parent ef8dafc9fa4caff80f6e243eb0171bcd60c455b4
-# Date 0 0
-
-diff --git a/a b/b
-copy from a
-copy to b
-% git=auto: git patch when using --git
-# HG changeset patch
-# Parent 99586d5f048c399e20f81cee41fbb3809c0e735d
-# Date 0 0
-
-diff --git a/regular b/regular
-new file mode 100644
---- /dev/null
-+++ b/regular
-@@ -0,0 +1,1 @@
-+regular
-% git=auto: regular patch after qrefresh without --git
-# HG changeset patch
-# Parent 99586d5f048c399e20f81cee41fbb3809c0e735d
-# Date 0 0
-
-diff -r 99586d5f048c regular
---- /dev/null
-+++ b/regular
-@@ -0,0 +1,1 @@
-+regular
-% git=keep: git patch with --git
-# HG changeset patch
-# Parent 0000000000000000000000000000000000000000
-# Date 0 0
-
-diff --git a/a b/a
-new file mode 100644
---- /dev/null
-+++ b/a
-@@ -0,0 +1,1 @@
-+a
-% git=keep: git patch after qrefresh without --git
-# HG changeset patch
-# Parent 0000000000000000000000000000000000000000
-# Date 0 0
-
-diff --git a/a b/a
-new file mode 100644
---- /dev/null
-+++ b/a
-@@ -0,0 +1,2 @@
-+a
-+a
-% git=yes: git patch
-# HG changeset patch
-# Parent 0000000000000000000000000000000000000000
-# Date 0 0
-
-diff --git a/a b/a
-new file mode 100644
---- /dev/null
-+++ b/a
-@@ -0,0 +1,1 @@
-+a
-% git=yes: git patch after qrefresh
-# HG changeset patch
-# Parent 0000000000000000000000000000000000000000
-# Date 0 0
-
-diff --git a/a b/a
-new file mode 100644
---- /dev/null
-+++ b/a
-@@ -0,0 +1,2 @@
-+a
-+a
-% git=no: regular patch with copy
-# HG changeset patch
-# Parent ef8dafc9fa4caff80f6e243eb0171bcd60c455b4
-# Date 0 0
-
-diff -r ef8dafc9fa4c -r a70404f79ba3 b
---- /dev/null
-+++ b/b
-@@ -0,0 +1,1 @@
-+a
-% git=no: regular patch after qrefresh with copy
-# HG changeset patch
-# Parent ef8dafc9fa4caff80f6e243eb0171bcd60c455b4
-# Date 0 0
-
-diff -r ef8dafc9fa4c b
---- /dev/null
-+++ b/b
-@@ -0,0 +1,1 @@
-+a
-diff -r ef8dafc9fa4c c
---- /dev/null
-+++ b/c
-@@ -0,0 +1,1 @@
-+a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-mq-git.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,210 @@
+# Test the plumbing of mq.git option
+# Automatic upgrade itself is tested elsewhere.
+
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "mq=" >> $HGRCPATH
+  $ echo "[diff]" >> $HGRCPATH
+  $ echo "nodates=1" >> $HGRCPATH
+
+  $ hg init repo-auto
+  $ cd repo-auto
+
+git=auto: regular patch creation:
+
+  $ echo a > a
+  $ hg add a
+  $ hg qnew -d '0 0' -f adda
+
+  $ cat .hg/patches/adda
+  # HG changeset patch
+  # Parent 0000000000000000000000000000000000000000
+  # Date 0 0
+  
+  diff -r 000000000000 -r ef8dafc9fa4c a
+  --- /dev/null
+  +++ b/a
+  @@ -0,0 +1,1 @@
+  +a
+
+git=auto: git patch creation with copy:
+
+  $ hg cp a b
+  $ hg qnew -d '0 0' -f copy
+
+  $ cat .hg/patches/copy
+  # HG changeset patch
+  # Parent ef8dafc9fa4caff80f6e243eb0171bcd60c455b4
+  # Date 0 0
+  
+  diff --git a/a b/b
+  copy from a
+  copy to b
+
+git=auto: git patch when using --git:
+
+  $ echo regular > regular
+  $ hg add regular
+  $ hg qnew -d '0 0' --git -f git
+
+  $ cat .hg/patches/git
+  # HG changeset patch
+  # Parent 99586d5f048c399e20f81cee41fbb3809c0e735d
+  # Date 0 0
+  
+  diff --git a/regular b/regular
+  new file mode 100644
+  --- /dev/null
+  +++ b/regular
+  @@ -0,0 +1,1 @@
+  +regular
+
+git=auto: regular patch after qrefresh without --git:
+
+  $ hg qrefresh -d '0 0'
+
+  $ cat .hg/patches/git
+  # HG changeset patch
+  # Parent 99586d5f048c399e20f81cee41fbb3809c0e735d
+  # Date 0 0
+  
+  diff -r 99586d5f048c regular
+  --- /dev/null
+  +++ b/regular
+  @@ -0,0 +1,1 @@
+  +regular
+
+  $ cd ..
+
+  $ hg init repo-keep
+  $ cd repo-keep
+  $ echo '[mq]' > .hg/hgrc
+  $ echo 'git = KEEP' >> .hg/hgrc
+
+git=keep: git patch with --git:
+
+  $ echo a > a
+  $ hg add a
+  $ hg qnew -d '0 0' -f --git git
+
+  $ cat .hg/patches/git
+  # HG changeset patch
+  # Parent 0000000000000000000000000000000000000000
+  # Date 0 0
+  
+  diff --git a/a b/a
+  new file mode 100644
+  --- /dev/null
+  +++ b/a
+  @@ -0,0 +1,1 @@
+  +a
+
+git=keep: git patch after qrefresh without --git:
+
+  $ echo a >> a
+  $ hg qrefresh -d '0 0'
+
+  $ cat .hg/patches/git
+  # HG changeset patch
+  # Parent 0000000000000000000000000000000000000000
+  # Date 0 0
+  
+  diff --git a/a b/a
+  new file mode 100644
+  --- /dev/null
+  +++ b/a
+  @@ -0,0 +1,2 @@
+  +a
+  +a
+  $ cd ..
+
+  $ hg init repo-yes
+  $ cd repo-yes
+  $ echo '[mq]' > .hg/hgrc
+  $ echo 'git = yes' >> .hg/hgrc
+
+git=yes: git patch:
+
+  $ echo a > a
+  $ hg add a
+  $ hg qnew -d '0 0' -f git
+
+  $ cat .hg/patches/git
+  # HG changeset patch
+  # Parent 0000000000000000000000000000000000000000
+  # Date 0 0
+  
+  diff --git a/a b/a
+  new file mode 100644
+  --- /dev/null
+  +++ b/a
+  @@ -0,0 +1,1 @@
+  +a
+
+git=yes: git patch after qrefresh:
+
+  $ echo a >> a
+  $ hg qrefresh -d '0 0'
+
+  $ cat .hg/patches/git
+  # HG changeset patch
+  # Parent 0000000000000000000000000000000000000000
+  # Date 0 0
+  
+  diff --git a/a b/a
+  new file mode 100644
+  --- /dev/null
+  +++ b/a
+  @@ -0,0 +1,2 @@
+  +a
+  +a
+  $ cd ..
+
+  $ hg init repo-no
+  $ cd repo-no
+  $ echo '[diff]' > .hg/hgrc
+  $ echo 'git = True' >> .hg/hgrc
+  $ echo '[mq]' > .hg/hgrc
+  $ echo 'git = False' >> .hg/hgrc
+
+git=no: regular patch with copy:
+
+  $ echo a > a
+  $ hg add a
+  $ hg qnew -d '0 0' -f adda
+  $ hg cp a b
+  $ hg qnew -d '0 0' -f regular
+
+  $ cat .hg/patches/regular
+  # HG changeset patch
+  # Parent ef8dafc9fa4caff80f6e243eb0171bcd60c455b4
+  # Date 0 0
+  
+  diff -r ef8dafc9fa4c -r a70404f79ba3 b
+  --- /dev/null
+  +++ b/b
+  @@ -0,0 +1,1 @@
+  +a
+
+git=no: regular patch after qrefresh with copy:
+
+  $ hg cp a c
+  $ hg qrefresh -d '0 0'
+
+  $ cat .hg/patches/regular
+  # HG changeset patch
+  # Parent ef8dafc9fa4caff80f6e243eb0171bcd60c455b4
+  # Date 0 0
+  
+  diff -r ef8dafc9fa4c b
+  --- /dev/null
+  +++ b/b
+  @@ -0,0 +1,1 @@
+  +a
+  diff -r ef8dafc9fa4c c
+  --- /dev/null
+  +++ b/c
+  @@ -0,0 +1,1 @@
+  +a
+
+  $ cd ..
+
--- a/tests/test-mq-guards	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,168 +0,0 @@
-#!/bin/sh
-
-echo "[extensions]" >> $HGRCPATH
-echo "mq=" >> $HGRCPATH
-
-hg init
-hg qinit
-
-echo x > x
-hg ci -Ama
-
-hg qnew a.patch
-echo a > a
-hg add a
-hg qrefresh
-
-hg qnew b.patch
-echo b > b
-hg add b
-hg qrefresh
-
-hg qnew c.patch
-echo c > c
-hg add c
-hg qrefresh
-
-hg qpop -a
-
-echo % should fail
-hg qguard does-not-exist.patch +bleh
-
-echo % should fail
-hg qguard +fail
-
-hg qpush
-echo % should guard a.patch
-hg qguard +a
-echo % should print +a
-hg qguard
-hg qpop
-
-echo % should fail
-hg qpush a.patch
-
-hg qguard a.patch
-echo % should push b.patch
-hg qpush
-
-hg qpop
-echo % test selection of an empty guard
-hg qselect ""
-hg qselect a
-echo % should push a.patch
-hg qpush
-
-hg qguard -- c.patch -a
-echo % should print -a
-hg qguard c.patch
-
-echo % should skip c.patch
-hg qpush -a
-echo % should display b.patch
-hg qtop
-
-hg qguard -n c.patch
-echo % should push c.patch
-hg qpush -a
-
-hg qpop -a
-hg qselect -n
-echo % should push all
-hg qpush -a
-
-hg qpop -a
-hg qguard a.patch +1
-hg qguard b.patch +2
-hg qselect 1
-echo % should push a.patch, not b.patch
-hg qpush
-hg qpush
-hg qpop -a
-
-hg qselect 2
-echo % should push b.patch
-hg qpush
-hg qpush -a
-# Used to be an issue with holes in the patch sequence
-# So, put one hole on the base and ask for topmost patch.
-hg qtop
-hg qpop -a
-
-hg qselect 1 2
-echo % should push a.patch, b.patch
-hg qpush
-hg qpush
-hg qpop -a
-
-hg qguard -- a.patch +1 +2 -3
-hg qselect 1 2 3
-echo % list patches and guards
-hg qguard -l
-echo % list patches and guards with color
-hg --config extensions.color= qguard --config color.mode=ansi \
-    -l --color=always
-echo % list series
-hg qseries -v
-echo % list guards
-hg qselect
-echo % should push b.patch
-hg qpush
-
-hg qpush -a
-hg qselect -n --reapply
-echo % guards in series file: +1 +2 -3
-hg qselect -s
-echo % should show c.patch
-hg qapplied
-
-hg qrename a.patch new.patch
-echo % should show :
-echo % new.patch: +1 +2 -3
-echo % b.patch: +2
-echo % c.patch: unguarded
-hg qguard -l
-
-hg qnew d.patch
-hg qpop
-echo % should show new.patch and b.patch as Guarded, c.patch as Applied
-echo % and d.patch as Unapplied
-hg qseries -v
-echo % qseries again, but with color
-hg --config extensions.color= qseries -v --color=always
-
-hg qguard d.patch +2
-echo % new.patch, b.patch: Guarded. c.patch: Applied. d.patch: Guarded.
-hg qseries -v
-
-qappunappv()
-{
-    for command in qapplied "qapplied -v" qunapplied "qunapplied -v"; do
-        echo % hg $command
-        hg $command
-    done
-}
-
-hg qpop -a
-hg qguard -l
-qappunappv
-hg qselect 1
-qappunappv
-hg qpush -a
-qappunappv
-hg qselect 2
-qappunappv
-
-for patch in `hg qseries`; do
-    echo % hg qapplied $patch
-    hg qapplied $patch
-    echo % hg qunapplied $patch
-    hg qunapplied $patch
-done
-
-echo % hg qseries -m: only b.patch should be shown
-echo the guards file was not ignored in the past
-hg qdelete -k b.patch
-hg qseries -m
-echo % hg qseries -m with color
-hg --config extensions.color= qseries -m --color=always
--- a/tests/test-mq-guards.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,219 +0,0 @@
-adding x
-popping c.patch
-popping b.patch
-popping a.patch
-patch queue now empty
-% should fail
-abort: no patch named does-not-exist.patch
-% should fail
-abort: no patches applied
-applying a.patch
-now at: a.patch
-% should guard a.patch
-% should print +a
-a.patch: +a
-popping a.patch
-patch queue now empty
-% should fail
-cannot push 'a.patch' - guarded by ['+a']
-a.patch: +a
-% should push b.patch
-applying b.patch
-now at: b.patch
-popping b.patch
-patch queue now empty
-% test selection of an empty guard
-abort: guard cannot be an empty string
-number of unguarded, unapplied patches has changed from 2 to 3
-% should push a.patch
-applying a.patch
-now at: a.patch
-% should print -a
-c.patch: -a
-% should skip c.patch
-applying b.patch
-skipping c.patch - guarded by '-a'
-now at: b.patch
-% should display b.patch
-b.patch
-% should push c.patch
-applying c.patch
-now at: c.patch
-popping c.patch
-popping b.patch
-popping a.patch
-patch queue now empty
-guards deactivated
-number of unguarded, unapplied patches has changed from 3 to 2
-% should push all
-applying b.patch
-applying c.patch
-now at: c.patch
-popping c.patch
-popping b.patch
-patch queue now empty
-number of unguarded, unapplied patches has changed from 1 to 2
-% should push a.patch, not b.patch
-applying a.patch
-now at: a.patch
-applying c.patch
-now at: c.patch
-popping c.patch
-popping a.patch
-patch queue now empty
-% should push b.patch
-applying b.patch
-now at: b.patch
-applying c.patch
-now at: c.patch
-c.patch
-popping c.patch
-popping b.patch
-patch queue now empty
-number of unguarded, unapplied patches has changed from 2 to 3
-% should push a.patch, b.patch
-applying a.patch
-now at: a.patch
-applying b.patch
-now at: b.patch
-popping b.patch
-popping a.patch
-patch queue now empty
-number of unguarded, unapplied patches has changed from 3 to 2
-% list patches and guards
-a.patch: +1 +2 -3
-b.patch: +2
-c.patch: unguarded
-% list patches and guards with color
-a.patch: +1 +2 -3
-b.patch: +2
-c.patch: unguarded
-% list series
-0 G a.patch
-1 U b.patch
-2 U c.patch
-% list guards
-1
-2
-3
-% should push b.patch
-applying b.patch
-now at: b.patch
-applying c.patch
-now at: c.patch
-guards deactivated
-popping guarded patches
-popping c.patch
-popping b.patch
-patch queue now empty
-reapplying unguarded patches
-applying c.patch
-now at: c.patch
-% guards in series file: +1 +2 -3
-+1
-+2
--3
-% should show c.patch
-c.patch
-% should show :
-% new.patch: +1 +2 -3
-% b.patch: +2
-% c.patch: unguarded
-new.patch: +1 +2 -3
-b.patch: +2
-c.patch: unguarded
-popping d.patch
-now at: c.patch
-% should show new.patch and b.patch as Guarded, c.patch as Applied
-% and d.patch as Unapplied
-0 G new.patch
-1 G b.patch
-2 A c.patch
-3 U d.patch
-% qseries again, but with color
-0 G new.patch
-1 G b.patch
-2 A c.patch
-3 U d.patch
-% new.patch, b.patch: Guarded. c.patch: Applied. d.patch: Guarded.
-0 G new.patch
-1 G b.patch
-2 A c.patch
-3 G d.patch
-popping c.patch
-patch queue now empty
-new.patch: +1 +2 -3
-b.patch: +2
-c.patch: unguarded
-d.patch: +2
-% hg qapplied
-% hg qapplied -v
-% hg qunapplied
-c.patch
-% hg qunapplied -v
-0 G new.patch
-1 G b.patch
-2 U c.patch
-3 G d.patch
-number of unguarded, unapplied patches has changed from 1 to 2
-% hg qapplied
-% hg qapplied -v
-% hg qunapplied
-new.patch
-c.patch
-% hg qunapplied -v
-0 U new.patch
-1 G b.patch
-2 U c.patch
-3 G d.patch
-applying new.patch
-skipping b.patch - guarded by ['+2']
-applying c.patch
-skipping d.patch - guarded by ['+2']
-now at: c.patch
-% hg qapplied
-new.patch
-c.patch
-% hg qapplied -v
-0 A new.patch
-1 G b.patch
-2 A c.patch
-% hg qunapplied
-% hg qunapplied -v
-3 G d.patch
-number of unguarded, unapplied patches has changed from 0 to 1
-number of guarded, applied patches has changed from 1 to 0
-% hg qapplied
-new.patch
-c.patch
-% hg qapplied -v
-0 A new.patch
-1 U b.patch
-2 A c.patch
-% hg qunapplied
-d.patch
-% hg qunapplied -v
-3 U d.patch
-% hg qapplied new.patch
-new.patch
-% hg qunapplied new.patch
-b.patch
-d.patch
-% hg qapplied b.patch
-new.patch
-% hg qunapplied b.patch
-d.patch
-% hg qapplied c.patch
-new.patch
-c.patch
-% hg qunapplied c.patch
-d.patch
-% hg qapplied d.patch
-new.patch
-c.patch
-% hg qunapplied d.patch
-% hg qseries -m: only b.patch should be shown
-the guards file was not ignored in the past
-b.patch
-% hg qseries -m with color
-b.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-mq-guards.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,436 @@
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "mq=" >> $HGRCPATH
+
+  $ hg init
+  $ hg qinit
+
+  $ echo x > x
+  $ hg ci -Ama
+  adding x
+
+  $ hg qnew a.patch
+  $ echo a > a
+  $ hg add a
+  $ hg qrefresh
+
+  $ hg qnew b.patch
+  $ echo b > b
+  $ hg add b
+  $ hg qrefresh
+
+  $ hg qnew c.patch
+  $ echo c > c
+  $ hg add c
+  $ hg qrefresh
+
+  $ hg qpop -a
+  popping c.patch
+  popping b.patch
+  popping a.patch
+  patch queue now empty
+
+
+should fail
+
+  $ hg qguard does-not-exist.patch +bleh
+  abort: no patch named does-not-exist.patch
+  [255]
+
+
+should fail
+
+  $ hg qguard +fail
+  abort: no patches applied
+  [255]
+
+  $ hg qpush
+  applying a.patch
+  now at: a.patch
+
+should guard a.patch
+
+  $ hg qguard +a
+
+should print +a
+
+  $ hg qguard
+  a.patch: +a
+  $ hg qpop
+  popping a.patch
+  patch queue now empty
+
+
+should fail
+
+  $ hg qpush a.patch
+  cannot push 'a.patch' - guarded by ['+a']
+  [1]
+
+  $ hg qguard a.patch
+  a.patch: +a
+
+should push b.patch
+
+  $ hg qpush
+  applying b.patch
+  now at: b.patch
+
+  $ hg qpop
+  popping b.patch
+  patch queue now empty
+
+test selection of an empty guard
+
+  $ hg qselect ""
+  abort: guard cannot be an empty string
+  [255]
+  $ hg qselect a
+  number of unguarded, unapplied patches has changed from 2 to 3
+
+should push a.patch
+
+  $ hg qpush
+  applying a.patch
+  now at: a.patch
+
+  $ hg qguard -- c.patch -a
+
+should print -a
+
+  $ hg qguard c.patch
+  c.patch: -a
+
+
+should skip c.patch
+
+  $ hg qpush -a
+  applying b.patch
+  skipping c.patch - guarded by '-a'
+  now at: b.patch
+
+should display b.patch
+
+  $ hg qtop
+  b.patch
+
+  $ hg qguard -n c.patch
+
+should push c.patch
+
+  $ hg qpush -a
+  applying c.patch
+  now at: c.patch
+
+  $ hg qpop -a
+  popping c.patch
+  popping b.patch
+  popping a.patch
+  patch queue now empty
+  $ hg qselect -n
+  guards deactivated
+  number of unguarded, unapplied patches has changed from 3 to 2
+
+should push all
+
+  $ hg qpush -a
+  applying b.patch
+  applying c.patch
+  now at: c.patch
+
+  $ hg qpop -a
+  popping c.patch
+  popping b.patch
+  patch queue now empty
+  $ hg qguard a.patch +1
+  $ hg qguard b.patch +2
+  $ hg qselect 1
+  number of unguarded, unapplied patches has changed from 1 to 2
+
+should push a.patch, not b.patch
+
+  $ hg qpush
+  applying a.patch
+  now at: a.patch
+  $ hg qpush
+  applying c.patch
+  now at: c.patch
+  $ hg qpop -a
+  popping c.patch
+  popping a.patch
+  patch queue now empty
+
+  $ hg qselect 2
+
+should push b.patch
+
+  $ hg qpush
+  applying b.patch
+  now at: b.patch
+  $ hg qpush -a
+  applying c.patch
+  now at: c.patch
+
+Used to be an issue with holes in the patch sequence
+So, put one hole on the base and ask for topmost patch.
+
+  $ hg qtop
+  c.patch
+  $ hg qpop -a
+  popping c.patch
+  popping b.patch
+  patch queue now empty
+
+  $ hg qselect 1 2
+  number of unguarded, unapplied patches has changed from 2 to 3
+
+should push a.patch, b.patch
+
+  $ hg qpush
+  applying a.patch
+  now at: a.patch
+  $ hg qpush
+  applying b.patch
+  now at: b.patch
+  $ hg qpop -a
+  popping b.patch
+  popping a.patch
+  patch queue now empty
+
+  $ hg qguard -- a.patch +1 +2 -3
+  $ hg qselect 1 2 3
+  number of unguarded, unapplied patches has changed from 3 to 2
+
+
+list patches and guards
+
+  $ hg qguard -l
+  a.patch: +1 +2 -3
+  b.patch: +2
+  c.patch: unguarded
+
+have at least one patch applied to test coloring
+
+  $ hg qpush
+  applying b.patch
+  now at: b.patch
+
+list patches and guards with color
+
+  $ hg --config extensions.color= qguard --config color.mode=ansi \
+  >     -l --color=always
+  a.patch: +1 +2 -3
+  b.patch: +2
+  c.patch: unguarded
+
+should pop b.patch
+
+  $ hg qpop
+  popping b.patch
+  patch queue now empty
+
+list series
+
+  $ hg qseries -v
+  0 G a.patch
+  1 U b.patch
+  2 U c.patch
+
+list guards
+
+  $ hg qselect
+  1
+  2
+  3
+
+should push b.patch
+
+  $ hg qpush
+  applying b.patch
+  now at: b.patch
+
+  $ hg qpush -a
+  applying c.patch
+  now at: c.patch
+  $ hg qselect -n --reapply
+  guards deactivated
+  popping guarded patches
+  popping c.patch
+  popping b.patch
+  patch queue now empty
+  reapplying unguarded patches
+  applying c.patch
+  now at: c.patch
+
+guards in series file: +1 +2 -3
+
+  $ hg qselect -s
+  +1
+  +2
+  -3
+
+should show c.patch
+
+  $ hg qapplied
+  c.patch
+
+  $ hg qrename a.patch new.patch
+
+should show :
+
+
+new.patch: +1 +2 -3
+
+
+b.patch: +2
+
+
+c.patch: unguarded
+
+  $ hg qguard -l
+  new.patch: +1 +2 -3
+  b.patch: +2
+  c.patch: unguarded
+
+  $ hg qnew d.patch
+  $ hg qpop
+  popping d.patch
+  now at: c.patch
+
+should show new.patch and b.patch as Guarded, c.patch as Applied
+
+
+and d.patch as Unapplied
+
+  $ hg qseries -v
+  0 G new.patch
+  1 G b.patch
+  2 A c.patch
+  3 U d.patch
+
+qseries again, but with color
+
+  $ hg --config extensions.color= qseries -v --color=always
+  0 G new.patch
+  1 G b.patch
+  2 A c.patch
+  3 U d.patch
+
+  $ hg qguard d.patch +2
+
+new.patch, b.patch: Guarded. c.patch: Applied. d.patch: Guarded.
+
+  $ hg qseries -v
+  0 G new.patch
+  1 G b.patch
+  2 A c.patch
+  3 G d.patch
+
+  $ qappunappv()
+  > {
+  >     for command in qapplied "qapplied -v" qunapplied "qunapplied -v"; do
+  >         echo % hg $command
+  >         hg $command
+  >     done
+  > }
+
+  $ hg qpop -a
+  popping c.patch
+  patch queue now empty
+  $ hg qguard -l
+  new.patch: +1 +2 -3
+  b.patch: +2
+  c.patch: unguarded
+  d.patch: +2
+  $ qappunappv
+  % hg qapplied
+  % hg qapplied -v
+  % hg qunapplied
+  c.patch
+  % hg qunapplied -v
+  0 G new.patch
+  1 G b.patch
+  2 U c.patch
+  3 G d.patch
+  $ hg qselect 1
+  number of unguarded, unapplied patches has changed from 1 to 2
+  $ qappunappv
+  % hg qapplied
+  % hg qapplied -v
+  % hg qunapplied
+  new.patch
+  c.patch
+  % hg qunapplied -v
+  0 U new.patch
+  1 G b.patch
+  2 U c.patch
+  3 G d.patch
+  $ hg qpush -a
+  applying new.patch
+  skipping b.patch - guarded by ['+2']
+  applying c.patch
+  skipping d.patch - guarded by ['+2']
+  now at: c.patch
+  $ qappunappv
+  % hg qapplied
+  new.patch
+  c.patch
+  % hg qapplied -v
+  0 A new.patch
+  1 G b.patch
+  2 A c.patch
+  % hg qunapplied
+  % hg qunapplied -v
+  3 G d.patch
+  $ hg qselect 2
+  number of unguarded, unapplied patches has changed from 0 to 1
+  number of guarded, applied patches has changed from 1 to 0
+  $ qappunappv
+  % hg qapplied
+  new.patch
+  c.patch
+  % hg qapplied -v
+  0 A new.patch
+  1 U b.patch
+  2 A c.patch
+  % hg qunapplied
+  d.patch
+  % hg qunapplied -v
+  3 U d.patch
+
+  $ for patch in `hg qseries`; do
+  >     echo % hg qapplied $patch
+  >     hg qapplied $patch
+  >     echo % hg qunapplied $patch
+  >     hg qunapplied $patch
+  > done
+  % hg qapplied new.patch
+  new.patch
+  % hg qunapplied new.patch
+  b.patch
+  d.patch
+  % hg qapplied b.patch
+  new.patch
+  % hg qunapplied b.patch
+  d.patch
+  % hg qapplied c.patch
+  new.patch
+  c.patch
+  % hg qunapplied c.patch
+  d.patch
+  % hg qapplied d.patch
+  new.patch
+  c.patch
+  % hg qunapplied d.patch
+
+
+hg qseries -m: only b.patch should be shown
+the guards file was not ignored in the past
+
+  $ hg qdelete -k b.patch
+  $ hg qseries -m
+  b.patch
+
+hg qseries -m with color
+
+  $ hg --config extensions.color= qseries -m --color=always
+  b.patch
--- a/tests/test-mq-merge	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-#!/bin/sh
-
-# Test issue 529 - mq aborts when merging patch deleting files
-
-checkundo()
-{
-    if [ -f .hg/store/undo ]; then
-	echo ".hg/store/undo still exists after $1"
-    fi
-}
-
-echo "[extensions]" >> $HGRCPATH
-echo "mq =" >> $HGRCPATH
-echo "[mq]" >> $HGRCPATH
-echo "git = keep" >> $HGRCPATH
-
-# Commit two dummy files in "init" changeset
-hg init t
-cd t
-echo a > a
-echo b > b
-hg ci -Am init
-hg tag -l init
-
-# Create a patch removing a
-hg qnew rm_a
-hg rm a
-hg qrefresh -m "rm a"
-
-# Save the patch queue so we can merge it later
-hg qsave -c -e 2>&1 | grep -v '^copy'
-checkundo qsave
-
-# Update b and commit in an "update" changeset
-hg up -C init
-echo b >> b
-hg st
-hg ci -m update
-
-# Here, qpush used to abort with :
-# The system cannot find the file specified => a
-hg manifest
-hg qpush -a -m 2>&1 | grep -v '^merging'
-checkundo 'qpush -m'
-hg manifest
-
-# ensure status is correct after merge
-hg qpop -a
-cd ..
-
-# Classic MQ merge sequence *with an explicit named queue*
-echo
-echo % init t2
-hg init t2
-cd t2
-echo '[diff]' > .hg/hgrc
-echo 'nodates = 1' >> .hg/hgrc
-echo a > a
-hg ci -Am init
-echo b > a
-hg ci -m changea
-hg up -C 0
-hg cp a aa
-echo c >> a
-hg qnew --git -f -e patcha
-echo d >> a
-hg qnew -d '0 0' -f -e patcha2
-echo % create the reference queue
-hg qsave -c -e -n refqueue 2> /dev/null
-hg up -C 1
-echo % merge
-HGMERGE=internal:other hg qpush -a -m -n refqueue 2>&1 | \
-    sed 's/merging with queue at.*refqueue/merging with queue at refqueue/'
-echo % check patcha is still a git patch
-cat .hg/patches/patcha
-echo % check patcha2 is still a regular patch
-grep git .hg/patches/patcha2 && echo 'git patch found!'
-cd ..
-
--- a/tests/test-mq-merge.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-adding a
-adding b
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-M b
-created new head
-a
-b
-applying rm_a
-now at: rm_a
-b
-popping rm_a
-popping .hg.patches.merge.marker
-patch queue now empty
-
-% init t2
-adding a
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% create the reference queue
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-% merge
-merging with queue at refqueue
-applying patcha
-patching file a
-Hunk #1 FAILED at 0
-1 out of 1 hunks FAILED -- saving rejects to file a.rej
-patch failed, unable to continue (try -v)
-patch failed, rejects left in working dir
-patch didn't work out, merging patcha
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-0 files updated, 2 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-applying patcha2
-now at: patcha2
-% check patcha is still a git patch
-# HG changeset patch
-# Parent d3873e73d99ef67873dac33fbcc66268d5d2b6f4
-
-diff --git a/a b/a
---- a/a
-+++ b/a
-@@ -1,1 +1,2 @@
--b
-+a
-+c
-diff --git a/a b/aa
-copy from a
-copy to aa
---- a/a
-+++ b/aa
-@@ -1,1 +1,1 @@
--b
-+a
-% check patcha2 is still a regular patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-mq-merge.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,153 @@
+# Test issue 529 - mq aborts when merging patch deleting files
+
+  $ checkundo()
+  > {
+  >     if [ -f .hg/store/undo ]; then
+  >         echo ".hg/store/undo still exists"
+  >     fi
+  > }
+
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "mq =" >> $HGRCPATH
+  $ echo "[mq]" >> $HGRCPATH
+  $ echo "git = keep" >> $HGRCPATH
+
+Commit two dummy files in "init" changeset:
+
+  $ hg init t
+  $ cd t
+  $ echo a > a
+  $ echo b > b
+  $ hg ci -Am init
+  adding a
+  adding b
+  $ hg tag -l init
+
+Create a patch removing a:
+
+  $ hg qnew rm_a
+  $ hg rm a
+  $ hg qrefresh -m "rm a"
+
+Save the patch queue so we can merge it later:
+
+  $ hg qsave -c -e
+  copy */t/.hg/patches to */t/.hg/patches.1 (glob)
+  $ checkundo
+
+Update b and commit in an "update" changeset:
+
+  $ hg up -C init
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo b >> b
+  $ hg st
+  M b
+  $ hg ci -m update
+  created new head
+
+# Here, qpush used to abort with :
+# The system cannot find the file specified => a
+  $ hg manifest
+  a
+  b
+
+  $ hg qpush -a -m
+  merging with queue at: */t/.hg/patches.1 (glob)
+  applying rm_a
+  now at: rm_a
+
+  $ checkundo
+  $ hg manifest
+  b
+
+Ensure status is correct after merge:
+
+  $ hg qpop -a
+  popping rm_a
+  popping .hg.patches.merge.marker
+  patch queue now empty
+
+  $ cd ..
+
+Classic MQ merge sequence *with an explicit named queue*:
+
+  $ hg init t2
+  $ cd t2
+  $ echo '[diff]' > .hg/hgrc
+  $ echo 'nodates = 1' >> .hg/hgrc
+  $ echo a > a
+  $ hg ci -Am init
+  adding a
+  $ echo b > a
+  $ hg ci -m changea
+  $ hg up -C 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg cp a aa
+  $ echo c >> a
+  $ hg qnew --git -f -e patcha
+  $ echo d >> a
+  $ hg qnew -d '0 0' -f -e patcha2
+
+Create the reference queue:
+
+  $ hg qsave -c -e -n refqueue
+  copy */t2/.hg/patches to */t2/.hg/refqueue (glob)
+  $ hg up -C 1
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+Merge:
+
+  $ HGMERGE=internal:other hg qpush -a -m -n refqueue
+  merging with queue at: */t2/.hg/refqueue (glob)
+  applying patcha
+  patching file a
+  Hunk #1 FAILED at 0
+  1 out of 1 hunks FAILED -- saving rejects to file a.rej
+  patch failed, unable to continue (try -v)
+  patch failed, rejects left in working dir
+  patch didn't work out, merging patcha
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  0 files updated, 2 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  applying patcha2
+  now at: patcha2
+
+Check patcha is still a git patch:
+
+  $ cat .hg/patches/patcha
+  # HG changeset patch
+  # Parent d3873e73d99ef67873dac33fbcc66268d5d2b6f4
+  
+  diff --git a/a b/a
+  --- a/a
+  +++ b/a
+  @@ -1,1 +1,2 @@
+  -b
+  +a
+  +c
+  diff --git a/a b/aa
+  copy from a
+  copy to aa
+  --- a/a
+  +++ b/aa
+  @@ -1,1 +1,1 @@
+  -b
+  +a
+
+Check patcha2 is still a regular patch:
+
+  $ cat .hg/patches/patcha2
+  # HG changeset patch
+  # Parent ???????????????????????????????????????? (glob)
+  # Date 0 0
+  
+  diff -r ???????????? -r ???????????? a (glob)
+  --- a/a
+  +++ b/a
+  @@ -1,2 +1,3 @@
+   a
+   c
+  +d
+
+  $ cd ..
+
--- a/tests/test-mq-missingfiles	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-#!/bin/sh
-
-# Test issue835:
-# qpush fails immediately when patching a missing file, but
-# remaining added files are still created empty which will
-# trick a future qrefresh.
-
-cat > writelines.py <<EOF
-import sys
-path = sys.argv[1]
-args = sys.argv[2:]
-assert (len(args) % 2) == 0
-
-f = file(path, 'wb')
-for i in xrange(len(args)/2):
-   count, s = args[2*i:2*i+2]
-   count = int(count)
-   s = s.decode('string_escape')
-   f.write(s*count)
-f.close()
-
-EOF
-
-echo "[extensions]" >> $HGRCPATH
-echo "mq=" >> $HGRCPATH
-
-hg init normal
-cd normal
-python ../writelines.py b 10 'a\n'
-hg ci -Am addb
-echo a > a
-python ../writelines.py b 2 'b\n' 10 'a\n' 2 'c\n'
-echo c > c
-hg add a c
-hg qnew -f changeb
-hg qpop
-hg rm b
-hg ci -Am rmb
-echo % push patch with missing target
-hg qpush
-echo % display added files
-cat a
-cat c
-echo % display rejections
-cat b.rej
-cd ..
-
-
-echo "[diff]" >> $HGRCPATH
-echo "git=1" >> $HGRCPATH
-
-hg init git
-cd git
-python ../writelines.py b 1 '\x00'
-hg ci -Am addb
-echo a > a
-python ../writelines.py b 1 '\x01' 1 '\x00'
-echo c > c
-hg add a c
-hg qnew -f changeb
-hg qpop
-hg rm b
-hg ci -Am rmb
-echo % push git patch with missing target
-hg qpush 2>&1 | sed -e 's/b:.*/b: No such file or directory/'
-hg st
-echo % display added files
-cat a
-cat c
-echo % display rejections
-cat b.rej
-cd ..
-
-echo % test push creating directory during git copy or rename
-hg init missingdir
-cd missingdir
-echo a > a
-hg ci -Am adda
-mkdir d
-hg copy a d/a2
-hg mv a d/a
-hg qnew -g -f patch
-hg qpop
-hg qpush
-cd ..
--- a/tests/test-mq-missingfiles.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-adding b
-popping changeb
-patch queue now empty
-% push patch with missing target
-applying changeb
-unable to find 'b' for patching
-2 out of 2 hunks FAILED -- saving rejects to file b.rej
-patch failed, unable to continue (try -v)
-patch failed, rejects left in working dir
-errors during apply, please fix and refresh changeb
-% display added files
-a
-c
-% display rejections
---- b
-+++ b
-@@ -1,3 +1,5 @@
-+b
-+b
- a
- a
- a
-@@ -8,3 +10,5 @@
- a
- a
- a
-+c
-+c
-adding b
-popping changeb
-patch queue now empty
-% push git patch with missing target
-applying changeb
-unable to find 'b' for patching
-1 out of 1 hunks FAILED -- saving rejects to file b.rej
-patch failed, unable to continue (try -v)
-b: No such file or directory
-patch failed, rejects left in working dir
-errors during apply, please fix and refresh changeb
-? b.rej
-% display added files
-a
-c
-% display rejections
---- b
-+++ b
-GIT binary patch
-literal 2
-Jc${No0000400IC2
-
-% test push creating directory during git copy or rename
-adding a
-popping patch
-patch queue now empty
-applying patch
-now at: patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-mq-missingfiles.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,150 @@
+
+# Test issue835:
+# qpush fails immediately when patching a missing file, but
+# remaining added files are still created empty which will
+# trick a future qrefresh.
+
+  $ cat > writelines.py <<EOF
+  > import sys
+  > path = sys.argv[1]
+  > args = sys.argv[2:]
+  > assert (len(args) % 2) == 0
+  > 
+  > f = file(path, 'wb')
+  > for i in xrange(len(args)/2):
+  >    count, s = args[2*i:2*i+2]
+  >    count = int(count)
+  >    s = s.decode('string_escape')
+  >    f.write(s*count)
+  > f.close()
+  > EOF
+
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "mq=" >> $HGRCPATH
+
+  $ hg init normal
+  $ cd normal
+  $ python ../writelines.py b 10 'a\n'
+  $ hg ci -Am addb
+  adding b
+  $ echo a > a
+  $ python ../writelines.py b 2 'b\n' 10 'a\n' 2 'c\n'
+  $ echo c > c
+  $ hg add a c
+  $ hg qnew -f changeb
+  $ hg qpop
+  popping changeb
+  patch queue now empty
+  $ hg rm b
+  $ hg ci -Am rmb
+
+Push patch with missing target:
+
+  $ hg qpush
+  applying changeb
+  unable to find 'b' for patching
+  2 out of 2 hunks FAILED -- saving rejects to file b.rej
+  patch failed, unable to continue (try -v)
+  patch failed, rejects left in working dir
+  errors during apply, please fix and refresh changeb
+  [2]
+
+Display added files:
+
+  $ cat a
+  a
+  $ cat c
+  c
+
+Display rejections:
+
+  $ cat b.rej
+  --- b
+  +++ b
+  @@ -1,3 +1,5 @@
+  +b
+  +b
+   a
+   a
+   a
+  @@ -8,3 +10,5 @@
+   a
+   a
+   a
+  +c
+  +c
+
+  $ cd ..
+
+
+  $ echo "[diff]" >> $HGRCPATH
+  $ echo "git=1" >> $HGRCPATH
+
+  $ hg init git
+  $ cd git
+  $ python ../writelines.py b 1 '\x00'
+  $ hg ci -Am addb
+  adding b
+  $ echo a > a
+  $ python ../writelines.py b 1 '\x01' 1 '\x00'
+  $ echo c > c
+  $ hg add a c
+  $ hg qnew -f changeb
+  $ hg qpop
+  popping changeb
+  patch queue now empty
+  $ hg rm b
+  $ hg ci -Am rmb
+
+Push git patch with missing target:
+
+  $ hg qpush
+  applying changeb
+  unable to find 'b' for patching
+  1 out of 1 hunks FAILED -- saving rejects to file b.rej
+  patch failed, unable to continue (try -v)
+  b: No such file or directory
+  patch failed, rejects left in working dir
+  errors during apply, please fix and refresh changeb
+  [2]
+  $ hg st
+  ? b.rej
+
+Display added files:
+
+  $ cat a
+  a
+  $ cat c
+  c
+
+Display rejections:
+
+  $ cat b.rej
+  --- b
+  +++ b
+  GIT binary patch
+  literal 2
+  Jc${No0000400IC2
+  
+  $ cd ..
+
+Test push creating directory during git copy or rename:
+
+  $ hg init missingdir
+  $ cd missingdir
+  $ echo a > a
+  $ hg ci -Am adda
+  adding a
+  $ mkdir d
+  $ hg copy a d/a2
+  $ hg mv a d/a
+  $ hg qnew -g -f patch
+  $ hg qpop
+  popping patch
+  patch queue now empty
+  $ hg qpush
+  applying patch
+  now at: patch
+
+  $ cd ..
+
--- a/tests/test-mq-pull-from-bundle	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-#!/bin/sh
-
-cat <<EOF >> $HGRCPATH
-[extensions]
-mq=
-[defaults]
-log = --template "{rev}: {desc}\\n"
-heads = --template "{rev}: {desc}\\n"
-incoming = --template "{rev}: {desc}\\n"
-EOF
-
-echo "====== Setup main"
-hg init base
-cd base
-echo "One" > one
-hg add
-hg ci -m "main: one added."
-echo "++" >> one
-hg ci -m "main: one updated."
-
-echo "====== Bundle main"
-hg bundle --base=null ../main.hg
-cd ..
-
-echo "====== Incoming to fresh repo"
-hg init fresh
-echo ">> hg -R fresh incoming main.hg"
-hg -R fresh incoming main.hg
-echo ">> hg -R fresh incoming bundle:fresh+main.hg"
-hg -R fresh incoming bundle:fresh+main.hg
-
-
-echo "====== Setup queue"
-cd base
-hg qinit -c
-hg qnew -m "patch: two added." two.patch
-echo two > two
-hg add
-hg qrefresh
-hg qcommit -m "queue: two.patch added."
-hg qpop -a
-
-echo "====== Bundle queue"
-hg -R .hg/patches bundle --base=null ../queue.hgq
-cd ..
-
-
-echo "====== Clone base"
-hg clone base copy
-cd copy
-hg qinit -c
-
-echo "====== Incoming queue bundle"
-echo ">> hg -R .hg/patches incoming ../queue.hgq"
-hg -R .hg/patches incoming ../queue.hgq
-
-echo "====== Pull queue bundle"
-echo ">> hg -R .hg/patches pull --update ../queue.hgq"
-hg -R .hg/patches pull --update ../queue.hgq
-echo ">> hg -R .hg/patches heads"
-hg -R .hg/patches heads
-echo ">> hg -R .hg/patches log"
-hg -R .hg/patches log
-echo ">> hg qseries"
-hg qseries
-cd ..
-
-
-echo "====== Clone base again"
-hg clone base copy2
-cd copy2
-hg qinit -c
-
-echo "====== Unbundle queue bundle"
-echo ">> hg -R .hg/patches unbundle --update ../queue.hgq"
-hg -R .hg/patches unbundle --update ../queue.hgq
-echo ">> hg -R .hg/patches heads"
-hg -R .hg/patches heads
-echo ">> hg -R .hg/patches log"
-hg -R .hg/patches log
-echo ">> hg qseries"
-hg qseries
-cd ..
--- a/tests/test-mq-pull-from-bundle.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-====== Setup main
-adding one
-====== Bundle main
-2 changesets found
-====== Incoming to fresh repo
->> hg -R fresh incoming main.hg
-comparing with main.hg
-0: main: one added.
-1: main: one updated.
->> hg -R fresh incoming bundle:fresh+main.hg
-comparing with bundle:fresh+main.hg
-0: main: one added.
-1: main: one updated.
-====== Setup queue
-adding two
-popping two.patch
-patch queue now empty
-====== Bundle queue
-1 changesets found
-====== Clone base
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-====== Incoming queue bundle
->> hg -R .hg/patches incoming ../queue.hgq
-comparing with ../queue.hgq
-0: queue: two.patch added.
-====== Pull queue bundle
->> hg -R .hg/patches pull --update ../queue.hgq
-pulling from ../queue.hgq
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 3 changes to 3 files
-merging series
-2 files updated, 1 files merged, 0 files removed, 0 files unresolved
->> hg -R .hg/patches heads
-0: queue: two.patch added.
->> hg -R .hg/patches log
-0: queue: two.patch added.
->> hg qseries
-two.patch
-====== Clone base again
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-====== Unbundle queue bundle
->> hg -R .hg/patches unbundle --update ../queue.hgq
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 3 changes to 3 files
-merging series
-2 files updated, 1 files merged, 0 files removed, 0 files unresolved
->> hg -R .hg/patches heads
-0: queue: two.patch added.
->> hg -R .hg/patches log
-0: queue: two.patch added.
->> hg qseries
-two.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-mq-pull-from-bundle.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,131 @@
+  $ cat <<EOF >> $HGRCPATH
+  > [extensions]
+  > mq=
+  > [alias]
+  > tlog = log --template "{rev}: {desc}\\n"
+  > theads = heads --template "{rev}: {desc}\\n"
+  > tincoming = incoming --template "{rev}: {desc}\\n"
+  > EOF
+
+Setup main:
+
+  $ hg init base
+  $ cd base
+  $ echo "One" > one
+  $ hg add
+  adding one
+  $ hg ci -m "main: one added"
+  $ echo "++" >> one
+  $ hg ci -m "main: one updated"
+
+Bundle main:
+
+  $ hg bundle --base=null ../main.hg
+  2 changesets found
+
+  $ cd ..
+
+Incoming to fresh repo:
+
+  $ hg init fresh
+
+  $ hg -R fresh tincoming main.hg
+  comparing with main.hg
+  0: main: one added
+  1: main: one updated
+
+  $ hg -R fresh tincoming bundle:fresh+main.hg
+  comparing with bundle:fresh+main.hg
+  0: main: one added
+  1: main: one updated
+
+
+Setup queue:
+
+  $ cd base
+  $ hg qinit -c
+  $ hg qnew -m "patch: two added" two.patch
+  $ echo two > two
+  $ hg add
+  adding two
+  $ hg qrefresh
+  $ hg qcommit -m "queue: two.patch added"
+  $ hg qpop -a
+  popping two.patch
+  patch queue now empty
+
+Bundle queue:
+
+  $ hg -R .hg/patches bundle --base=null ../queue.hgq
+  1 changesets found
+
+  $ cd ..
+
+
+Clone base:
+
+  $ hg clone base copy
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd copy
+  $ hg qinit -c
+
+Incoming queue bundle:
+
+  $ hg -R .hg/patches tincoming ../queue.hgq
+  comparing with ../queue.hgq
+  0: queue: two.patch added
+
+Pull queue bundle:
+
+  $ hg -R .hg/patches pull --update ../queue.hgq
+  pulling from ../queue.hgq
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 3 changes to 3 files
+  merging series
+  2 files updated, 1 files merged, 0 files removed, 0 files unresolved
+
+  $ hg -R .hg/patches theads
+  0: queue: two.patch added
+
+  $ hg -R .hg/patches tlog
+  0: queue: two.patch added
+
+  $ hg qseries
+  two.patch
+
+  $ cd ..
+
+
+Clone base again:
+
+  $ hg clone base copy2
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd copy2
+  $ hg qinit -c
+
+Unbundle queue bundle:
+
+  $ hg -R .hg/patches unbundle --update ../queue.hgq
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 3 changes to 3 files
+  merging series
+  2 files updated, 1 files merged, 0 files removed, 0 files unresolved
+
+  $ hg -R .hg/patches theads
+  0: queue: two.patch added
+
+  $ hg -R .hg/patches tlog
+  0: queue: two.patch added
+
+  $ hg qseries
+  two.patch
+
+  $ cd ..
+
--- a/tests/test-mq-qdelete	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-#!/bin/sh
-
-echo "[extensions]" >> $HGRCPATH
-echo "mq=" >> $HGRCPATH
-
-hg init a
-cd a
-
-echo 'base' > base
-hg ci -Ambase -d '1 0'
-
-hg qnew -d '1 0' a
-hg qnew -d '1 0' b
-hg qnew -d '1 0' c
-
-hg qdel
-
-hg qdel c
-hg qpop
-hg qdel c
-hg qseries
-ls .hg/patches
-hg qpop
-hg qdel -k 1
-ls .hg/patches
-hg qdel -r a
-hg qapplied
-hg log --template '{rev} {desc}\n'
-
-hg qnew d
-hg qnew e
-hg qnew f
-
-hg qdel -r e
-hg qdel -r qbase:e
-hg qapplied
-hg log --template '{rev} {desc}\n'
-
-cd ..
-hg init b
-cd b
-
-echo 'base' > base
-hg ci -Ambase -d '1 0'
-
-hg qfinish
-hg qfinish -a
-
-hg qnew -d '1 0' a
-hg qnew -d '1 0' b
-hg qnew c # XXX fails to apply by /usr/bin/patch if we put a date
-
-hg qfinish 0
-hg qfinish b
-
-hg qpop
-hg qfinish -a c
-hg qpush
-
-hg qfinish qbase:b
-hg qapplied
-hg log --template '{rev} {desc}\n'
-
-hg qfinish -a c
-hg qapplied
-hg log --template '{rev} {desc}\n'
-ls .hg/patches
--- a/tests/test-mq-qdelete.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-adding base
-abort: qdelete requires at least one revision or patch name
-abort: cannot delete applied patch c
-popping c
-now at: b
-a
-b
-a
-b
-series
-status
-popping b
-now at: a
-a
-b
-series
-status
-patch a finalized without changeset message
-1 [mq]: a
-0 base
-abort: cannot delete revision 3 above applied patches
-patch d finalized without changeset message
-patch e finalized without changeset message
-f
-4 [mq]: f
-3 [mq]: e
-2 [mq]: d
-1 [mq]: a
-0 base
-adding base
-abort: no revisions specified
-no patches applied
-abort: revision 0 is not managed
-abort: cannot delete revision 2 above applied patches
-popping c
-now at: b
-abort: unknown revision 'c'!
-applying c
-patch c is empty
-now at: c
-patch a finalized without changeset message
-patch b finalized without changeset message
-c
-3 imported patch c
-2 [mq]: b
-1 [mq]: a
-0 base
-patch c finalized without changeset message
-3 imported patch c
-2 [mq]: b
-1 [mq]: a
-0 base
-series
-status
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-mq-qdelete.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,150 @@
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "mq=" >> $HGRCPATH
+
+  $ hg init a
+  $ cd a
+
+  $ echo 'base' > base
+  $ hg ci -Ambase -d '1 0'
+  adding base
+
+  $ hg qnew -d '1 0' a
+  $ hg qnew -d '1 0' b
+  $ hg qnew -d '1 0' c
+
+  $ hg qdel
+  abort: qdelete requires at least one revision or patch name
+  [255]
+
+  $ hg qdel c
+  abort: cannot delete applied patch c
+  [255]
+
+  $ hg qpop
+  popping c
+  now at: b
+
+  $ hg qdel c
+
+  $ hg qseries
+  a
+  b
+
+  $ ls .hg/patches
+  a
+  b
+  series
+  status
+
+  $ hg qpop
+  popping b
+  now at: a
+
+  $ hg qdel -k 1
+
+  $ ls .hg/patches
+  a
+  b
+  series
+  status
+
+  $ hg qdel -r a
+  patch a finalized without changeset message
+
+  $ hg qapplied
+
+  $ hg log --template '{rev} {desc}\n'
+  1 [mq]: a
+  0 base
+
+  $ hg qnew d
+  $ hg qnew e
+  $ hg qnew f
+
+  $ hg qdel -r e
+  abort: cannot delete revision 3 above applied patches
+  [255]
+
+  $ hg qdel -r qbase:e
+  patch d finalized without changeset message
+  patch e finalized without changeset message
+
+  $ hg qapplied
+  f
+
+  $ hg log --template '{rev} {desc}\n'
+  4 [mq]: f
+  3 [mq]: e
+  2 [mq]: d
+  1 [mq]: a
+  0 base
+
+  $ cd ..
+
+  $ hg init b
+  $ cd b
+
+  $ echo 'base' > base
+  $ hg ci -Ambase -d '1 0'
+  adding base
+
+  $ hg qfinish
+  abort: no revisions specified
+  [255]
+
+  $ hg qfinish -a
+  no patches applied
+
+  $ hg qnew -d '1 0' a
+  $ hg qnew -d '1 0' b
+  $ hg qnew c # XXX fails to apply by /usr/bin/patch if we put a date
+
+  $ hg qfinish 0
+  abort: revision 0 is not managed
+  [255]
+
+  $ hg qfinish b
+  abort: cannot delete revision 2 above applied patches
+  [255]
+
+  $ hg qpop
+  popping c
+  now at: b
+
+  $ hg qfinish -a c
+  abort: unknown revision 'c'!
+  [255]
+
+  $ hg qpush
+  applying c
+  patch c is empty
+  now at: c
+
+  $ hg qfinish qbase:b
+  patch a finalized without changeset message
+  patch b finalized without changeset message
+
+  $ hg qapplied
+  c
+
+  $ hg log --template '{rev} {desc}\n'
+  3 imported patch c
+  2 [mq]: b
+  1 [mq]: a
+  0 base
+
+  $ hg qfinish -a c
+  patch c finalized without changeset message
+
+  $ hg qapplied
+
+  $ hg log --template '{rev} {desc}\n'
+  3 imported patch c
+  2 [mq]: b
+  1 [mq]: a
+  0 base
+
+  $ ls .hg/patches
+  series
+  status
+
--- a/tests/test-mq-qdiff	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-#!/bin/sh
-
-echo "[extensions]" >> $HGRCPATH
-echo "mq=" >> $HGRCPATH
-echo "[mq]" >> $HGRCPATH
-echo "git=keep" >> $HGRCPATH
-
-echo % init
-hg init a
-cd a
-
-echo % commit
-echo 'base' > base
-hg ci -Ambase -d '1 0'
-
-echo % qnew mqbase
-hg qnew -mmqbase mqbase
-
-echo % qrefresh
-echo 'patched' > base
-hg qrefresh
-
-echo % qdiff
-hg qdiff | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
-               -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
-
-echo % qdiff dirname
-hg qdiff . | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
-                 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
-
-echo % qdiff filename
-hg qdiff --nodates base
-
-echo % revert
-hg revert -a
-
-echo % qpop
-hg qpop
-
-echo % qdelete mqbase
-hg qdelete mqbase
-
-echo % commit 2
-printf '1\n2\n3\n4\nhello world\ngoodbye world\n7\n8\n9\n' > lines
-hg ci -Amlines -d '2 0'
-
-echo % qnew 2
-hg qnew -mmqbase2 mqbase2
-printf '\n\n1\n2\n3\n4\nhello  world\n     goodbye world\n7\n8\n9\n' > lines
-
-echo % qdiff -U 1
-hg qdiff --nodates -U 1
-
-echo % qdiff -b
-hg qdiff --nodates -b
-
-echo % qdiff -U 1 -B
-hg qdiff --nodates -U 1 -B
-
-echo % qdiff -w
-hg qdiff --nodates -w
-
-echo % qdiff --reverse
-hg qdiff --nodates --reverse
-
-echo % qdiff preserve existing git flag
-hg qrefresh --git
-echo a >> lines
-hg qdiff
-
-echo % qdiff --stat
-hg qdiff --stat
--- a/tests/test-mq-qdiff.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,127 +0,0 @@
-% init
-% commit
-adding base
-% qnew mqbase
-% qrefresh
-% qdiff
-diff -r 67e992f2c4f3 base
---- a/base
-+++ b/base
-@@ -1,1 +1,1 @@
--base
-+patched
-% qdiff dirname
-diff -r 67e992f2c4f3 base
---- a/base
-+++ b/base
-@@ -1,1 +1,1 @@
--base
-+patched
-% qdiff filename
-diff -r 67e992f2c4f3 base
---- a/base
-+++ b/base
-@@ -1,1 +1,1 @@
--base
-+patched
-% revert
-% qpop
-popping mqbase
-patch queue now empty
-% qdelete mqbase
-% commit 2
-adding lines
-% qnew 2
-% qdiff -U 1
-diff -r 35fb829491c1 lines
---- a/lines
-+++ b/lines
-@@ -1,1 +1,3 @@
-+
-+
- 1
-@@ -4,4 +6,4 @@
- 4
--hello world
--goodbye world
-+hello  world
-+     goodbye world
- 7
-% qdiff -b
-diff -r 35fb829491c1 lines
---- a/lines
-+++ b/lines
-@@ -1,9 +1,11 @@
-+
-+
- 1
- 2
- 3
- 4
- hello world
--goodbye world
-+     goodbye world
- 7
- 8
- 9
-% qdiff -U 1 -B
-diff -r 35fb829491c1 lines
---- a/lines
-+++ b/lines
-@@ -4,4 +6,4 @@
- 4
--hello world
--goodbye world
-+hello  world
-+     goodbye world
- 7
-% qdiff -w
-diff -r 35fb829491c1 lines
---- a/lines
-+++ b/lines
-@@ -1,3 +1,5 @@
-+
-+
- 1
- 2
- 3
-% qdiff --reverse
-diff -r 35fb829491c1 lines
---- a/lines
-+++ b/lines
-@@ -1,11 +1,9 @@
--
--
- 1
- 2
- 3
- 4
--hello  world
--     goodbye world
-+hello world
-+goodbye world
- 7
- 8
- 9
-% qdiff preserve existing git flag
-diff --git a/lines b/lines
---- a/lines
-+++ b/lines
-@@ -1,9 +1,12 @@
-+
-+
- 1
- 2
- 3
- 4
--hello world
--goodbye world
-+hello  world
-+     goodbye world
- 7
- 8
- 9
-+a
-% qdiff --stat
- lines |  7 +++++--
- 1 files changed, 5 insertions(+), 2 deletions(-)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-mq-qdiff.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,166 @@
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "mq=" >> $HGRCPATH
+  $ echo "[mq]" >> $HGRCPATH
+  $ echo "git=keep" >> $HGRCPATH
+
+  $ hg init a
+  $ cd a
+
+  $ echo 'base' > base
+  $ hg ci -Ambase
+  adding base
+
+  $ hg qnew -mmqbase mqbase
+
+  $ echo 'patched' > base
+  $ hg qrefresh
+
+qdiff:
+
+  $ hg qdiff
+  diff -r d20a80d4def3 base
+  --- a/base	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/base* (glob)
+  @@ -1,1 +1,1 @@
+  -base
+  +patched
+
+qdiff dirname:
+
+  $ hg qdiff --nodates .
+  diff -r d20a80d4def3 base
+  --- a/base
+  +++ b/base
+  @@ -1,1 +1,1 @@
+  -base
+  +patched
+
+qdiff filename:
+
+  $ hg qdiff --nodates base
+  diff -r d20a80d4def3 base
+  --- a/base
+  +++ b/base
+  @@ -1,1 +1,1 @@
+  -base
+  +patched
+
+  $ hg revert -a
+
+  $ hg qpop
+  popping mqbase
+  patch queue now empty
+
+  $ hg qdelete mqbase
+
+  $ printf '1\n2\n3\n4\nhello world\ngoodbye world\n7\n8\n9\n' > lines
+  $ hg ci -Amlines -d '2 0'
+  adding lines
+
+  $ hg qnew -mmqbase2 mqbase2
+  $ printf '\n\n1\n2\n3\n4\nhello  world\n     goodbye world\n7\n8\n9\n' > lines
+
+  $ hg qdiff --nodates -U 1
+  diff -r b0c220e1cf43 lines
+  --- a/lines
+  +++ b/lines
+  @@ -1,1 +1,3 @@
+  +
+  +
+   1
+  @@ -4,4 +6,4 @@
+   4
+  -hello world
+  -goodbye world
+  +hello  world
+  +     goodbye world
+   7
+
+  $ hg qdiff --nodates -b
+  diff -r b0c220e1cf43 lines
+  --- a/lines
+  +++ b/lines
+  @@ -1,9 +1,11 @@
+  +
+  +
+   1
+   2
+   3
+   4
+   hello world
+  -goodbye world
+  +     goodbye world
+   7
+   8
+   9
+
+  $ hg qdiff --nodates -U 1 -B
+  diff -r b0c220e1cf43 lines
+  --- a/lines
+  +++ b/lines
+  @@ -4,4 +6,4 @@
+   4
+  -hello world
+  -goodbye world
+  +hello  world
+  +     goodbye world
+   7
+
+  $ hg qdiff --nodates -w
+  diff -r b0c220e1cf43 lines
+  --- a/lines
+  +++ b/lines
+  @@ -1,3 +1,5 @@
+  +
+  +
+   1
+   2
+   3
+
+  $ hg qdiff --nodates --reverse
+  diff -r b0c220e1cf43 lines
+  --- a/lines
+  +++ b/lines
+  @@ -1,11 +1,9 @@
+  -
+  -
+   1
+   2
+   3
+   4
+  -hello  world
+  -     goodbye world
+  +hello world
+  +goodbye world
+   7
+   8
+   9
+
+qdiff preserve existing git flag:
+
+  $ hg qrefresh --git
+  $ echo a >> lines
+  $ hg qdiff
+  diff --git a/lines b/lines
+  --- a/lines
+  +++ b/lines
+  @@ -1,9 +1,12 @@
+  +
+  +
+   1
+   2
+   3
+   4
+  -hello world
+  -goodbye world
+  +hello  world
+  +     goodbye world
+   7
+   8
+   9
+  +a
+
+  $ hg qdiff --stat
+   lines |  7 +++++--
+   1 files changed, 5 insertions(+), 2 deletions(-)
+
--- a/tests/test-mq-qfold	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-#!/bin/sh
-
-echo "[extensions]" >> $HGRCPATH
-echo "mq=" >> $HGRCPATH
-echo "[mq]" >> $HGRCPATH
-echo "git=keep" >> $HGRCPATH
-
-filterdiff()
-{
-    grep -v diff | \
-	sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
-	-e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
-}
-
-filterpatch()
-{
-    sed -e "s/\(# Parent \).*/\1/"
-}
-
-echo '% init'
-hg init repo
-cd repo
-echo a > a
-hg ci -Am adda
-echo a >> a
-hg qnew -f p1
-echo b >> a
-hg qnew -f p2
-echo c >> a
-hg qnew -f p3
-echo '% fold in the middle of the queue'
-hg qpop p1
-hg qdiff | filterdiff
-hg qfold p2
-grep git .hg/patches/p1 && echo 'git patch found!'
-hg qser
-hg qdiff | filterdiff
-echo '% fold with local changes'
-echo d >> a
-hg qfold p3
-hg diff -c . | filterdiff
-hg revert -a --no-backup
-
-echo '% fold git patch into a regular patch, expect git patch'
-echo a >> a
-hg qnew -f regular
-hg cp a aa
-hg qnew --git -f git
-hg qpop
-hg qfold git
-cat .hg/patches/regular | filterpatch
-hg qpop
-hg qdel regular
-
-echo '% fold regular patch into a git patch, expect git patch'
-hg cp a aa
-hg qnew --git -f git
-echo b >> aa
-hg qnew -f regular
-hg qpop
-hg qfold regular
-cat .hg/patches/git | filterpatch
-
-cd ..
-
-
--- a/tests/test-mq-qfold.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-% init
-adding a
-% fold in the middle of the queue
-popping p3
-popping p2
-now at: p1
---- a/a
-+++ b/a
-@@ -1,1 +1,2 @@
- a
-+a
-p1
-p3
---- a/a
-+++ b/a
-@@ -1,1 +1,3 @@
- a
-+a
-+b
-% fold with local changes
-abort: local changes found, refresh first
---- a/a
-+++ b/a
-@@ -1,1 +1,3 @@
- a
-+a
-+b
-reverting a
-% fold git patch into a regular patch, expect git patch
-popping git
-now at: regular
-# HG changeset patch
-# Parent 
-
-diff --git a/a b/a
---- a/a
-+++ b/a
-@@ -1,3 +1,4 @@
- a
- a
- b
-+a
-diff --git a/a b/aa
-copy from a
-copy to aa
---- a/a
-+++ b/aa
-@@ -1,3 +1,4 @@
- a
- a
- b
-+a
-popping regular
-now at: p1
-% fold regular patch into a git patch, expect git patch
-popping regular
-now at: git
-# HG changeset patch
-# Parent 
-
-diff --git a/a b/aa
-copy from a
-copy to aa
---- a/a
-+++ b/aa
-@@ -1,3 +1,4 @@
- a
- a
- b
-+b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-mq-qfold.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,144 @@
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "mq=" >> $HGRCPATH
+  $ echo "[mq]" >> $HGRCPATH
+  $ echo "git=keep" >> $HGRCPATH
+  $ echo "[diff]" >> $HGRCPATH
+  $ echo "nodates=1" >> $HGRCPATH
+
+init:
+
+  $ hg init repo
+  $ cd repo
+  $ echo a > a
+  $ hg ci -Am adda
+  adding a
+  $ echo a >> a
+  $ hg qnew -f p1
+  $ echo b >> a
+  $ hg qnew -f p2
+  $ echo c >> a
+  $ hg qnew -f p3
+
+Fold in the middle of the queue:
+
+  $ hg qpop p1
+  popping p3
+  popping p2
+  now at: p1
+
+  $ hg qdiff
+  diff -r 07f494440405 a
+  --- a/a
+  +++ b/a
+  @@ -1,1 +1,2 @@
+   a
+  +a
+
+  $ hg qfold p2
+  $ grep git .hg/patches/p1 && echo 'git patch found!'
+  [1]
+
+  $ hg qser
+  p1
+  p3
+
+  $ hg qdiff
+  diff -r 07f494440405 a
+  --- a/a
+  +++ b/a
+  @@ -1,1 +1,3 @@
+   a
+  +a
+  +b
+
+Fold with local changes:
+
+  $ echo d >> a
+  $ hg qfold p3
+  abort: local changes found, refresh first
+  [255]
+
+  $ hg diff -c .
+  diff -r 07f494440405 -r ???????????? a (glob)
+  --- a/a
+  +++ b/a
+  @@ -1,1 +1,3 @@
+   a
+  +a
+  +b
+
+  $ hg revert -a --no-backup
+  reverting a
+
+Fold git patch into a regular patch, expect git patch:
+
+  $ echo a >> a
+  $ hg qnew -f regular
+  $ hg cp a aa
+  $ hg qnew --git -f git
+
+  $ hg qpop
+  popping git
+  now at: regular
+
+  $ hg qfold git
+
+  $ cat .hg/patches/regular
+  # HG changeset patch
+  # Parent ???????????????????????????????????????? (glob)
+  
+  diff --git a/a b/a
+  --- a/a
+  +++ b/a
+  @@ -1,3 +1,4 @@
+   a
+   a
+   b
+  +a
+  diff --git a/a b/aa
+  copy from a
+  copy to aa
+  --- a/a
+  +++ b/aa
+  @@ -1,3 +1,4 @@
+   a
+   a
+   b
+  +a
+
+  $ hg qpop
+  popping regular
+  now at: p1
+
+  $ hg qdel regular
+
+Fold regular patch into a git patch, expect git patch:
+
+  $ hg cp a aa
+  $ hg qnew --git -f git
+  $ echo b >> aa
+  $ hg qnew -f regular
+
+  $ hg qpop
+  popping regular
+  now at: git
+
+  $ hg qfold regular
+
+  $ cat .hg/patches/git
+  # HG changeset patch
+  # Parent ???????????????????????????????????????? (glob)
+  
+  diff --git a/a b/aa
+  copy from a
+  copy to aa
+  --- a/a
+  +++ b/aa
+  @@ -1,3 +1,4 @@
+   a
+   a
+   b
+  +b
+
+  $ cd ..
+
--- a/tests/test-mq-qgoto	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-#!/bin/sh
-
-echo "[extensions]" >> $HGRCPATH
-echo "mq=" >> $HGRCPATH
-
-hg init a
-cd a
-echo a > a
-hg ci -Ama
-
-hg qnew a.patch
-echo a >> a
-hg qrefresh
-
-hg qnew b.patch
-echo b > b
-hg add b
-hg qrefresh
-
-hg qnew c.patch
-echo c > c
-hg add c
-hg qrefresh
-
-hg qgoto a.patch
-hg qgoto c.patch
-hg qgoto b.patch
-
-echo
-echo % Using index
-hg qgoto 0
-hg qgoto 2
-
-echo
-echo % No warnings when using index
-hg qnew bug314159
-echo d >> c
-hg qrefresh
-hg qnew bug141421
-echo e >> c
-hg qrefresh
-hg qgoto 1
-hg qgoto 3
-
-echo
-echo % Detect ambiguous non-index
-hg qgoto 14
-
-exit 0
--- a/tests/test-mq-qgoto.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-adding a
-popping c.patch
-popping b.patch
-now at: a.patch
-applying b.patch
-applying c.patch
-now at: c.patch
-popping c.patch
-now at: b.patch
-
-% Using index
-popping b.patch
-now at: a.patch
-applying b.patch
-applying c.patch
-now at: c.patch
-
-% No warnings when using index
-popping bug141421
-popping bug314159
-popping c.patch
-now at: b.patch
-applying c.patch
-applying bug314159
-now at: bug314159
-
-% Detect ambiguous non-index
-patch name "14" is ambiguous:
-  bug314159
-  bug141421
-abort: patch 14 not in series
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-mq-qgoto.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,77 @@
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "mq=" >> $HGRCPATH
+
+  $ hg init a
+  $ cd a
+  $ echo a > a
+  $ hg ci -Ama
+  adding a
+
+  $ hg qnew a.patch
+  $ echo a >> a
+  $ hg qrefresh
+
+  $ hg qnew b.patch
+  $ echo b > b
+  $ hg add b
+  $ hg qrefresh
+
+  $ hg qnew c.patch
+  $ echo c > c
+  $ hg add c
+  $ hg qrefresh
+
+  $ hg qgoto a.patch
+  popping c.patch
+  popping b.patch
+  now at: a.patch
+
+  $ hg qgoto c.patch
+  applying b.patch
+  applying c.patch
+  now at: c.patch
+
+  $ hg qgoto b.patch
+  popping c.patch
+  now at: b.patch
+
+Using index:
+
+  $ hg qgoto 0
+  popping b.patch
+  now at: a.patch
+
+  $ hg qgoto 2
+  applying b.patch
+  applying c.patch
+  now at: c.patch
+
+No warnings when using index:
+
+  $ hg qnew bug314159
+  $ echo d >> c
+  $ hg qrefresh
+  $ hg qnew bug141421
+  $ echo e >> c
+  $ hg qrefresh
+
+  $ hg qgoto 1
+  popping bug141421
+  popping bug314159
+  popping c.patch
+  now at: b.patch
+
+  $ hg qgoto 3
+  applying c.patch
+  applying bug314159
+  now at: bug314159
+
+Detect ambiguous non-index:
+
+  $ hg qgoto 14
+  patch name "14" is ambiguous:
+    bug314159
+    bug141421
+  abort: patch 14 not in series
+  [255]
+
--- a/tests/test-mq-qimport	Wed Sep 22 17:13:49 2010 -0500
+++ b/tests/test-mq-qimport	Wed Sep 22 18:29:41 2010 -0500
@@ -109,3 +109,19 @@
 hg qimport --push another.diff
 hg qfin -a
 hg qimport -rtip -P
+
+hg qpop -a
+hg qdel -k 2.diff
+echo % qimport -e
+hg qimport -e 2.diff
+hg qdel -k 2.diff
+echo % qimport -e --name newname oldexisitingpatch
+hg qimport -e --name this-name-is-better 2.diff
+hg qser
+echo % qimport -e --name without --force
+cp .hg/patches/this-name-is-better .hg/patches/3.diff
+hg qimport -e --name this-name-is-better 3.diff
+hg qser
+echo % qimport -e --name with --force
+hg qimport --force -e --name this-name-is-better 3.diff
+hg qser
--- a/tests/test-mq-qimport.out	Wed Sep 22 17:13:49 2010 -0500
+++ b/tests/test-mq-qimport.out	Wed Sep 22 18:29:41 2010 -0500
@@ -52,3 +52,21 @@
 now at: another.diff
 patch b.diff finalized without changeset message
 patch another.diff finalized without changeset message
+popping 2.diff
+patch queue now empty
+% qimport -e
+adding 2.diff to series file
+% qimport -e --name newname oldexisitingpatch
+renaming 2.diff to this-name-is-better
+adding this-name-is-better to series file
+this-name-is-better
+url.diff
+% qimport -e --name without --force
+abort: patch "this-name-is-better" already exists
+this-name-is-better
+url.diff
+% qimport -e --name with --force
+renaming 3.diff to this-name-is-better
+adding this-name-is-better to series file
+this-name-is-better
+url.diff
--- a/tests/test-mq-qnew	Wed Sep 22 17:13:49 2010 -0500
+++ b/tests/test-mq-qnew	Wed Sep 22 18:29:41 2010 -0500
@@ -70,6 +70,10 @@
     HGUSER= hg qnew -u blue red
     catpatch ../.hg/patches/red
 
+    echo '% qnew -e -u with no username configured'
+    HGUSER= hg qnew -e -u chartreuse fucsia
+    catpatch ../.hg/patches/fucsia
+
     echo '% fail when trying to import a merge'
     hg init merge
     cd merge
--- a/tests/test-mq-qnew.out	Wed Sep 22 17:13:49 2010 -0500
+++ b/tests/test-mq-qnew.out	Wed Sep 22 18:29:41 2010 -0500
@@ -42,6 +42,9 @@
 % qnew -u with no username configured
 From: blue
 
+% qnew -e -u with no username configured
+From: chartreuse
+
 % fail when trying to import a merge
 adding a
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -50,7 +53,7 @@
 warning: conflicts during merge.
 merging a failed!
 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
+use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
 abort: cannot manage merge changesets
 %%% hg headers
 adding a
@@ -101,6 +104,10 @@
 # HG changeset patch
 # Parent 
 # User blue
+% qnew -e -u with no username configured
+# HG changeset patch
+# Parent 
+# User chartreuse
 % fail when trying to import a merge
 adding a
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -109,5 +116,5 @@
 warning: conflicts during merge.
 merging a failed!
 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
+use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
 abort: cannot manage merge changesets
--- a/tests/test-mq-qqueue	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-#!/bin/sh
-
-echo "[extensions]" >> $HGRCPATH
-echo "mq=" >> $HGRCPATH
-
-hg init foo
-cd foo
-echo a > a
-hg ci -qAm a
-
-echo %% default queue
-hg qqueue
-
-echo b > a
-hg qnew -fgDU somestuff
-
-echo %% applied patches in default queue
-hg qap
-
-echo %% try to change patch \(create succeeds, switch fails\)
-hg qqueue foo --create
-hg qqueue
-
-echo %% empty default queue
-hg qpop
-
-echo %% switch queue
-hg qqueue foo
-hg qqueue
-
-echo %% fail creating queue with already existing name
-hg qqueue --create foo
-hg qqueue
-
-echo %% unapplied patches
-hg qun
-echo c > a
-hg qnew -fgDU otherstuff
-
-echo %% fail switching back
-hg qqueue patches
-
-echo %% fail deleting current
-hg qqueue foo --delete
-
-echo %% switch back and delete foo
-hg qpop -a
-hg qqueue patches
-hg qqueue foo --delete
-hg qqueue
-
-echo %% tricky cases
-hg qqueue store --create
-hg qnew journal
-hg qqueue
-hg qpop -a
-hg qqueue patches
-hg qun
-
-echo %% invalid names
-hg qqueue test/../../bar --create
-hg qqueue . --create
-
-cd ..
--- a/tests/test-mq-qqueue.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-%% default queue
-patches (active)
-%% applied patches in default queue
-somestuff
-%% try to change patch (create succeeds, switch fails)
-abort: patches applied - cannot set new queue active
-foo
-patches (active)
-%% empty default queue
-popping somestuff
-patch queue now empty
-%% switch queue
-foo (active)
-patches
-%% fail creating queue with already existing name
-abort: queue "foo" already exists
-foo (active)
-patches
-%% unapplied patches
-%% fail switching back
-abort: patches applied - cannot set new queue active
-%% fail deleting current
-abort: cannot delete currently active queue
-%% switch back and delete foo
-popping otherstuff
-patch queue now empty
-patches (active)
-%% tricky cases
-patches
-store (active)
-popping journal
-patch queue now empty
-somestuff
-%% invalid names
-abort: invalid queue name, may not contain the characters ":\/."
-abort: invalid queue name, may not contain the characters ":\/."
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-mq-qqueue.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,188 @@
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "mq=" >> $HGRCPATH
+
+  $ hg init foo
+  $ cd foo
+  $ echo a > a
+  $ hg ci -qAm a
+
+Default queue:
+
+  $ hg qqueue
+  patches (active)
+
+  $ echo b > a
+  $ hg qnew -fgDU somestuff
+
+Applied patches in default queue:
+
+  $ hg qap
+  somestuff
+
+Try to change patch (create succeeds, switch fails):
+
+  $ hg qqueue foo --create
+  abort: patches applied - cannot set new queue active
+  [255]
+
+  $ hg qqueue
+  foo
+  patches (active)
+
+Empty default queue:
+
+  $ hg qpop
+  popping somestuff
+  patch queue now empty
+
+Switch queue:
+
+  $ hg qqueue foo
+  $ hg qqueue
+  foo (active)
+  patches
+
+List queues, quiet:
+
+  $ hg qqueue --quiet
+  foo
+  patches
+
+Fail creating queue with already existing name:
+
+  $ hg qqueue --create foo
+  abort: queue "foo" already exists
+  [255]
+
+  $ hg qqueue
+  foo (active)
+  patches
+
+Create new queue for rename:
+
+  $ hg qqueue --create bar
+
+  $ hg qqueue
+  bar (active)
+  foo
+  patches
+
+Rename queue, same name:
+
+  $ hg qqueue --rename bar
+  abort: can't rename "bar" to its current name
+  [255]
+
+Rename queue to existing:
+
+  $ hg qqueue --rename foo
+  abort: queue "foo" already exists
+  [255]
+
+Rename queue:
+
+  $ hg qqueue --rename buz
+
+  $ hg qqueue
+  buz (active)
+  foo
+  patches
+
+Switch back to previous queue:
+
+  $ hg qqueue foo
+  $ hg qqueue --delete buz
+
+  $ hg qqueue
+  foo (active)
+  patches
+
+Create queue for purge:
+
+  $ hg qqueue --create purge-me
+
+  $ hg qqueue
+  foo
+  patches
+  purge-me (active)
+
+Create patch for purge:
+
+  $ hg qnew patch-purge-me
+
+  $ ls -1d .hg/patches-purge-me 2>/dev/null || true
+  .hg/patches-purge-me
+
+  $ hg qpop -a
+  popping patch-purge-me
+  patch queue now empty
+
+Purge queue:
+
+  $ hg qqueue foo
+  $ hg qqueue --purge purge-me
+
+  $ hg qqueue
+  foo (active)
+  patches
+
+  $ ls -1d .hg/patches-purge-me 2>/dev/null || true
+
+Unapplied patches:
+
+  $ hg qun
+  $ echo c > a
+  $ hg qnew -fgDU otherstuff
+
+Fail switching back:
+
+  $ hg qqueue patches
+  abort: patches applied - cannot set new queue active
+  [255]
+
+Fail deleting current:
+
+  $ hg qqueue foo --delete
+  abort: cannot delete currently active queue
+  [255]
+
+Switch back and delete foo:
+
+  $ hg qpop -a
+  popping otherstuff
+  patch queue now empty
+
+  $ hg qqueue patches
+  $ hg qqueue foo --delete
+  $ hg qqueue
+  patches (active)
+
+Tricky cases:
+
+  $ hg qqueue store --create
+  $ hg qnew journal
+
+  $ hg qqueue
+  patches
+  store (active)
+
+  $ hg qpop -a
+  popping journal
+  patch queue now empty
+
+  $ hg qqueue patches
+  $ hg qun
+  somestuff
+
+Invalid names:
+
+  $ hg qqueue test/../../bar --create
+  abort: invalid queue name, may not contain the characters ":\/."
+  [255]
+
+  $ hg qqueue . --create
+  abort: invalid queue name, may not contain the characters ":\/."
+  [255]
+
+  $ cd ..
+
--- a/tests/test-mq-qrefresh	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,198 +0,0 @@
-#!/bin/sh
-
-echo "[extensions]" >> $HGRCPATH
-echo "mq=" >> $HGRCPATH
-
-catpatch() {
-    cat $1 | sed -e "s/^\(# Parent \).*/\1/"
-}
-
-echo % init
-hg init a
-cd a
-
-echo % commit
-mkdir 1 2
-echo 'base' > 1/base
-echo 'base' > 2/base
-hg ci -Ambase -d '1 0'
-
-echo % qnew mqbase
-hg qnew -mmqbase mqbase
-
-echo % qrefresh
-echo 'patched' > 1/base
-echo 'patched' > 2/base
-hg qrefresh
-
-echo % qdiff
-hg qdiff | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
-               -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
-
-echo % qdiff dirname
-hg qdiff . | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
-                 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
-
-echo % patch file contents
-catpatch .hg/patches/mqbase | \
-sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
-    -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
-
-echo % qrefresh 1
-echo 'patched again' > base
-hg qrefresh 1
-
-echo % qdiff
-hg qdiff | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
-               -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
-
-echo % qdiff dirname
-hg qdiff . | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
-                 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
-
-echo % patch file contents
-catpatch .hg/patches/mqbase | \
-sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
-    -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
-
-echo % qrefresh . in subdir
-( cd 1 ; hg qrefresh . )
-
-echo % qdiff
-hg qdiff | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
-               -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
-
-echo % qdiff dirname
-hg qdiff . | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
-                 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
-
-echo % patch file contents
-catpatch .hg/patches/mqbase | \
-sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
-    -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
-
-echo % qrefresh in hg-root again
-hg qrefresh
-
-echo % qdiff
-hg qdiff | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
-               -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
-
-echo % qdiff dirname
-hg qdiff . | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
-                 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
-
-echo % patch file contents
-catpatch .hg/patches/mqbase | \
-sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
-    -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
-
-echo
-echo % qrefresh --short tests:
-echo 'orphan' > orphanchild
-hg add orphanchild
-
-echo % - add 1/base and 2/base one by one
-hg qrefresh nonexistingfilename # clear patch
-hg qrefresh --short 1/base
-hg qrefresh --short 2/base
-
-echo % -- qdiff output
-hg qdiff | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
-               -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
-
-echo % -- patch file content
-catpatch .hg/patches/mqbase | \
-sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
-    -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
-hg st
-
-echo % -- diff shows what is not in patch
-hg diff | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
-              -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" \
-              -e "s/^\(diff\).*/\1/"
-echo % - before starting exclusive tests
-sed -n '/^diff/s/diff -r [^ ]* //p' .hg/patches/mqbase
-echo % - exclude 2/base
-hg qref -s -X 2/base
-sed -n '/^diff/s/diff -r [^ ]* //p' .hg/patches/mqbase
-echo % -- status shows 2/base as dirty
-hg st
-echo % - remove 1/base and add 2/base again but not orphanchild
-hg qref -s -X orphanchild -X 1/base 2/base orphanchild
-sed -n '/^diff/s/diff -r [^ ]* //p' .hg/patches/mqbase
-echo % - add 1/base with include filter - and thus remove 2/base from patch
-hg qref -s -I 1/ o* */*
-sed -n '/^diff/s/diff -r [^ ]* //p' .hg/patches/mqbase
-echo
-cd ..
-
-# Test qrefresh --git losing copy metadata
-echo % create test repo
-hg init repo
-cd repo
-echo "[diff]" >> .hg/hgrc
-echo "git=True" >> .hg/hgrc
-echo a > a
-hg ci -Am adda
-hg copy a ab
-echo b >> ab
-hg copy a ac
-echo c >> ac
-echo % capture changes
-hg qnew -f p1
-hg qdiff
-echo % refresh and check changes again
-hg qref
-hg qdiff
-cd ..
-
-# Test issue 1441: qrefresh confused after hg rename
-echo % issue1441 without git patches
-hg init repo-1441
-cd repo-1441
-echo a > a
-hg add a
-hg qnew -f p
-hg mv a b
-hg qrefresh
-hg qdiff --nodates
-cd ..
-
-echo '% issue2025: qrefresh does not honor filtering options when tip != qtip'
-hg init repo-2025
-cd repo-2025
-echo a > a
-echo b > b
-hg ci -qAm addab
-echo a >> a
-echo b >> b
-hg qnew -f patch
-hg up -qC 0
-echo c > c
-hg ci -qAm addc
-hg up -qC 1
-echo '% refresh with tip != qtip'
-hg --config diff.nodates=1 qrefresh -I b 2>&1 \
-    | sed 's/saving bundle.*/saving bundle.../g'
-echo '% status after refresh'
-hg st
-echo '% b after refresh'
-cat b
-echo '% patch file after refresh'
-catpatch .hg/patches/patch
-cd ..
-
-
-echo % issue1441 with git patches
-hg init repo-1441-git
-cd repo-1441-git
-echo "[diff]" >> .hg/hgrc
-echo "git=True" >> .hg/hgrc
-echo a > a
-hg add a
-hg qnew -f p
-hg mv a b
-hg qrefresh
-hg qdiff --nodates
-cd ..
--- a/tests/test-mq-qrefresh.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,295 +0,0 @@
-% init
-% commit
-adding 1/base
-adding 2/base
-% qnew mqbase
-% qrefresh
-% qdiff
-diff -r b55ecdccb5cf 1/base
---- a/1/base
-+++ b/1/base
-@@ -1,1 +1,1 @@
--base
-+patched
-diff -r b55ecdccb5cf 2/base
---- a/2/base
-+++ b/2/base
-@@ -1,1 +1,1 @@
--base
-+patched
-% qdiff dirname
-diff -r b55ecdccb5cf 1/base
---- a/1/base
-+++ b/1/base
-@@ -1,1 +1,1 @@
--base
-+patched
-diff -r b55ecdccb5cf 2/base
---- a/2/base
-+++ b/2/base
-@@ -1,1 +1,1 @@
--base
-+patched
-% patch file contents
-# HG changeset patch
-# Parent 
-mqbase
-
-diff -r b55ecdccb5cf 1/base
---- a/1/base
-+++ b/1/base
-@@ -1,1 +1,1 @@
--base
-+patched
-diff -r b55ecdccb5cf 2/base
---- a/2/base
-+++ b/2/base
-@@ -1,1 +1,1 @@
--base
-+patched
-% qrefresh 1
-% qdiff
-diff -r b55ecdccb5cf 1/base
---- a/1/base
-+++ b/1/base
-@@ -1,1 +1,1 @@
--base
-+patched
-diff -r b55ecdccb5cf 2/base
---- a/2/base
-+++ b/2/base
-@@ -1,1 +1,1 @@
--base
-+patched
-% qdiff dirname
-diff -r b55ecdccb5cf 1/base
---- a/1/base
-+++ b/1/base
-@@ -1,1 +1,1 @@
--base
-+patched
-diff -r b55ecdccb5cf 2/base
---- a/2/base
-+++ b/2/base
-@@ -1,1 +1,1 @@
--base
-+patched
-% patch file contents
-# HG changeset patch
-# Parent 
-mqbase
-
-diff -r b55ecdccb5cf 1/base
---- a/1/base
-+++ b/1/base
-@@ -1,1 +1,1 @@
--base
-+patched
-% qrefresh . in subdir
-% qdiff
-diff -r b55ecdccb5cf 1/base
---- a/1/base
-+++ b/1/base
-@@ -1,1 +1,1 @@
--base
-+patched
-diff -r b55ecdccb5cf 2/base
---- a/2/base
-+++ b/2/base
-@@ -1,1 +1,1 @@
--base
-+patched
-% qdiff dirname
-diff -r b55ecdccb5cf 1/base
---- a/1/base
-+++ b/1/base
-@@ -1,1 +1,1 @@
--base
-+patched
-diff -r b55ecdccb5cf 2/base
---- a/2/base
-+++ b/2/base
-@@ -1,1 +1,1 @@
--base
-+patched
-% patch file contents
-# HG changeset patch
-# Parent 
-mqbase
-
-diff -r b55ecdccb5cf 1/base
---- a/1/base
-+++ b/1/base
-@@ -1,1 +1,1 @@
--base
-+patched
-% qrefresh in hg-root again
-% qdiff
-diff -r b55ecdccb5cf 1/base
---- a/1/base
-+++ b/1/base
-@@ -1,1 +1,1 @@
--base
-+patched
-diff -r b55ecdccb5cf 2/base
---- a/2/base
-+++ b/2/base
-@@ -1,1 +1,1 @@
--base
-+patched
-% qdiff dirname
-diff -r b55ecdccb5cf 1/base
---- a/1/base
-+++ b/1/base
-@@ -1,1 +1,1 @@
--base
-+patched
-diff -r b55ecdccb5cf 2/base
---- a/2/base
-+++ b/2/base
-@@ -1,1 +1,1 @@
--base
-+patched
-% patch file contents
-# HG changeset patch
-# Parent 
-mqbase
-
-diff -r b55ecdccb5cf 1/base
---- a/1/base
-+++ b/1/base
-@@ -1,1 +1,1 @@
--base
-+patched
-diff -r b55ecdccb5cf 2/base
---- a/2/base
-+++ b/2/base
-@@ -1,1 +1,1 @@
--base
-+patched
-
-% qrefresh --short tests:
-% - add 1/base and 2/base one by one
-% -- qdiff output
-diff -r b55ecdccb5cf 1/base
---- a/1/base
-+++ b/1/base
-@@ -1,1 +1,1 @@
--base
-+patched
-diff -r b55ecdccb5cf 2/base
---- a/2/base
-+++ b/2/base
-@@ -1,1 +1,1 @@
--base
-+patched
-diff -r b55ecdccb5cf orphanchild
---- /dev/null
-+++ b/orphanchild
-@@ -0,0 +1,1 @@
-+orphan
-% -- patch file content
-# HG changeset patch
-# Parent 
-mqbase
-
-diff -r b55ecdccb5cf 1/base
---- a/1/base
-+++ b/1/base
-@@ -1,1 +1,1 @@
--base
-+patched
-diff -r b55ecdccb5cf 2/base
---- a/2/base
-+++ b/2/base
-@@ -1,1 +1,1 @@
--base
-+patched
-A orphanchild
-? base
-% -- diff shows what is not in patch
-diff
---- /dev/null
-+++ b/orphanchild
-@@ -0,0 +1,1 @@
-+orphan
-% - before starting exclusive tests
-1/base
-2/base
-% - exclude 2/base
-1/base
-% -- status shows 2/base as dirty
-M 2/base
-A orphanchild
-? base
-% - remove 1/base and add 2/base again but not orphanchild
-2/base
-% - add 1/base with include filter - and thus remove 2/base from patch
-1/base
-
-% create test repo
-adding a
-% capture changes
-diff --git a/a b/ab
-copy from a
-copy to ab
---- a/a
-+++ b/ab
-@@ -1,1 +1,2 @@
- a
-+b
-diff --git a/a b/ac
-copy from a
-copy to ac
---- a/a
-+++ b/ac
-@@ -1,1 +1,2 @@
- a
-+c
-% refresh and check changes again
-diff --git a/a b/ab
-copy from a
-copy to ab
---- a/a
-+++ b/ab
-@@ -1,1 +1,2 @@
- a
-+b
-diff --git a/a b/ac
-copy from a
-copy to ac
---- a/a
-+++ b/ac
-@@ -1,1 +1,2 @@
- a
-+c
-% issue1441 without git patches
-diff -r 000000000000 b
---- /dev/null
-+++ b/b
-@@ -0,0 +1,1 @@
-+a
-% issue2025: qrefresh does not honor filtering options when tip != qtip
-% refresh with tip != qtip
-% status after refresh
-M a
-% b after refresh
-b
-b
-% patch file after refresh
-# HG changeset patch
-# Parent 
-
-diff -r 1a60229be7ac b
---- a/b
-+++ b/b
-@@ -1,1 +1,2 @@
- b
-+b
-% issue1441 with git patches
-diff --git a/b b/b
-new file mode 100644
---- /dev/null
-+++ b/b
-@@ -0,0 +1,1 @@
-+a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-mq-qrefresh.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,488 @@
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "mq=" >> $HGRCPATH
+  $ echo "[diff]" >> $HGRCPATH
+  $ echo "nodates=1" >> $HGRCPATH
+
+  $ hg init a
+  $ cd a
+
+  $ mkdir 1 2
+  $ echo 'base' > 1/base
+  $ echo 'base' > 2/base
+  $ hg ci -Ambase
+  adding 1/base
+  adding 2/base
+
+  $ hg qnew -mmqbase mqbase
+
+  $ echo 'patched' > 1/base
+  $ echo 'patched' > 2/base
+  $ hg qrefresh
+
+  $ hg qdiff
+  diff -r e7af5904b465 1/base
+  --- a/1/base
+  +++ b/1/base
+  @@ -1,1 +1,1 @@
+  -base
+  +patched
+  diff -r e7af5904b465 2/base
+  --- a/2/base
+  +++ b/2/base
+  @@ -1,1 +1,1 @@
+  -base
+  +patched
+
+  $ hg qdiff .
+  diff -r e7af5904b465 1/base
+  --- a/1/base
+  +++ b/1/base
+  @@ -1,1 +1,1 @@
+  -base
+  +patched
+  diff -r e7af5904b465 2/base
+  --- a/2/base
+  +++ b/2/base
+  @@ -1,1 +1,1 @@
+  -base
+  +patched
+
+  $ cat .hg/patches/mqbase
+  # HG changeset patch
+  # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
+  mqbase
+  
+  diff -r e7af5904b465 1/base
+  --- a/1/base
+  +++ b/1/base
+  @@ -1,1 +1,1 @@
+  -base
+  +patched
+  diff -r e7af5904b465 2/base
+  --- a/2/base
+  +++ b/2/base
+  @@ -1,1 +1,1 @@
+  -base
+  +patched
+
+  $ echo 'patched again' > base
+  $ hg qrefresh 1
+
+  $ hg qdiff
+  diff -r e7af5904b465 1/base
+  --- a/1/base
+  +++ b/1/base
+  @@ -1,1 +1,1 @@
+  -base
+  +patched
+  diff -r e7af5904b465 2/base
+  --- a/2/base
+  +++ b/2/base
+  @@ -1,1 +1,1 @@
+  -base
+  +patched
+
+  $ hg qdiff .
+  diff -r e7af5904b465 1/base
+  --- a/1/base
+  +++ b/1/base
+  @@ -1,1 +1,1 @@
+  -base
+  +patched
+  diff -r e7af5904b465 2/base
+  --- a/2/base
+  +++ b/2/base
+  @@ -1,1 +1,1 @@
+  -base
+  +patched
+
+  $ cat .hg/patches/mqbase
+  # HG changeset patch
+  # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
+  mqbase
+  
+  diff -r e7af5904b465 1/base
+  --- a/1/base
+  +++ b/1/base
+  @@ -1,1 +1,1 @@
+  -base
+  +patched
+
+qrefresh . in subdir:
+
+  $ ( cd 1 ; hg qrefresh . )
+
+  $ hg qdiff
+  diff -r e7af5904b465 1/base
+  --- a/1/base
+  +++ b/1/base
+  @@ -1,1 +1,1 @@
+  -base
+  +patched
+  diff -r e7af5904b465 2/base
+  --- a/2/base
+  +++ b/2/base
+  @@ -1,1 +1,1 @@
+  -base
+  +patched
+
+  $ hg qdiff .
+  diff -r e7af5904b465 1/base
+  --- a/1/base
+  +++ b/1/base
+  @@ -1,1 +1,1 @@
+  -base
+  +patched
+  diff -r e7af5904b465 2/base
+  --- a/2/base
+  +++ b/2/base
+  @@ -1,1 +1,1 @@
+  -base
+  +patched
+
+  $ cat .hg/patches/mqbase
+  # HG changeset patch
+  # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
+  mqbase
+  
+  diff -r e7af5904b465 1/base
+  --- a/1/base
+  +++ b/1/base
+  @@ -1,1 +1,1 @@
+  -base
+  +patched
+
+qrefresh in hg-root again:
+
+  $ hg qrefresh
+
+  $ hg qdiff
+  diff -r e7af5904b465 1/base
+  --- a/1/base
+  +++ b/1/base
+  @@ -1,1 +1,1 @@
+  -base
+  +patched
+  diff -r e7af5904b465 2/base
+  --- a/2/base
+  +++ b/2/base
+  @@ -1,1 +1,1 @@
+  -base
+  +patched
+
+  $ hg qdiff .
+  diff -r e7af5904b465 1/base
+  --- a/1/base
+  +++ b/1/base
+  @@ -1,1 +1,1 @@
+  -base
+  +patched
+  diff -r e7af5904b465 2/base
+  --- a/2/base
+  +++ b/2/base
+  @@ -1,1 +1,1 @@
+  -base
+  +patched
+
+  $ cat .hg/patches/mqbase
+  # HG changeset patch
+  # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
+  mqbase
+  
+  diff -r e7af5904b465 1/base
+  --- a/1/base
+  +++ b/1/base
+  @@ -1,1 +1,1 @@
+  -base
+  +patched
+  diff -r e7af5904b465 2/base
+  --- a/2/base
+  +++ b/2/base
+  @@ -1,1 +1,1 @@
+  -base
+  +patched
+
+
+qrefresh --short tests:
+
+  $ echo 'orphan' > orphanchild
+  $ hg add orphanchild
+  $ hg qrefresh nonexistingfilename # clear patch
+  $ hg qrefresh --short 1/base
+  $ hg qrefresh --short 2/base
+
+  $ hg qdiff
+  diff -r e7af5904b465 1/base
+  --- a/1/base
+  +++ b/1/base
+  @@ -1,1 +1,1 @@
+  -base
+  +patched
+  diff -r e7af5904b465 2/base
+  --- a/2/base
+  +++ b/2/base
+  @@ -1,1 +1,1 @@
+  -base
+  +patched
+  diff -r e7af5904b465 orphanchild
+  --- /dev/null
+  +++ b/orphanchild
+  @@ -0,0 +1,1 @@
+  +orphan
+
+  $ cat .hg/patches/mqbase
+  # HG changeset patch
+  # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
+  mqbase
+  
+  diff -r e7af5904b465 1/base
+  --- a/1/base
+  +++ b/1/base
+  @@ -1,1 +1,1 @@
+  -base
+  +patched
+  diff -r e7af5904b465 2/base
+  --- a/2/base
+  +++ b/2/base
+  @@ -1,1 +1,1 @@
+  -base
+  +patched
+
+  $ hg st
+  A orphanchild
+  ? base
+
+diff shows what is not in patch:
+
+  $ hg diff
+  diff -r ???????????? orphanchild (glob)
+  --- /dev/null
+  +++ b/orphanchild
+  @@ -0,0 +1,1 @@
+  +orphan
+
+Before starting exclusive tests:
+
+  $ cat .hg/patches/mqbase
+  # HG changeset patch
+  # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
+  mqbase
+  
+  diff -r e7af5904b465 1/base
+  --- a/1/base
+  +++ b/1/base
+  @@ -1,1 +1,1 @@
+  -base
+  +patched
+  diff -r e7af5904b465 2/base
+  --- a/2/base
+  +++ b/2/base
+  @@ -1,1 +1,1 @@
+  -base
+  +patched
+
+Exclude 2/base:
+
+  $ hg qref -s -X 2/base
+
+  $ cat .hg/patches/mqbase
+  # HG changeset patch
+  # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
+  mqbase
+  
+  diff -r e7af5904b465 1/base
+  --- a/1/base
+  +++ b/1/base
+  @@ -1,1 +1,1 @@
+  -base
+  +patched
+
+status shows 2/base as dirty:
+
+  $ hg status
+  M 2/base
+  A orphanchild
+  ? base
+
+Remove 1/base and add 2/base again but not orphanchild:
+
+  $ hg qref -s -X orphanchild -X 1/base 2/base orphanchild
+
+  $ cat .hg/patches/mqbase
+  # HG changeset patch
+  # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
+  mqbase
+  
+  diff -r e7af5904b465 2/base
+  --- a/2/base
+  +++ b/2/base
+  @@ -1,1 +1,1 @@
+  -base
+  +patched
+
+Add 1/base with include filter - and thus remove 2/base from patch:
+
+  $ hg qref -s -I 1/ o* */*
+
+  $ cat .hg/patches/mqbase
+  # HG changeset patch
+  # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
+  mqbase
+  
+  diff -r e7af5904b465 1/base
+  --- a/1/base
+  +++ b/1/base
+  @@ -1,1 +1,1 @@
+  -base
+  +patched
+
+  $ cd ..
+
+
+Test qrefresh --git losing copy metadata:
+
+  $ hg init repo
+  $ cd repo
+
+  $ echo "[diff]" >> .hg/hgrc
+  $ echo "git=True" >> .hg/hgrc
+  $ echo a > a
+
+  $ hg ci -Am adda
+  adding a
+  $ hg copy a ab
+  $ echo b >> ab
+  $ hg copy a ac
+  $ echo c >> ac
+
+Capture changes:
+
+  $ hg qnew -f p1
+
+  $ hg qdiff
+  diff --git a/a b/ab
+  copy from a
+  copy to ab
+  --- a/a
+  +++ b/ab
+  @@ -1,1 +1,2 @@
+   a
+  +b
+  diff --git a/a b/ac
+  copy from a
+  copy to ac
+  --- a/a
+  +++ b/ac
+  @@ -1,1 +1,2 @@
+   a
+  +c
+
+Refresh and check changes again:
+
+  $ hg qrefresh
+
+  $ hg qdiff
+  diff --git a/a b/ab
+  copy from a
+  copy to ab
+  --- a/a
+  +++ b/ab
+  @@ -1,1 +1,2 @@
+   a
+  +b
+  diff --git a/a b/ac
+  copy from a
+  copy to ac
+  --- a/a
+  +++ b/ac
+  @@ -1,1 +1,2 @@
+   a
+  +c
+
+  $ cd ..
+
+
+Test issue 1441: qrefresh confused after hg rename:
+
+  $ hg init repo-1441
+  $ cd repo-1441
+  $ echo a > a
+  $ hg add a
+  $ hg qnew -f p
+  $ hg mv a b
+  $ hg qrefresh
+
+  $ hg qdiff
+  diff -r 000000000000 b
+  --- /dev/null
+  +++ b/b
+  @@ -0,0 +1,1 @@
+  +a
+
+  $ cd ..
+
+
+Issue2025: qrefresh does not honor filtering options when tip != qtip:
+
+  $ hg init repo-2025
+  $ cd repo-2025
+  $ echo a > a
+  $ echo b > b
+  $ hg ci -qAm addab
+  $ echo a >> a
+  $ echo b >> b
+  $ hg qnew -f patch
+  $ hg up -qC 0
+  $ echo c > c
+  $ hg ci -qAm addc
+  $ hg up -qC 1
+
+refresh with tip != qtip:
+
+  $ hg --config diff.nodates=1 qrefresh -I b
+
+  $ hg st
+  M a
+
+  $ cat b
+  b
+  b
+
+  $ cat .hg/patches/patch
+  # HG changeset patch
+  # Parent 1a60229be7ac3e4a7f647508e99b87bef1f03593
+  
+  diff -r 1a60229be7ac b
+  --- a/b
+  +++ b/b
+  @@ -1,1 +1,2 @@
+   b
+  +b
+
+  $ cd ..
+
+
+Issue1441 with git patches:
+
+  $ hg init repo-1441-git
+  $ cd repo-1441-git
+
+  $ echo "[diff]" >> .hg/hgrc
+  $ echo "git=True" >> .hg/hgrc
+
+  $ echo a > a
+  $ hg add a
+  $ hg qnew -f p
+  $ hg mv a b
+  $ hg qrefresh
+
+  $ hg qdiff --nodates
+  diff --git a/b b/b
+  new file mode 100644
+  --- /dev/null
+  +++ b/b
+  @@ -0,0 +1,1 @@
+  +a
+
+  $ cd ..
+
--- a/tests/test-mq-qrename	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-#!/bin/sh
-
-echo "[extensions]" >> $HGRCPATH
-echo "mq=" >> $HGRCPATH
-
-hg init a
-cd a
-
-echo 'base' > base
-hg ci -Ambase -d '1 0'
-
-hg qnew -mmqbase mqbase
-hg qrename mqbase renamed
-mkdir .hg/patches/foo
-hg qrename renamed foo
-hg qseries
-ls .hg/patches/foo
-mkdir .hg/patches/bar
-hg qrename foo/renamed bar
-hg qseries
-ls .hg/patches/bar
-hg qrename bar/renamed baz
-hg qseries
-ls .hg/patches/baz
-hg qrename baz new/dir
-hg qseries
-ls .hg/patches/new/dir
-cd ..
-
-echo % test patch being renamed before committed
-hg init b
-cd b
-hg qinit -c
-hg qnew x
-hg qrename y
-hg qcommit -m rename
-cd ..
-
-echo '% test overlapping renames (issue2388)'
-hg init c
-cd c
-hg qinit -c
-echo a > a
-hg add
-hg qnew patcha
-echo b > b
-hg add
-hg qnew patchb
-hg ci --mq -m c1
-hg qrename patchb patchc
-hg qrename patcha patchb
-hg st --mq
-cd ..
\ No newline at end of file
--- a/tests/test-mq-qrename.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-adding base
-foo/renamed
-renamed
-bar/renamed
-renamed
-baz
-.hg/patches/baz
-new/dir
-.hg/patches/new/dir
-% test patch being renamed before committed
-% test overlapping renames (issue2388)
-adding a
-adding b
-M patchb
-M series
-A patchc
-R patcha
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-mq-qrename.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,83 @@
+
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "mq=" >> $HGRCPATH
+
+  $ hg init a
+  $ cd a
+
+  $ echo 'base' > base
+  $ hg ci -Ambase
+  adding base
+
+  $ hg qnew -mmqbase mqbase
+
+  $ hg qrename mqbase renamed
+  $ mkdir .hg/patches/foo
+  $ hg qrename renamed foo
+
+  $ hg qseries
+  foo/renamed
+
+  $ ls .hg/patches/foo
+  renamed
+
+  $ mkdir .hg/patches/bar
+  $ hg qrename foo/renamed bar
+
+  $ hg qseries
+  bar/renamed
+
+  $ ls .hg/patches/bar
+  renamed
+
+  $ hg qrename bar/renamed baz
+
+  $ hg qseries
+  baz
+
+  $ ls .hg/patches/baz
+  .hg/patches/baz
+
+  $ hg qrename baz new/dir
+
+  $ hg qseries
+  new/dir
+
+  $ ls .hg/patches/new/dir
+  .hg/patches/new/dir
+
+  $ cd ..
+
+Test patch being renamed before committed:
+
+  $ hg init b
+  $ cd b
+  $ hg qinit -c
+  $ hg qnew x
+  $ hg qrename y
+  $ hg qcommit -m rename
+
+  $ cd ..
+
+Test overlapping renames (issue2388)
+
+  $ hg init c
+  $ cd c
+  $ hg qinit -c
+  $ echo a > a
+  $ hg add
+  adding a
+  $ hg qnew patcha
+  $ echo b > b
+  $ hg add
+  adding b
+  $ hg qnew patchb
+  $ hg ci --mq -m c1
+  $ hg qrename patchb patchc
+  $ hg qrename patcha patchb
+  $ hg st --mq
+  M patchb
+  M series
+  A patchc
+  R patcha
+  $ cd ..
--- a/tests/test-mq-qsave	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-#!/bin/sh
-
-echo "[extensions]" >> $HGRCPATH
-echo "mq=" >> $HGRCPATH
-
-hg init a
-cd a
-
-echo 'base' > base
-hg ci -Ambase -d '1 0'
-
-hg qnew -mmqbase mqbase
-
-hg qsave
-hg qrestore 2
--- a/tests/test-mq-qsave.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-adding base
-restoring status: hg patches saved state
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-mq-qsave.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,15 @@
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "mq=" >> $HGRCPATH
+
+  $ hg init
+
+  $ echo 'base' > base
+  $ hg ci -Ambase
+  adding base
+
+  $ hg qnew -mmqbase mqbase
+
+  $ hg qsave
+  $ hg qrestore 2
+  restoring status: hg patches saved state
+
--- a/tests/test-mq-safety	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +0,0 @@
-#!/bin/sh
-
-echo '[extensions]' >> $HGRCPATH
-echo 'mq =' >> $HGRCPATH
-
-hg init repo
-cd repo
-
-echo foo > foo
-hg ci -qAm 'add a file'
-
-hg qinit
-
-hg qnew foo
-echo foo >> foo
-hg qrefresh -m 'append foo'
-
-hg qnew bar
-echo bar >> foo
-hg qrefresh -m 'append bar'
-
-echo '% try to commit on top of a patch'
-echo quux >> foo
-hg ci -m 'append quux'
-
-# cheat a bit...
-mv .hg/patches .hg/patches2
-hg ci -m 'append quux'
-mv .hg/patches2 .hg/patches
-
-echo '% qpop/qrefresh on the wrong revision'
-hg qpop
-hg qpop -n patches 2>&1 | sed -e 's/\(using patch queue:\).*/\1/'
-hg qrefresh
-
-hg up -C qtip
-echo '% qpop'
-hg qpop
-
-echo '% qrefresh'
-hg qrefresh
-
-echo '% tip:'
-hg tip --template '{rev} {desc}\n'
-
-echo '% qpush warning branchheads'
-cd ..
-hg init branchy
-cd branchy
-echo q > q
-hg add q
-hg qnew -f qp
-hg qpop
-echo a > a
-hg ci -Ama
-hg up null
-hg branch b
-echo c > c
-hg ci -Amc
-hg merge default
-hg ci -mmerge
-hg up default
-hg log
-hg qpush
-cd ..
-
-echo '% testing applied patches, push and --force'
-hg init forcepush
-cd forcepush
-echo a > a
-hg ci -Am adda
-echo a >> a
-hg ci -m changea
-hg up 0
-hg branch branch
-echo b > b
-hg ci -Am addb
-hg up 0
-hg --cwd .. clone -r 0 forcepush forcepush2
-echo a >> a
-hg qnew patch
-echo '% pushing applied patch with --rev without --force'
-hg push -r default ../forcepush2
-echo '% pushing applied patch with branchhash, without --force'
-hg push ../forcepush2#default
-echo '% pushing revs excluding applied patch'
-hg push --new-branch -r branch -r 2 ../forcepush2
-echo '% pushing applied patch with --force'
-hg push --force -r default ../forcepush2
-cd ..
--- a/tests/test-mq-safety.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-% try to commit on top of a patch
-abort: cannot commit over an applied mq patch
-% qpop/qrefresh on the wrong revision
-abort: popping would remove a revision not managed by this patch queue
-using patch queue:
-abort: popping would remove a revision not managed by this patch queue
-abort: working directory revision is not qtip
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% qpop
-abort: popping would remove a revision not managed by this patch queue
-% qrefresh
-abort: cannot refresh a revision with children
-% tip:
-3 append quux
-% qpush warning branchheads
-popping qp
-patch queue now empty
-adding a
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-marked working directory as branch b
-adding c
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-changeset:   2:65309210bf4e
-branch:      b
-tag:         tip
-parent:      1:707adb4c8ae1
-parent:      0:cb9a9f314b8b
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     merge
-
-changeset:   1:707adb4c8ae1
-branch:      b
-parent:      -1:000000000000
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     c
-
-changeset:   0:cb9a9f314b8b
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     a
-
-applying qp
-now at: qp
-% testing applied patches, push and --force
-adding a
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-marked working directory as branch branch
-adding b
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% pushing applied patch with --rev without --force
-pushing to ../forcepush2
-abort: source has mq patches applied
-% pushing applied patch with branchhash, without --force
-pushing to ../forcepush2
-abort: source has mq patches applied
-% pushing revs excluding applied patch
-pushing to ../forcepush2
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-% pushing applied patch with --force
-pushing to ../forcepush2
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files (+1 heads)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-mq-safety.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,176 @@
+  $ echo '[extensions]' >> $HGRCPATH
+  $ echo 'mq =' >> $HGRCPATH
+
+  $ hg init repo
+  $ cd repo
+
+  $ echo foo > foo
+  $ hg ci -qAm 'add a file'
+
+  $ hg qinit
+
+  $ hg qnew foo
+  $ echo foo >> foo
+  $ hg qrefresh -m 'append foo'
+
+  $ hg qnew bar
+  $ echo bar >> foo
+  $ hg qrefresh -m 'append bar'
+
+
+try to commit on top of a patch
+
+  $ echo quux >> foo
+  $ hg ci -m 'append quux'
+  abort: cannot commit over an applied mq patch
+  [255]
+
+
+cheat a bit...
+
+  $ mv .hg/patches .hg/patches2
+  $ hg ci -m 'append quux'
+  $ mv .hg/patches2 .hg/patches
+
+
+qpop/qrefresh on the wrong revision
+
+  $ hg qpop
+  abort: popping would remove a revision not managed by this patch queue
+  [255]
+  $ hg qpop -n patches
+  using patch queue: */repo/.hg/patches (glob)
+  abort: popping would remove a revision not managed by this patch queue
+  [255]
+  $ hg qrefresh
+  abort: working directory revision is not qtip
+  [255]
+
+  $ hg up -C qtip
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg qpop
+  abort: popping would remove a revision not managed by this patch queue
+  [255]
+  $ hg qrefresh
+  abort: cannot refresh a revision with children
+  [255]
+  $ hg tip --template '{rev} {desc}\n'
+  3 append quux
+
+
+qpush warning branchheads
+
+  $ cd ..
+  $ hg init branchy
+  $ cd branchy
+  $ echo q > q
+  $ hg add q
+  $ hg qnew -f qp
+  $ hg qpop
+  popping qp
+  patch queue now empty
+  $ echo a > a
+  $ hg ci -Ama
+  adding a
+  $ hg up null
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg branch b
+  marked working directory as branch b
+  $ echo c > c
+  $ hg ci -Amc
+  adding c
+  $ hg merge default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg ci -mmerge
+  $ hg up default
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg log
+  changeset:   2:65309210bf4e
+  branch:      b
+  tag:         tip
+  parent:      1:707adb4c8ae1
+  parent:      0:cb9a9f314b8b
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     merge
+  
+  changeset:   1:707adb4c8ae1
+  branch:      b
+  parent:      -1:000000000000
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     c
+  
+  changeset:   0:cb9a9f314b8b
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     a
+  
+  $ hg qpush
+  applying qp
+  now at: qp
+
+Testing applied patches, push and --force
+
+  $ cd ..
+  $ hg init forcepush
+  $ cd forcepush
+  $ echo a > a
+  $ hg ci -Am adda
+  adding a
+  $ echo a >> a
+  $ hg ci -m changea
+  $ hg up 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg branch branch
+  marked working directory as branch branch
+  $ echo b > b
+  $ hg ci -Am addb
+  adding b
+  $ hg up 0
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg --cwd .. clone -r 0 forcepush forcepush2
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo a >> a
+  $ hg qnew patch
+
+Pushing applied patch with --rev without --force
+
+  $ hg push -r default ../forcepush2
+  pushing to ../forcepush2
+  abort: source has mq patches applied
+  [255]
+
+Pushing applied patch with branchhash, without --force
+
+  $ hg push ../forcepush2#default
+  pushing to ../forcepush2
+  abort: source has mq patches applied
+  [255]
+
+Pushing revs excluding applied patch
+
+  $ hg push --new-branch -r branch -r 2 ../forcepush2
+  pushing to ../forcepush2
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+
+Pushing applied patch with --force
+
+  $ hg push --force -r default ../forcepush2
+  pushing to ../forcepush2
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files (+1 heads)
--- a/tests/test-mq-strip	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-#!/bin/sh
-
-. $TESTDIR/helpers.sh
-
-echo "[extensions]" >> $HGRCPATH
-echo "mq=" >> $HGRCPATH
-
-teststrip() {
-    hg up -C $1
-    echo % before update $1, strip $2
-    hg parents
-    hg strip $2 | hidebackup
-    echo % after update $1, strip $2
-    hg parents
-    hg unbundle -q .hg/strip-backup/*
-    rm .hg/strip-backup/*
-}
-
-hg init test
-cd test
-
-echo foo > bar
-hg ci -Ama
-
-echo more >> bar
-hg ci -Amb
-
-echo blah >> bar
-hg ci -Amc
-
-hg up 1
-echo blah >> bar
-hg ci -Amd
-
-echo final >> bar
-hg ci -Ame
-
-hg log
-
-teststrip 4 4
-teststrip 4 3
-teststrip 1 4
-teststrip 4 2
-teststrip 4 1
-teststrip null 4
-
-hg log
-
-hg up -C 2
-hg merge 4
-echo % before strip of merge parent
-hg parents
-hg strip 4 2>&1 | hidebackup
-echo % after strip of merge parent
-hg parents
-
-#strip of applied mq should cleanup status file
-hg up -C 3
-echo fooagain >> bar
-hg ci -mf
-hg qimport -r tip:2
-echo % applied patches before strip
-hg qapplied
-echo % stripping revision in queue
-hg strip 3 | hidebackup
-echo % applied patches after stripping rev in queue
-hg qapplied
-echo % stripping ancestor of queue
-hg strip 1 | hidebackup
-echo % applied patches after stripping ancestor of queue
-hg qapplied
--- a/tests/test-mq-strip.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,181 +0,0 @@
-adding bar
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-changeset:   4:443431ffac4f
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     e
-
-changeset:   3:65bd5f99a4a3
-parent:      1:ef3a871183d7
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     d
-
-changeset:   2:264128213d29
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     c
-
-changeset:   1:ef3a871183d7
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     b
-
-changeset:   0:9ab35a2d17cb
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     a
-
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% before update 4, strip 4
-changeset:   4:443431ffac4f
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     e
-
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-saved backup bundle to 
-% after update 4, strip 4
-changeset:   3:65bd5f99a4a3
-tag:         tip
-parent:      1:ef3a871183d7
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     d
-
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% before update 4, strip 3
-changeset:   4:443431ffac4f
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     e
-
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-saved backup bundle to 
-% after update 4, strip 3
-changeset:   1:ef3a871183d7
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     b
-
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% before update 1, strip 4
-changeset:   1:ef3a871183d7
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     b
-
-saved backup bundle to 
-% after update 1, strip 4
-changeset:   1:ef3a871183d7
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     b
-
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% before update 4, strip 2
-changeset:   4:443431ffac4f
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     e
-
-saved backup bundle to 
-% after update 4, strip 2
-changeset:   3:443431ffac4f
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     e
-
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% before update 4, strip 1
-changeset:   4:264128213d29
-tag:         tip
-parent:      1:ef3a871183d7
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     c
-
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-saved backup bundle to 
-% after update 4, strip 1
-changeset:   0:9ab35a2d17cb
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     a
-
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-% before update null, strip 4
-saved backup bundle to 
-% after update null, strip 4
-changeset:   4:264128213d29
-tag:         tip
-parent:      1:ef3a871183d7
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     c
-
-changeset:   3:443431ffac4f
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     e
-
-changeset:   2:65bd5f99a4a3
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     d
-
-changeset:   1:ef3a871183d7
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     b
-
-changeset:   0:9ab35a2d17cb
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     a
-
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-% before strip of merge parent
-changeset:   2:65bd5f99a4a3
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     d
-
-changeset:   4:264128213d29
-tag:         tip
-parent:      1:ef3a871183d7
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     c
-
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-saved backup bundle to 
-% after strip of merge parent
-changeset:   1:ef3a871183d7
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     b
-
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% applied patches before strip
-2.diff
-3.diff
-4.diff
-% stripping revision in queue
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-saved backup bundle to 
-% applied patches after stripping rev in queue
-2.diff
-% stripping ancestor of queue
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-saved backup bundle to 
-% applied patches after stripping ancestor of queue
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-mq-strip.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,382 @@
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "mq=" >> $HGRCPATH
+  $ echo "graphlog=" >> $HGRCPATH
+
+  $ restore() {
+  >     hg unbundle -q .hg/strip-backup/*
+  >     rm .hg/strip-backup/*
+  > }
+  $ teststrip() {
+  >     hg up -C $1
+  >     echo % before update $1, strip $2
+  >     hg parents
+  >     hg --traceback strip $2
+  >     echo % after update $1, strip $2
+  >     hg parents
+  >     restore
+  > }
+
+  $ hg init test
+  $ cd test
+
+  $ echo foo > bar
+  $ hg ci -Ama
+  adding bar
+
+  $ echo more >> bar
+  $ hg ci -Amb
+
+  $ echo blah >> bar
+  $ hg ci -Amc
+
+  $ hg up 1
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo blah >> bar
+  $ hg ci -Amd
+  created new head
+
+  $ echo final >> bar
+  $ hg ci -Ame
+
+  $ hg log
+  changeset:   4:443431ffac4f
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     e
+  
+  changeset:   3:65bd5f99a4a3
+  parent:      1:ef3a871183d7
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     d
+  
+  changeset:   2:264128213d29
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     c
+  
+  changeset:   1:ef3a871183d7
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     b
+  
+  changeset:   0:9ab35a2d17cb
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     a
+  
+
+  $ teststrip 4 4
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  % before update 4, strip 4
+  changeset:   4:443431ffac4f
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     e
+  
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  saved backup bundle to * (glob)
+  % after update 4, strip 4
+  changeset:   3:65bd5f99a4a3
+  tag:         tip
+  parent:      1:ef3a871183d7
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     d
+  
+  $ teststrip 4 3
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  % before update 4, strip 3
+  changeset:   4:443431ffac4f
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     e
+  
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  saved backup bundle to * (glob)
+  % after update 4, strip 3
+  changeset:   1:ef3a871183d7
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     b
+  
+  $ teststrip 1 4
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  % before update 1, strip 4
+  changeset:   1:ef3a871183d7
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     b
+  
+  saved backup bundle to * (glob)
+  % after update 1, strip 4
+  changeset:   1:ef3a871183d7
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     b
+  
+  $ teststrip 4 2
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  % before update 4, strip 2
+  changeset:   4:443431ffac4f
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     e
+  
+  saved backup bundle to * (glob)
+  % after update 4, strip 2
+  changeset:   3:443431ffac4f
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     e
+  
+  $ teststrip 4 1
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  % before update 4, strip 1
+  changeset:   4:264128213d29
+  tag:         tip
+  parent:      1:ef3a871183d7
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     c
+  
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  saved backup bundle to * (glob)
+  % after update 4, strip 1
+  changeset:   0:9ab35a2d17cb
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     a
+  
+  $ teststrip null 4
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  % before update null, strip 4
+  saved backup bundle to * (glob)
+  % after update null, strip 4
+
+  $ hg log
+  changeset:   4:264128213d29
+  tag:         tip
+  parent:      1:ef3a871183d7
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     c
+  
+  changeset:   3:443431ffac4f
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     e
+  
+  changeset:   2:65bd5f99a4a3
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     d
+  
+  changeset:   1:ef3a871183d7
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     b
+  
+  changeset:   0:9ab35a2d17cb
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     a
+  
+
+  $ hg up -C 2
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg merge 4
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+before strip of merge parent
+
+  $ hg parents
+  changeset:   2:65bd5f99a4a3
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     d
+  
+  changeset:   4:264128213d29
+  tag:         tip
+  parent:      1:ef3a871183d7
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     c
+  
+  $ hg strip 4
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  saved backup bundle to * (glob)
+
+after strip of merge parent
+
+  $ hg parents
+  changeset:   1:ef3a871183d7
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     b
+  
+  $ restore
+
+  $ hg up
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg glog
+  @  changeset:   4:264128213d29
+  |  tag:         tip
+  |  parent:      1:ef3a871183d7
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     c
+  |
+  | o  changeset:   3:443431ffac4f
+  | |  user:        test
+  | |  date:        Thu Jan 01 00:00:00 1970 +0000
+  | |  summary:     e
+  | |
+  | o  changeset:   2:65bd5f99a4a3
+  |/   user:        test
+  |    date:        Thu Jan 01 00:00:00 1970 +0000
+  |    summary:     d
+  |
+  o  changeset:   1:ef3a871183d7
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     b
+  |
+  o  changeset:   0:9ab35a2d17cb
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     a
+  
+
+2 is parent of 3, only one strip should happen
+
+  $ hg strip 2 3
+  saved backup bundle to * (glob)
+  $ hg glog
+  @  changeset:   2:264128213d29
+  |  tag:         tip
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     c
+  |
+  o  changeset:   1:ef3a871183d7
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     b
+  |
+  o  changeset:   0:9ab35a2d17cb
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     a
+  
+  $ restore
+  $ hg glog
+  o  changeset:   4:443431ffac4f
+  |  tag:         tip
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     e
+  |
+  o  changeset:   3:65bd5f99a4a3
+  |  parent:      1:ef3a871183d7
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     d
+  |
+  | @  changeset:   2:264128213d29
+  |/   user:        test
+  |    date:        Thu Jan 01 00:00:00 1970 +0000
+  |    summary:     c
+  |
+  o  changeset:   1:ef3a871183d7
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     b
+  |
+  o  changeset:   0:9ab35a2d17cb
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     a
+  
+
+2 different branches: 2 strips
+
+  $ hg strip 2 4
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  saved backup bundle to * (glob)
+  saved backup bundle to * (glob)
+  $ hg glog
+  @  changeset:   2:65bd5f99a4a3
+  |  tag:         tip
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     d
+  |
+  o  changeset:   1:ef3a871183d7
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     b
+  |
+  o  changeset:   0:9ab35a2d17cb
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     a
+  
+  $ restore
+
+2 different branches and a common ancestor: 1 strip
+
+  $ hg strip 1 2 4
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  saved backup bundle to * (glob)
+  $ restore
+
+
+remove branchy history for qimport tests
+
+  $ hg strip 3
+  saved backup bundle to * (glob)
+
+
+strip of applied mq should cleanup status file
+
+  $ hg up -C 3
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo fooagain >> bar
+  $ hg ci -mf
+  $ hg qimport -r tip:2
+
+applied patches before strip
+
+  $ hg qapplied
+  2.diff
+  3.diff
+  4.diff
+
+stripping revision in queue
+
+  $ hg strip 3
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  saved backup bundle to * (glob)
+
+applied patches after stripping rev in queue
+
+  $ hg qapplied
+  2.diff
+
+stripping ancestor of queue
+
+  $ hg strip 1
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  saved backup bundle to * (glob)
+
+applied patches after stripping ancestor of queue
+
+  $ hg qapplied
--- a/tests/test-mq-symlinks	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-#!/bin/sh
-
-"$TESTDIR/hghave" symlink || exit 80
-
-echo "[extensions]" >> $HGRCPATH
-echo "mq=" >> $HGRCPATH
-
-hg init
-hg qinit
-hg qnew base.patch
-echo aaa > a
-echo bbb > b
-echo ccc > c
-hg add a b c
-hg qrefresh
-$TESTDIR/readlink.py a
-
-echo '% test replacing a file with a symlink'
-hg qnew symlink.patch
-rm a
-ln -s b a
-hg qrefresh --git
-$TESTDIR/readlink.py a
-
-hg qpop
-hg qpush
-$TESTDIR/readlink.py a
-
-echo '% test updating a symlink'
-rm a
-ln -s c a
-hg qnew --git -f updatelink
-$TESTDIR/readlink.py a
-hg qpop
-hg qpush --debug
-$TESTDIR/readlink.py a
-hg st
-
-echo '% test replacing a symlink with a file'
-ln -s c s
-hg add s
-hg qnew --git -f addlink
-rm s
-echo sss > s
-hg qnew --git -f replacelinkwithfile
-hg qpop
-hg qpush
-cat s
-hg st
-
-echo '% test symlink removal'
-hg qnew removesl.patch
-hg rm a
-hg qrefresh --git
-hg qpop
-hg qpush
-hg st -c
-
-echo '% replace broken symlink with another broken symlink'
-ln -s linka linka
-hg add linka
-hg qnew link
-hg mv linka linkb
-ln -sf linkb linkb
-hg qnew movelink
-hg qpop
-hg qpush
-$TESTDIR/readlink.py linkb
-echo '% check patch does not overwrite untracked symlinks'
-hg qpop
-ln -s linkbb linkb
-hg qpush
-
-true
\ No newline at end of file
--- a/tests/test-mq-symlinks.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-a -> a not a symlink
-% test replacing a file with a symlink
-a -> b
-popping symlink.patch
-now at: base.patch
-applying symlink.patch
-now at: symlink.patch
-a -> b
-% test updating a symlink
-a -> c
-popping updatelink
-now at: symlink.patch
-applying updatelink
-patching file a
-a
-now at: updatelink
-a -> c
-% test replacing a symlink with a file
-popping replacelinkwithfile
-now at: addlink
-applying replacelinkwithfile
-now at: replacelinkwithfile
-sss
-% test symlink removal
-popping removesl.patch
-now at: replacelinkwithfile
-applying removesl.patch
-now at: removesl.patch
-C b
-C c
-C s
-% replace broken symlink with another broken symlink
-popping movelink
-now at: link
-applying movelink
-now at: movelink
-linkb -> linkb
-% check patch does not overwrite untracked symlinks
-popping movelink
-now at: link
-applying movelink
-patch failed, unable to continue (try -v)
-patch failed, rejects left in working dir
-errors during apply, please fix and refresh movelink
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-mq-symlinks.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,120 @@
+  $ "$TESTDIR/hghave" symlink || exit 80
+
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "mq=" >> $HGRCPATH
+
+  $ hg init
+  $ hg qinit
+  $ hg qnew base.patch
+  $ echo aaa > a
+  $ echo bbb > b
+  $ echo ccc > c
+  $ hg add a b c
+  $ hg qrefresh
+  $ $TESTDIR/readlink.py a
+  a -> a not a symlink
+
+
+test replacing a file with a symlink
+
+  $ hg qnew symlink.patch
+  $ rm a
+  $ ln -s b a
+  $ hg qrefresh --git
+  $ $TESTDIR/readlink.py a
+  a -> b
+
+  $ hg qpop
+  popping symlink.patch
+  now at: base.patch
+  $ hg qpush
+  applying symlink.patch
+  now at: symlink.patch
+  $ $TESTDIR/readlink.py a
+  a -> b
+
+
+test updating a symlink
+
+  $ rm a
+  $ ln -s c a
+  $ hg qnew --git -f updatelink
+  $ $TESTDIR/readlink.py a
+  a -> c
+  $ hg qpop
+  popping updatelink
+  now at: symlink.patch
+  $ hg qpush --debug
+  applying updatelink
+  patching file a
+  a
+  now at: updatelink
+  $ $TESTDIR/readlink.py a
+  a -> c
+  $ hg st
+
+
+test replacing a symlink with a file
+
+  $ ln -s c s
+  $ hg add s
+  $ hg qnew --git -f addlink
+  $ rm s
+  $ echo sss > s
+  $ hg qnew --git -f replacelinkwithfile
+  $ hg qpop
+  popping replacelinkwithfile
+  now at: addlink
+  $ hg qpush
+  applying replacelinkwithfile
+  now at: replacelinkwithfile
+  $ cat s
+  sss
+  $ hg st
+
+
+test symlink removal
+
+  $ hg qnew removesl.patch
+  $ hg rm a
+  $ hg qrefresh --git
+  $ hg qpop
+  popping removesl.patch
+  now at: replacelinkwithfile
+  $ hg qpush
+  applying removesl.patch
+  now at: removesl.patch
+  $ hg st -c
+  C b
+  C c
+  C s
+
+replace broken symlink with another broken symlink
+
+  $ ln -s linka linka
+  $ hg add linka
+  $ hg qnew link
+  $ hg mv linka linkb
+  $ ln -sf linkb linkb
+  $ hg qnew movelink
+  $ hg qpop
+  popping movelink
+  now at: link
+  $ hg qpush
+  applying movelink
+  now at: movelink
+  $ $TESTDIR/readlink.py linkb
+  linkb -> linkb
+
+check patch does not overwrite untracked symlinks
+
+  $ hg qpop
+  popping movelink
+  now at: link
+  $ ln -s linkbb linkb
+  $ hg qpush
+  applying movelink
+  patch failed, unable to continue (try -v)
+  patch failed, rejects left in working dir
+  errors during apply, please fix and refresh movelink
+  [2]
--- a/tests/test-mq.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,653 +0,0 @@
-% help
-mq extension - manage a stack of patches
-
-This extension lets you work with a stack of patches in a Mercurial
-repository. It manages two stacks of patches - all known patches, and applied
-patches (subset of known patches).
-
-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):
-
-  create new patch                          qnew
-  import existing patch                     qimport
-
-  print patch series                        qseries
-  print applied patches                     qapplied
-
-  add known patch to applied stack          qpush
-  remove patch from applied stack           qpop
-  refresh contents of top applied patch     qrefresh
-
-By default, mq will automatically use git patches when required to avoid
-losing file mode changes, copy records, binary files or empty files creations
-or deletions. This behaviour can be configured with:
-
-  [mq]
-  git = auto/keep/yes/no
-
-If set to 'keep', mq will obey the [diff] section configuration while
-preserving existing git patches upon qrefresh. If set to 'yes' or 'no', mq
-will override the [diff] section and always generate git or regular patches,
-possibly losing data in the second case.
-
-You will by default be managing a patch queue named "patches". You can create
-other, independent patch queues with the "hg qqueue" command.
-
-list of commands:
-
- qapplied     print the patches already applied
- qclone       clone main and patch repository at same time
- qdelete      remove patches from queue
- qdiff        diff of the current patch and subsequent modifications
- qfinish      move applied patches into repository history
- qfold        fold the named patches into the current patch
- qgoto        push or pop patches until named patch is at top of stack
- qguard       set or print guards for a patch
- qheader      print the header of the topmost or specified patch
- qimport      import a patch
- qnew         create a new patch
- qnext        print the name of the next patch
- qpop         pop the current patch off the stack
- qprev        print the name of the previous patch
- qpush        push the next patch onto the stack
- qqueue       manage multiple patch queues
- qrefresh     update the current patch
- qrename      rename a patch
- qselect      set or print guarded patches to push
- qseries      print the entire series file
- qtop         print the name of the current patch
- qunapplied   print the patches not yet applied
- strip        strip a changeset and all its descendants from the repository
-
-use "hg -v help mq" to show aliases and global options
-adding a
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-adding b/z
-% qinit
-% -R qinit
-% qinit -c
-A .hgignore
-A series
-% qinit; qinit -c
-  .hgignore:
-^\.hg
-^\.mq
-syntax: glob
-status
-guards
-  series:
-abort: repository already exists!
-% qinit; <stuff>; qinit -c
-adding .hg/patches/A
-adding .hg/patches/B
-A .hgignore
-A A
-A B
-A series
-  .hgignore:
-status
-bleh
-  series:
-A
-B
-% status --mq with color (issue2096)
-A .hgignore
-A A
-A B
-A series
-% init --mq without repo
-abort: there is no Mercurial repository here (.hg not found)
-% init --mq with repo path
-ok
-% init --mq with nonexistent directory
-abort: repository nonexistentdir not found!
-% init --mq with bundle (non "local")
-abort: only a local queue repository may be initialized
-% qrefresh
-foo bar
-
-diff -r  xa
---- a/a
-+++ b/a
-@@ -1,1 +1,2 @@
- a
-+a
-% empty qrefresh
-revision:
-patch:
-foo bar
-
-working dir diff:
---- a/a
-+++ b/a
-@@ -1,1 +1,2 @@
- a
-+a
-% qpop
-popping test.patch
-patch queue now empty
-% qpush with dump of tag cache
-.hg/tags.cache (pre qpush):
-1
-
-applying test.patch
-now at: test.patch
-.hg/tags.cache (post qpush):
-2
-
-% pop/push outside repo
-popping test.patch
-patch queue now empty
-applying test.patch
-now at: test.patch
-% qrefresh in subdir
-% pop/push -a in subdir
-popping test2.patch
-popping test.patch
-patch queue now empty
-applying test.patch
-applying test2.patch
-now at: test2.patch
-% qseries
-test.patch
-test2.patch
-0 A test.patch: f...
-1 A test2.patch: 
-popping test2.patch
-now at: test.patch
-0 A test.patch: foo bar
-1 U test2.patch: 
-mq:     1 applied, 1 unapplied
-applying test2.patch
-now at: test2.patch
-mq:     2 applied
-% qapplied
-test.patch
-test2.patch
-% qtop
-test2.patch
-% prev
-test.patch
-% next
-all patches applied
-popping test2.patch
-now at: test.patch
-% commit should fail
-abort: cannot commit over an applied mq patch
-% push should fail
-pushing to ../../k
-abort: source has mq patches applied
-% import should fail
-abort: cannot import over an applied patch
-% import --no-commit should succeed
-applying ../../import.diff
-M a
-% qunapplied
-test2.patch
-% qpush/qpop with index
-applying test2.patch
-now at: test2.patch
-popping test2.patch
-popping test1b.patch
-now at: test.patch
-applying test1b.patch
-now at: test1b.patch
-applying test2.patch
-now at: test2.patch
-popping test2.patch
-now at: test1b.patch
-popping test1b.patch
-now at: test.patch
-applying test1b.patch
-applying test2.patch
-now at: test2.patch
-% qpush --move
-popping test2.patch
-popping test1b.patch
-popping test.patch
-patch queue now empty
-cannot push 'test2.patch' - guarded by ['+posguard']
-number of unguarded, unapplied patches has changed from 2 to 3
-applying test2.patch
-now at: test2.patch
-applying test1b.patch
-now at: test1b.patch
-applying test.patch
-now at: test.patch
-0 A test2.patch
-1 A test1b.patch
-2 A test.patch
-popping test.patch
-popping test1b.patch
-popping test2.patch
-patch queue now empty
-guards deactivated
-number of unguarded, unapplied patches has changed from 3 to 2
-applying test.patch
-now at: test.patch
-applying test1b.patch
-now at: test1b.patch
-abort: patch bogus not in series
-abort: please specify the patch to move
-abort: cannot push to a previous patch: test.patch
-applying test2.patch
-now at: test2.patch
-% series after move
-test.patch
-test1b.patch
-test2.patch
-# comment
-
-% pop, qapplied, qunapplied
-0 A test.patch
-1 A test1b.patch
-2 A test2.patch
-% qapplied -1 test.patch
-only one patch applied
-% qapplied -1 test1b.patch
-test.patch
-% qapplied -1 test2.patch
-test1b.patch
-% qapplied -1
-test1b.patch
-% qapplied
-test.patch
-test1b.patch
-test2.patch
-% qapplied test1b.patch
-test.patch
-test1b.patch
-% qunapplied -1
-all patches applied
-% qunapplied
-% popping
-popping test2.patch
-now at: test1b.patch
-% qunapplied -1
-test2.patch
-% qunapplied
-test2.patch
-% qunapplied test2.patch
-% qunapplied -1 test2.patch
-all patches applied
-% popping -a
-popping test1b.patch
-popping test.patch
-patch queue now empty
-% qapplied
-% qapplied -1
-no patches applied
-applying test.patch
-now at: test.patch
-% push should succeed
-popping test.patch
-patch queue now empty
-pushing to ../../k
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-% qpush/qpop error codes
-applying test.patch
-applying test1b.patch
-applying test2.patch
-now at: test2.patch
-  % pops all patches and succeeds
-popping test2.patch
-popping test1b.patch
-popping test.patch
-patch queue now empty
-  qpop -a succeeds
-  % does nothing and succeeds
-no patches applied
-  qpop -a succeeds
-  % fails - nothing else to pop
-no patches applied
-  qpop fails
-  % pushes a patch and succeeds
-applying test.patch
-now at: test.patch
-  qpush succeeds
-  % pops a patch and succeeds
-popping test.patch
-patch queue now empty
-  qpop succeeds
-  % pushes up to test1b.patch and succeeds
-applying test.patch
-applying test1b.patch
-now at: test1b.patch
-  qpush test1b.patch succeeds
-  % does nothing and succeeds
-qpush: test1b.patch is already at the top
-  qpush test1b.patch succeeds
-  % does nothing and succeeds
-qpop: test1b.patch is already at the top
-  qpop test1b.patch succeeds
-  % fails - can't push to this patch
-abort: cannot push to a previous patch: test.patch
-  qpush test.patch fails
-  % fails - can't pop to this patch
-abort: patch test2.patch is not applied
-  qpop test2.patch fails
-  % pops up to test.patch and succeeds
-popping test1b.patch
-now at: test.patch
-  qpop test.patch succeeds
-  % pushes all patches and succeeds
-applying test1b.patch
-applying test2.patch
-now at: test2.patch
-  qpush -a succeeds
-  % does nothing and succeeds
-all patches are currently applied
-  qpush -a succeeds
-  % fails - nothing else to push
-patch series already fully applied
-  qpush fails
-  % does nothing and succeeds
-qpush: test2.patch is already at the top
-  qpush test2.patch succeeds
-% strip
-adding x
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-saved backup bundle to 
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-(run 'hg update' to get a working copy)
-% strip with local changes, should complain
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-abort: local changes found
-% --force strip with local changes
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-saved backup bundle to 
-% cd b; hg qrefresh
-adding a
-foo
-
-diff -r cb9a9f314b8b a
---- a/a
-+++ b/a
-@@ -1,1 +1,2 @@
- a
-+a
-diff -r cb9a9f314b8b b/f
---- /dev/null
-+++ b/b/f
-@@ -0,0 +1,1 @@
-+f
-% hg qrefresh .
-foo
-
-diff -r cb9a9f314b8b b/f
---- /dev/null
-+++ b/b/f
-@@ -0,0 +1,1 @@
-+f
-M a
-% qpush failure
-popping bar
-popping foo
-patch queue now empty
-applying foo
-applying bar
-file foo already exists
-1 out of 1 hunks FAILED -- saving rejects to file foo.rej
-patch failed, unable to continue (try -v)
-patch failed, rejects left in working dir
-errors during apply, please fix and refresh bar
-? foo
-? foo.rej
-% mq tags
-0 qparent
-1 foo qbase
-2 bar qtip tip
-% bad node in status
-popping bar
-now at: foo
-changeset:   0:cb9a9f314b8b
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     a
-
-default                        0:cb9a9f314b8b
-no patches applied
-new file
-
-diff --git a/new b/new
-new file mode 100755
---- /dev/null
-+++ b/new
-@@ -0,0 +1,1 @@
-+foo
-copy file
-
-diff --git a/new b/copy
-copy from new
-copy to copy
-popping copy
-now at: new
-applying copy
-now at: copy
-diff --git a/new b/copy
-copy from new
-copy to copy
-diff --git a/new b/copy
-copy from new
-copy to copy
-% test file addition in slow path
-1 files updated, 0 files merged, 2 files removed, 0 files unresolved
-created new head
-2 files updated, 0 files merged, 1 files removed, 0 files unresolved
-diff --git a/bar b/bar
-new file mode 100644
---- /dev/null
-+++ b/bar
-@@ -0,0 +1,1 @@
-+bar
-diff --git a/foo b/baz
-rename from foo
-rename to baz
-2 baz (foo)
-diff --git a/bar b/bar
-new file mode 100644
---- /dev/null
-+++ b/bar
-@@ -0,0 +1,1 @@
-+bar
-diff --git a/foo b/baz
-rename from foo
-rename to baz
-2 baz (foo)
-diff --git a/bar b/bar
-diff --git a/foo b/baz
-% test file move chains in the slow path
-1 files updated, 0 files merged, 2 files removed, 0 files unresolved
-2 files updated, 0 files merged, 1 files removed, 0 files unresolved
-diff --git a/foo b/bleh
-rename from foo
-rename to bleh
-diff --git a/quux b/quux
-new file mode 100644
---- /dev/null
-+++ b/quux
-@@ -0,0 +1,1 @@
-+bar
-3 bleh (foo)
-diff --git a/foo b/barney
-rename from foo
-rename to barney
-diff --git a/fred b/fred
-new file mode 100644
---- /dev/null
-+++ b/fred
-@@ -0,0 +1,1 @@
-+bar
-3 barney (foo)
-% refresh omitting an added file
-C newfile
-A newfile
-popping baz
-now at: bar
-% create a git patch
-diff --git a/alexander b/alexander
-% create a git binary patch
-8ba2a2f3e77b55d03051ff9c24ad65e7  bucephalus
-diff --git a/bucephalus b/bucephalus
-% check binary patches can be popped and pushed
-popping addbucephalus
-now at: addalexander
-applying addbucephalus
-now at: addbucephalus
-8ba2a2f3e77b55d03051ff9c24ad65e7  bucephalus
-% strip again
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-merging foo
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-changeset:   3:99615015637b
-tag:         tip
-parent:      2:20cbbe65cff7
-parent:      1:d2871fc282d4
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     merge
-
-changeset:   2:20cbbe65cff7
-parent:      0:53245c60e682
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     change foo 2
-
-changeset:   1:d2871fc282d4
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     change foo 1
-
-changeset:   0:53245c60e682
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     add foo
-
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-saved backup bundle to 
-changeset:   1:20cbbe65cff7
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     change foo 2
-
-changeset:   0:53245c60e682
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     add foo
-
-% qclone
-abort: versioned patch repository not found (see init --mq)
-adding .hg/patches/patch1
-main repo:
-    rev 1: change foo
-    rev 0: add foo
-patch repo:
-    rev 0: checkpoint
-updating to branch default
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-main repo:
-    rev 0: add foo
-patch repo:
-    rev 0: checkpoint
-popping patch1
-patch queue now empty
-main repo:
-    rev 0: add foo
-patch repo:
-    rev 0: checkpoint
-updating to branch default
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-main repo:
-    rev 0: add foo
-patch repo:
-    rev 0: checkpoint
-% test applying on an empty file (issue 1033)
-adding a
-popping changea
-patch queue now empty
-applying changea
-now at: changea
-% test qpush with --force, issue1087
-adding bye.txt
-adding hello.txt
-popping empty
-patch queue now empty
-% qpush should fail, local changes
-abort: local changes found, refresh first
-% apply force, should not discard changes with empty patch
-applying empty
-patch empty is empty
-now at: empty
-diff -r bf5fc3f07a0a hello.txt
---- a/hello.txt
-+++ b/hello.txt
-@@ -1,1 +1,2 @@
- hello
-+world
-diff -r 9ecee4f634e3 hello.txt
---- a/hello.txt
-+++ b/hello.txt
-@@ -1,1 +1,2 @@
- hello
-+world
-changeset:   1:bf5fc3f07a0a
-tag:         empty
-tag:         qbase
-tag:         qtip
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     imported patch empty
-
-
-popping empty
-patch queue now empty
-% qpush should fail, local changes
-abort: local changes found, refresh first
-% apply force, should discard changes in hello, but not bye
-applying empty
-now at: empty
-M bye.txt
-diff -r ba252371dbc1 bye.txt
---- a/bye.txt
-+++ b/bye.txt
-@@ -1,1 +1,2 @@
- bye
-+universe
-diff -r 9ecee4f634e3 bye.txt
---- a/bye.txt
-+++ b/bye.txt
-@@ -1,1 +1,2 @@
- bye
-+universe
-diff -r 9ecee4f634e3 hello.txt
---- a/hello.txt
-+++ b/hello.txt
-@@ -1,1 +1,3 @@
- hello
-+world
-+universe
-% test popping revisions not in working dir ancestry
-0 A empty
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-popping empty
-patch queue now empty
-% test popping must remove files added in subdirectories first
-popping rename-dir
-patch queue now empty
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-mq.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,1368 @@
+  $ checkundo()
+  > {
+  >     if [ -f .hg/store/undo ]; then
+  >     echo ".hg/store/undo still exists after $1"
+  >     fi
+  > }
+
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "mq=" >> $HGRCPATH
+
+  $ echo "[mq]" >> $HGRCPATH
+  $ echo "plain=true" >> $HGRCPATH
+
+
+help
+
+  $ hg help mq
+  mq extension - manage a stack of patches
+  
+  This extension lets you work with a stack of patches in a Mercurial
+  repository. It manages two stacks of patches - all known patches, and applied
+  patches (subset of known patches).
+  
+  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):
+  
+    create new patch                          qnew
+    import existing patch                     qimport
+  
+    print patch series                        qseries
+    print applied patches                     qapplied
+  
+    add known patch to applied stack          qpush
+    remove patch from applied stack           qpop
+    refresh contents of top applied patch     qrefresh
+  
+  By default, mq will automatically use git patches when required to avoid
+  losing file mode changes, copy records, binary files or empty files creations
+  or deletions. This behaviour can be configured with:
+  
+    [mq]
+    git = auto/keep/yes/no
+  
+  If set to 'keep', mq will obey the [diff] section configuration while
+  preserving existing git patches upon qrefresh. If set to 'yes' or 'no', mq
+  will override the [diff] section and always generate git or regular patches,
+  possibly losing data in the second case.
+  
+  You will by default be managing a patch queue named "patches". You can create
+  other, independent patch queues with the "hg qqueue" command.
+  
+  list of commands:
+  
+   qapplied     print the patches already applied
+   qclone       clone main and patch repository at same time
+   qdelete      remove patches from queue
+   qdiff        diff of the current patch and subsequent modifications
+   qfinish      move applied patches into repository history
+   qfold        fold the named patches into the current patch
+   qgoto        push or pop patches until named patch is at top of stack
+   qguard       set or print guards for a patch
+   qheader      print the header of the topmost or specified patch
+   qimport      import a patch
+   qnew         create a new patch
+   qnext        print the name of the next patch
+   qpop         pop the current patch off the stack
+   qprev        print the name of the previous patch
+   qpush        push the next patch onto the stack
+   qqueue       manage multiple patch queues
+   qrefresh     update the current patch
+   qrename      rename a patch
+   qselect      set or print guarded patches to push
+   qseries      print the entire series file
+   qtop         print the name of the current patch
+   qunapplied   print the patches not yet applied
+   strip        strip changesets and all their descendants from the repository
+  
+  use "hg -v help mq" to show aliases and global options
+
+  $ hg init a
+  $ cd a
+  $ echo a > a
+  $ hg ci -Ama
+  adding a
+
+  $ hg clone . ../k
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ mkdir b
+  $ echo z > b/z
+  $ hg ci -Ama
+  adding b/z
+
+
+qinit
+
+  $ hg qinit
+
+  $ cd ..
+  $ hg init b
+
+
+-R qinit
+
+  $ hg -R b qinit
+
+  $ hg init c
+
+
+qinit -c
+
+  $ hg --cwd c qinit -c
+  $ hg -R c/.hg/patches st
+  A .hgignore
+  A series
+
+
+qinit; qinit -c
+
+  $ hg init d
+  $ cd d
+  $ hg qinit
+  $ hg qinit -c
+
+qinit -c should create both files if they don't exist
+
+  $ cat .hg/patches/.hgignore
+  ^\.hg
+  ^\.mq
+  syntax: glob
+  status
+  guards
+  $ cat .hg/patches/series
+  $ hg qinit -c
+  abort: repository * already exists! (glob)
+  [255]
+  $ cd ..
+
+  $ echo '% qinit; <stuff>; qinit -c'
+  % qinit; <stuff>; qinit -c
+  $ hg init e
+  $ cd e
+  $ hg qnew A
+  $ checkundo qnew
+  $ echo foo > foo
+  $ hg add foo
+  $ hg qrefresh
+  $ hg qnew B
+  $ echo >> foo
+  $ hg qrefresh
+  $ echo status >> .hg/patches/.hgignore
+  $ echo bleh >> .hg/patches/.hgignore
+  $ hg qinit -c
+  adding .hg/patches/A
+  adding .hg/patches/B
+  $ hg -R .hg/patches status
+  A .hgignore
+  A A
+  A B
+  A series
+
+qinit -c shouldn't touch these files if they already exist
+
+  $ cat .hg/patches/.hgignore
+  status
+  bleh
+  $ cat .hg/patches/series
+  A
+  B
+
+add an untracked file
+
+  $ echo >> .hg/patches/flaf
+
+status --mq with color (issue2096)
+
+  $ hg status --mq --config extensions.color= --color=always
+  A .hgignore
+  A A
+  A B
+  A series
+  ? flaf
+
+try the --mq option on a command provided by an extension
+
+  $ hg purge --mq --verbose --config extensions.purge=
+  Removing file flaf
+
+  $ cd ..
+
+init --mq without repo
+
+  $ mkdir f
+  $ cd f
+  $ hg init --mq
+  abort: there is no Mercurial repository here (.hg not found)
+  [255]
+  $ cd ..
+
+init --mq with repo path
+
+  $ hg init g
+  $ hg init --mq g
+  $ test -d g/.hg/patches/.hg
+
+init --mq with nonexistent directory
+
+  $ hg init --mq nonexistentdir
+  abort: repository nonexistentdir not found!
+  [255]
+
+
+init --mq with bundle (non "local")
+
+  $ hg -R a bundle --all a.bundle >/dev/null
+  $ hg init --mq a.bundle
+  abort: only a local queue repository may be initialized
+  [255]
+
+  $ cd a
+
+  $ hg qnew -m 'foo bar' test.patch
+
+  $ echo '# comment' > .hg/patches/series.tmp
+  $ echo >> .hg/patches/series.tmp # empty line
+  $ cat .hg/patches/series >> .hg/patches/series.tmp
+  $ mv .hg/patches/series.tmp .hg/patches/series
+
+
+qrefresh
+
+  $ echo a >> a
+  $ hg qrefresh
+  $ cat .hg/patches/test.patch
+  foo bar
+  
+  diff -r [a-f0-9]* a (re)
+  --- a/a\t(?P<date>.*) (re)
+  \+\+\+ b/a\t(?P<date2>.*) (re)
+  @@ -1,1 +1,2 @@
+   a
+  +a
+
+empty qrefresh
+
+  $ hg qrefresh -X a
+
+revision:
+
+  $ hg diff -r -2 -r -1
+
+patch:
+
+  $ cat .hg/patches/test.patch
+  foo bar
+  
+
+working dir diff:
+
+  $ hg diff --nodates -q
+  --- a/a
+  +++ b/a
+  @@ -1,1 +1,2 @@
+   a
+  +a
+
+restore things
+
+  $ hg qrefresh
+  $ checkundo qrefresh
+
+
+qpop
+
+  $ hg qpop
+  popping test.patch
+  patch queue now empty
+  $ checkundo qpop
+
+
+qpush with dump of tag cache
+Dump the tag cache to ensure that it has exactly one head after qpush.
+
+  $ rm -f .hg/tags.cache
+  $ hg tags > /dev/null
+
+.hg/tags.cache (pre qpush):
+
+  $ cat .hg/tags.cache
+  1 [\da-f]{40} (re)
+  
+  $ hg qpush
+  applying test.patch
+  now at: test.patch
+  $ hg tags > /dev/null
+
+.hg/tags.cache (post qpush):
+
+  $ cat .hg/tags.cache
+  2 [\da-f]{40} (re)
+  
+  $ checkundo qpush
+  $ cd ..
+
+
+pop/push outside repo
+  $ hg -R a qpop
+  popping test.patch
+  patch queue now empty
+  $ hg -R a qpush
+  applying test.patch
+  now at: test.patch
+
+  $ cd a
+  $ hg qnew test2.patch
+
+qrefresh in subdir
+
+  $ cd b
+  $ echo a > a
+  $ hg add a
+  $ hg qrefresh
+
+pop/push -a in subdir
+
+  $ hg qpop -a
+  popping test2.patch
+  popping test.patch
+  patch queue now empty
+  $ hg --traceback qpush -a
+  applying test.patch
+  applying test2.patch
+  now at: test2.patch
+
+
+setting columns & formatted tests truncating (issue1912)
+
+  $ COLUMNS=4 hg qseries --config ui.formatted=true
+  test.patch
+  test2.patch
+  $ COLUMNS=20 hg qseries --config ui.formatted=true -vs
+  0 A test.patch: f...
+  1 A test2.patch: 
+  $ hg qpop
+  popping test2.patch
+  now at: test.patch
+  $ hg qseries -vs
+  0 A test.patch: foo bar
+  1 U test2.patch: 
+  $ hg sum | grep mq
+  mq:     1 applied, 1 unapplied
+  $ hg qpush
+  applying test2.patch
+  now at: test2.patch
+  $ hg sum | grep mq
+  mq:     2 applied
+  $ hg qapplied
+  test.patch
+  test2.patch
+  $ hg qtop
+  test2.patch
+
+
+prev
+
+  $ hg qapp -1
+  test.patch
+
+next
+
+  $ hg qunapp -1
+  all patches applied
+  [1]
+
+  $ hg qpop
+  popping test2.patch
+  now at: test.patch
+
+commit should fail
+
+  $ hg commit
+  abort: cannot commit over an applied mq patch
+  [255]
+
+push should fail
+
+  $ hg push ../../k
+  pushing to ../../k
+  abort: source has mq patches applied
+  [255]
+
+
+import should fail
+
+  $ hg st .
+  $ echo foo >> ../a
+  $ hg diff > ../../import.diff
+  $ hg revert --no-backup ../a
+  $ hg import ../../import.diff
+  abort: cannot import over an applied patch
+  [255]
+  $ hg st
+
+import --no-commit should succeed
+
+  $ hg import --no-commit ../../import.diff
+  applying ../../import.diff
+  $ hg st
+  M a
+  $ hg revert --no-backup ../a
+
+
+qunapplied
+
+  $ hg qunapplied
+  test2.patch
+
+
+qpush/qpop with index
+
+  $ hg qnew test1b.patch
+  $ echo 1b > 1b
+  $ hg add 1b
+  $ hg qrefresh
+  $ hg qpush 2
+  applying test2.patch
+  now at: test2.patch
+  $ hg qpop 0
+  popping test2.patch
+  popping test1b.patch
+  now at: test.patch
+  $ hg qpush test.patch+1
+  applying test1b.patch
+  now at: test1b.patch
+  $ hg qpush test.patch+2
+  applying test2.patch
+  now at: test2.patch
+  $ hg qpop test2.patch-1
+  popping test2.patch
+  now at: test1b.patch
+  $ hg qpop test2.patch-2
+  popping test1b.patch
+  now at: test.patch
+  $ hg qpush test1b.patch+1
+  applying test1b.patch
+  applying test2.patch
+  now at: test2.patch
+
+
+qpush --move
+
+  $ hg qpop -a
+  popping test2.patch
+  popping test1b.patch
+  popping test.patch
+  patch queue now empty
+  $ hg qguard test1b.patch -- -negguard
+  $ hg qguard test2.patch -- +posguard
+  $ hg qpush --move test2.patch # can't move guarded patch
+  cannot push 'test2.patch' - guarded by ['+posguard']
+  [1]
+  $ hg qselect posguard
+  number of unguarded, unapplied patches has changed from 2 to 3
+  $ hg qpush --move test2.patch # move to front
+  applying test2.patch
+  now at: test2.patch
+  $ hg qpush --move test1b.patch # negative guard unselected
+  applying test1b.patch
+  now at: test1b.patch
+  $ hg qpush --move test.patch # noop move
+  applying test.patch
+  now at: test.patch
+  $ hg qseries -v
+  0 A test2.patch
+  1 A test1b.patch
+  2 A test.patch
+  $ hg qpop -a
+  popping test.patch
+  popping test1b.patch
+  popping test2.patch
+  patch queue now empty
+
+cleaning up
+
+  $ hg qselect --none
+  guards deactivated
+  number of unguarded, unapplied patches has changed from 3 to 2
+  $ hg qguard --none test1b.patch
+  $ hg qguard --none test2.patch
+  $ hg qpush --move test.patch
+  applying test.patch
+  now at: test.patch
+  $ hg qpush --move test1b.patch
+  applying test1b.patch
+  now at: test1b.patch
+  $ hg qpush --move bogus # nonexistent patch
+  abort: patch bogus not in series
+  [255]
+  $ hg qpush --move # no patch
+  abort: please specify the patch to move
+  [255]
+  $ hg qpush --move test.patch # already applied
+  abort: cannot push to a previous patch: test.patch
+  [255]
+  $ hg qpush
+  applying test2.patch
+  now at: test2.patch
+
+
+series after move
+
+  $ cat `hg root`/.hg/patches/series
+  test.patch
+  test1b.patch
+  test2.patch
+  # comment
+  
+
+
+pop, qapplied, qunapplied
+
+  $ hg qseries -v
+  0 A test.patch
+  1 A test1b.patch
+  2 A test2.patch
+
+qapplied -1 test.patch
+
+  $ hg qapplied -1 test.patch
+  only one patch applied
+  [1]
+
+qapplied -1 test1b.patch
+
+  $ hg qapplied -1 test1b.patch
+  test.patch
+
+qapplied -1 test2.patch
+
+  $ hg qapplied -1 test2.patch
+  test1b.patch
+
+qapplied -1
+
+  $ hg qapplied -1
+  test1b.patch
+
+qapplied
+
+  $ hg qapplied
+  test.patch
+  test1b.patch
+  test2.patch
+
+qapplied test1b.patch
+
+  $ hg qapplied test1b.patch
+  test.patch
+  test1b.patch
+
+qunapplied -1
+
+  $ hg qunapplied -1
+  all patches applied
+  [1]
+
+qunapplied
+
+  $ hg qunapplied
+
+popping
+
+  $ hg qpop
+  popping test2.patch
+  now at: test1b.patch
+
+qunapplied -1
+
+  $ hg qunapplied -1
+  test2.patch
+
+qunapplied
+
+  $ hg qunapplied
+  test2.patch
+
+qunapplied test2.patch
+
+  $ hg qunapplied test2.patch
+
+qunapplied -1 test2.patch
+
+  $ hg qunapplied -1 test2.patch
+  all patches applied
+  [1]
+
+popping -a
+
+  $ hg qpop -a
+  popping test1b.patch
+  popping test.patch
+  patch queue now empty
+
+qapplied
+
+  $ hg qapplied
+
+qapplied -1
+
+  $ hg qapplied -1
+  no patches applied
+  [1]
+  $ hg qpush
+  applying test.patch
+  now at: test.patch
+
+
+push should succeed
+
+  $ hg qpop -a
+  popping test.patch
+  patch queue now empty
+  $ hg push ../../k
+  pushing to ../../k
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+
+
+we want to start with some patches applied
+
+  $ hg qpush -a
+  applying test.patch
+  applying test1b.patch
+  applying test2.patch
+  now at: test2.patch
+
+% pops all patches and succeeds
+
+  $ hg qpop -a
+  popping test2.patch
+  popping test1b.patch
+  popping test.patch
+  patch queue now empty
+
+% does nothing and succeeds
+
+  $ hg qpop -a
+  no patches applied
+
+% fails - nothing else to pop
+
+  $ hg qpop
+  no patches applied
+  [1]
+
+% pushes a patch and succeeds
+
+  $ hg qpush
+  applying test.patch
+  now at: test.patch
+
+% pops a patch and succeeds
+
+  $ hg qpop
+  popping test.patch
+  patch queue now empty
+
+% pushes up to test1b.patch and succeeds
+
+  $ hg qpush test1b.patch
+  applying test.patch
+  applying test1b.patch
+  now at: test1b.patch
+
+% does nothing and succeeds
+
+  $ hg qpush test1b.patch
+  qpush: test1b.patch is already at the top
+
+% does nothing and succeeds
+
+  $ hg qpop test1b.patch
+  qpop: test1b.patch is already at the top
+
+% fails - can't push to this patch
+
+  $ hg qpush test.patch
+  abort: cannot push to a previous patch: test.patch
+  [255]
+
+% fails - can't pop to this patch
+
+  $ hg qpop test2.patch
+  abort: patch test2.patch is not applied
+  [255]
+
+% pops up to test.patch and succeeds
+
+  $ hg qpop test.patch
+  popping test1b.patch
+  now at: test.patch
+
+% pushes all patches and succeeds
+
+  $ hg qpush -a
+  applying test1b.patch
+  applying test2.patch
+  now at: test2.patch
+
+% does nothing and succeeds
+
+  $ hg qpush -a
+  all patches are currently applied
+
+% fails - nothing else to push
+
+  $ hg qpush
+  patch series already fully applied
+  [1]
+
+% does nothing and succeeds
+
+  $ hg qpush test2.patch
+  qpush: test2.patch is already at the top
+
+strip
+
+  $ cd ../../b
+  $ echo x>x
+  $ hg ci -Ama
+  adding x
+  $ hg strip tip
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  saved backup bundle to * (glob)
+  $ hg unbundle .hg/strip-backup/*
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  (run 'hg update' to get a working copy)
+
+
+strip with local changes, should complain
+
+  $ hg up
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo y>y
+  $ hg add y
+  $ hg strip tip
+  abort: local changes found
+  [255]
+
+--force strip with local changes
+
+  $ hg strip -f tip
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  saved backup bundle to * (glob)
+
+
+cd b; hg qrefresh
+
+  $ hg init refresh
+  $ cd refresh
+  $ echo a > a
+  $ hg ci -Ama
+  adding a
+  $ hg qnew -mfoo foo
+  $ echo a >> a
+  $ hg qrefresh
+  $ mkdir b
+  $ cd b
+  $ echo f > f
+  $ hg add f
+  $ hg qrefresh
+  $ cat ../.hg/patches/foo
+  foo
+  
+  diff -r cb9a9f314b8b a
+  --- a/a\t(?P<date>.*) (re)
+  \+\+\+ b/a\t(?P<date>.*) (re)
+  @@ -1,1 +1,2 @@
+   a
+  +a
+  diff -r cb9a9f314b8b b/f
+  --- /dev/null\t(?P<date>.*) (re)
+  \+\+\+ b/b/f\t(?P<date>.*) (re)
+  @@ -0,0 +1,1 @@
+  +f
+
+hg qrefresh .
+
+  $ hg qrefresh .
+  $ cat ../.hg/patches/foo
+  foo
+  
+  diff -r cb9a9f314b8b b/f
+  --- /dev/null\t(?P<date>.*) (re)
+  \+\+\+ b/b/f\t(?P<date>.*) (re)
+  @@ -0,0 +1,1 @@
+  +f
+  $ hg status
+  M a
+
+
+qpush failure
+
+  $ cd ..
+  $ hg qrefresh
+  $ hg qnew -mbar bar
+  $ echo foo > foo
+  $ echo bar > bar
+  $ hg add foo bar
+  $ hg qrefresh
+  $ hg qpop -a
+  popping bar
+  popping foo
+  patch queue now empty
+  $ echo bar > foo
+  $ hg qpush -a
+  applying foo
+  applying bar
+  file foo already exists
+  1 out of 1 hunks FAILED -- saving rejects to file foo.rej
+  patch failed, unable to continue (try -v)
+  patch failed, rejects left in working dir
+  errors during apply, please fix and refresh bar
+  [2]
+  $ hg st
+  ? foo
+  ? foo.rej
+
+
+mq tags
+
+  $ hg log --template '{rev} {tags}\n' -r qparent:qtip
+  0 qparent
+  1 foo qbase
+  2 bar qtip tip
+
+
+bad node in status
+
+  $ hg qpop
+  popping bar
+  now at: foo
+  $ hg strip -qn tip
+  $ hg tip
+  changeset:   0:cb9a9f314b8b
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     a
+  
+  $ hg branches
+  default                        0:cb9a9f314b8b
+  $ hg qpop
+  no patches applied
+  [1]
+
+  $ cat >>$HGRCPATH <<EOF
+  > [diff]
+  > git = True
+  > EOF
+  $ cd ..
+  $ hg init git
+  $ cd git
+  $ hg qinit
+
+  $ hg qnew -m'new file' new
+  $ echo foo > new
+  $ chmod +x new
+  $ hg add new
+  $ hg qrefresh
+  $ cat .hg/patches/new
+  new file
+  
+  diff --git a/new b/new
+  new file mode 100755
+  --- /dev/null
+  +++ b/new
+  @@ -0,0 +1,1 @@
+  +foo
+
+  $ hg qnew -m'copy file' copy
+  $ hg cp new copy
+  $ hg qrefresh
+  $ cat .hg/patches/copy
+  copy file
+  
+  diff --git a/new b/copy
+  copy from new
+  copy to copy
+
+  $ hg qpop
+  popping copy
+  now at: new
+  $ hg qpush
+  applying copy
+  now at: copy
+  $ hg qdiff
+  diff --git a/new b/copy
+  copy from new
+  copy to copy
+  $ cat >>$HGRCPATH <<EOF
+  > [diff]
+  > git = False
+  > EOF
+  $ hg qdiff --git
+  diff --git a/new b/copy
+  copy from new
+  copy to copy
+  $ cd ..
+
+
+test file addition in slow path
+
+  $ hg init slow
+  $ cd slow
+  $ hg qinit
+  $ echo foo > foo
+  $ hg add foo
+  $ hg ci -m 'add foo'
+  $ hg qnew bar
+  $ echo bar > bar
+  $ hg add bar
+  $ hg mv foo baz
+  $ hg qrefresh --git
+  $ hg up -C 0
+  1 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  $ echo >> foo
+  $ hg ci -m 'change foo'
+  created new head
+  $ hg up -C 1
+  2 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg qrefresh --git
+  $ cat .hg/patches/bar
+  diff --git a/bar b/bar
+  new file mode 100644
+  --- /dev/null
+  +++ b/bar
+  @@ -0,0 +1,1 @@
+  +bar
+  diff --git a/foo b/baz
+  rename from foo
+  rename to baz
+  $ hg log -v --template '{rev} {file_copies}\n' -r .
+  2 baz (foo)
+  $ hg qrefresh --git
+  $ cat .hg/patches/bar
+  diff --git a/bar b/bar
+  new file mode 100644
+  --- /dev/null
+  +++ b/bar
+  @@ -0,0 +1,1 @@
+  +bar
+  diff --git a/foo b/baz
+  rename from foo
+  rename to baz
+  $ hg log -v --template '{rev} {file_copies}\n' -r .
+  2 baz (foo)
+  $ hg qrefresh
+  $ grep 'diff --git' .hg/patches/bar
+  diff --git a/bar b/bar
+  diff --git a/foo b/baz
+
+
+test file move chains in the slow path
+
+  $ hg up -C 1
+  1 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  $ echo >> foo
+  $ hg ci -m 'change foo again'
+  $ hg up -C 2
+  2 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg mv bar quux
+  $ hg mv baz bleh
+  $ hg qrefresh --git
+  $ cat .hg/patches/bar
+  diff --git a/foo b/bleh
+  rename from foo
+  rename to bleh
+  diff --git a/quux b/quux
+  new file mode 100644
+  --- /dev/null
+  +++ b/quux
+  @@ -0,0 +1,1 @@
+  +bar
+  $ hg log -v --template '{rev} {file_copies}\n' -r .
+  3 bleh (foo)
+  $ hg mv quux fred
+  $ hg mv bleh barney
+  $ hg qrefresh --git
+  $ cat .hg/patches/bar
+  diff --git a/foo b/barney
+  rename from foo
+  rename to barney
+  diff --git a/fred b/fred
+  new file mode 100644
+  --- /dev/null
+  +++ b/fred
+  @@ -0,0 +1,1 @@
+  +bar
+  $ hg log -v --template '{rev} {file_copies}\n' -r .
+  3 barney (foo)
+
+
+refresh omitting an added file
+
+  $ hg qnew baz
+  $ echo newfile > newfile
+  $ hg add newfile
+  $ hg qrefresh
+  $ hg st -A newfile
+  C newfile
+  $ hg qrefresh -X newfile
+  $ hg st -A newfile
+  A newfile
+  $ hg revert newfile
+  $ rm newfile
+  $ hg qpop
+  popping baz
+  now at: bar
+  $ hg qdel baz
+
+
+create a git patch
+
+  $ echo a > alexander
+  $ hg add alexander
+  $ hg qnew -f --git addalexander
+  $ grep diff .hg/patches/addalexander
+  diff --git a/alexander b/alexander
+
+
+create a git binary patch
+
+  $ cat > writebin.py <<EOF
+  > import sys
+  > path = sys.argv[1]
+  > open(path, 'wb').write('BIN\x00ARY')
+  > EOF
+  $ python writebin.py bucephalus
+
+  $ python "$TESTDIR/md5sum.py" bucephalus
+  8ba2a2f3e77b55d03051ff9c24ad65e7  bucephalus
+  $ hg add bucephalus
+  $ hg qnew -f --git addbucephalus
+  $ grep diff .hg/patches/addbucephalus
+  diff --git a/bucephalus b/bucephalus
+
+
+check binary patches can be popped and pushed
+
+  $ hg qpop
+  popping addbucephalus
+  now at: addalexander
+  $ test -f bucephalus && echo % bucephalus should not be there
+  [1]
+  $ hg qpush
+  applying addbucephalus
+  now at: addbucephalus
+  $ test -f bucephalus
+  $ python "$TESTDIR/md5sum.py" bucephalus
+  8ba2a2f3e77b55d03051ff9c24ad65e7  bucephalus
+
+
+
+strip again
+
+  $ cd ..
+  $ hg init strip
+  $ cd strip
+  $ touch foo
+  $ hg add foo
+  $ hg ci -m 'add foo'
+  $ echo >> foo
+  $ hg ci -m 'change foo 1'
+  $ hg up -C 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo 1 >> foo
+  $ hg ci -m 'change foo 2'
+  created new head
+  $ HGMERGE=true hg merge
+  merging foo
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg ci -m merge
+  $ hg log
+  changeset:   3:99615015637b
+  tag:         tip
+  parent:      2:20cbbe65cff7
+  parent:      1:d2871fc282d4
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     merge
+  
+  changeset:   2:20cbbe65cff7
+  parent:      0:53245c60e682
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     change foo 2
+  
+  changeset:   1:d2871fc282d4
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     change foo 1
+  
+  changeset:   0:53245c60e682
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add foo
+  
+  $ hg strip 1
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  saved backup bundle to * (glob)
+  $ checkundo strip
+  $ hg log
+  changeset:   1:20cbbe65cff7
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     change foo 2
+  
+  changeset:   0:53245c60e682
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add foo
+  
+  $ cd ..
+
+
+qclone
+
+  $ qlog()
+  > {
+  >     echo 'main repo:'
+  >     hg log --template '    rev {rev}: {desc}\n'
+  >     echo 'patch repo:'
+  >     hg -R .hg/patches log --template '    rev {rev}: {desc}\n'
+  > }
+  $ hg init qclonesource
+  $ cd qclonesource
+  $ echo foo > foo
+  $ hg add foo
+  $ hg ci -m 'add foo'
+  $ hg qinit
+  $ hg qnew patch1
+  $ echo bar >> foo
+  $ hg qrefresh -m 'change foo'
+  $ cd ..
+
+
+repo with unversioned patch dir
+
+  $ hg qclone qclonesource failure
+  abort: versioned patch repository not found (see init --mq)
+  [255]
+
+  $ cd qclonesource
+  $ hg qinit -c
+  adding .hg/patches/patch1
+  $ hg qci -m checkpoint
+  $ qlog
+  main repo:
+      rev 1: change foo
+      rev 0: add foo
+  patch repo:
+      rev 0: checkpoint
+  $ cd ..
+
+
+repo with patches applied
+
+  $ hg qclone qclonesource qclonedest
+  updating to branch default
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd qclonedest
+  $ qlog
+  main repo:
+      rev 0: add foo
+  patch repo:
+      rev 0: checkpoint
+  $ cd ..
+
+
+repo with patches unapplied
+
+  $ cd qclonesource
+  $ hg qpop -a
+  popping patch1
+  patch queue now empty
+  $ qlog
+  main repo:
+      rev 0: add foo
+  patch repo:
+      rev 0: checkpoint
+  $ cd ..
+  $ hg qclone qclonesource qclonedest2
+  updating to branch default
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd qclonedest2
+  $ qlog
+  main repo:
+      rev 0: add foo
+  patch repo:
+      rev 0: checkpoint
+  $ cd ..
+
+
+test applying on an empty file (issue 1033)
+
+  $ hg init empty
+  $ cd empty
+  $ touch a
+  $ hg ci -Am addempty
+  adding a
+  $ echo a > a
+  $ hg qnew -f -e changea
+  $ hg qpop
+  popping changea
+  patch queue now empty
+  $ hg qpush
+  applying changea
+  now at: changea
+  $ cd ..
+
+
+test qpush with --force, issue1087
+
+  $ hg init forcepush
+  $ cd forcepush
+  $ echo hello > hello.txt
+  $ echo bye > bye.txt
+  $ hg ci -Ama
+  adding bye.txt
+  adding hello.txt
+  $ hg qnew -d '0 0' empty
+  $ hg qpop
+  popping empty
+  patch queue now empty
+  $ echo world >> hello.txt
+
+
+qpush should fail, local changes
+
+  $ hg qpush
+  abort: local changes found, refresh first
+  [255]
+
+
+apply force, should not discard changes with empty patch
+
+  $ hg qpush -f
+  applying empty
+  patch empty is empty
+  now at: empty
+  $ hg diff --config diff.nodates=True
+  diff -r bf5fc3f07a0a hello.txt
+  --- a/hello.txt
+  +++ b/hello.txt
+  @@ -1,1 +1,2 @@
+   hello
+  +world
+  $ hg qdiff --config diff.nodates=True
+  diff -r 9ecee4f634e3 hello.txt
+  --- a/hello.txt
+  +++ b/hello.txt
+  @@ -1,1 +1,2 @@
+   hello
+  +world
+  $ hg log -l1 -p
+  changeset:   1:bf5fc3f07a0a
+  tag:         empty
+  tag:         qbase
+  tag:         qtip
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     imported patch empty
+  
+  
+  $ hg qref -d '0 0'
+  $ hg qpop
+  popping empty
+  patch queue now empty
+  $ echo universe >> hello.txt
+  $ echo universe >> bye.txt
+
+
+qpush should fail, local changes
+
+  $ hg qpush
+  abort: local changes found, refresh first
+  [255]
+
+
+apply force, should discard changes in hello, but not bye
+
+  $ hg qpush -f
+  applying empty
+  now at: empty
+  $ hg st
+  M bye.txt
+  $ hg diff --config diff.nodates=True
+  diff -r ba252371dbc1 bye.txt
+  --- a/bye.txt
+  +++ b/bye.txt
+  @@ -1,1 +1,2 @@
+   bye
+  +universe
+  $ hg qdiff --config diff.nodates=True
+  diff -r 9ecee4f634e3 bye.txt
+  --- a/bye.txt
+  +++ b/bye.txt
+  @@ -1,1 +1,2 @@
+   bye
+  +universe
+  diff -r 9ecee4f634e3 hello.txt
+  --- a/hello.txt
+  +++ b/hello.txt
+  @@ -1,1 +1,3 @@
+   hello
+  +world
+  +universe
+
+
+test popping revisions not in working dir ancestry
+
+  $ hg qseries -v
+  0 A empty
+  $ hg up qparent
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg qpop
+  popping empty
+  patch queue now empty
+
+  $ cd ..
+  $ hg init deletion-order
+  $ cd deletion-order
+
+  $ touch a
+  $ hg ci -Aqm0
+
+  $ hg qnew rename-dir
+  $ hg rm a
+  $ hg qrefresh
+
+  $ mkdir a b
+  $ touch a/a b/b
+  $ hg add -q a b
+  $ hg qrefresh
+
+
+test popping must remove files added in subdirectories first
+
+  $ hg qpop
+  popping rename-dir
+  patch queue now empty
+  $ cd ..
+
--- a/tests/test-nested-repo	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-#!/bin/sh
-
-hg init a
-cd a
-hg init b
-echo x > b/x
-
-echo '# should print nothing'
-hg add b
-hg st
-
-echo '# should fail'
-hg st b/x
-hg add b/x
-
-echo '# should fail'
-hg add b b/x
-hg st
-
-echo '# should arguably print nothing'
-hg st b
-
-echo a > a
-hg ci -Ama a
-
-echo '# should fail'
-hg mv a b
-hg st
--- a/tests/test-nested-repo.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-# should print nothing
-# should fail
-abort: path 'b/x' is inside repo 'b'
-abort: path 'b/x' is inside repo 'b'
-# should fail
-abort: path 'b/x' is inside repo 'b'
-# should arguably print nothing
-# should fail
-abort: path 'b/a' is inside repo 'b'
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-nested-repo.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,40 @@
+  $ hg init a
+  $ cd a
+  $ hg init b
+  $ echo x > b/x
+
+Should print nothing:
+
+  $ hg add b
+  $ hg st
+
+Should fail:
+
+  $ hg st b/x
+  abort: path 'b/x' is inside repo 'b'
+  [255]
+  $ hg add b/x
+  abort: path 'b/x' is inside repo 'b'
+  [255]
+
+Should fail:
+
+  $ hg add b b/x
+  abort: path 'b/x' is inside repo 'b'
+  [255]
+  $ hg st
+
+Should arguably print nothing:
+
+  $ hg st b
+
+  $ echo a > a
+  $ hg ci -Ama a
+
+Should fail:
+
+  $ hg mv a b
+  abort: path 'b/a' is inside repo 'b'
+  [255]
+  $ hg st
+
--- a/tests/test-newbranch	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,113 +0,0 @@
-#!/bin/sh
-
-branchcache=.hg/branchheads.cache
-
-hg init t
-cd t
-hg branches
-
-echo foo > a
-hg add a
-hg ci -m "initial" -d "1000000 0"
-hg branch foo
-hg branch
-hg ci -m "add branch name" -d "1000000 0"
-hg branch bar
-hg ci -m "change branch name" -d "1000000 0"
-echo % branch shadowing
-hg branch default
-hg branch -f default
-hg ci -m "clear branch name" -d "1000000 0"
-
-echo % there should be only one default branch head
-hg heads .
-
-hg co foo
-hg branch
-echo bleah > a
-hg ci -m "modify a branch" -d "1000000 0"
-
-hg merge default
-hg branch
-hg ci -m "merge" -d "1000000 0"
-hg log
-
-hg branches
-hg branches -q
-
-echo % test for invalid branch cache
-hg rollback
-cp $branchcache .hg/bc-invalid
-hg log -r foo
-cp .hg/bc-invalid $branchcache
-hg --debug log -r foo
-rm $branchcache
-echo corrupted > $branchcache
-hg log -qr foo
-cat $branchcache
-
-echo % push should update the branch cache
-hg init ../target
-echo % pushing just rev 0
-hg push -qr 0 ../target
-cat ../target/$branchcache
-echo % pushing everything
-hg push -qf ../target
-cat ../target/$branchcache
-
-echo % update with no arguments: tipmost revision of the current branch
-hg up -q -C 0
-hg up -q
-hg id
-hg up -q 1
-hg up -q
-hg id
-hg branch foobar
-hg up
-
-echo % fastforward merge
-hg branch ff
-echo ff > ff
-hg ci -Am'fast forward' -d '1000000 0'
-hg up foo
-hg merge ff
-hg branch
-hg commit -m'Merge ff into foo' -d '1000000 0'
-hg parents
-hg manifest
-
-echo % test merging, add 3 default heads and one test head
-cd ..
-hg init merges
-cd merges
-echo a > a
-hg ci -Ama
-
-echo b > b
-hg ci -Amb
-
-hg up 0
-echo c > c
-hg ci -Amc
-
-hg up 0
-echo d > d
-hg ci -Amd
-
-hg up 0
-hg branch test
-echo e >> e
-hg ci -Ame
-
-hg log
-
-echo % implicit merge with test branch as parent
-hg merge
-hg up -C default
-echo % implicit merge with default branch as parent
-hg merge
-echo % 3 branch heads, explicit merge required
-hg merge 2
-hg ci -m merge
-echo % 2 branch heads, implicit merge works
-hg merge
--- a/tests/test-newbranch.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,180 +0,0 @@
-marked working directory as branch foo
-foo
-marked working directory as branch bar
-% branch shadowing
-abort: a branch of the same name already exists (use 'hg update' to switch to it)
-marked working directory as branch default
-created new head
-% there should be only one default branch head
-changeset:   3:bf1bc2f45e83
-tag:         tip
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     clear branch name
-
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-foo
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-foo
-changeset:   5:5f8fb06e083e
-branch:      foo
-tag:         tip
-parent:      4:4909a3732169
-parent:      3:bf1bc2f45e83
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     merge
-
-changeset:   4:4909a3732169
-branch:      foo
-parent:      1:b699b1cec9c2
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     modify a branch
-
-changeset:   3:bf1bc2f45e83
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     clear branch name
-
-changeset:   2:67ec16bde7f1
-branch:      bar
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     change branch name
-
-changeset:   1:b699b1cec9c2
-branch:      foo
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     add branch name
-
-changeset:   0:be8523e69bf8
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     initial
-
-foo                            5:5f8fb06e083e
-default                        3:bf1bc2f45e83 (inactive)
-bar                            2:67ec16bde7f1 (inactive)
-foo
-default
-bar
-% test for invalid branch cache
-rolling back to revision 4 (undo commit)
-changeset:   4:4909a3732169
-branch:      foo
-tag:         tip
-parent:      1:b699b1cec9c2
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     modify a branch
-
-invalidating branch cache (tip differs)
-changeset:   4:4909a3732169c0c20011c4f4b8fdff4e3d89b23f
-branch:      foo
-tag:         tip
-parent:      1:b699b1cec9c2966b3700de4fef0dc123cd754c31
-parent:      -1:0000000000000000000000000000000000000000
-manifest:    4:d01b250baaa05909152f7ae07d7a649deea0df9a
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-files:       a
-extra:       branch=foo
-description:
-modify a branch
-
-
-4:4909a3732169
-4909a3732169c0c20011c4f4b8fdff4e3d89b23f 4
-bf1bc2f45e834c75404d0ddab57d53beab56e2f8 default
-4909a3732169c0c20011c4f4b8fdff4e3d89b23f foo
-67ec16bde7f1575d523313b9bca000f6a6f12dca bar
-% push should update the branch cache
-% pushing just rev 0
-be8523e69bf892e25817fc97187516b3c0804ae4 0
-be8523e69bf892e25817fc97187516b3c0804ae4 default
-% pushing everything
-4909a3732169c0c20011c4f4b8fdff4e3d89b23f 4
-bf1bc2f45e834c75404d0ddab57d53beab56e2f8 default
-4909a3732169c0c20011c4f4b8fdff4e3d89b23f foo
-67ec16bde7f1575d523313b9bca000f6a6f12dca bar
-% update with no arguments: tipmost revision of the current branch
-bf1bc2f45e83
-4909a3732169 (foo) tip
-marked working directory as branch foobar
-abort: branch foobar not found
-% fastforward merge
-marked working directory as branch ff
-adding ff
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-foo
-changeset:   6:f0c74f92a385
-branch:      foo
-tag:         tip
-parent:      4:4909a3732169
-parent:      5:c420d2121b71
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     Merge ff into foo
-
-a
-ff
-% test merging, add 3 default heads and one test head
-adding a
-adding b
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-adding c
-created new head
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-adding d
-created new head
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-marked working directory as branch test
-adding e
-changeset:   4:3a1e01ed1df4
-branch:      test
-tag:         tip
-parent:      0:cb9a9f314b8b
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     e
-
-changeset:   3:980f7dc84c29
-parent:      0:cb9a9f314b8b
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     d
-
-changeset:   2:d36c0562f908
-parent:      0:cb9a9f314b8b
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     c
-
-changeset:   1:d2ae7f538514
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     b
-
-changeset:   0:cb9a9f314b8b
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     a
-
-% implicit merge with test branch as parent
-abort: branch 'test' has one head - please merge with an explicit rev
-(run 'hg heads' to see all heads)
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-% implicit merge with default branch as parent
-abort: branch 'default' has 3 heads - please merge with an explicit rev
-(run 'hg heads .' to see heads)
-% 3 branch heads, explicit merge required
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-% 2 branch heads, implicit merge works
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-newbranch.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,320 @@
+  $ branchcache=.hg/branchheads.cache
+
+  $ hg init t
+  $ cd t
+
+  $ hg branches
+  $ echo foo > a
+  $ hg add a
+  $ hg ci -m "initial"
+  $ hg branch foo
+  marked working directory as branch foo
+  $ hg branch
+  foo
+  $ hg ci -m "add branch name"
+  $ hg branch bar
+  marked working directory as branch bar
+  $ hg ci -m "change branch name"
+
+Branch shadowing:
+
+  $ hg branch default
+  abort: a branch of the same name already exists (use 'hg update' to switch to it)
+  [255]
+
+  $ hg branch -f default
+  marked working directory as branch default
+
+  $ hg ci -m "clear branch name"
+  created new head
+
+There should be only one default branch head
+
+  $ hg heads .
+  changeset:   3:9d567d0b51f9
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     clear branch name
+  
+
+  $ hg co foo
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg branch
+  foo
+  $ echo bleah > a
+  $ hg ci -m "modify a branch"
+
+  $ hg merge default
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+  $ hg branch
+  foo
+  $ hg ci -m "merge"
+
+  $ hg log
+  changeset:   5:dc140083783b
+  branch:      foo
+  tag:         tip
+  parent:      4:98d14f698afe
+  parent:      3:9d567d0b51f9
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     merge
+  
+  changeset:   4:98d14f698afe
+  branch:      foo
+  parent:      1:0079f24813e2
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     modify a branch
+  
+  changeset:   3:9d567d0b51f9
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     clear branch name
+  
+  changeset:   2:ed2bbf4e0102
+  branch:      bar
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     change branch name
+  
+  changeset:   1:0079f24813e2
+  branch:      foo
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add branch name
+  
+  changeset:   0:db01e8ea3388
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     initial
+  
+  $ hg branches
+  foo                            5:dc140083783b
+  default                        3:9d567d0b51f9 (inactive)
+  bar                            2:ed2bbf4e0102 (inactive)
+
+  $ hg branches -q
+  foo
+  default
+  bar
+
+Test for invalid branch cache:
+
+  $ hg rollback
+  rolling back to revision 4 (undo commit)
+
+  $ cp $branchcache .hg/bc-invalid
+
+  $ hg log -r foo
+  changeset:   4:98d14f698afe
+  branch:      foo
+  tag:         tip
+  parent:      1:0079f24813e2
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     modify a branch
+  
+  $ cp .hg/bc-invalid $branchcache
+
+  $ hg --debug log -r foo
+  invalidating branch cache (tip differs)
+  changeset:   4:98d14f698afeaff8cb612dcf215ce95e639effc3
+  branch:      foo
+  tag:         tip
+  parent:      1:0079f24813e2b73a891577c243684c5066347bc8
+  parent:      -1:0000000000000000000000000000000000000000
+  manifest:    4:d01b250baaa05909152f7ae07d7a649deea0df9a
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files:       a
+  extra:       branch=foo
+  description:
+  modify a branch
+  
+  
+  $ rm $branchcache
+  $ echo corrupted > $branchcache
+
+  $ hg log -qr foo
+  4:98d14f698afe
+
+  $ cat $branchcache
+  98d14f698afeaff8cb612dcf215ce95e639effc3 4
+  9d567d0b51f9e2068b054e1948e1a927f99b5874 default
+  98d14f698afeaff8cb612dcf215ce95e639effc3 foo
+  ed2bbf4e01029020711be82ca905283e883f0e11 bar
+
+Push should update the branch cache:
+
+  $ hg init ../target
+
+Pushing just rev 0:
+
+  $ hg push -qr 0 ../target
+
+  $ cat ../target/$branchcache
+  db01e8ea3388fd3c7c94e1436ea2bd6a53d581c5 0
+  db01e8ea3388fd3c7c94e1436ea2bd6a53d581c5 default
+
+Pushing everything:
+
+  $ hg push -qf ../target
+
+  $ cat ../target/$branchcache
+  98d14f698afeaff8cb612dcf215ce95e639effc3 4
+  9d567d0b51f9e2068b054e1948e1a927f99b5874 default
+  98d14f698afeaff8cb612dcf215ce95e639effc3 foo
+  ed2bbf4e01029020711be82ca905283e883f0e11 bar
+
+Update with no arguments: tipmost revision of the current branch:
+
+  $ hg up -q -C 0
+  $ hg up -q
+  $ hg id
+  9d567d0b51f9
+
+  $ hg up -q 1
+  $ hg up -q
+  $ hg id
+  98d14f698afe (foo) tip
+
+  $ hg branch foobar
+  marked working directory as branch foobar
+
+  $ hg up
+  abort: branch foobar not found
+  [255]
+
+Fastforward merge:
+
+  $ hg branch ff
+  marked working directory as branch ff
+
+  $ echo ff > ff
+  $ hg ci -Am'fast forward'
+  adding ff
+
+  $ hg up foo
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+  $ hg merge ff
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+  $ hg branch
+  foo
+  $ hg commit -m'Merge ff into foo'
+  $ hg parents
+  changeset:   6:917eb54e1b4b
+  branch:      foo
+  tag:         tip
+  parent:      4:98d14f698afe
+  parent:      5:6683a60370cb
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     Merge ff into foo
+  
+  $ hg manifest
+  a
+  ff
+
+
+Test merging, add 3 default heads and one test head:
+
+  $ cd ..
+  $ hg init merges
+  $ cd merges
+  $ echo a > a
+  $ hg ci -Ama
+  adding a
+
+  $ echo b > b
+  $ hg ci -Amb
+  adding b
+
+  $ hg up 0
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo c > c
+  $ hg ci -Amc
+  adding c
+  created new head
+
+  $ hg up 0
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo d > d
+  $ hg ci -Amd
+  adding d
+  created new head
+
+  $ hg up 0
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg branch test
+  marked working directory as branch test
+  $ echo e >> e
+  $ hg ci -Ame
+  adding e
+
+  $ hg log
+  changeset:   4:3a1e01ed1df4
+  branch:      test
+  tag:         tip
+  parent:      0:cb9a9f314b8b
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     e
+  
+  changeset:   3:980f7dc84c29
+  parent:      0:cb9a9f314b8b
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     d
+  
+  changeset:   2:d36c0562f908
+  parent:      0:cb9a9f314b8b
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     c
+  
+  changeset:   1:d2ae7f538514
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     b
+  
+  changeset:   0:cb9a9f314b8b
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     a
+  
+Implicit merge with test branch as parent:
+
+  $ hg merge
+  abort: branch 'test' has one head - please merge with an explicit rev
+  (run 'hg heads' to see all heads)
+  [255]
+  $ hg up -C default
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+Implicit merge with default branch as parent:
+
+  $ hg merge
+  abort: branch 'default' has 3 heads - please merge with an explicit rev
+  (run 'hg heads .' to see heads)
+  [255]
+
+3 branch heads, explicit merge required:
+
+  $ hg merge 2
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg ci -m merge
+
+2 branch heads, implicit merge works:
+
+  $ hg merge
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
--- a/tests/test-non-interactive-wsgi	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-#!/bin/sh
-# Tests if hgweb can run without touching sys.stdin, as is required
-# by the WSGI standard and strictly implemented by mod_wsgi.
-
-mkdir repo
-cd repo
-hg init
-echo foo > bar
-hg add bar
-hg commit -m "test"
-hg tip
-
-cat > request.py <<EOF
-from mercurial import dispatch
-from mercurial.hgweb.hgweb_mod import hgweb
-from mercurial.ui import ui
-from mercurial import hg
-from StringIO import StringIO
-import os, sys
-
-class FileLike(object):
-    def __init__(self, real):
-        self.real = real
-    def fileno(self):
-        print >> sys.__stdout__, 'FILENO'
-        return self.real.fileno()
-    def read(self):
-        print >> sys.__stdout__, 'READ'
-        return self.real.read()
-    def readline(self):
-        print >> sys.__stdout__, 'READLINE'
-        return self.real.readline()
-
-sys.stdin = FileLike(sys.stdin)
-errors = StringIO()
-input = StringIO()
-output = StringIO()
-
-def startrsp(headers, data):
-	print '---- HEADERS'
-	print headers
-	print '---- DATA'
-	print data
-	return output.write
-
-env = {
-	'wsgi.version': (1, 0),
-	'wsgi.url_scheme': 'http',
-	'wsgi.errors': errors,
-	'wsgi.input': input,
-	'wsgi.multithread': False,
-	'wsgi.multiprocess': False,
-	'wsgi.run_once': False,
-	'REQUEST_METHOD': 'GET',
-	'SCRIPT_NAME': '',
-	'PATH_INFO': '',
-	'QUERY_STRING': '',
-	'SERVER_NAME': '127.0.0.1',
-	'SERVER_PORT': os.environ['HGPORT'],
-	'SERVER_PROTOCOL': 'HTTP/1.0'
-}
-
-i = hgweb('.')
-i(env, startrsp)
-print '---- ERRORS'
-print errors.getvalue()
-print '---- OS.ENVIRON wsgi variables'
-print sorted([x for x in os.environ if x.startswith('wsgi')])
-print '---- request.ENVIRON wsgi variables'
-print sorted([x for x in i.repo.ui.environ if x.startswith('wsgi')])
-EOF
-
-python request.py
--- a/tests/test-non-interactive-wsgi.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-changeset:   0:61c9426e69fe
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     test
-
----- HEADERS
-200 Script output follows
----- DATA
-[('Content-Type', 'text/html; charset=ascii')]
----- ERRORS
-
----- OS.ENVIRON wsgi variables
-[]
----- request.ENVIRON wsgi variables
-['wsgi.errors', 'wsgi.input', 'wsgi.multiprocess', 'wsgi.multithread', 'wsgi.run_once', 'wsgi.url_scheme', 'wsgi.version']
--- a/tests/test-parents	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-#!/bin/sh
-# test parents command
-
-hg init repo
-cd repo
-echo % no working directory
-hg parents
-
-echo a > a
-echo b > b
-hg ci -Amab -d '0 0'
-echo a >> a
-hg ci -Ama -d '1 0'
-echo b >> b
-hg ci -Amb -d '2 0'
-echo c > c
-hg ci -Amc -d '3 0'
-hg up -C 1
-echo d > c
-hg ci -Amc2 -d '4 0'
-hg up -C 3
-
-echo % hg parents
-hg parents
-
-echo % hg parents a
-hg parents a
-
-echo % hg parents c, single revision
-hg parents c
-
-echo % hg parents -r 3 c
-hg parents -r 3 c
-
-echo % hg parents -r 2
-hg parents -r 2
-
-echo % hg parents -r 2 a
-hg parents -r 2 a
-
-echo % hg parents -r 2 ../a
-hg parents -r 2 ../a
-
-echo '% cd dir; hg parents -r 2 ../a'
-mkdir dir
-cd dir
-hg parents -r 2 ../a
-
-echo '% hg parents -r 2 path:a'
-hg parents -r 2 path:a
-
-echo '% hg parents -r 2 glob:a'
-cd ..
-hg parents -r 2 glob:a
-
-echo % merge working dir with 2 parents, hg parents c
-HGMERGE=true hg merge
-hg parents c
-
-echo % merge working dir with 1 parent, hg parents
-hg up -C 2
-HGMERGE=true hg merge -r 4
-hg parents
-echo % merge working dir with 1 parent, hg parents c
-hg parents c
-
-true
--- a/tests/test-parents.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +0,0 @@
-% no working directory
-adding a
-adding b
-adding c
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-adding c
-created new head
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% hg parents
-changeset:   3:02d851b7e549
-user:        test
-date:        Thu Jan 01 00:00:03 1970 +0000
-summary:     c
-
-% hg parents a
-changeset:   1:d786049f033a
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-summary:     a
-
-% hg parents c, single revision
-changeset:   3:02d851b7e549
-user:        test
-date:        Thu Jan 01 00:00:03 1970 +0000
-summary:     c
-
-% hg parents -r 3 c
-abort: 'c' not found in manifest!
-% hg parents -r 2
-changeset:   1:d786049f033a
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-summary:     a
-
-% hg parents -r 2 a
-changeset:   1:d786049f033a
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-summary:     a
-
-% hg parents -r 2 ../a
-abort: ../a not under root
-% cd dir; hg parents -r 2 ../a
-changeset:   1:d786049f033a
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-summary:     a
-
-% hg parents -r 2 path:a
-changeset:   1:d786049f033a
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-summary:     a
-
-% hg parents -r 2 glob:a
-abort: can only specify an explicit filename
-% merge working dir with 2 parents, hg parents c
-merging c
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-changeset:   3:02d851b7e549
-user:        test
-date:        Thu Jan 01 00:00:03 1970 +0000
-summary:     c
-
-changeset:   4:48cee28d4b4e
-tag:         tip
-parent:      1:d786049f033a
-user:        test
-date:        Thu Jan 01 00:00:04 1970 +0000
-summary:     c2
-
-% merge working dir with 1 parent, hg parents
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-changeset:   2:6cfac479f009
-user:        test
-date:        Thu Jan 01 00:00:02 1970 +0000
-summary:     b
-
-changeset:   4:48cee28d4b4e
-tag:         tip
-parent:      1:d786049f033a
-user:        test
-date:        Thu Jan 01 00:00:04 1970 +0000
-summary:     c2
-
-% merge working dir with 1 parent, hg parents c
-changeset:   4:48cee28d4b4e
-tag:         tip
-parent:      1:d786049f033a
-user:        test
-date:        Thu Jan 01 00:00:04 1970 +0000
-summary:     c2
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-parents.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,152 @@
+test parents command
+
+  $ hg init repo
+  $ cd repo
+
+no working directory
+
+  $ hg parents
+
+  $ echo a > a
+  $ echo b > b
+  $ hg ci -Amab -d '0 0'
+  adding a
+  adding b
+  $ echo a >> a
+  $ hg ci -Ama -d '1 0'
+  $ echo b >> b
+  $ hg ci -Amb -d '2 0'
+  $ echo c > c
+  $ hg ci -Amc -d '3 0'
+  adding c
+  $ hg up -C 1
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo d > c
+  $ hg ci -Amc2 -d '4 0'
+  adding c
+  created new head
+  $ hg up -C 3
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+
+  $ hg parents
+  changeset:   3:02d851b7e549
+  user:        test
+  date:        Thu Jan 01 00:00:03 1970 +0000
+  summary:     c
+  
+
+  $ hg parents a
+  changeset:   1:d786049f033a
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  summary:     a
+  
+
+hg parents c, single revision
+
+  $ hg parents c
+  changeset:   3:02d851b7e549
+  user:        test
+  date:        Thu Jan 01 00:00:03 1970 +0000
+  summary:     c
+  
+
+  $ hg parents -r 3 c
+  abort: 'c' not found in manifest!
+  [255]
+
+  $ hg parents -r 2
+  changeset:   1:d786049f033a
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  summary:     a
+  
+
+  $ hg parents -r 2 a
+  changeset:   1:d786049f033a
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  summary:     a
+  
+
+  $ hg parents -r 2 ../a
+  abort: ../a not under root
+  [255]
+
+
+cd dir; hg parents -r 2 ../a
+
+  $ mkdir dir
+  $ cd dir
+  $ hg parents -r 2 ../a
+  changeset:   1:d786049f033a
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  summary:     a
+  
+  $ hg parents -r 2 path:a
+  changeset:   1:d786049f033a
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  summary:     a
+  
+  $ cd ..
+
+  $ hg parents -r 2 glob:a
+  abort: can only specify an explicit filename
+  [255]
+
+
+merge working dir with 2 parents, hg parents c
+
+  $ HGMERGE=true hg merge
+  merging c
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg parents c
+  changeset:   3:02d851b7e549
+  user:        test
+  date:        Thu Jan 01 00:00:03 1970 +0000
+  summary:     c
+  
+  changeset:   4:48cee28d4b4e
+  tag:         tip
+  parent:      1:d786049f033a
+  user:        test
+  date:        Thu Jan 01 00:00:04 1970 +0000
+  summary:     c2
+  
+
+
+merge working dir with 1 parent, hg parents
+
+  $ hg up -C 2
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ HGMERGE=true hg merge -r 4
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg parents
+  changeset:   2:6cfac479f009
+  user:        test
+  date:        Thu Jan 01 00:00:02 1970 +0000
+  summary:     b
+  
+  changeset:   4:48cee28d4b4e
+  tag:         tip
+  parent:      1:d786049f033a
+  user:        test
+  date:        Thu Jan 01 00:00:04 1970 +0000
+  summary:     c2
+  
+
+merge working dir with 1 parent, hg parents c
+
+  $ hg parents c
+  changeset:   4:48cee28d4b4e
+  tag:         tip
+  parent:      1:d786049f033a
+  user:        test
+  date:        Thu Jan 01 00:00:04 1970 +0000
+  summary:     c2
+  
--- a/tests/test-parse-date	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
-#!/bin/sh
-
-# This runs with TZ="GMT"
-hg init
-echo "test-parse-date" > a
-hg add a
-hg ci -d "2006-02-01 13:00:30" -m "rev 0"
-echo "hi!" >> a
-hg ci -d "2006-02-01 13:00:30 -0500" -m "rev 1"
-hg tag -d "2006-04-15 13:30" "Hi"
-hg backout --merge -d "2006-04-15 13:30 +0200" -m "rev 3" 1
-hg ci -d "1150000000 14400" -m "rev 4 (merge)"
-echo "fail" >> a
-hg ci -d "should fail" -m "fail"
-hg ci -d "100000000000000000 1400" -m "fail"
-hg ci -d "100000 1400000" -m "fail"
-
-# Check with local timezone other than GMT and with DST
-TZ="PST+8PDT"
-export TZ
-# PST=UTC-8 / PDT=UTC-7
-hg debugrebuildstate
-echo "a" > a
-hg ci -d "2006-07-15 13:30" -m "summer@UTC-7"
-hg debugrebuildstate
-echo "b" > a
-hg ci -d "2006-07-15 13:30 +0500" -m "summer@UTC+5"
-hg debugrebuildstate
-echo "c" > a
-hg ci -d "2006-01-15 13:30" -m "winter@UTC-8"
-hg debugrebuildstate
-echo "d" > a
-hg ci -d "2006-01-15 13:30 +0500" -m "winter@UTC+5"
-hg log --template '{date|date}\n'
-
-# Test issue1014 (fractional timezones)
-hg debugdate "1000000000 -16200" # 0430
-hg debugdate "1000000000 -15300" # 0415
-hg debugdate "1000000000 -14400" # 0400
-hg debugdate "1000000000 0"      # GMT
-hg debugdate "1000000000 14400"  # -0400
-hg debugdate "1000000000 15300"  # -0415
-hg debugdate "1000000000 16200"  # -0430
-hg debugdate "Sat Sep 08 21:16:40 2001 +0430"
-hg debugdate "Sat Sep 08 21:16:40 2001 -0430"
-
-# Test 12-hours times
-hg debugdate "2006-02-01 1:00:30PM +0000"
-hg debugdate "1:00:30PM" > /dev/null || echo 'failed'
-
-#Test date formats with '>' or '<' accompanied by space characters
-hg log -d '>' --template '{date|date}\n'
-hg log -d '<' hg log -d '>' --template '{date|date}\n'
-
-hg log -d ' >' --template '{date|date}\n'
-hg log -d ' <' --template '{date|date}\n'
-
-hg log -d '> ' --template '{date|date}\n'
-hg log -d '< ' --template '{date|date}\n'
-
-hg log -d ' > ' --template '{date|date}\n'
-hg log -d ' < ' --template '{date|date}\n'
-
-
-hg log -d '>02/01' --template '{date|date}\n'
-hg log -d '<02/01' --template '{date|date}\n'
-
-hg log -d ' >02/01' --template '{date|date}\n'
-hg log -d ' <02/01' --template '{date|date}\n'
-
-hg log -d '> 02/01' --template '{date|date}\n'
-hg log -d '< 02/01' --template '{date|date}\n'
-
-hg log -d ' > 02/01' --template '{date|date}\n'
-hg log -d ' < 02/01' --template '{date|date}\n'
-
-hg log -d '>02/01 ' --template '{date|date}\n'
-hg log -d '<02/01 ' --template '{date|date}\n'
-
-hg log -d ' >02/01 ' --template '{date|date}\n'
-hg log -d ' <02/01 ' --template '{date|date}\n'
-
-hg log -d '> 02/01 ' --template '{date|date}\n'
-hg log -d '< 02/01 ' --template '{date|date}\n'
-
-hg log -d ' > 02/01 ' --template '{date|date}\n'
-hg log -d ' < 02/01 ' --template '{date|date}\n'
--- a/tests/test-parse-date.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,146 +0,0 @@
-reverting a
-created new head
-changeset 3:107ce1ee2b43 backs out changeset 1:25a1420a55f8
-merging with changeset 3:107ce1ee2b43
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-abort: invalid date: 'should fail' 
-abort: date exceeds 32 bits: 100000000000000000
-abort: impossible time zone offset: 1400000
-Sun Jan 15 13:30:00 2006 +0500
-Sun Jan 15 13:30:00 2006 -0800
-Sat Jul 15 13:30:00 2006 +0500
-Sat Jul 15 13:30:00 2006 -0700
-Sun Jun 11 00:26:40 2006 -0400
-Sat Apr 15 13:30:00 2006 +0200
-Sat Apr 15 13:30:00 2006 +0000
-Wed Feb 01 13:00:30 2006 -0500
-Wed Feb 01 13:00:30 2006 +0000
-internal: 1000000000 -16200
-standard: Sun Sep 09 06:16:40 2001 +0430
-internal: 1000000000 -15300
-standard: Sun Sep 09 06:01:40 2001 +0415
-internal: 1000000000 -14400
-standard: Sun Sep 09 05:46:40 2001 +0400
-internal: 1000000000 0
-standard: Sun Sep 09 01:46:40 2001 +0000
-internal: 1000000000 14400
-standard: Sat Sep 08 21:46:40 2001 -0400
-internal: 1000000000 15300
-standard: Sat Sep 08 21:31:40 2001 -0415
-internal: 1000000000 16200
-standard: Sat Sep 08 21:16:40 2001 -0430
-internal: 999967600 -16200
-standard: Sat Sep 08 21:16:40 2001 +0430
-internal: 1000000000 16200
-standard: Sat Sep 08 21:16:40 2001 -0430
-internal: 1138798830 0
-standard: Wed Feb 01 13:00:30 2006 +0000
-Sun Jan 15 13:30:00 2006 +0500
-Sun Jan 15 13:30:00 2006 -0800
-Sat Jul 15 13:30:00 2006 +0500
-Sat Jul 15 13:30:00 2006 -0700
-Sun Jun 11 00:26:40 2006 -0400
-Sat Apr 15 13:30:00 2006 +0200
-Sat Apr 15 13:30:00 2006 +0000
-Wed Feb 01 13:00:30 2006 -0500
-Wed Feb 01 13:00:30 2006 +0000
-Sun Jan 15 13:30:00 2006 +0500
-Sun Jan 15 13:30:00 2006 -0800
-Sat Jul 15 13:30:00 2006 +0500
-Sat Jul 15 13:30:00 2006 -0700
-Sun Jun 11 00:26:40 2006 -0400
-Sat Apr 15 13:30:00 2006 +0200
-Sat Apr 15 13:30:00 2006 +0000
-Wed Feb 01 13:00:30 2006 -0500
-Wed Feb 01 13:00:30 2006 +0000
-Sun Jan 15 13:30:00 2006 +0500
-Sun Jan 15 13:30:00 2006 -0800
-Sat Jul 15 13:30:00 2006 +0500
-Sat Jul 15 13:30:00 2006 -0700
-Sun Jun 11 00:26:40 2006 -0400
-Sat Apr 15 13:30:00 2006 +0200
-Sat Apr 15 13:30:00 2006 +0000
-Wed Feb 01 13:00:30 2006 -0500
-Wed Feb 01 13:00:30 2006 +0000
-Sun Jan 15 13:30:00 2006 +0500
-Sun Jan 15 13:30:00 2006 -0800
-Sat Jul 15 13:30:00 2006 +0500
-Sat Jul 15 13:30:00 2006 -0700
-Sun Jun 11 00:26:40 2006 -0400
-Sat Apr 15 13:30:00 2006 +0200
-Sat Apr 15 13:30:00 2006 +0000
-Wed Feb 01 13:00:30 2006 -0500
-Wed Feb 01 13:00:30 2006 +0000
-Sun Jan 15 13:30:00 2006 +0500
-Sun Jan 15 13:30:00 2006 -0800
-Sat Jul 15 13:30:00 2006 +0500
-Sat Jul 15 13:30:00 2006 -0700
-Sun Jun 11 00:26:40 2006 -0400
-Sat Apr 15 13:30:00 2006 +0200
-Sat Apr 15 13:30:00 2006 +0000
-Wed Feb 01 13:00:30 2006 -0500
-Wed Feb 01 13:00:30 2006 +0000
-Sun Jan 15 13:30:00 2006 +0500
-Sun Jan 15 13:30:00 2006 -0800
-Sat Jul 15 13:30:00 2006 +0500
-Sat Jul 15 13:30:00 2006 -0700
-Sun Jun 11 00:26:40 2006 -0400
-Sat Apr 15 13:30:00 2006 +0200
-Sat Apr 15 13:30:00 2006 +0000
-Wed Feb 01 13:00:30 2006 -0500
-Wed Feb 01 13:00:30 2006 +0000
-Sun Jan 15 13:30:00 2006 +0500
-Sun Jan 15 13:30:00 2006 -0800
-Sat Jul 15 13:30:00 2006 +0500
-Sat Jul 15 13:30:00 2006 -0700
-Sun Jun 11 00:26:40 2006 -0400
-Sat Apr 15 13:30:00 2006 +0200
-Sat Apr 15 13:30:00 2006 +0000
-Wed Feb 01 13:00:30 2006 -0500
-Wed Feb 01 13:00:30 2006 +0000
-Sun Jan 15 13:30:00 2006 +0500
-Sun Jan 15 13:30:00 2006 -0800
-Sat Jul 15 13:30:00 2006 +0500
-Sat Jul 15 13:30:00 2006 -0700
-Sun Jun 11 00:26:40 2006 -0400
-Sat Apr 15 13:30:00 2006 +0200
-Sat Apr 15 13:30:00 2006 +0000
-Wed Feb 01 13:00:30 2006 -0500
-Wed Feb 01 13:00:30 2006 +0000
-Sun Jan 15 13:30:00 2006 +0500
-Sun Jan 15 13:30:00 2006 -0800
-Sat Jul 15 13:30:00 2006 +0500
-Sat Jul 15 13:30:00 2006 -0700
-Sun Jun 11 00:26:40 2006 -0400
-Sat Apr 15 13:30:00 2006 +0200
-Sat Apr 15 13:30:00 2006 +0000
-Wed Feb 01 13:00:30 2006 -0500
-Wed Feb 01 13:00:30 2006 +0000
-Sun Jan 15 13:30:00 2006 +0500
-Sun Jan 15 13:30:00 2006 -0800
-Sat Jul 15 13:30:00 2006 +0500
-Sat Jul 15 13:30:00 2006 -0700
-Sun Jun 11 00:26:40 2006 -0400
-Sat Apr 15 13:30:00 2006 +0200
-Sat Apr 15 13:30:00 2006 +0000
-Wed Feb 01 13:00:30 2006 -0500
-Wed Feb 01 13:00:30 2006 +0000
-Sun Jan 15 13:30:00 2006 +0500
-Sun Jan 15 13:30:00 2006 -0800
-Sat Jul 15 13:30:00 2006 +0500
-Sat Jul 15 13:30:00 2006 -0700
-Sun Jun 11 00:26:40 2006 -0400
-Sat Apr 15 13:30:00 2006 +0200
-Sat Apr 15 13:30:00 2006 +0000
-Wed Feb 01 13:00:30 2006 -0500
-Wed Feb 01 13:00:30 2006 +0000
-Sun Jan 15 13:30:00 2006 +0500
-Sun Jan 15 13:30:00 2006 -0800
-Sat Jul 15 13:30:00 2006 +0500
-Sat Jul 15 13:30:00 2006 -0700
-Sun Jun 11 00:26:40 2006 -0400
-Sat Apr 15 13:30:00 2006 +0200
-Sat Apr 15 13:30:00 2006 +0000
-Wed Feb 01 13:00:30 2006 -0500
-Wed Feb 01 13:00:30 2006 +0000
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-parse-date.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,240 @@
+This runs with TZ="GMT"
+
+  $ hg init
+  $ echo "test-parse-date" > a
+  $ hg add a
+  $ hg ci -d "2006-02-01 13:00:30" -m "rev 0"
+  $ echo "hi!" >> a
+  $ hg ci -d "2006-02-01 13:00:30 -0500" -m "rev 1"
+  $ hg tag -d "2006-04-15 13:30" "Hi"
+  $ hg backout --merge -d "2006-04-15 13:30 +0200" -m "rev 3" 1
+  reverting a
+  created new head
+  changeset 3:107ce1ee2b43 backs out changeset 1:25a1420a55f8
+  merging with changeset 3:107ce1ee2b43
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg ci -d "1150000000 14400" -m "rev 4 (merge)"
+  $ echo "fail" >> a
+  $ hg ci -d "should fail" -m "fail"
+  abort: invalid date: 'should fail'
+  [255]
+  $ hg ci -d "100000000000000000 1400" -m "fail"
+  abort: date exceeds 32 bits: 100000000000000000
+  [255]
+  $ hg ci -d "100000 1400000" -m "fail"
+  abort: impossible time zone offset: 1400000
+  [255]
+
+Check with local timezone other than GMT and with DST
+
+  $ TZ="PST+8PDT"
+  $ export TZ
+
+PST=UTC-8 / PDT=UTC-7
+
+  $ hg debugrebuildstate
+  $ echo "a" > a
+  $ hg ci -d "2006-07-15 13:30" -m "summer@UTC-7"
+  $ hg debugrebuildstate
+  $ echo "b" > a
+  $ hg ci -d "2006-07-15 13:30 +0500" -m "summer@UTC+5"
+  $ hg debugrebuildstate
+  $ echo "c" > a
+  $ hg ci -d "2006-01-15 13:30" -m "winter@UTC-8"
+  $ hg debugrebuildstate
+  $ echo "d" > a
+  $ hg ci -d "2006-01-15 13:30 +0500" -m "winter@UTC+5"
+  $ hg log --template '{date|date}\n'
+  Sun Jan 15 13:30:00 2006 +0500
+  Sun Jan 15 13:30:00 2006 -0800
+  Sat Jul 15 13:30:00 2006 +0500
+  Sat Jul 15 13:30:00 2006 -0700
+  Sun Jun 11 00:26:40 2006 -0400
+  Sat Apr 15 13:30:00 2006 +0200
+  Sat Apr 15 13:30:00 2006 +0000
+  Wed Feb 01 13:00:30 2006 -0500
+  Wed Feb 01 13:00:30 2006 +0000
+
+Test issue1014 (fractional timezones)
+
+  $ hg debugdate "1000000000 -16200" # 0430
+  internal: 1000000000 -16200
+  standard: Sun Sep 09 06:16:40 2001 +0430
+  $ hg debugdate "1000000000 -15300" # 0415
+  internal: 1000000000 -15300
+  standard: Sun Sep 09 06:01:40 2001 +0415
+  $ hg debugdate "1000000000 -14400" # 0400
+  internal: 1000000000 -14400
+  standard: Sun Sep 09 05:46:40 2001 +0400
+  $ hg debugdate "1000000000 0"      # GMT
+  internal: 1000000000 0
+  standard: Sun Sep 09 01:46:40 2001 +0000
+  $ hg debugdate "1000000000 14400"  # -0400
+  internal: 1000000000 14400
+  standard: Sat Sep 08 21:46:40 2001 -0400
+  $ hg debugdate "1000000000 15300"  # -0415
+  internal: 1000000000 15300
+  standard: Sat Sep 08 21:31:40 2001 -0415
+  $ hg debugdate "1000000000 16200"  # -0430
+  internal: 1000000000 16200
+  standard: Sat Sep 08 21:16:40 2001 -0430
+  $ hg debugdate "Sat Sep 08 21:16:40 2001 +0430"
+  internal: 999967600 -16200
+  standard: Sat Sep 08 21:16:40 2001 +0430
+  $ hg debugdate "Sat Sep 08 21:16:40 2001 -0430"
+  internal: 1000000000 16200
+  standard: Sat Sep 08 21:16:40 2001 -0430
+
+Test 12-hours times
+
+  $ hg debugdate "2006-02-01 1:00:30PM +0000"
+  internal: 1138798830 0
+  standard: Wed Feb 01 13:00:30 2006 +0000
+  $ hg debugdate "1:00:30PM" > /dev/null
+
+Test date formats with '>' or '<' accompanied by space characters
+
+  $ hg log -d '>' --template '{date|date}\n'
+  Sun Jan 15 13:30:00 2006 +0500
+  Sun Jan 15 13:30:00 2006 -0800
+  Sat Jul 15 13:30:00 2006 +0500
+  Sat Jul 15 13:30:00 2006 -0700
+  Sun Jun 11 00:26:40 2006 -0400
+  Sat Apr 15 13:30:00 2006 +0200
+  Sat Apr 15 13:30:00 2006 +0000
+  Wed Feb 01 13:00:30 2006 -0500
+  Wed Feb 01 13:00:30 2006 +0000
+  $ hg log -d '<' hg log -d '>' --template '{date|date}\n'
+
+  $ hg log -d ' >' --template '{date|date}\n'
+  Sun Jan 15 13:30:00 2006 +0500
+  Sun Jan 15 13:30:00 2006 -0800
+  Sat Jul 15 13:30:00 2006 +0500
+  Sat Jul 15 13:30:00 2006 -0700
+  Sun Jun 11 00:26:40 2006 -0400
+  Sat Apr 15 13:30:00 2006 +0200
+  Sat Apr 15 13:30:00 2006 +0000
+  Wed Feb 01 13:00:30 2006 -0500
+  Wed Feb 01 13:00:30 2006 +0000
+  $ hg log -d ' <' --template '{date|date}\n'
+
+  $ hg log -d '> ' --template '{date|date}\n'
+  Sun Jan 15 13:30:00 2006 +0500
+  Sun Jan 15 13:30:00 2006 -0800
+  Sat Jul 15 13:30:00 2006 +0500
+  Sat Jul 15 13:30:00 2006 -0700
+  Sun Jun 11 00:26:40 2006 -0400
+  Sat Apr 15 13:30:00 2006 +0200
+  Sat Apr 15 13:30:00 2006 +0000
+  Wed Feb 01 13:00:30 2006 -0500
+  Wed Feb 01 13:00:30 2006 +0000
+  $ hg log -d '< ' --template '{date|date}\n'
+
+  $ hg log -d ' > ' --template '{date|date}\n'
+  Sun Jan 15 13:30:00 2006 +0500
+  Sun Jan 15 13:30:00 2006 -0800
+  Sat Jul 15 13:30:00 2006 +0500
+  Sat Jul 15 13:30:00 2006 -0700
+  Sun Jun 11 00:26:40 2006 -0400
+  Sat Apr 15 13:30:00 2006 +0200
+  Sat Apr 15 13:30:00 2006 +0000
+  Wed Feb 01 13:00:30 2006 -0500
+  Wed Feb 01 13:00:30 2006 +0000
+  $ hg log -d ' < ' --template '{date|date}\n'
+
+  $ hg log -d '>02/01' --template '{date|date}\n'
+  $ hg log -d '<02/01' --template '{date|date}\n'
+  Sun Jan 15 13:30:00 2006 +0500
+  Sun Jan 15 13:30:00 2006 -0800
+  Sat Jul 15 13:30:00 2006 +0500
+  Sat Jul 15 13:30:00 2006 -0700
+  Sun Jun 11 00:26:40 2006 -0400
+  Sat Apr 15 13:30:00 2006 +0200
+  Sat Apr 15 13:30:00 2006 +0000
+  Wed Feb 01 13:00:30 2006 -0500
+  Wed Feb 01 13:00:30 2006 +0000
+
+  $ hg log -d ' >02/01' --template '{date|date}\n'
+  $ hg log -d ' <02/01' --template '{date|date}\n'
+  Sun Jan 15 13:30:00 2006 +0500
+  Sun Jan 15 13:30:00 2006 -0800
+  Sat Jul 15 13:30:00 2006 +0500
+  Sat Jul 15 13:30:00 2006 -0700
+  Sun Jun 11 00:26:40 2006 -0400
+  Sat Apr 15 13:30:00 2006 +0200
+  Sat Apr 15 13:30:00 2006 +0000
+  Wed Feb 01 13:00:30 2006 -0500
+  Wed Feb 01 13:00:30 2006 +0000
+
+  $ hg log -d '> 02/01' --template '{date|date}\n'
+  $ hg log -d '< 02/01' --template '{date|date}\n'
+  Sun Jan 15 13:30:00 2006 +0500
+  Sun Jan 15 13:30:00 2006 -0800
+  Sat Jul 15 13:30:00 2006 +0500
+  Sat Jul 15 13:30:00 2006 -0700
+  Sun Jun 11 00:26:40 2006 -0400
+  Sat Apr 15 13:30:00 2006 +0200
+  Sat Apr 15 13:30:00 2006 +0000
+  Wed Feb 01 13:00:30 2006 -0500
+  Wed Feb 01 13:00:30 2006 +0000
+
+  $ hg log -d ' > 02/01' --template '{date|date}\n'
+  $ hg log -d ' < 02/01' --template '{date|date}\n'
+  Sun Jan 15 13:30:00 2006 +0500
+  Sun Jan 15 13:30:00 2006 -0800
+  Sat Jul 15 13:30:00 2006 +0500
+  Sat Jul 15 13:30:00 2006 -0700
+  Sun Jun 11 00:26:40 2006 -0400
+  Sat Apr 15 13:30:00 2006 +0200
+  Sat Apr 15 13:30:00 2006 +0000
+  Wed Feb 01 13:00:30 2006 -0500
+  Wed Feb 01 13:00:30 2006 +0000
+
+  $ hg log -d '>02/01 ' --template '{date|date}\n'
+  $ hg log -d '<02/01 ' --template '{date|date}\n'
+  Sun Jan 15 13:30:00 2006 +0500
+  Sun Jan 15 13:30:00 2006 -0800
+  Sat Jul 15 13:30:00 2006 +0500
+  Sat Jul 15 13:30:00 2006 -0700
+  Sun Jun 11 00:26:40 2006 -0400
+  Sat Apr 15 13:30:00 2006 +0200
+  Sat Apr 15 13:30:00 2006 +0000
+  Wed Feb 01 13:00:30 2006 -0500
+  Wed Feb 01 13:00:30 2006 +0000
+
+  $ hg log -d ' >02/01 ' --template '{date|date}\n'
+  $ hg log -d ' <02/01 ' --template '{date|date}\n'
+  Sun Jan 15 13:30:00 2006 +0500
+  Sun Jan 15 13:30:00 2006 -0800
+  Sat Jul 15 13:30:00 2006 +0500
+  Sat Jul 15 13:30:00 2006 -0700
+  Sun Jun 11 00:26:40 2006 -0400
+  Sat Apr 15 13:30:00 2006 +0200
+  Sat Apr 15 13:30:00 2006 +0000
+  Wed Feb 01 13:00:30 2006 -0500
+  Wed Feb 01 13:00:30 2006 +0000
+
+  $ hg log -d '> 02/01 ' --template '{date|date}\n'
+  $ hg log -d '< 02/01 ' --template '{date|date}\n'
+  Sun Jan 15 13:30:00 2006 +0500
+  Sun Jan 15 13:30:00 2006 -0800
+  Sat Jul 15 13:30:00 2006 +0500
+  Sat Jul 15 13:30:00 2006 -0700
+  Sun Jun 11 00:26:40 2006 -0400
+  Sat Apr 15 13:30:00 2006 +0200
+  Sat Apr 15 13:30:00 2006 +0000
+  Wed Feb 01 13:00:30 2006 -0500
+  Wed Feb 01 13:00:30 2006 +0000
+
+  $ hg log -d ' > 02/01 ' --template '{date|date}\n'
+  $ hg log -d ' < 02/01 ' --template '{date|date}\n'
+  Sun Jan 15 13:30:00 2006 +0500
+  Sun Jan 15 13:30:00 2006 -0800
+  Sat Jul 15 13:30:00 2006 +0500
+  Sat Jul 15 13:30:00 2006 -0700
+  Sun Jun 11 00:26:40 2006 -0400
+  Sat Apr 15 13:30:00 2006 +0200
+  Sat Apr 15 13:30:00 2006 +0000
+  Wed Feb 01 13:00:30 2006 -0500
+  Wed Feb 01 13:00:30 2006 +0000
--- a/tests/test-parseindex	Wed Sep 22 17:13:49 2010 -0500
+++ b/tests/test-parseindex	Wed Sep 22 18:29:41 2010 -0500
@@ -14,10 +14,10 @@
 cd a
 echo abc > foo
 hg add foo
-hg commit -m 'add foo' -d '1000000 0'
+hg commit -m 'add foo'
 
 echo >> foo
-hg commit -m 'change foo' -d '1000001 0'
+hg commit -m 'change foo'
 hg log -r 0:
 
 cat >> test.py << EOF
--- a/tests/test-parseindex.out	Wed Sep 22 17:13:49 2010 -0500
+++ b/tests/test-parseindex.out	Wed Sep 22 18:29:41 2010 -0500
@@ -1,14 +1,14 @@
-changeset:   0:9c2cf2b35aa7
+changeset:   0:7c31755bf9b5
 user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
+date:        Thu Jan 01 00:00:00 1970 +0000
 summary:     add foo
 
-changeset:   1:3756a9556b89
+changeset:   1:26333235a41c
 tag:         tip
 user:        test
-date:        Mon Jan 12 13:46:41 1970 +0000
+date:        Thu Jan 01 00:00:00 1970 +0000
 summary:     change foo
 
 2 revisions:
-9c2cf2b35aa7
-3756a9556b89
+7c31755bf9b5
+26333235a41c
--- a/tests/test-patch	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-#!/bin/sh
-
-cat > patchtool.py <<EOF
-import sys
-print 'Using custom patch'
-if '--binary' in sys.argv:
-    print '--binary found !'
-EOF
-
-echo "[ui]" >> $HGRCPATH
-echo "patch=python ../patchtool.py" >> $HGRCPATH
-
-hg init a
-cd a
-echo a > a
-hg commit -Ama -d '1 0'
-echo b >> a
-hg commit -Amb -d '2 0'
-cd ..
-
-# This test check that:
-# - custom patch commands with arguments actually works
-# - patch code does not try to add weird arguments like
-# --binary when custom patch commands are used. For instance
-# --binary is added by default under win32.
-
-echo % check custom patch options are honored
-hg --cwd a export -o ../a.diff tip
-hg clone -r 0 a b
-
-hg --cwd b import -v ../a.diff
-
-
-
-
-
--- a/tests/test-patch.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-adding a
-% check custom patch options are honored
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-applying ../a.diff
-Using custom patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-patch.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,41 @@
+  $ cat > patchtool.py <<EOF
+  > import sys
+  > print 'Using custom patch'
+  > if '--binary' in sys.argv:
+  >     print '--binary found !'
+  > EOF
+
+  $ echo "[ui]" >> $HGRCPATH
+  $ echo "patch=python ../patchtool.py" >> $HGRCPATH
+
+  $ hg init a
+  $ cd a
+  $ echo a > a
+  $ hg commit -Ama -d '1 0'
+  adding a
+  $ echo b >> a
+  $ hg commit -Amb -d '2 0'
+  $ cd ..
+
+This test checks that:
+ - custom patch commands with arguments actually work
+ - patch code does not try to add weird arguments like
+ --binary when custom patch commands are used. For instance
+ --binary is added by default under win32.
+
+check custom patch options are honored
+
+  $ hg --cwd a export -o ../a.diff tip
+  $ hg clone -r 0 a b
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ hg --cwd b import -v ../a.diff
+  applying ../a.diff
+  Using custom patch
+
--- a/tests/test-patchbomb	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,208 +0,0 @@
-#!/bin/sh
-
-fixheaders()
-{
-    sed -e 's/\(Message-Id:.*@\).*/\1/'  \
-        -e 's/\(In-Reply-To:.*@\).*/\1/' \
-        -e 's/\(References:.*@\).*/\1/'  \
-        -e 's/\(User-Agent:.*\)\/.*/\1/'  \
-        -e 's/===.*/===/'
-}
-
-echo "[extensions]" >> $HGRCPATH
-echo "patchbomb=" >> $HGRCPATH
-
-hg init t
-cd t
-echo a > a
-hg commit -Ama -d '1 0'
-
-hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -r tip | \
-  fixheaders
-
-echo b > b
-hg commit -Amb -d '2 0'
-
-hg email --date '1970-1-1 0:2' -n -f quux -t foo -c bar -s test -r 0:tip | \
-  fixheaders
-
-hg email -m test.mbox -f quux -t foo -c bar -s test 0:tip
-
-cd ..
-
-hg clone -q t t2
-cd t2
-echo c > c
-hg commit -Amc -d '3 0'
-
-cat > description <<EOF
-a multiline
-
-description
-EOF
-
-echo "% test bundle and description"
-hg email --date '1970-1-1 0:3' -n -f quux -t foo \
-    -c bar -s test -r tip -b --desc description | \
-    fixheaders
-
-echo "% utf-8 patch"
-python -c 'fp = open("utf", "wb"); fp.write("h\xC3\xB6mma!\n"); fp.close();'
-hg commit -A -d '4 0' -m 'charset=utf-8; content-transfer-encoding: base64'
-
-echo "% no mime encoding for email --test"
-hg email --date '1970-1-1 0:4' -f quux -t foo -c bar -r tip -n | \
-    fixheaders > mailtest
-echo "% md5sum of 8-bit output"
-$TESTDIR/md5sum.py mailtest
-rm mailtest
-
-echo "% mime encoded mbox (base64)"
-hg email --date '1970-1-1 0:4' -f quux -t foo -c bar -r tip -m mbox
-cat mbox | fixheaders
-rm mbox
-
-echo "% mime encoded mbox (quoted-printable)"
-python -c 'fp = open("qp", "wb"); fp.write("%s\nfoo\n\nbar\n" % \
-  ("x" * 1024)); fp.close();'
-hg commit -A -d '4 0' -m \
-    'charset=utf-8; content-transfer-encoding: quoted-printable'
-
-echo "% no mime encoding for email --test"
-hg email --date '1970-1-1 0:4' -f quux -t foo -c bar -r tip -n | \
-    fixheaders > mailtest
-echo "% md5sum of qp output"
-$TESTDIR/md5sum.py mailtest
-rm mailtest
-
-echo "% mime encoded mbox (quoted-printable)"
-hg email --date '1970-1-1 0:4' -f quux -t foo -c bar -r tip -m mbox
-cat mbox | fixheaders
-rm mbox
-
-echo "% iso-8859-1 patch"
-python -c 'fp = open("isolatin", "wb"); fp.write("h\xF6mma!\n"); fp.close();'
-hg commit -A -d '5 0' -m 'charset=us-ascii; content-transfer-encoding: 8bit'
-
-echo "% fake ascii mbox"
-hg email --date '1970-1-1 0:5' -f quux -t foo -c bar -r tip -m mbox
-fixheaders < mbox > mboxfix
-echo "% md5sum of 8-bit output"
-$TESTDIR/md5sum.py mboxfix
-
-echo "% test diffstat for single patch"
-hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -d -y -r 2 | \
-  fixheaders
-
-echo "% test diffstat for multiple patches"
-hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -d -y \
-  -r 0:1 | fixheaders
-
-echo "% test inline for single patch"
-hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i -r 2 | \
-  fixheaders
-
-echo "% test inline for single patch (quoted-printable)"
-hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i -r 4 | \
-  fixheaders
-
-echo "% test inline for multiple patches"
-hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i \
-  -r 0:1 -r 4 | fixheaders
-
-echo "% test attach for single patch"
-hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -a -r 2 | \
-  fixheaders
-
-echo "% test attach for single patch (quoted-printable)"
-hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -a -r 4 | \
-  fixheaders
-
-echo "% test attach for multiple patches"
-hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -a \
-  -r 0:1 -r 4 | fixheaders
-
-echo "% test intro for single patch"
-hg email --date '1970-1-1 0:1' -n --intro -f quux -t foo -c bar -s test \
-  -r 2 | fixheaders
-
-echo "% test --desc without --intro for a single patch"
-echo foo > intro.text
-hg email --date '1970-1-1 0:1' -n --desc intro.text -f quux -t foo -c bar \
-  -s test -r 2 | fixheaders
-
-echo "% test intro for multiple patches"
-hg email --date '1970-1-1 0:1' -n --intro -f quux -t foo -c bar -s test \
-  -r 0:1 | fixheaders
-
-echo "% test reply-to via config"
-hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -r 2 \
-  --config patchbomb.reply-to='baz@example.com' | fixheaders
-
-echo "% test reply-to via command line"
-hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -r 2 \
-  --reply-to baz --reply-to fred | fixheaders
-
-echo "% tagging csets"
-hg tag -r0 zero zero.foo
-hg tag -r1 one one.patch
-hg tag -r2 two two.diff
-
-echo "% test inline for single named patch"
-hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i -r 2 | \
-  fixheaders
-
-echo "% test inline for multiple named/unnamed patches"
-hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i -r 0:1 | \
-  fixheaders
-
-echo "% test inreplyto"
-hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar --in-reply-to baz \
-  -r tip | fixheaders
-
-hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar --in-reply-to baz \
-  -r 0:1 | fixheaders
-
-hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar --in-reply-to baz \
-  -s test -r 0:1 | fixheaders
-
-echo "% test single flag for single patch"
-hg email --date '1970-1-1 0:1' -n --flag fooFlag -f quux -t foo -c bar -s test \
-  -r 2 | fixheaders
-
-echo "% test single flag for multiple patches"
-hg email --date '1970-1-1 0:1' -n --flag fooFlag -f quux -t foo -c bar -s test \
-  -r 0:1 | fixheaders
-
-echo "% test mutiple flags for single patch"
-hg email --date '1970-1-1 0:1' -n --flag fooFlag --flag barFlag -f quux -t foo \
- -c bar -s test -r 2 | fixheaders
-
-echo "% test multiple flags for multiple patches"
-hg email --date '1970-1-1 0:1' -n --flag fooFlag --flag barFlag -f quux -t foo \
- -c bar -s test -r 0:1 | fixheaders
-
-echo "% test multi-address parsing"
-hg email --date '1980-1-1 0:1' -m tmp.mbox -f quux -t 'spam<spam><eggs>' \
- -t toast -c 'foo,bar@example.com' -c '"A, B <>" <a@example.com>' -s test -r 0 \
- --config email.bcc='"Quux, A." <quux>'
-cat tmp.mbox | fixheaders
-
-echo "% test multi-byte domain parsing"
-UUML=`python -c 'import sys; sys.stdout.write("\374")'`
-HGENCODING=iso-8859-1
-export HGENCODING
-hg email --date '1980-1-1 0:1' -m tmp.mbox -f quux -t "bar@${UUML}nicode.com" \
-  -s test -r 0
-cat tmp.mbox | fixheaders
-
-echo "% test outgoing"
-hg up 1
-hg branch test
-echo d > d
-hg add d
-hg ci -md -d '4 0'
-hg email --date '1980-1-1 0:1' -n -t foo -s test -o ../t | fixheaders
-
-echo "% dest#branch URIs"
-hg email --date '1980-1-1 0:1' -n -t foo -s test -o ../t#test | fixheaders
--- a/tests/test-patchbomb.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1947 +0,0 @@
-adding a
-This patch series consists of 1 patches.
-
-
-Displaying [PATCH] a ...
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [PATCH] a
-X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
-Message-Id: <8580ff50825a50c8f716.60@
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:01:00 +0000
-From: quux
-To: foo
-Cc: bar
-
-# HG changeset patch
-# User test
-# Date 1 0
-# Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
-# Parent  0000000000000000000000000000000000000000
-a
-
-diff -r 000000000000 -r 8580ff50825a a
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/a	Thu Jan 01 00:00:01 1970 +0000
-@@ -0,0 +1,1 @@
-+a
-
-adding b
-This patch series consists of 2 patches.
-
-
-Write the introductory message for the patch series.
-
-
-Displaying [PATCH 0 of 2] test ...
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [PATCH 0 of 2] test
-Message-Id: <patchbomb.120@
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:02:00 +0000
-From: quux
-To: foo
-Cc: bar
-
-
-Displaying [PATCH 1 of 2] a ...
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [PATCH 1 of 2] a
-X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
-Message-Id: <8580ff50825a50c8f716.121@
-In-Reply-To: <patchbomb.120@
-References: <patchbomb.120@
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:02:01 +0000
-From: quux
-To: foo
-Cc: bar
-
-# HG changeset patch
-# User test
-# Date 1 0
-# Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
-# Parent  0000000000000000000000000000000000000000
-a
-
-diff -r 000000000000 -r 8580ff50825a a
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/a	Thu Jan 01 00:00:01 1970 +0000
-@@ -0,0 +1,1 @@
-+a
-
-Displaying [PATCH 2 of 2] b ...
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [PATCH 2 of 2] b
-X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
-Message-Id: <97d72e5f12c7e84f8506.122@
-In-Reply-To: <patchbomb.120@
-References: <patchbomb.120@
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:02:02 +0000
-From: quux
-To: foo
-Cc: bar
-
-# HG changeset patch
-# User test
-# Date 2 0
-# Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
-# Parent  8580ff50825a50c8f716709acdf8de0deddcd6ab
-b
-
-diff -r 8580ff50825a -r 97d72e5f12c7 b
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/b	Thu Jan 01 00:00:02 1970 +0000
-@@ -0,0 +1,1 @@
-+b
-
-This patch series consists of 2 patches.
-
-
-Write the introductory message for the patch series.
-
-
-Writing [PATCH 0 of 2] test ...
-Writing [PATCH 1 of 2] a ...
-Writing [PATCH 2 of 2] b ...
-adding c
-% test bundle and description
-searching for changes
-1 changesets found
-
-Displaying test ...
-Content-Type: multipart/mixed; boundary="===
-MIME-Version: 1.0
-Subject: test
-Message-Id: <patchbomb.180@
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:03:00 +0000
-From: quux
-To: foo
-Cc: bar
-
---===
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-
-a multiline
-
-description
-
---===
-Content-Type: application/x-mercurial-bundle
-MIME-Version: 1.0
-Content-Disposition: attachment; filename="bundle.hg"
-Content-Transfer-Encoding: base64
-
-SEcxMEJaaDkxQVkmU1nvR7I3AAAN////lFYQWj1/4HwRkdC/AywIAk0E4pfoSIIIgQCgGEQOcLAA
-2tA1VPyp4mkeoG0EaaPU0GTT1GjRiNPIg9CZGBqZ6UbU9J+KFU09DNUaGgAAAAAANAGgAAAAA1U8
-oGgAADQGgAANNANAAAAAAZipFLz3XoakCEQB3PVPyHJVi1iYkAAKQAZQGpQGZESInRnCFMqLDla2
-Bx3qfRQeA2N4lnzKkAmP8kR2asievLLXXebVU8Vg4iEBqcJNJAxIapSU6SM4888ZAciRG6MYAIEE
-SlIBpFisgGkyRjX//TMtfcUAEsGu56+YnE1OlTZmzKm8BSu2rvo4rHAYYaadIFFuTy0LYgIkgLVD
-sgVa2F19D1tx9+hgbAygLgQwaIqcDdgA4BjQgIiz/AEP72++llgDKhKducqodGE4B0ETqF3JFOFC
-Q70eyNw=
---===
-% utf-8 patch
-adding description
-adding utf
-% no mime encoding for email --test
-% md5sum of 8-bit output
-e726c29b3008e77994c7572563e57c34  mailtest
-% mime encoded mbox (base64)
-This patch series consists of 1 patches.
-
-
-Writing [PATCH] charset=utf-8; content-transfer-encoding: base64 ...
-From quux Thu Jan 01 00:04:01 1970
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: base64
-Subject: [PATCH] charset=utf-8; content-transfer-encoding: base64
-X-Mercurial-Node: c3c9e37db9f4fe4882cda39baf42fed6bad8b15a
-Message-Id: <c3c9e37db9f4fe4882cd.240@
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:04:00 +0000
-From: quux
-To: foo
-Cc: bar
-
-IyBIRyBjaGFuZ2VzZXQgcGF0Y2gKIyBVc2VyIHRlc3QKIyBEYXRlIDQgMAojIE5vZGUgSUQgYzNj
-OWUzN2RiOWY0ZmU0ODgyY2RhMzliYWY0MmZlZDZiYWQ4YjE1YQojIFBhcmVudCAgZmYyYzlmYTIw
-MThiMTVmYTc0YjMzMzYzYmRhOTUyNzMyM2UyYTk5ZgpjaGFyc2V0PXV0Zi04OyBjb250ZW50LXRy
-YW5zZmVyLWVuY29kaW5nOiBiYXNlNjQKCmRpZmYgLXIgZmYyYzlmYTIwMThiIC1yIGMzYzllMzdk
-YjlmNCBkZXNjcmlwdGlvbgotLS0gL2Rldi9udWxsCVRodSBKYW4gMDEgMDA6MDA6MDAgMTk3MCAr
-MDAwMAorKysgYi9kZXNjcmlwdGlvbglUaHUgSmFuIDAxIDAwOjAwOjA0IDE5NzAgKzAwMDAKQEAg
-LTAsMCArMSwzIEBACithIG11bHRpbGluZQorCitkZXNjcmlwdGlvbgpkaWZmIC1yIGZmMmM5ZmEy
-MDE4YiAtciBjM2M5ZTM3ZGI5ZjQgdXRmCi0tLSAvZGV2L251bGwJVGh1IEphbiAwMSAwMDowMDow
-MCAxOTcwICswMDAwCisrKyBiL3V0ZglUaHUgSmFuIDAxIDAwOjAwOjA0IDE5NzAgKzAwMDAKQEAg
-LTAsMCArMSwxIEBACitow7ZtbWEhCg==
-
-
-% mime encoded mbox (quoted-printable)
-adding qp
-% no mime encoding for email --test
-% md5sum of qp output
-0402c7d033e04044e423bb04816f9dae  mailtest
-% mime encoded mbox (quoted-printable)
-This patch series consists of 1 patches.
-
-
-Writing [PATCH] charset=utf-8; content-transfer-encoding: quoted-printable ...
-From quux Thu Jan 01 00:04:01 1970
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: quoted-printable
-Subject: [PATCH] charset=utf-8; content-transfer-encoding: quoted-printable
-X-Mercurial-Node: c655633f8c87700bb38cc6a59a2753bdc5a6c376
-Message-Id: <c655633f8c87700bb38c.240@
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:04:00 +0000
-From: quux
-To: foo
-Cc: bar
-
-# HG changeset patch
-# User test
-# Date 4 0
-# Node ID c655633f8c87700bb38cc6a59a2753bdc5a6c376
-# Parent  c3c9e37db9f4fe4882cda39baf42fed6bad8b15a
-charset=3Dutf-8; content-transfer-encoding: quoted-printable
-
-diff -r c3c9e37db9f4 -r c655633f8c87 qp
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/qp	Thu Jan 01 00:00:04 1970 +0000
-@@ -0,0 +1,4 @@
-+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-+foo
-+
-+bar
-
-
-% iso-8859-1 patch
-adding isolatin
-% fake ascii mbox
-This patch series consists of 1 patches.
-
-
-Writing [PATCH] charset=us-ascii; content-transfer-encoding: 8bit ...
-% md5sum of 8-bit output
-9ea043d8fc43a71045114508baed144b  mboxfix
-% test diffstat for single patch
-This patch series consists of 1 patches.
-
-c
-
- c |  1 +
- 1 files changed, 1 insertions(+), 0 deletions(-)
-
-
-Displaying [PATCH] test ...
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [PATCH] test
-X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
-Message-Id: <ff2c9fa2018b15fa74b3.60@
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:01:00 +0000
-From: quux
-To: foo
-Cc: bar
-
- c |  1 +
- 1 files changed, 1 insertions(+), 0 deletions(-)
-
-
-# HG changeset patch
-# User test
-# Date 3 0
-# Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
-# Parent  97d72e5f12c7e84f85064aa72e5a297142c36ed9
-c
-
-diff -r 97d72e5f12c7 -r ff2c9fa2018b c
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/c	Thu Jan 01 00:00:03 1970 +0000
-@@ -0,0 +1,1 @@
-+c
-
-% test diffstat for multiple patches
-This patch series consists of 2 patches.
-
-a
-
- a |  1 +
- 1 files changed, 1 insertions(+), 0 deletions(-)
-
-b
-
- b |  1 +
- 1 files changed, 1 insertions(+), 0 deletions(-)
-
-Final summary:
-
- a |  1 +
- b |  1 +
- 2 files changed, 2 insertions(+), 0 deletions(-)
-
-
-Write the introductory message for the patch series.
-
-
-Displaying [PATCH 0 of 2] test ...
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [PATCH 0 of 2] test
-Message-Id: <patchbomb.60@
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:01:00 +0000
-From: quux
-To: foo
-Cc: bar
-
-
- a |  1 +
- b |  1 +
- 2 files changed, 2 insertions(+), 0 deletions(-)
-
-Displaying [PATCH 1 of 2] a ...
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [PATCH 1 of 2] a
-X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
-Message-Id: <8580ff50825a50c8f716.61@
-In-Reply-To: <patchbomb.60@
-References: <patchbomb.60@
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:01:01 +0000
-From: quux
-To: foo
-Cc: bar
-
- a |  1 +
- 1 files changed, 1 insertions(+), 0 deletions(-)
-
-
-# HG changeset patch
-# User test
-# Date 1 0
-# Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
-# Parent  0000000000000000000000000000000000000000
-a
-
-diff -r 000000000000 -r 8580ff50825a a
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/a	Thu Jan 01 00:00:01 1970 +0000
-@@ -0,0 +1,1 @@
-+a
-
-Displaying [PATCH 2 of 2] b ...
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [PATCH 2 of 2] b
-X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
-Message-Id: <97d72e5f12c7e84f8506.62@
-In-Reply-To: <patchbomb.60@
-References: <patchbomb.60@
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:01:02 +0000
-From: quux
-To: foo
-Cc: bar
-
- b |  1 +
- 1 files changed, 1 insertions(+), 0 deletions(-)
-
-
-# HG changeset patch
-# User test
-# Date 2 0
-# Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
-# Parent  8580ff50825a50c8f716709acdf8de0deddcd6ab
-b
-
-diff -r 8580ff50825a -r 97d72e5f12c7 b
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/b	Thu Jan 01 00:00:02 1970 +0000
-@@ -0,0 +1,1 @@
-+b
-
-% test inline for single patch
-This patch series consists of 1 patches.
-
-
-Displaying [PATCH] test ...
-Content-Type: multipart/mixed; boundary="===
-MIME-Version: 1.0
-Subject: [PATCH] test
-X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
-Message-Id: <ff2c9fa2018b15fa74b3.60@
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:01:00 +0000
-From: quux
-To: foo
-Cc: bar
-
---===
-Content-Type: text/x-patch; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Content-Disposition: inline; filename=t2.patch
-
-# HG changeset patch
-# User test
-# Date 3 0
-# Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
-# Parent  97d72e5f12c7e84f85064aa72e5a297142c36ed9
-c
-
-diff -r 97d72e5f12c7 -r ff2c9fa2018b c
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/c	Thu Jan 01 00:00:03 1970 +0000
-@@ -0,0 +1,1 @@
-+c
-
---===
-% test inline for single patch (quoted-printable)
-This patch series consists of 1 patches.
-
-
-Displaying [PATCH] test ...
-Content-Type: multipart/mixed; boundary="===
-MIME-Version: 1.0
-Subject: [PATCH] test
-X-Mercurial-Node: c655633f8c87700bb38cc6a59a2753bdc5a6c376
-Message-Id: <c655633f8c87700bb38c.60@
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:01:00 +0000
-From: quux
-To: foo
-Cc: bar
-
---===
-Content-Type: text/x-patch; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: quoted-printable
-Content-Disposition: inline; filename=t2.patch
-
-# HG changeset patch
-# User test
-# Date 4 0
-# Node ID c655633f8c87700bb38cc6a59a2753bdc5a6c376
-# Parent  c3c9e37db9f4fe4882cda39baf42fed6bad8b15a
-charset=3Dutf-8; content-transfer-encoding: quoted-printable
-
-diff -r c3c9e37db9f4 -r c655633f8c87 qp
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/qp	Thu Jan 01 00:00:04 1970 +0000
-@@ -0,0 +1,4 @@
-+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-+foo
-+
-+bar
-
---===
-% test inline for multiple patches
-This patch series consists of 3 patches.
-
-
-Write the introductory message for the patch series.
-
-
-Displaying [PATCH 0 of 3] test ...
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [PATCH 0 of 3] test
-Message-Id: <patchbomb.60@
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:01:00 +0000
-From: quux
-To: foo
-Cc: bar
-
-
-Displaying [PATCH 1 of 3] a ...
-Content-Type: multipart/mixed; boundary="===
-MIME-Version: 1.0
-Subject: [PATCH 1 of 3] a
-X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
-Message-Id: <8580ff50825a50c8f716.61@
-In-Reply-To: <patchbomb.60@
-References: <patchbomb.60@
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:01:01 +0000
-From: quux
-To: foo
-Cc: bar
-
---===
-Content-Type: text/x-patch; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Content-Disposition: inline; filename=t2-1.patch
-
-# HG changeset patch
-# User test
-# Date 1 0
-# Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
-# Parent  0000000000000000000000000000000000000000
-a
-
-diff -r 000000000000 -r 8580ff50825a a
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/a	Thu Jan 01 00:00:01 1970 +0000
-@@ -0,0 +1,1 @@
-+a
-
---===
-Displaying [PATCH 2 of 3] b ...
-Content-Type: multipart/mixed; boundary="===
-MIME-Version: 1.0
-Subject: [PATCH 2 of 3] b
-X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
-Message-Id: <97d72e5f12c7e84f8506.62@
-In-Reply-To: <patchbomb.60@
-References: <patchbomb.60@
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:01:02 +0000
-From: quux
-To: foo
-Cc: bar
-
---===
-Content-Type: text/x-patch; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Content-Disposition: inline; filename=t2-2.patch
-
-# HG changeset patch
-# User test
-# Date 2 0
-# Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
-# Parent  8580ff50825a50c8f716709acdf8de0deddcd6ab
-b
-
-diff -r 8580ff50825a -r 97d72e5f12c7 b
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/b	Thu Jan 01 00:00:02 1970 +0000
-@@ -0,0 +1,1 @@
-+b
-
---===
-Displaying [PATCH 3 of 3] charset=utf-8; content-transfer-encoding: quoted-printable ...
-Content-Type: multipart/mixed; boundary="===
-MIME-Version: 1.0
-Subject: [PATCH 3 of 3] charset=utf-8;
- content-transfer-encoding: quoted-printable
-X-Mercurial-Node: c655633f8c87700bb38cc6a59a2753bdc5a6c376
-Message-Id: <c655633f8c87700bb38c.63@
-In-Reply-To: <patchbomb.60@
-References: <patchbomb.60@
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:01:03 +0000
-From: quux
-To: foo
-Cc: bar
-
---===
-Content-Type: text/x-patch; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: quoted-printable
-Content-Disposition: inline; filename=t2-3.patch
-
-# HG changeset patch
-# User test
-# Date 4 0
-# Node ID c655633f8c87700bb38cc6a59a2753bdc5a6c376
-# Parent  c3c9e37db9f4fe4882cda39baf42fed6bad8b15a
-charset=3Dutf-8; content-transfer-encoding: quoted-printable
-
-diff -r c3c9e37db9f4 -r c655633f8c87 qp
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/qp	Thu Jan 01 00:00:04 1970 +0000
-@@ -0,0 +1,4 @@
-+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-+foo
-+
-+bar
-
---===
-% test attach for single patch
-This patch series consists of 1 patches.
-
-
-Displaying [PATCH] test ...
-Content-Type: multipart/mixed; boundary="===
-MIME-Version: 1.0
-Subject: [PATCH] test
-X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
-Message-Id: <ff2c9fa2018b15fa74b3.60@
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:01:00 +0000
-From: quux
-To: foo
-Cc: bar
-
---===
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-
-Patch subject is complete summary.
-
-
-
---===
-Content-Type: text/x-patch; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Content-Disposition: attachment; filename=t2.patch
-
-# HG changeset patch
-# User test
-# Date 3 0
-# Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
-# Parent  97d72e5f12c7e84f85064aa72e5a297142c36ed9
-c
-
-diff -r 97d72e5f12c7 -r ff2c9fa2018b c
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/c	Thu Jan 01 00:00:03 1970 +0000
-@@ -0,0 +1,1 @@
-+c
-
---===
-% test attach for single patch (quoted-printable)
-This patch series consists of 1 patches.
-
-
-Displaying [PATCH] test ...
-Content-Type: multipart/mixed; boundary="===
-MIME-Version: 1.0
-Subject: [PATCH] test
-X-Mercurial-Node: c655633f8c87700bb38cc6a59a2753bdc5a6c376
-Message-Id: <c655633f8c87700bb38c.60@
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:01:00 +0000
-From: quux
-To: foo
-Cc: bar
-
---===
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-
-Patch subject is complete summary.
-
-
-
---===
-Content-Type: text/x-patch; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: quoted-printable
-Content-Disposition: attachment; filename=t2.patch
-
-# HG changeset patch
-# User test
-# Date 4 0
-# Node ID c655633f8c87700bb38cc6a59a2753bdc5a6c376
-# Parent  c3c9e37db9f4fe4882cda39baf42fed6bad8b15a
-charset=3Dutf-8; content-transfer-encoding: quoted-printable
-
-diff -r c3c9e37db9f4 -r c655633f8c87 qp
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/qp	Thu Jan 01 00:00:04 1970 +0000
-@@ -0,0 +1,4 @@
-+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-+foo
-+
-+bar
-
---===
-% test attach for multiple patches
-This patch series consists of 3 patches.
-
-
-Write the introductory message for the patch series.
-
-
-Displaying [PATCH 0 of 3] test ...
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [PATCH 0 of 3] test
-Message-Id: <patchbomb.60@
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:01:00 +0000
-From: quux
-To: foo
-Cc: bar
-
-
-Displaying [PATCH 1 of 3] a ...
-Content-Type: multipart/mixed; boundary="===
-MIME-Version: 1.0
-Subject: [PATCH 1 of 3] a
-X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
-Message-Id: <8580ff50825a50c8f716.61@
-In-Reply-To: <patchbomb.60@
-References: <patchbomb.60@
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:01:01 +0000
-From: quux
-To: foo
-Cc: bar
-
---===
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-
-Patch subject is complete summary.
-
-
-
---===
-Content-Type: text/x-patch; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Content-Disposition: attachment; filename=t2-1.patch
-
-# HG changeset patch
-# User test
-# Date 1 0
-# Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
-# Parent  0000000000000000000000000000000000000000
-a
-
-diff -r 000000000000 -r 8580ff50825a a
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/a	Thu Jan 01 00:00:01 1970 +0000
-@@ -0,0 +1,1 @@
-+a
-
---===
-Displaying [PATCH 2 of 3] b ...
-Content-Type: multipart/mixed; boundary="===
-MIME-Version: 1.0
-Subject: [PATCH 2 of 3] b
-X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
-Message-Id: <97d72e5f12c7e84f8506.62@
-In-Reply-To: <patchbomb.60@
-References: <patchbomb.60@
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:01:02 +0000
-From: quux
-To: foo
-Cc: bar
-
---===
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-
-Patch subject is complete summary.
-
-
-
---===
-Content-Type: text/x-patch; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Content-Disposition: attachment; filename=t2-2.patch
-
-# HG changeset patch
-# User test
-# Date 2 0
-# Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
-# Parent  8580ff50825a50c8f716709acdf8de0deddcd6ab
-b
-
-diff -r 8580ff50825a -r 97d72e5f12c7 b
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/b	Thu Jan 01 00:00:02 1970 +0000
-@@ -0,0 +1,1 @@
-+b
-
---===
-Displaying [PATCH 3 of 3] charset=utf-8; content-transfer-encoding: quoted-printable ...
-Content-Type: multipart/mixed; boundary="===
-MIME-Version: 1.0
-Subject: [PATCH 3 of 3] charset=utf-8;
- content-transfer-encoding: quoted-printable
-X-Mercurial-Node: c655633f8c87700bb38cc6a59a2753bdc5a6c376
-Message-Id: <c655633f8c87700bb38c.63@
-In-Reply-To: <patchbomb.60@
-References: <patchbomb.60@
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:01:03 +0000
-From: quux
-To: foo
-Cc: bar
-
---===
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-
-Patch subject is complete summary.
-
-
-
---===
-Content-Type: text/x-patch; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: quoted-printable
-Content-Disposition: attachment; filename=t2-3.patch
-
-# HG changeset patch
-# User test
-# Date 4 0
-# Node ID c655633f8c87700bb38cc6a59a2753bdc5a6c376
-# Parent  c3c9e37db9f4fe4882cda39baf42fed6bad8b15a
-charset=3Dutf-8; content-transfer-encoding: quoted-printable
-
-diff -r c3c9e37db9f4 -r c655633f8c87 qp
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/qp	Thu Jan 01 00:00:04 1970 +0000
-@@ -0,0 +1,4 @@
-+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-+foo
-+
-+bar
-
---===
-% test intro for single patch
-This patch series consists of 1 patches.
-
-
-Write the introductory message for the patch series.
-
-
-Displaying [PATCH 0 of 1] test ...
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [PATCH 0 of 1] test
-Message-Id: <patchbomb.60@
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:01:00 +0000
-From: quux
-To: foo
-Cc: bar
-
-
-Displaying [PATCH 1 of 1] c ...
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [PATCH 1 of 1] c
-X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
-Message-Id: <ff2c9fa2018b15fa74b3.61@
-In-Reply-To: <patchbomb.60@
-References: <patchbomb.60@
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:01:01 +0000
-From: quux
-To: foo
-Cc: bar
-
-# HG changeset patch
-# User test
-# Date 3 0
-# Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
-# Parent  97d72e5f12c7e84f85064aa72e5a297142c36ed9
-c
-
-diff -r 97d72e5f12c7 -r ff2c9fa2018b c
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/c	Thu Jan 01 00:00:03 1970 +0000
-@@ -0,0 +1,1 @@
-+c
-
-% test --desc without --intro for a single patch
-This patch series consists of 1 patches.
-
-
-Displaying [PATCH 0 of 1] test ...
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [PATCH 0 of 1] test
-Message-Id: <patchbomb.60@
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:01:00 +0000
-From: quux
-To: foo
-Cc: bar
-
-foo
-
-Displaying [PATCH 1 of 1] c ...
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [PATCH 1 of 1] c
-X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
-Message-Id: <ff2c9fa2018b15fa74b3.61@
-In-Reply-To: <patchbomb.60@
-References: <patchbomb.60@
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:01:01 +0000
-From: quux
-To: foo
-Cc: bar
-
-# HG changeset patch
-# User test
-# Date 3 0
-# Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
-# Parent  97d72e5f12c7e84f85064aa72e5a297142c36ed9
-c
-
-diff -r 97d72e5f12c7 -r ff2c9fa2018b c
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/c	Thu Jan 01 00:00:03 1970 +0000
-@@ -0,0 +1,1 @@
-+c
-
-% test intro for multiple patches
-This patch series consists of 2 patches.
-
-
-Write the introductory message for the patch series.
-
-
-Displaying [PATCH 0 of 2] test ...
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [PATCH 0 of 2] test
-Message-Id: <patchbomb.60@
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:01:00 +0000
-From: quux
-To: foo
-Cc: bar
-
-
-Displaying [PATCH 1 of 2] a ...
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [PATCH 1 of 2] a
-X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
-Message-Id: <8580ff50825a50c8f716.61@
-In-Reply-To: <patchbomb.60@
-References: <patchbomb.60@
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:01:01 +0000
-From: quux
-To: foo
-Cc: bar
-
-# HG changeset patch
-# User test
-# Date 1 0
-# Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
-# Parent  0000000000000000000000000000000000000000
-a
-
-diff -r 000000000000 -r 8580ff50825a a
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/a	Thu Jan 01 00:00:01 1970 +0000
-@@ -0,0 +1,1 @@
-+a
-
-Displaying [PATCH 2 of 2] b ...
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [PATCH 2 of 2] b
-X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
-Message-Id: <97d72e5f12c7e84f8506.62@
-In-Reply-To: <patchbomb.60@
-References: <patchbomb.60@
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:01:02 +0000
-From: quux
-To: foo
-Cc: bar
-
-# HG changeset patch
-# User test
-# Date 2 0
-# Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
-# Parent  8580ff50825a50c8f716709acdf8de0deddcd6ab
-b
-
-diff -r 8580ff50825a -r 97d72e5f12c7 b
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/b	Thu Jan 01 00:00:02 1970 +0000
-@@ -0,0 +1,1 @@
-+b
-
-% test reply-to via config
-This patch series consists of 1 patches.
-
-
-Displaying [PATCH] test ...
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [PATCH] test
-X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
-Message-Id: <ff2c9fa2018b15fa74b3.60@
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:01:00 +0000
-From: quux
-To: foo
-Cc: bar
-Reply-To: baz@example.com
-
-# HG changeset patch
-# User test
-# Date 3 0
-# Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
-# Parent  97d72e5f12c7e84f85064aa72e5a297142c36ed9
-c
-
-diff -r 97d72e5f12c7 -r ff2c9fa2018b c
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/c	Thu Jan 01 00:00:03 1970 +0000
-@@ -0,0 +1,1 @@
-+c
-
-% test reply-to via command line
-This patch series consists of 1 patches.
-
-
-Displaying [PATCH] test ...
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [PATCH] test
-X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
-Message-Id: <ff2c9fa2018b15fa74b3.60@
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:01:00 +0000
-From: quux
-To: foo
-Cc: bar
-Reply-To: baz, fred
-
-# HG changeset patch
-# User test
-# Date 3 0
-# Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
-# Parent  97d72e5f12c7e84f85064aa72e5a297142c36ed9
-c
-
-diff -r 97d72e5f12c7 -r ff2c9fa2018b c
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/c	Thu Jan 01 00:00:03 1970 +0000
-@@ -0,0 +1,1 @@
-+c
-
-% tagging csets
-% test inline for single named patch
-This patch series consists of 1 patches.
-
-
-Displaying [PATCH] test ...
-Content-Type: multipart/mixed; boundary="===
-MIME-Version: 1.0
-Subject: [PATCH] test
-X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
-Message-Id: <ff2c9fa2018b15fa74b3.60@
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:01:00 +0000
-From: quux
-To: foo
-Cc: bar
-
---===
-Content-Type: text/x-patch; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Content-Disposition: inline; filename=two.diff
-
-# HG changeset patch
-# User test
-# Date 3 0
-# Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
-# Parent  97d72e5f12c7e84f85064aa72e5a297142c36ed9
-c
-
-diff -r 97d72e5f12c7 -r ff2c9fa2018b c
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/c	Thu Jan 01 00:00:03 1970 +0000
-@@ -0,0 +1,1 @@
-+c
-
---===
-% test inline for multiple named/unnamed patches
-This patch series consists of 2 patches.
-
-
-Write the introductory message for the patch series.
-
-
-Displaying [PATCH 0 of 2] test ...
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [PATCH 0 of 2] test
-Message-Id: <patchbomb.60@
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:01:00 +0000
-From: quux
-To: foo
-Cc: bar
-
-
-Displaying [PATCH 1 of 2] a ...
-Content-Type: multipart/mixed; boundary="===
-MIME-Version: 1.0
-Subject: [PATCH 1 of 2] a
-X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
-Message-Id: <8580ff50825a50c8f716.61@
-In-Reply-To: <patchbomb.60@
-References: <patchbomb.60@
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:01:01 +0000
-From: quux
-To: foo
-Cc: bar
-
---===
-Content-Type: text/x-patch; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Content-Disposition: inline; filename=t2-1.patch
-
-# HG changeset patch
-# User test
-# Date 1 0
-# Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
-# Parent  0000000000000000000000000000000000000000
-a
-
-diff -r 000000000000 -r 8580ff50825a a
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/a	Thu Jan 01 00:00:01 1970 +0000
-@@ -0,0 +1,1 @@
-+a
-
---===
-Displaying [PATCH 2 of 2] b ...
-Content-Type: multipart/mixed; boundary="===
-MIME-Version: 1.0
-Subject: [PATCH 2 of 2] b
-X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
-Message-Id: <97d72e5f12c7e84f8506.62@
-In-Reply-To: <patchbomb.60@
-References: <patchbomb.60@
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:01:02 +0000
-From: quux
-To: foo
-Cc: bar
-
---===
-Content-Type: text/x-patch; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Content-Disposition: inline; filename=one.patch
-
-# HG changeset patch
-# User test
-# Date 2 0
-# Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
-# Parent  8580ff50825a50c8f716709acdf8de0deddcd6ab
-b
-
-diff -r 8580ff50825a -r 97d72e5f12c7 b
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/b	Thu Jan 01 00:00:02 1970 +0000
-@@ -0,0 +1,1 @@
-+b
-
---===
-% test inreplyto
-This patch series consists of 1 patches.
-
-
-Displaying [PATCH] Added tag two, two.diff for changeset ff2c9fa2018b ...
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [PATCH] Added tag two, two.diff for changeset ff2c9fa2018b
-X-Mercurial-Node: e317db6a6f288748d1f6cb064f3810fcba66b1b6
-Message-Id: <e317db6a6f288748d1f6.60@
-In-Reply-To: <baz>
-References: <baz>
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:01:00 +0000
-From: quux
-To: foo
-Cc: bar
-
-# HG changeset patch
-# User test
-# Date 0 0
-# Node ID e317db6a6f288748d1f6cb064f3810fcba66b1b6
-# Parent  eae5fcf795eee29d0e45ffc9f519a91cd79fc9ff
-Added tag two, two.diff for changeset ff2c9fa2018b
-
-diff -r eae5fcf795ee -r e317db6a6f28 .hgtags
---- a/.hgtags	Thu Jan 01 00:00:00 1970 +0000
-+++ b/.hgtags	Thu Jan 01 00:00:00 1970 +0000
-@@ -2,3 +2,5 @@
- 8580ff50825a50c8f716709acdf8de0deddcd6ab zero.foo
- 97d72e5f12c7e84f85064aa72e5a297142c36ed9 one
- 97d72e5f12c7e84f85064aa72e5a297142c36ed9 one.patch
-+ff2c9fa2018b15fa74b33363bda9527323e2a99f two
-+ff2c9fa2018b15fa74b33363bda9527323e2a99f two.diff
-
-abort: Subject: [PATCH 0 of 2] Please enter a valid value
-This patch series consists of 2 patches.
-
-This patch series consists of 2 patches.
-
-
-Write the introductory message for the patch series.
-
-
-Displaying [PATCH 0 of 2] test ...
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [PATCH 0 of 2] test
-Message-Id: <patchbomb.60@
-In-Reply-To: <baz>
-References: <baz>
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:01:00 +0000
-From: quux
-To: foo
-Cc: bar
-
-
-Displaying [PATCH 1 of 2] a ...
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [PATCH 1 of 2] a
-X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
-Message-Id: <8580ff50825a50c8f716.61@
-In-Reply-To: <patchbomb.60@
-References: <patchbomb.60@
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:01:01 +0000
-From: quux
-To: foo
-Cc: bar
-
-# HG changeset patch
-# User test
-# Date 1 0
-# Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
-# Parent  0000000000000000000000000000000000000000
-a
-
-diff -r 000000000000 -r 8580ff50825a a
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/a	Thu Jan 01 00:00:01 1970 +0000
-@@ -0,0 +1,1 @@
-+a
-
-Displaying [PATCH 2 of 2] b ...
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [PATCH 2 of 2] b
-X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
-Message-Id: <97d72e5f12c7e84f8506.62@
-In-Reply-To: <patchbomb.60@
-References: <patchbomb.60@
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:01:02 +0000
-From: quux
-To: foo
-Cc: bar
-
-# HG changeset patch
-# User test
-# Date 2 0
-# Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
-# Parent  8580ff50825a50c8f716709acdf8de0deddcd6ab
-b
-
-diff -r 8580ff50825a -r 97d72e5f12c7 b
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/b	Thu Jan 01 00:00:02 1970 +0000
-@@ -0,0 +1,1 @@
-+b
-
-% test single flag for single patch
-This patch series consists of 1 patches.
-
-
-Displaying [PATCH fooFlag] test ...
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [PATCH fooFlag] test
-X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
-Message-Id: <ff2c9fa2018b15fa74b3.60@
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:01:00 +0000
-From: quux
-To: foo
-Cc: bar
-
-# HG changeset patch
-# User test
-# Date 3 0
-# Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
-# Parent  97d72e5f12c7e84f85064aa72e5a297142c36ed9
-c
-
-diff -r 97d72e5f12c7 -r ff2c9fa2018b c
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/c	Thu Jan 01 00:00:03 1970 +0000
-@@ -0,0 +1,1 @@
-+c
-
-% test single flag for multiple patches
-This patch series consists of 2 patches.
-
-
-Write the introductory message for the patch series.
-
-
-Displaying [PATCH 0 of 2 fooFlag] test ...
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [PATCH 0 of 2 fooFlag] test
-Message-Id: <patchbomb.60@
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:01:00 +0000
-From: quux
-To: foo
-Cc: bar
-
-
-Displaying [PATCH 1 of 2 fooFlag] a ...
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [PATCH 1 of 2 fooFlag] a
-X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
-Message-Id: <8580ff50825a50c8f716.61@
-In-Reply-To: <patchbomb.60@
-References: <patchbomb.60@
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:01:01 +0000
-From: quux
-To: foo
-Cc: bar
-
-# HG changeset patch
-# User test
-# Date 1 0
-# Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
-# Parent  0000000000000000000000000000000000000000
-a
-
-diff -r 000000000000 -r 8580ff50825a a
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/a	Thu Jan 01 00:00:01 1970 +0000
-@@ -0,0 +1,1 @@
-+a
-
-Displaying [PATCH 2 of 2 fooFlag] b ...
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [PATCH 2 of 2 fooFlag] b
-X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
-Message-Id: <97d72e5f12c7e84f8506.62@
-In-Reply-To: <patchbomb.60@
-References: <patchbomb.60@
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:01:02 +0000
-From: quux
-To: foo
-Cc: bar
-
-# HG changeset patch
-# User test
-# Date 2 0
-# Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
-# Parent  8580ff50825a50c8f716709acdf8de0deddcd6ab
-b
-
-diff -r 8580ff50825a -r 97d72e5f12c7 b
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/b	Thu Jan 01 00:00:02 1970 +0000
-@@ -0,0 +1,1 @@
-+b
-
-% test mutiple flags for single patch
-This patch series consists of 1 patches.
-
-
-Displaying [PATCH fooFlag barFlag] test ...
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [PATCH fooFlag barFlag] test
-X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
-Message-Id: <ff2c9fa2018b15fa74b3.60@
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:01:00 +0000
-From: quux
-To: foo
-Cc: bar
-
-# HG changeset patch
-# User test
-# Date 3 0
-# Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
-# Parent  97d72e5f12c7e84f85064aa72e5a297142c36ed9
-c
-
-diff -r 97d72e5f12c7 -r ff2c9fa2018b c
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/c	Thu Jan 01 00:00:03 1970 +0000
-@@ -0,0 +1,1 @@
-+c
-
-% test multiple flags for multiple patches
-This patch series consists of 2 patches.
-
-
-Write the introductory message for the patch series.
-
-
-Displaying [PATCH 0 of 2 fooFlag barFlag] test ...
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [PATCH 0 of 2 fooFlag barFlag] test
-Message-Id: <patchbomb.60@
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:01:00 +0000
-From: quux
-To: foo
-Cc: bar
-
-
-Displaying [PATCH 1 of 2 fooFlag barFlag] a ...
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [PATCH 1 of 2 fooFlag barFlag] a
-X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
-Message-Id: <8580ff50825a50c8f716.61@
-In-Reply-To: <patchbomb.60@
-References: <patchbomb.60@
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:01:01 +0000
-From: quux
-To: foo
-Cc: bar
-
-# HG changeset patch
-# User test
-# Date 1 0
-# Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
-# Parent  0000000000000000000000000000000000000000
-a
-
-diff -r 000000000000 -r 8580ff50825a a
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/a	Thu Jan 01 00:00:01 1970 +0000
-@@ -0,0 +1,1 @@
-+a
-
-Displaying [PATCH 2 of 2 fooFlag barFlag] b ...
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [PATCH 2 of 2 fooFlag barFlag] b
-X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
-Message-Id: <97d72e5f12c7e84f8506.62@
-In-Reply-To: <patchbomb.60@
-References: <patchbomb.60@
-User-Agent: Mercurial-patchbomb
-Date: Thu, 01 Jan 1970 00:01:02 +0000
-From: quux
-To: foo
-Cc: bar
-
-# HG changeset patch
-# User test
-# Date 2 0
-# Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
-# Parent  8580ff50825a50c8f716709acdf8de0deddcd6ab
-b
-
-diff -r 8580ff50825a -r 97d72e5f12c7 b
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/b	Thu Jan 01 00:00:02 1970 +0000
-@@ -0,0 +1,1 @@
-+b
-
-% test multi-address parsing
-This patch series consists of 1 patches.
-
-
-Writing [PATCH] test ...
-From quux Tue Jan 01 00:01:01 1980
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [PATCH] test
-X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
-Message-Id: <8580ff50825a50c8f716.315532860@
-User-Agent: Mercurial-patchbomb
-Date: Tue, 01 Jan 1980 00:01:00 +0000
-From: quux
-To: spam <spam>, eggs, toast
-Cc: foo, bar@example.com, "A, B <>" <a@example.com>
-Bcc: "Quux, A." <quux>
-
-# HG changeset patch
-# User test
-# Date 1 0
-# Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
-# Parent  0000000000000000000000000000000000000000
-a
-
-diff -r 000000000000 -r 8580ff50825a a
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/a	Thu Jan 01 00:00:01 1970 +0000
-@@ -0,0 +1,1 @@
-+a
-
-
-% test multi-byte domain parsing
-This patch series consists of 1 patches.
-
-
-Writing [PATCH] test ...
-From quux Tue Jan 01 00:01:01 1980
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [PATCH] test
-X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
-Message-Id: <8580ff50825a50c8f716.315532860@
-User-Agent: Mercurial-patchbomb
-Date: Tue, 01 Jan 1980 00:01:00 +0000
-From: quux
-To: bar@xn--nicode-2ya.com
-
-# HG changeset patch
-# User test
-# Date 1 0
-# Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
-# Parent  0000000000000000000000000000000000000000
-a
-
-diff -r 000000000000 -r 8580ff50825a a
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/a	Thu Jan 01 00:00:01 1970 +0000
-@@ -0,0 +1,1 @@
-+a
-
-
-% test outgoing
-0 files updated, 0 files merged, 6 files removed, 0 files unresolved
-marked working directory as branch test
-comparing with ../t
-searching for changes
-This patch series consists of 8 patches.
-
-
-Write the introductory message for the patch series.
-
-
-Displaying [PATCH 0 of 8] test ...
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [PATCH 0 of 8] test
-Message-Id: <patchbomb.315532860@
-User-Agent: Mercurial-patchbomb
-Date: Tue, 01 Jan 1980 00:01:00 +0000
-From: test
-To: foo
-
-
-Displaying [PATCH 1 of 8] c ...
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [PATCH 1 of 8] c
-X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
-Message-Id: <ff2c9fa2018b15fa74b3.315532861@
-In-Reply-To: <patchbomb.315532860@
-References: <patchbomb.315532860@
-User-Agent: Mercurial-patchbomb
-Date: Tue, 01 Jan 1980 00:01:01 +0000
-From: test
-To: foo
-
-# HG changeset patch
-# User test
-# Date 3 0
-# Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
-# Parent  97d72e5f12c7e84f85064aa72e5a297142c36ed9
-c
-
-diff -r 97d72e5f12c7 -r ff2c9fa2018b c
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/c	Thu Jan 01 00:00:03 1970 +0000
-@@ -0,0 +1,1 @@
-+c
-
-Displaying [PATCH 2 of 8] charset=utf-8; content-transfer-encoding: base64 ...
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 8bit
-Subject: [PATCH 2 of 8] charset=utf-8; content-transfer-encoding: base64
-X-Mercurial-Node: c3c9e37db9f4fe4882cda39baf42fed6bad8b15a
-Message-Id: <c3c9e37db9f4fe4882cd.315532862@
-In-Reply-To: <patchbomb.315532860@
-References: <patchbomb.315532860@
-User-Agent: Mercurial-patchbomb
-Date: Tue, 01 Jan 1980 00:01:02 +0000
-From: test
-To: foo
-
-# HG changeset patch
-# User test
-# Date 4 0
-# Node ID c3c9e37db9f4fe4882cda39baf42fed6bad8b15a
-# Parent  ff2c9fa2018b15fa74b33363bda9527323e2a99f
-charset=utf-8; content-transfer-encoding: base64
-
-diff -r ff2c9fa2018b -r c3c9e37db9f4 description
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/description	Thu Jan 01 00:00:04 1970 +0000
-@@ -0,0 +1,3 @@
-+a multiline
-+
-+description
-diff -r ff2c9fa2018b -r c3c9e37db9f4 utf
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/utf	Thu Jan 01 00:00:04 1970 +0000
-@@ -0,0 +1,1 @@
-+hömma!
-
-Displaying [PATCH 3 of 8] charset=utf-8; content-transfer-encoding: quoted-printable ...
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: quoted-printable
-Subject: [PATCH 3 of 8] charset=utf-8;
- content-transfer-encoding: quoted-printable
-X-Mercurial-Node: c655633f8c87700bb38cc6a59a2753bdc5a6c376
-Message-Id: <c655633f8c87700bb38c.315532863@
-In-Reply-To: <patchbomb.315532860@
-References: <patchbomb.315532860@
-User-Agent: Mercurial-patchbomb
-Date: Tue, 01 Jan 1980 00:01:03 +0000
-From: test
-To: foo
-
-# HG changeset patch
-# User test
-# Date 4 0
-# Node ID c655633f8c87700bb38cc6a59a2753bdc5a6c376
-# Parent  c3c9e37db9f4fe4882cda39baf42fed6bad8b15a
-charset=3Dutf-8; content-transfer-encoding: quoted-printable
-
-diff -r c3c9e37db9f4 -r c655633f8c87 qp
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/qp	Thu Jan 01 00:00:04 1970 +0000
-@@ -0,0 +1,4 @@
-+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-+foo
-+
-+bar
-
-Displaying [PATCH 4 of 8] charset=us-ascii; content-transfer-encoding: 8bit ...
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 8bit
-Subject: [PATCH 4 of 8] charset=us-ascii; content-transfer-encoding: 8bit
-X-Mercurial-Node: 22d0f96be12f5945fd67d101af58f7bc8263c835
-Message-Id: <22d0f96be12f5945fd67.315532864@
-In-Reply-To: <patchbomb.315532860@
-References: <patchbomb.315532860@
-User-Agent: Mercurial-patchbomb
-Date: Tue, 01 Jan 1980 00:01:04 +0000
-From: test
-To: foo
-
-# HG changeset patch
-# User test
-# Date 5 0
-# Node ID 22d0f96be12f5945fd67d101af58f7bc8263c835
-# Parent  c655633f8c87700bb38cc6a59a2753bdc5a6c376
-charset=us-ascii; content-transfer-encoding: 8bit
-
-diff -r c655633f8c87 -r 22d0f96be12f isolatin
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/isolatin	Thu Jan 01 00:00:05 1970 +0000
-@@ -0,0 +1,1 @@
-+hömma!
-
-Displaying [PATCH 5 of 8] Added tag zero, zero.foo for changeset 8580ff50825a ...
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [PATCH 5 of 8] Added tag zero, zero.foo for changeset 8580ff50825a
-X-Mercurial-Node: dd9c2b4b8a8a0934d5523c15f2c119b362360903
-Message-Id: <dd9c2b4b8a8a0934d552.315532865@
-In-Reply-To: <patchbomb.315532860@
-References: <patchbomb.315532860@
-User-Agent: Mercurial-patchbomb
-Date: Tue, 01 Jan 1980 00:01:05 +0000
-From: test
-To: foo
-
-# HG changeset patch
-# User test
-# Date 0 0
-# Node ID dd9c2b4b8a8a0934d5523c15f2c119b362360903
-# Parent  22d0f96be12f5945fd67d101af58f7bc8263c835
-Added tag zero, zero.foo for changeset 8580ff50825a
-
-diff -r 22d0f96be12f -r dd9c2b4b8a8a .hgtags
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/.hgtags	Thu Jan 01 00:00:00 1970 +0000
-@@ -0,0 +1,2 @@
-+8580ff50825a50c8f716709acdf8de0deddcd6ab zero
-+8580ff50825a50c8f716709acdf8de0deddcd6ab zero.foo
-
-Displaying [PATCH 6 of 8] Added tag one, one.patch for changeset 97d72e5f12c7 ...
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [PATCH 6 of 8] Added tag one, one.patch for changeset 97d72e5f12c7
-X-Mercurial-Node: eae5fcf795eee29d0e45ffc9f519a91cd79fc9ff
-Message-Id: <eae5fcf795eee29d0e45.315532866@
-In-Reply-To: <patchbomb.315532860@
-References: <patchbomb.315532860@
-User-Agent: Mercurial-patchbomb
-Date: Tue, 01 Jan 1980 00:01:06 +0000
-From: test
-To: foo
-
-# HG changeset patch
-# User test
-# Date 0 0
-# Node ID eae5fcf795eee29d0e45ffc9f519a91cd79fc9ff
-# Parent  dd9c2b4b8a8a0934d5523c15f2c119b362360903
-Added tag one, one.patch for changeset 97d72e5f12c7
-
-diff -r dd9c2b4b8a8a -r eae5fcf795ee .hgtags
---- a/.hgtags	Thu Jan 01 00:00:00 1970 +0000
-+++ b/.hgtags	Thu Jan 01 00:00:00 1970 +0000
-@@ -1,2 +1,4 @@
- 8580ff50825a50c8f716709acdf8de0deddcd6ab zero
- 8580ff50825a50c8f716709acdf8de0deddcd6ab zero.foo
-+97d72e5f12c7e84f85064aa72e5a297142c36ed9 one
-+97d72e5f12c7e84f85064aa72e5a297142c36ed9 one.patch
-
-Displaying [PATCH 7 of 8] Added tag two, two.diff for changeset ff2c9fa2018b ...
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [PATCH 7 of 8] Added tag two, two.diff for changeset ff2c9fa2018b
-X-Mercurial-Node: e317db6a6f288748d1f6cb064f3810fcba66b1b6
-Message-Id: <e317db6a6f288748d1f6.315532867@
-In-Reply-To: <patchbomb.315532860@
-References: <patchbomb.315532860@
-User-Agent: Mercurial-patchbomb
-Date: Tue, 01 Jan 1980 00:01:07 +0000
-From: test
-To: foo
-
-# HG changeset patch
-# User test
-# Date 0 0
-# Node ID e317db6a6f288748d1f6cb064f3810fcba66b1b6
-# Parent  eae5fcf795eee29d0e45ffc9f519a91cd79fc9ff
-Added tag two, two.diff for changeset ff2c9fa2018b
-
-diff -r eae5fcf795ee -r e317db6a6f28 .hgtags
---- a/.hgtags	Thu Jan 01 00:00:00 1970 +0000
-+++ b/.hgtags	Thu Jan 01 00:00:00 1970 +0000
-@@ -2,3 +2,5 @@
- 8580ff50825a50c8f716709acdf8de0deddcd6ab zero.foo
- 97d72e5f12c7e84f85064aa72e5a297142c36ed9 one
- 97d72e5f12c7e84f85064aa72e5a297142c36ed9 one.patch
-+ff2c9fa2018b15fa74b33363bda9527323e2a99f two
-+ff2c9fa2018b15fa74b33363bda9527323e2a99f two.diff
-
-Displaying [PATCH 8 of 8] d ...
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [PATCH 8 of 8] d
-X-Mercurial-Node: 2f9fa9b998c5fe3ac2bd9a2b14bfcbeecbc7c268
-Message-Id: <2f9fa9b998c5fe3ac2bd.315532868@
-In-Reply-To: <patchbomb.315532860@
-References: <patchbomb.315532860@
-User-Agent: Mercurial-patchbomb
-Date: Tue, 01 Jan 1980 00:01:08 +0000
-From: test
-To: foo
-
-# HG changeset patch
-# User test
-# Date 4 0
-# Branch test
-# Node ID 2f9fa9b998c5fe3ac2bd9a2b14bfcbeecbc7c268
-# Parent  97d72e5f12c7e84f85064aa72e5a297142c36ed9
-d
-
-diff -r 97d72e5f12c7 -r 2f9fa9b998c5 d
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/d	Thu Jan 01 00:00:04 1970 +0000
-@@ -0,0 +1,1 @@
-+d
-
-% dest#branch URIs
-comparing with ../t
-searching for changes
-This patch series consists of 1 patches.
-
-
-Displaying [PATCH] test ...
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [PATCH] test
-X-Mercurial-Node: 2f9fa9b998c5fe3ac2bd9a2b14bfcbeecbc7c268
-Message-Id: <2f9fa9b998c5fe3ac2bd.315532860@
-User-Agent: Mercurial-patchbomb
-Date: Tue, 01 Jan 1980 00:01:00 +0000
-From: test
-To: foo
-
-# HG changeset patch
-# User test
-# Date 4 0
-# Branch test
-# Node ID 2f9fa9b998c5fe3ac2bd9a2b14bfcbeecbc7c268
-# Parent  97d72e5f12c7e84f85064aa72e5a297142c36ed9
-d
-
-diff -r 97d72e5f12c7 -r 2f9fa9b998c5 d
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/d	Thu Jan 01 00:00:04 1970 +0000
-@@ -0,0 +1,1 @@
-+d
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-patchbomb.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,2151 @@
+  $ fixheaders()
+  > {
+  >     sed -e 's/\(Message-Id:.*@\).*/\1/'  \
+  >         -e 's/\(In-Reply-To:.*@\).*/\1/' \
+  >         -e 's/\(References:.*@\).*/\1/'  \
+  >         -e 's/\(User-Agent:.*\)\/.*/\1/'  \
+  >         -e 's/===.*/===/'
+  > }
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "patchbomb=" >> $HGRCPATH
+
+  $ hg init t
+  $ cd t
+  $ echo a > a
+  $ hg commit -Ama -d '1 0'
+  adding a
+
+  $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -r tip
+  This patch series consists of 1 patches.
+  
+  
+  Displaying [PATCH] a ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Subject: [PATCH] a
+  X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
+  Message-Id: <8580ff50825a50c8f716.60@* (glob)
+  User-Agent: Mercurial-patchbomb/* (glob)
+  Date: Thu, 01 Jan 1970 00:01:00 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+  # HG changeset patch
+  # User test
+  # Date 1 0
+  # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
+  # Parent  0000000000000000000000000000000000000000
+  a
+  
+  diff -r 000000000000 -r 8580ff50825a a
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/a	Thu Jan 01 00:00:01 1970 +0000
+  @@ -0,0 +1,1 @@
+  +a
+  
+
+  $ hg --config ui.interactive=1 email --confirm -n -f quux -t foo -c bar -r tip<<EOF
+  > n
+  > EOF
+  This patch series consists of 1 patches.
+  
+  
+  Final summary:
+  
+  From: quux
+  To: foo
+  Cc: bar
+  Subject: [PATCH] a
+   a |  1 +
+   1 files changed, 1 insertions(+), 0 deletions(-)
+  
+  are you sure you want to send (yn)? abort: patchbomb canceled
+  [255]
+
+  $ echo b > b
+  $ hg commit -Amb -d '2 0'
+  adding b
+
+  $ hg email --date '1970-1-1 0:2' -n -f quux -t foo -c bar -s test -r 0:tip
+  This patch series consists of 2 patches.
+  
+  
+  Write the introductory message for the patch series.
+  
+  
+  Displaying [PATCH 0 of 2] test ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Subject: [PATCH 0 of 2] test
+  Message-Id: <patchbomb\.120@[^>]*> (re)
+  User-Agent: Mercurial-patchbomb/* (glob)
+  Date: Thu, 01 Jan 1970 00:02:00 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+  
+  Displaying [PATCH 1 of 2] a ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Subject: [PATCH 1 of 2] a
+  X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
+  Message-Id: <8580ff50825a50c8f716\.121@[^>]*> (re)
+  In-Reply-To: <patchbomb\.120@[^>]*> (re)
+  References: <patchbomb\.120@[^>]*> (re)
+  User-Agent: Mercurial-patchbomb/* (glob)
+  Date: Thu, 01 Jan 1970 00:02:01 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+  # HG changeset patch
+  # User test
+  # Date 1 0
+  # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
+  # Parent  0000000000000000000000000000000000000000
+  a
+  
+  diff -r 000000000000 -r 8580ff50825a a
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/a	Thu Jan 01 00:00:01 1970 +0000
+  @@ -0,0 +1,1 @@
+  +a
+  
+  Displaying [PATCH 2 of 2] b ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Subject: [PATCH 2 of 2] b
+  X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
+  Message-Id: <97d72e5f12c7e84f8506\.122@[^>]*> (re)
+  In-Reply-To: <patchbomb\.120@[^>]*> (re)
+  References: <patchbomb\.120@[^>]*> (re)
+  User-Agent: Mercurial-patchbomb/* (glob)
+  Date: Thu, 01 Jan 1970 00:02:02 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+  # HG changeset patch
+  # User test
+  # Date 2 0
+  # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
+  # Parent  8580ff50825a50c8f716709acdf8de0deddcd6ab
+  b
+  
+  diff -r 8580ff50825a -r 97d72e5f12c7 b
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/b	Thu Jan 01 00:00:02 1970 +0000
+  @@ -0,0 +1,1 @@
+  +b
+  
+
+  $ hg email -m test.mbox -f quux -t foo -c bar -s test 0:tip
+  This patch series consists of 2 patches.
+  
+  
+  Write the introductory message for the patch series.
+  
+  
+  Writing [PATCH 0 of 2] test ...
+  Writing [PATCH 1 of 2] a ...
+  Writing [PATCH 2 of 2] b ...
+
+  $ cd ..
+
+  $ hg clone -q t t2
+  $ cd t2
+  $ echo c > c
+  $ hg commit -Amc -d '3 0'
+  adding c
+
+  $ cat > description <<EOF
+  > a multiline
+  > 
+  > description
+  > EOF
+
+
+test bundle and description:
+  $ hg email --date '1970-1-1 0:3' -n -f quux -t foo \
+  >  -c bar -s test -r tip -b --desc description | fixheaders
+  searching for changes
+  1 changesets found
+  
+  Displaying test ...
+  Content-Type: multipart/mixed; boundary="===
+  MIME-Version: 1.0
+  Subject: test
+  Message-Id: <patchbomb.180@
+  User-Agent: Mercurial-patchbomb
+  Date: Thu, 01 Jan 1970 00:03:00 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+  --===
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  
+  a multiline
+  
+  description
+  
+  --===
+  Content-Type: application/x-mercurial-bundle
+  MIME-Version: 1.0
+  Content-Disposition: attachment; filename="bundle.hg"
+  Content-Transfer-Encoding: base64
+  
+  SEcxMEJaaDkxQVkmU1nvR7I3AAAN////lFYQWj1/4HwRkdC/AywIAk0E4pfoSIIIgQCgGEQOcLAA
+  2tA1VPyp4mkeoG0EaaPU0GTT1GjRiNPIg9CZGBqZ6UbU9J+KFU09DNUaGgAAAAAANAGgAAAAA1U8
+  oGgAADQGgAANNANAAAAAAZipFLz3XoakCEQB3PVPyHJVi1iYkAAKQAZQGpQGZESInRnCFMqLDla2
+  Bx3qfRQeA2N4lnzKkAmP8kR2asievLLXXebVU8Vg4iEBqcJNJAxIapSU6SM4888ZAciRG6MYAIEE
+  SlIBpFisgGkyRjX//TMtfcUAEsGu56+YnE1OlTZmzKm8BSu2rvo4rHAYYaadIFFuTy0LYgIkgLVD
+  sgVa2F19D1tx9+hgbAygLgQwaIqcDdgA4BjQgIiz/AEP72++llgDKhKducqodGE4B0ETqF3JFOFC
+  Q70eyNw=
+  --===
+
+utf-8 patch:
+  $ python -c 'fp = open("utf", "wb"); fp.write("h\xC3\xB6mma!\n"); fp.close();'
+  $ hg commit -A -d '4 0' -m 'charset=utf-8; content-transfer-encoding: base64'
+  adding description
+  adding utf
+
+no mime encoding for email --test:
+  $ hg email --date '1970-1-1 0:4' -f quux -t foo -c bar -r tip -n | fixheaders > mailtest
+
+md5sum of 8-bit output:
+  $ $TESTDIR/md5sum.py mailtest
+  e726c29b3008e77994c7572563e57c34  mailtest
+
+  $ rm mailtest
+
+mime encoded mbox (base64):
+  $ hg email --date '1970-1-1 0:4' -f quux -t foo -c bar -r tip -m mbox
+  This patch series consists of 1 patches.
+  
+  
+  Writing [PATCH] charset=utf-8; content-transfer-encoding: base64 ...
+
+  $ cat mbox
+  From quux Thu Jan 01 00:04:01 1970
+  Content-Type: text/plain; charset="utf-8"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: base64
+  Subject: [PATCH] charset=utf-8; content-transfer-encoding: base64
+  X-Mercurial-Node: c3c9e37db9f4fe4882cda39baf42fed6bad8b15a
+  Message-Id: <c3c9e37db9f4fe4882cd.240@* (glob)
+  User-Agent: Mercurial-patchbomb/* (glob)
+  Date: Thu, 01 Jan 1970 00:04:00 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+  IyBIRyBjaGFuZ2VzZXQgcGF0Y2gKIyBVc2VyIHRlc3QKIyBEYXRlIDQgMAojIE5vZGUgSUQgYzNj
+  OWUzN2RiOWY0ZmU0ODgyY2RhMzliYWY0MmZlZDZiYWQ4YjE1YQojIFBhcmVudCAgZmYyYzlmYTIw
+  MThiMTVmYTc0YjMzMzYzYmRhOTUyNzMyM2UyYTk5ZgpjaGFyc2V0PXV0Zi04OyBjb250ZW50LXRy
+  YW5zZmVyLWVuY29kaW5nOiBiYXNlNjQKCmRpZmYgLXIgZmYyYzlmYTIwMThiIC1yIGMzYzllMzdk
+  YjlmNCBkZXNjcmlwdGlvbgotLS0gL2Rldi9udWxsCVRodSBKYW4gMDEgMDA6MDA6MDAgMTk3MCAr
+  MDAwMAorKysgYi9kZXNjcmlwdGlvbglUaHUgSmFuIDAxIDAwOjAwOjA0IDE5NzAgKzAwMDAKQEAg
+  LTAsMCArMSwzIEBACithIG11bHRpbGluZQorCitkZXNjcmlwdGlvbgpkaWZmIC1yIGZmMmM5ZmEy
+  MDE4YiAtciBjM2M5ZTM3ZGI5ZjQgdXRmCi0tLSAvZGV2L251bGwJVGh1IEphbiAwMSAwMDowMDow
+  MCAxOTcwICswMDAwCisrKyBiL3V0ZglUaHUgSmFuIDAxIDAwOjAwOjA0IDE5NzAgKzAwMDAKQEAg
+  LTAsMCArMSwxIEBACitow7ZtbWEhCg==
+  
+  
+  $ rm mbox
+
+mime encoded mbox (quoted-printable):
+  $ python -c 'fp = open("qp", "wb"); fp.write("%s\nfoo\n\nbar\n" % ("x" * 1024)); fp.close();'
+  $ hg commit -A -d '4 0' -m 'charset=utf-8; content-transfer-encoding: quoted-printable'
+  adding qp
+
+no mime encoding for email --test:
+  $ hg email --date '1970-1-1 0:4' -f quux -t foo -c bar -r tip -n | \
+  >  fixheaders > mailtest
+md5sum of qp output:
+  $ $TESTDIR/md5sum.py mailtest
+  0402c7d033e04044e423bb04816f9dae  mailtest
+  $ rm mailtest
+
+mime encoded mbox (quoted-printable):
+  $ hg email --date '1970-1-1 0:4' -f quux -t foo -c bar -r tip -m mbox
+  This patch series consists of 1 patches.
+  
+  
+  Writing [PATCH] charset=utf-8; content-transfer-encoding: quoted-printable ...
+  $ cat mbox | fixheaders
+  From quux Thu Jan 01 00:04:01 1970
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: quoted-printable
+  Subject: [PATCH] charset=utf-8; content-transfer-encoding: quoted-printable
+  X-Mercurial-Node: c655633f8c87700bb38cc6a59a2753bdc5a6c376
+  Message-Id: <c655633f8c87700bb38c.240@
+  User-Agent: Mercurial-patchbomb
+  Date: Thu, 01 Jan 1970 00:04:00 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+  # HG changeset patch
+  # User test
+  # Date 4 0
+  # Node ID c655633f8c87700bb38cc6a59a2753bdc5a6c376
+  # Parent  c3c9e37db9f4fe4882cda39baf42fed6bad8b15a
+  charset=3Dutf-8; content-transfer-encoding: quoted-printable
+  
+  diff -r c3c9e37db9f4 -r c655633f8c87 qp
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/qp	Thu Jan 01 00:00:04 1970 +0000
+  @@ -0,0 +1,4 @@
+  +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+  +foo
+  +
+  +bar
+  
+  
+
+  $ rm mbox
+
+iso-8859-1 patch:
+  $ python -c 'fp = open("isolatin", "wb"); fp.write("h\xF6mma!\n"); fp.close();'
+  $ hg commit -A -d '5 0' -m 'charset=us-ascii; content-transfer-encoding: 8bit'
+  adding isolatin
+
+fake ascii mbox:
+  $ hg email --date '1970-1-1 0:5' -f quux -t foo -c bar -r tip -m mbox
+  This patch series consists of 1 patches.
+  
+  
+  Writing [PATCH] charset=us-ascii; content-transfer-encoding: 8bit ...
+  $ fixheaders < mbox > mboxfix
+
+md5sum of 8-bit output:
+  $ $TESTDIR/md5sum.py mboxfix
+  9ea043d8fc43a71045114508baed144b  mboxfix
+
+test diffstat for single patch:
+  $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -d -y -r 2 | \
+  >  fixheaders
+  This patch series consists of 1 patches.
+  
+  
+  Final summary:
+  
+  From: quux
+  To: foo
+  Cc: bar
+  Subject: [PATCH] test
+   c |  1 +
+   1 files changed, 1 insertions(+), 0 deletions(-)
+  
+  are you sure you want to send (yn)? y
+  
+  Displaying [PATCH] test ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Subject: [PATCH] test
+  X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
+  Message-Id: <ff2c9fa2018b15fa74b3.60@
+  User-Agent: Mercurial-patchbomb
+  Date: Thu, 01 Jan 1970 00:01:00 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+   c |  1 +
+   1 files changed, 1 insertions(+), 0 deletions(-)
+  
+  
+  # HG changeset patch
+  # User test
+  # Date 3 0
+  # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
+  # Parent  97d72e5f12c7e84f85064aa72e5a297142c36ed9
+  c
+  
+  diff -r 97d72e5f12c7 -r ff2c9fa2018b c
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/c	Thu Jan 01 00:00:03 1970 +0000
+  @@ -0,0 +1,1 @@
+  +c
+  
+
+test diffstat for multiple patches:
+  $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -d -y \
+  >  -r 0:1 | fixheaders
+  This patch series consists of 2 patches.
+  
+  
+  Write the introductory message for the patch series.
+  
+  
+  Final summary:
+  
+  From: quux
+  To: foo
+  Cc: bar
+  Subject: [PATCH 0 of 2] test
+   a |  1 +
+   b |  1 +
+   2 files changed, 2 insertions(+), 0 deletions(-)
+  Subject: [PATCH 1 of 2] a
+   a |  1 +
+   1 files changed, 1 insertions(+), 0 deletions(-)
+  Subject: [PATCH 2 of 2] b
+   b |  1 +
+   1 files changed, 1 insertions(+), 0 deletions(-)
+  
+  are you sure you want to send (yn)? y
+  
+  Displaying [PATCH 0 of 2] test ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Subject: [PATCH 0 of 2] test
+  Message-Id: <patchbomb.60@
+  User-Agent: Mercurial-patchbomb
+  Date: Thu, 01 Jan 1970 00:01:00 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+  
+   a |  1 +
+   b |  1 +
+   2 files changed, 2 insertions(+), 0 deletions(-)
+  
+  Displaying [PATCH 1 of 2] a ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Subject: [PATCH 1 of 2] a
+  X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
+  Message-Id: <8580ff50825a50c8f716.61@
+  In-Reply-To: <patchbomb.60@
+  References: <patchbomb.60@
+  User-Agent: Mercurial-patchbomb
+  Date: Thu, 01 Jan 1970 00:01:01 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+   a |  1 +
+   1 files changed, 1 insertions(+), 0 deletions(-)
+  
+  
+  # HG changeset patch
+  # User test
+  # Date 1 0
+  # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
+  # Parent  0000000000000000000000000000000000000000
+  a
+  
+  diff -r 000000000000 -r 8580ff50825a a
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/a	Thu Jan 01 00:00:01 1970 +0000
+  @@ -0,0 +1,1 @@
+  +a
+  
+  Displaying [PATCH 2 of 2] b ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Subject: [PATCH 2 of 2] b
+  X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
+  Message-Id: <97d72e5f12c7e84f8506.62@
+  In-Reply-To: <patchbomb.60@
+  References: <patchbomb.60@
+  User-Agent: Mercurial-patchbomb
+  Date: Thu, 01 Jan 1970 00:01:02 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+   b |  1 +
+   1 files changed, 1 insertions(+), 0 deletions(-)
+  
+  
+  # HG changeset patch
+  # User test
+  # Date 2 0
+  # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
+  # Parent  8580ff50825a50c8f716709acdf8de0deddcd6ab
+  b
+  
+  diff -r 8580ff50825a -r 97d72e5f12c7 b
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/b	Thu Jan 01 00:00:02 1970 +0000
+  @@ -0,0 +1,1 @@
+  +b
+  
+
+test inline for single patch:
+  $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i -r 2 | \
+  >  fixheaders
+  This patch series consists of 1 patches.
+  
+  
+  Displaying [PATCH] test ...
+  Content-Type: multipart/mixed; boundary="===
+  MIME-Version: 1.0
+  Subject: [PATCH] test
+  X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
+  Message-Id: <ff2c9fa2018b15fa74b3.60@
+  User-Agent: Mercurial-patchbomb
+  Date: Thu, 01 Jan 1970 00:01:00 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+  --===
+  Content-Type: text/x-patch; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Content-Disposition: inline; filename=t2.patch
+  
+  # HG changeset patch
+  # User test
+  # Date 3 0
+  # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
+  # Parent  97d72e5f12c7e84f85064aa72e5a297142c36ed9
+  c
+  
+  diff -r 97d72e5f12c7 -r ff2c9fa2018b c
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/c	Thu Jan 01 00:00:03 1970 +0000
+  @@ -0,0 +1,1 @@
+  +c
+  
+  --===
+
+
+test inline for single patch (quoted-printable):
+  $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i -r 4 | \
+  >  fixheaders
+  This patch series consists of 1 patches.
+  
+  
+  Displaying [PATCH] test ...
+  Content-Type: multipart/mixed; boundary="===
+  MIME-Version: 1.0
+  Subject: [PATCH] test
+  X-Mercurial-Node: c655633f8c87700bb38cc6a59a2753bdc5a6c376
+  Message-Id: <c655633f8c87700bb38c.60@
+  User-Agent: Mercurial-patchbomb
+  Date: Thu, 01 Jan 1970 00:01:00 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+  --===
+  Content-Type: text/x-patch; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: quoted-printable
+  Content-Disposition: inline; filename=t2.patch
+  
+  # HG changeset patch
+  # User test
+  # Date 4 0
+  # Node ID c655633f8c87700bb38cc6a59a2753bdc5a6c376
+  # Parent  c3c9e37db9f4fe4882cda39baf42fed6bad8b15a
+  charset=3Dutf-8; content-transfer-encoding: quoted-printable
+  
+  diff -r c3c9e37db9f4 -r c655633f8c87 qp
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/qp	Thu Jan 01 00:00:04 1970 +0000
+  @@ -0,0 +1,4 @@
+  +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+  +foo
+  +
+  +bar
+  
+  --===
+
+test inline for multiple patches:
+  $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i \
+  >  -r 0:1 -r 4 | fixheaders
+  This patch series consists of 3 patches.
+  
+  
+  Write the introductory message for the patch series.
+  
+  
+  Displaying [PATCH 0 of 3] test ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Subject: [PATCH 0 of 3] test
+  Message-Id: <patchbomb.60@
+  User-Agent: Mercurial-patchbomb
+  Date: Thu, 01 Jan 1970 00:01:00 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+  
+  Displaying [PATCH 1 of 3] a ...
+  Content-Type: multipart/mixed; boundary="===
+  MIME-Version: 1.0
+  Subject: [PATCH 1 of 3] a
+  X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
+  Message-Id: <8580ff50825a50c8f716.61@
+  In-Reply-To: <patchbomb.60@
+  References: <patchbomb.60@
+  User-Agent: Mercurial-patchbomb
+  Date: Thu, 01 Jan 1970 00:01:01 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+  --===
+  Content-Type: text/x-patch; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Content-Disposition: inline; filename=t2-1.patch
+  
+  # HG changeset patch
+  # User test
+  # Date 1 0
+  # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
+  # Parent  0000000000000000000000000000000000000000
+  a
+  
+  diff -r 000000000000 -r 8580ff50825a a
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/a	Thu Jan 01 00:00:01 1970 +0000
+  @@ -0,0 +1,1 @@
+  +a
+  
+  --===
+  Displaying [PATCH 2 of 3] b ...
+  Content-Type: multipart/mixed; boundary="===
+  MIME-Version: 1.0
+  Subject: [PATCH 2 of 3] b
+  X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
+  Message-Id: <97d72e5f12c7e84f8506.62@
+  In-Reply-To: <patchbomb.60@
+  References: <patchbomb.60@
+  User-Agent: Mercurial-patchbomb
+  Date: Thu, 01 Jan 1970 00:01:02 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+  --===
+  Content-Type: text/x-patch; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Content-Disposition: inline; filename=t2-2.patch
+  
+  # HG changeset patch
+  # User test
+  # Date 2 0
+  # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
+  # Parent  8580ff50825a50c8f716709acdf8de0deddcd6ab
+  b
+  
+  diff -r 8580ff50825a -r 97d72e5f12c7 b
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/b	Thu Jan 01 00:00:02 1970 +0000
+  @@ -0,0 +1,1 @@
+  +b
+  
+  --===
+  Displaying [PATCH 3 of 3] charset=utf-8; content-transfer-encoding: quoted-printable ...
+  Content-Type: multipart/mixed; boundary="===
+  MIME-Version: 1.0
+  Subject: [PATCH 3 of 3] charset=utf-8;
+   content-transfer-encoding: quoted-printable
+  X-Mercurial-Node: c655633f8c87700bb38cc6a59a2753bdc5a6c376
+  Message-Id: <c655633f8c87700bb38c.63@
+  In-Reply-To: <patchbomb.60@
+  References: <patchbomb.60@
+  User-Agent: Mercurial-patchbomb
+  Date: Thu, 01 Jan 1970 00:01:03 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+  --===
+  Content-Type: text/x-patch; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: quoted-printable
+  Content-Disposition: inline; filename=t2-3.patch
+  
+  # HG changeset patch
+  # User test
+  # Date 4 0
+  # Node ID c655633f8c87700bb38cc6a59a2753bdc5a6c376
+  # Parent  c3c9e37db9f4fe4882cda39baf42fed6bad8b15a
+  charset=3Dutf-8; content-transfer-encoding: quoted-printable
+  
+  diff -r c3c9e37db9f4 -r c655633f8c87 qp
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/qp	Thu Jan 01 00:00:04 1970 +0000
+  @@ -0,0 +1,4 @@
+  +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+  +foo
+  +
+  +bar
+  
+  --===
+
+test attach for single patch:
+  $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -a -r 2 | \
+  >  fixheaders
+  This patch series consists of 1 patches.
+  
+  
+  Displaying [PATCH] test ...
+  Content-Type: multipart/mixed; boundary="===
+  MIME-Version: 1.0
+  Subject: [PATCH] test
+  X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
+  Message-Id: <ff2c9fa2018b15fa74b3.60@
+  User-Agent: Mercurial-patchbomb
+  Date: Thu, 01 Jan 1970 00:01:00 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+  --===
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  
+  Patch subject is complete summary.
+  
+  
+  
+  --===
+  Content-Type: text/x-patch; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Content-Disposition: attachment; filename=t2.patch
+  
+  # HG changeset patch
+  # User test
+  # Date 3 0
+  # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
+  # Parent  97d72e5f12c7e84f85064aa72e5a297142c36ed9
+  c
+  
+  diff -r 97d72e5f12c7 -r ff2c9fa2018b c
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/c	Thu Jan 01 00:00:03 1970 +0000
+  @@ -0,0 +1,1 @@
+  +c
+  
+  --===
+
+test attach for single patch (quoted-printable):
+  $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -a -r 4 | \
+  >  fixheaders
+  This patch series consists of 1 patches.
+  
+  
+  Displaying [PATCH] test ...
+  Content-Type: multipart/mixed; boundary="===
+  MIME-Version: 1.0
+  Subject: [PATCH] test
+  X-Mercurial-Node: c655633f8c87700bb38cc6a59a2753bdc5a6c376
+  Message-Id: <c655633f8c87700bb38c.60@
+  User-Agent: Mercurial-patchbomb
+  Date: Thu, 01 Jan 1970 00:01:00 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+  --===
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  
+  Patch subject is complete summary.
+  
+  
+  
+  --===
+  Content-Type: text/x-patch; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: quoted-printable
+  Content-Disposition: attachment; filename=t2.patch
+  
+  # HG changeset patch
+  # User test
+  # Date 4 0
+  # Node ID c655633f8c87700bb38cc6a59a2753bdc5a6c376
+  # Parent  c3c9e37db9f4fe4882cda39baf42fed6bad8b15a
+  charset=3Dutf-8; content-transfer-encoding: quoted-printable
+  
+  diff -r c3c9e37db9f4 -r c655633f8c87 qp
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/qp	Thu Jan 01 00:00:04 1970 +0000
+  @@ -0,0 +1,4 @@
+  +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+  +foo
+  +
+  +bar
+  
+  --===
+
+test attach for multiple patches:
+  $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -a \
+  >  -r 0:1 -r 4 | fixheaders
+  This patch series consists of 3 patches.
+  
+  
+  Write the introductory message for the patch series.
+  
+  
+  Displaying [PATCH 0 of 3] test ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Subject: [PATCH 0 of 3] test
+  Message-Id: <patchbomb.60@
+  User-Agent: Mercurial-patchbomb
+  Date: Thu, 01 Jan 1970 00:01:00 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+  
+  Displaying [PATCH 1 of 3] a ...
+  Content-Type: multipart/mixed; boundary="===
+  MIME-Version: 1.0
+  Subject: [PATCH 1 of 3] a
+  X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
+  Message-Id: <8580ff50825a50c8f716.61@
+  In-Reply-To: <patchbomb.60@
+  References: <patchbomb.60@
+  User-Agent: Mercurial-patchbomb
+  Date: Thu, 01 Jan 1970 00:01:01 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+  --===
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  
+  Patch subject is complete summary.
+  
+  
+  
+  --===
+  Content-Type: text/x-patch; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Content-Disposition: attachment; filename=t2-1.patch
+  
+  # HG changeset patch
+  # User test
+  # Date 1 0
+  # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
+  # Parent  0000000000000000000000000000000000000000
+  a
+  
+  diff -r 000000000000 -r 8580ff50825a a
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/a	Thu Jan 01 00:00:01 1970 +0000
+  @@ -0,0 +1,1 @@
+  +a
+  
+  --===
+  Displaying [PATCH 2 of 3] b ...
+  Content-Type: multipart/mixed; boundary="===
+  MIME-Version: 1.0
+  Subject: [PATCH 2 of 3] b
+  X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
+  Message-Id: <97d72e5f12c7e84f8506.62@
+  In-Reply-To: <patchbomb.60@
+  References: <patchbomb.60@
+  User-Agent: Mercurial-patchbomb
+  Date: Thu, 01 Jan 1970 00:01:02 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+  --===
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  
+  Patch subject is complete summary.
+  
+  
+  
+  --===
+  Content-Type: text/x-patch; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Content-Disposition: attachment; filename=t2-2.patch
+  
+  # HG changeset patch
+  # User test
+  # Date 2 0
+  # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
+  # Parent  8580ff50825a50c8f716709acdf8de0deddcd6ab
+  b
+  
+  diff -r 8580ff50825a -r 97d72e5f12c7 b
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/b	Thu Jan 01 00:00:02 1970 +0000
+  @@ -0,0 +1,1 @@
+  +b
+  
+  --===
+  Displaying [PATCH 3 of 3] charset=utf-8; content-transfer-encoding: quoted-printable ...
+  Content-Type: multipart/mixed; boundary="===
+  MIME-Version: 1.0
+  Subject: [PATCH 3 of 3] charset=utf-8;
+   content-transfer-encoding: quoted-printable
+  X-Mercurial-Node: c655633f8c87700bb38cc6a59a2753bdc5a6c376
+  Message-Id: <c655633f8c87700bb38c.63@
+  In-Reply-To: <patchbomb.60@
+  References: <patchbomb.60@
+  User-Agent: Mercurial-patchbomb
+  Date: Thu, 01 Jan 1970 00:01:03 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+  --===
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  
+  Patch subject is complete summary.
+  
+  
+  
+  --===
+  Content-Type: text/x-patch; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: quoted-printable
+  Content-Disposition: attachment; filename=t2-3.patch
+  
+  # HG changeset patch
+  # User test
+  # Date 4 0
+  # Node ID c655633f8c87700bb38cc6a59a2753bdc5a6c376
+  # Parent  c3c9e37db9f4fe4882cda39baf42fed6bad8b15a
+  charset=3Dutf-8; content-transfer-encoding: quoted-printable
+  
+  diff -r c3c9e37db9f4 -r c655633f8c87 qp
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/qp	Thu Jan 01 00:00:04 1970 +0000
+  @@ -0,0 +1,4 @@
+  +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+  +foo
+  +
+  +bar
+  
+  --===
+
+test intro for single patch:
+  $ hg email --date '1970-1-1 0:1' -n --intro -f quux -t foo -c bar -s test \
+  >  -r 2 | fixheaders
+  This patch series consists of 1 patches.
+  
+  
+  Write the introductory message for the patch series.
+  
+  
+  Displaying [PATCH 0 of 1] test ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Subject: [PATCH 0 of 1] test
+  Message-Id: <patchbomb.60@
+  User-Agent: Mercurial-patchbomb
+  Date: Thu, 01 Jan 1970 00:01:00 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+  
+  Displaying [PATCH 1 of 1] c ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Subject: [PATCH 1 of 1] c
+  X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
+  Message-Id: <ff2c9fa2018b15fa74b3.61@
+  In-Reply-To: <patchbomb.60@
+  References: <patchbomb.60@
+  User-Agent: Mercurial-patchbomb
+  Date: Thu, 01 Jan 1970 00:01:01 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+  # HG changeset patch
+  # User test
+  # Date 3 0
+  # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
+  # Parent  97d72e5f12c7e84f85064aa72e5a297142c36ed9
+  c
+  
+  diff -r 97d72e5f12c7 -r ff2c9fa2018b c
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/c	Thu Jan 01 00:00:03 1970 +0000
+  @@ -0,0 +1,1 @@
+  +c
+  
+
+test --desc without --intro for a single patch:
+  $ echo foo > intro.text
+  $ hg email --date '1970-1-1 0:1' -n --desc intro.text -f quux -t foo -c bar \
+  >  -s test -r 2 | fixheaders
+  This patch series consists of 1 patches.
+  
+  
+  Displaying [PATCH 0 of 1] test ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Subject: [PATCH 0 of 1] test
+  Message-Id: <patchbomb.60@
+  User-Agent: Mercurial-patchbomb
+  Date: Thu, 01 Jan 1970 00:01:00 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+  foo
+  
+  Displaying [PATCH 1 of 1] c ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Subject: [PATCH 1 of 1] c
+  X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
+  Message-Id: <ff2c9fa2018b15fa74b3.61@
+  In-Reply-To: <patchbomb.60@
+  References: <patchbomb.60@
+  User-Agent: Mercurial-patchbomb
+  Date: Thu, 01 Jan 1970 00:01:01 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+  # HG changeset patch
+  # User test
+  # Date 3 0
+  # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
+  # Parent  97d72e5f12c7e84f85064aa72e5a297142c36ed9
+  c
+  
+  diff -r 97d72e5f12c7 -r ff2c9fa2018b c
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/c	Thu Jan 01 00:00:03 1970 +0000
+  @@ -0,0 +1,1 @@
+  +c
+  
+
+test intro for multiple patches:
+  $ hg email --date '1970-1-1 0:1' -n --intro -f quux -t foo -c bar -s test \
+  >  -r 0:1 | fixheaders
+  This patch series consists of 2 patches.
+  
+  
+  Write the introductory message for the patch series.
+  
+  
+  Displaying [PATCH 0 of 2] test ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Subject: [PATCH 0 of 2] test
+  Message-Id: <patchbomb.60@
+  User-Agent: Mercurial-patchbomb
+  Date: Thu, 01 Jan 1970 00:01:00 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+  
+  Displaying [PATCH 1 of 2] a ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Subject: [PATCH 1 of 2] a
+  X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
+  Message-Id: <8580ff50825a50c8f716.61@
+  In-Reply-To: <patchbomb.60@
+  References: <patchbomb.60@
+  User-Agent: Mercurial-patchbomb
+  Date: Thu, 01 Jan 1970 00:01:01 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+  # HG changeset patch
+  # User test
+  # Date 1 0
+  # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
+  # Parent  0000000000000000000000000000000000000000
+  a
+  
+  diff -r 000000000000 -r 8580ff50825a a
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/a	Thu Jan 01 00:00:01 1970 +0000
+  @@ -0,0 +1,1 @@
+  +a
+  
+  Displaying [PATCH 2 of 2] b ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Subject: [PATCH 2 of 2] b
+  X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
+  Message-Id: <97d72e5f12c7e84f8506.62@
+  In-Reply-To: <patchbomb.60@
+  References: <patchbomb.60@
+  User-Agent: Mercurial-patchbomb
+  Date: Thu, 01 Jan 1970 00:01:02 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+  # HG changeset patch
+  # User test
+  # Date 2 0
+  # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
+  # Parent  8580ff50825a50c8f716709acdf8de0deddcd6ab
+  b
+  
+  diff -r 8580ff50825a -r 97d72e5f12c7 b
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/b	Thu Jan 01 00:00:02 1970 +0000
+  @@ -0,0 +1,1 @@
+  +b
+  
+
+test reply-to via config:
+  $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -r 2 \
+  >  --config patchbomb.reply-to='baz@example.com' | fixheaders
+  This patch series consists of 1 patches.
+  
+  
+  Displaying [PATCH] test ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Subject: [PATCH] test
+  X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
+  Message-Id: <ff2c9fa2018b15fa74b3.60@
+  User-Agent: Mercurial-patchbomb
+  Date: Thu, 01 Jan 1970 00:01:00 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  Reply-To: baz@example.com
+  
+  # HG changeset patch
+  # User test
+  # Date 3 0
+  # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
+  # Parent  97d72e5f12c7e84f85064aa72e5a297142c36ed9
+  c
+  
+  diff -r 97d72e5f12c7 -r ff2c9fa2018b c
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/c	Thu Jan 01 00:00:03 1970 +0000
+  @@ -0,0 +1,1 @@
+  +c
+  
+
+test reply-to via command line:
+  $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -r 2 \
+  >  --reply-to baz --reply-to fred | fixheaders
+  This patch series consists of 1 patches.
+  
+  
+  Displaying [PATCH] test ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Subject: [PATCH] test
+  X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
+  Message-Id: <ff2c9fa2018b15fa74b3.60@
+  User-Agent: Mercurial-patchbomb
+  Date: Thu, 01 Jan 1970 00:01:00 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  Reply-To: baz, fred
+  
+  # HG changeset patch
+  # User test
+  # Date 3 0
+  # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
+  # Parent  97d72e5f12c7e84f85064aa72e5a297142c36ed9
+  c
+  
+  diff -r 97d72e5f12c7 -r ff2c9fa2018b c
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/c	Thu Jan 01 00:00:03 1970 +0000
+  @@ -0,0 +1,1 @@
+  +c
+  
+
+tagging csets:
+  $ hg tag -r0 zero zero.foo
+  $ hg tag -r1 one one.patch
+  $ hg tag -r2 two two.diff
+
+test inline for single named patch:
+  $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i -r 2 | \
+  >  fixheaders
+  This patch series consists of 1 patches.
+  
+  
+  Displaying [PATCH] test ...
+  Content-Type: multipart/mixed; boundary="===
+  MIME-Version: 1.0
+  Subject: [PATCH] test
+  X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
+  Message-Id: <ff2c9fa2018b15fa74b3.60@
+  User-Agent: Mercurial-patchbomb
+  Date: Thu, 01 Jan 1970 00:01:00 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+  --===
+  Content-Type: text/x-patch; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Content-Disposition: inline; filename=two.diff
+  
+  # HG changeset patch
+  # User test
+  # Date 3 0
+  # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
+  # Parent  97d72e5f12c7e84f85064aa72e5a297142c36ed9
+  c
+  
+  diff -r 97d72e5f12c7 -r ff2c9fa2018b c
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/c	Thu Jan 01 00:00:03 1970 +0000
+  @@ -0,0 +1,1 @@
+  +c
+  
+  --===
+
+test inline for multiple named/unnamed patches:
+  $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i -r 0:1 | \
+  >  fixheaders
+  This patch series consists of 2 patches.
+  
+  
+  Write the introductory message for the patch series.
+  
+  
+  Displaying [PATCH 0 of 2] test ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Subject: [PATCH 0 of 2] test
+  Message-Id: <patchbomb.60@
+  User-Agent: Mercurial-patchbomb
+  Date: Thu, 01 Jan 1970 00:01:00 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+  
+  Displaying [PATCH 1 of 2] a ...
+  Content-Type: multipart/mixed; boundary="===
+  MIME-Version: 1.0
+  Subject: [PATCH 1 of 2] a
+  X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
+  Message-Id: <8580ff50825a50c8f716.61@
+  In-Reply-To: <patchbomb.60@
+  References: <patchbomb.60@
+  User-Agent: Mercurial-patchbomb
+  Date: Thu, 01 Jan 1970 00:01:01 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+  --===
+  Content-Type: text/x-patch; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Content-Disposition: inline; filename=t2-1.patch
+  
+  # HG changeset patch
+  # User test
+  # Date 1 0
+  # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
+  # Parent  0000000000000000000000000000000000000000
+  a
+  
+  diff -r 000000000000 -r 8580ff50825a a
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/a	Thu Jan 01 00:00:01 1970 +0000
+  @@ -0,0 +1,1 @@
+  +a
+  
+  --===
+  Displaying [PATCH 2 of 2] b ...
+  Content-Type: multipart/mixed; boundary="===
+  MIME-Version: 1.0
+  Subject: [PATCH 2 of 2] b
+  X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
+  Message-Id: <97d72e5f12c7e84f8506.62@
+  In-Reply-To: <patchbomb.60@
+  References: <patchbomb.60@
+  User-Agent: Mercurial-patchbomb
+  Date: Thu, 01 Jan 1970 00:01:02 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+  --===
+  Content-Type: text/x-patch; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Content-Disposition: inline; filename=one.patch
+  
+  # HG changeset patch
+  # User test
+  # Date 2 0
+  # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
+  # Parent  8580ff50825a50c8f716709acdf8de0deddcd6ab
+  b
+  
+  diff -r 8580ff50825a -r 97d72e5f12c7 b
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/b	Thu Jan 01 00:00:02 1970 +0000
+  @@ -0,0 +1,1 @@
+  +b
+  
+  --===
+
+
+test inreplyto:
+  $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar --in-reply-to baz \
+  >  -r tip | fixheaders
+  This patch series consists of 1 patches.
+  
+  
+  Displaying [PATCH] Added tag two, two.diff for changeset ff2c9fa2018b ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Subject: [PATCH] Added tag two, two.diff for changeset ff2c9fa2018b
+  X-Mercurial-Node: e317db6a6f288748d1f6cb064f3810fcba66b1b6
+  Message-Id: <e317db6a6f288748d1f6.60@
+  In-Reply-To: <baz>
+  References: <baz>
+  User-Agent: Mercurial-patchbomb
+  Date: Thu, 01 Jan 1970 00:01:00 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+  # HG changeset patch
+  # User test
+  # Date 0 0
+  # Node ID e317db6a6f288748d1f6cb064f3810fcba66b1b6
+  # Parent  eae5fcf795eee29d0e45ffc9f519a91cd79fc9ff
+  Added tag two, two.diff for changeset ff2c9fa2018b
+  
+  diff -r eae5fcf795ee -r e317db6a6f28 .hgtags
+  --- a/.hgtags	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/.hgtags	Thu Jan 01 00:00:00 1970 +0000
+  @@ -2,3 +2,5 @@
+   8580ff50825a50c8f716709acdf8de0deddcd6ab zero.foo
+   97d72e5f12c7e84f85064aa72e5a297142c36ed9 one
+   97d72e5f12c7e84f85064aa72e5a297142c36ed9 one.patch
+  +ff2c9fa2018b15fa74b33363bda9527323e2a99f two
+  +ff2c9fa2018b15fa74b33363bda9527323e2a99f two.diff
+  
+
+  $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar --in-reply-to baz \
+  >  -r 0:1
+  This patch series consists of 2 patches.
+  
+  abort: Subject: [PATCH 0 of 2] Please enter a valid value
+  [255]
+
+  $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar --in-reply-to baz \
+  >  -s test -r 0:1 | fixheaders
+  This patch series consists of 2 patches.
+  
+  
+  Write the introductory message for the patch series.
+  
+  
+  Displaying [PATCH 0 of 2] test ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Subject: [PATCH 0 of 2] test
+  Message-Id: <patchbomb.60@
+  In-Reply-To: <baz>
+  References: <baz>
+  User-Agent: Mercurial-patchbomb
+  Date: Thu, 01 Jan 1970 00:01:00 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+  
+  Displaying [PATCH 1 of 2] a ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Subject: [PATCH 1 of 2] a
+  X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
+  Message-Id: <8580ff50825a50c8f716.61@
+  In-Reply-To: <patchbomb.60@
+  References: <patchbomb.60@
+  User-Agent: Mercurial-patchbomb
+  Date: Thu, 01 Jan 1970 00:01:01 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+  # HG changeset patch
+  # User test
+  # Date 1 0
+  # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
+  # Parent  0000000000000000000000000000000000000000
+  a
+  
+  diff -r 000000000000 -r 8580ff50825a a
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/a	Thu Jan 01 00:00:01 1970 +0000
+  @@ -0,0 +1,1 @@
+  +a
+  
+  Displaying [PATCH 2 of 2] b ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Subject: [PATCH 2 of 2] b
+  X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
+  Message-Id: <97d72e5f12c7e84f8506.62@
+  In-Reply-To: <patchbomb.60@
+  References: <patchbomb.60@
+  User-Agent: Mercurial-patchbomb
+  Date: Thu, 01 Jan 1970 00:01:02 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+  # HG changeset patch
+  # User test
+  # Date 2 0
+  # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
+  # Parent  8580ff50825a50c8f716709acdf8de0deddcd6ab
+  b
+  
+  diff -r 8580ff50825a -r 97d72e5f12c7 b
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/b	Thu Jan 01 00:00:02 1970 +0000
+  @@ -0,0 +1,1 @@
+  +b
+  
+
+test single flag for single patch:
+  $ hg email --date '1970-1-1 0:1' -n --flag fooFlag -f quux -t foo -c bar -s test \
+  >  -r 2 | fixheaders
+  This patch series consists of 1 patches.
+  
+  
+  Displaying [PATCH fooFlag] test ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Subject: [PATCH fooFlag] test
+  X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
+  Message-Id: <ff2c9fa2018b15fa74b3.60@
+  User-Agent: Mercurial-patchbomb
+  Date: Thu, 01 Jan 1970 00:01:00 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+  # HG changeset patch
+  # User test
+  # Date 3 0
+  # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
+  # Parent  97d72e5f12c7e84f85064aa72e5a297142c36ed9
+  c
+  
+  diff -r 97d72e5f12c7 -r ff2c9fa2018b c
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/c	Thu Jan 01 00:00:03 1970 +0000
+  @@ -0,0 +1,1 @@
+  +c
+  
+
+test single flag for multiple patches:
+  $ hg email --date '1970-1-1 0:1' -n --flag fooFlag -f quux -t foo -c bar -s test \
+  >  -r 0:1 | fixheaders
+  This patch series consists of 2 patches.
+  
+  
+  Write the introductory message for the patch series.
+  
+  
+  Displaying [PATCH 0 of 2 fooFlag] test ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Subject: [PATCH 0 of 2 fooFlag] test
+  Message-Id: <patchbomb.60@
+  User-Agent: Mercurial-patchbomb
+  Date: Thu, 01 Jan 1970 00:01:00 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+  
+  Displaying [PATCH 1 of 2 fooFlag] a ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Subject: [PATCH 1 of 2 fooFlag] a
+  X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
+  Message-Id: <8580ff50825a50c8f716.61@
+  In-Reply-To: <patchbomb.60@
+  References: <patchbomb.60@
+  User-Agent: Mercurial-patchbomb
+  Date: Thu, 01 Jan 1970 00:01:01 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+  # HG changeset patch
+  # User test
+  # Date 1 0
+  # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
+  # Parent  0000000000000000000000000000000000000000
+  a
+  
+  diff -r 000000000000 -r 8580ff50825a a
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/a	Thu Jan 01 00:00:01 1970 +0000
+  @@ -0,0 +1,1 @@
+  +a
+  
+  Displaying [PATCH 2 of 2 fooFlag] b ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Subject: [PATCH 2 of 2 fooFlag] b
+  X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
+  Message-Id: <97d72e5f12c7e84f8506.62@
+  In-Reply-To: <patchbomb.60@
+  References: <patchbomb.60@
+  User-Agent: Mercurial-patchbomb
+  Date: Thu, 01 Jan 1970 00:01:02 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+  # HG changeset patch
+  # User test
+  # Date 2 0
+  # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
+  # Parent  8580ff50825a50c8f716709acdf8de0deddcd6ab
+  b
+  
+  diff -r 8580ff50825a -r 97d72e5f12c7 b
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/b	Thu Jan 01 00:00:02 1970 +0000
+  @@ -0,0 +1,1 @@
+  +b
+  
+
+test mutiple flags for single patch:
+  $ hg email --date '1970-1-1 0:1' -n --flag fooFlag --flag barFlag -f quux -t foo \
+  >  -c bar -s test -r 2 | fixheaders
+  This patch series consists of 1 patches.
+  
+  
+  Displaying [PATCH fooFlag barFlag] test ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Subject: [PATCH fooFlag barFlag] test
+  X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
+  Message-Id: <ff2c9fa2018b15fa74b3.60@
+  User-Agent: Mercurial-patchbomb
+  Date: Thu, 01 Jan 1970 00:01:00 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+  # HG changeset patch
+  # User test
+  # Date 3 0
+  # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
+  # Parent  97d72e5f12c7e84f85064aa72e5a297142c36ed9
+  c
+  
+  diff -r 97d72e5f12c7 -r ff2c9fa2018b c
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/c	Thu Jan 01 00:00:03 1970 +0000
+  @@ -0,0 +1,1 @@
+  +c
+  
+
+test multiple flags for multiple patches:
+  $ hg email --date '1970-1-1 0:1' -n --flag fooFlag --flag barFlag -f quux -t foo \
+  >  -c bar -s test -r 0:1 | fixheaders
+  This patch series consists of 2 patches.
+  
+  
+  Write the introductory message for the patch series.
+  
+  
+  Displaying [PATCH 0 of 2 fooFlag barFlag] test ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Subject: [PATCH 0 of 2 fooFlag barFlag] test
+  Message-Id: <patchbomb.60@
+  User-Agent: Mercurial-patchbomb
+  Date: Thu, 01 Jan 1970 00:01:00 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+  
+  Displaying [PATCH 1 of 2 fooFlag barFlag] a ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Subject: [PATCH 1 of 2 fooFlag barFlag] a
+  X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
+  Message-Id: <8580ff50825a50c8f716.61@
+  In-Reply-To: <patchbomb.60@
+  References: <patchbomb.60@
+  User-Agent: Mercurial-patchbomb
+  Date: Thu, 01 Jan 1970 00:01:01 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+  # HG changeset patch
+  # User test
+  # Date 1 0
+  # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
+  # Parent  0000000000000000000000000000000000000000
+  a
+  
+  diff -r 000000000000 -r 8580ff50825a a
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/a	Thu Jan 01 00:00:01 1970 +0000
+  @@ -0,0 +1,1 @@
+  +a
+  
+  Displaying [PATCH 2 of 2 fooFlag barFlag] b ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Subject: [PATCH 2 of 2 fooFlag barFlag] b
+  X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
+  Message-Id: <97d72e5f12c7e84f8506.62@
+  In-Reply-To: <patchbomb.60@
+  References: <patchbomb.60@
+  User-Agent: Mercurial-patchbomb
+  Date: Thu, 01 Jan 1970 00:01:02 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+  # HG changeset patch
+  # User test
+  # Date 2 0
+  # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
+  # Parent  8580ff50825a50c8f716709acdf8de0deddcd6ab
+  b
+  
+  diff -r 8580ff50825a -r 97d72e5f12c7 b
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/b	Thu Jan 01 00:00:02 1970 +0000
+  @@ -0,0 +1,1 @@
+  +b
+  
+
+test multi-address parsing:
+  $ hg email --date '1980-1-1 0:1' -m tmp.mbox -f quux -t 'spam<spam><eggs>' \
+  >  -t toast -c 'foo,bar@example.com' -c '"A, B <>" <a@example.com>' -s test -r 0 \
+  >  --config email.bcc='"Quux, A." <quux>'
+  This patch series consists of 1 patches.
+  
+  
+  Writing [PATCH] test ...
+  $ fixheaders < tmp.mbox
+  From quux Tue Jan 01 00:01:01 1980
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Subject: [PATCH] test
+  X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
+  Message-Id: <8580ff50825a50c8f716.315532860@
+  User-Agent: Mercurial-patchbomb
+  Date: Tue, 01 Jan 1980 00:01:00 +0000
+  From: quux
+  To: spam <spam>, eggs, toast
+  Cc: foo, bar@example.com, "A, B <>" <a@example.com>
+  Bcc: "Quux, A." <quux>
+  
+  # HG changeset patch
+  # User test
+  # Date 1 0
+  # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
+  # Parent  0000000000000000000000000000000000000000
+  a
+  
+  diff -r 000000000000 -r 8580ff50825a a
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/a	Thu Jan 01 00:00:01 1970 +0000
+  @@ -0,0 +1,1 @@
+  +a
+  
+  
+
+test multi-byte domain parsing:
+  $ UUML=`python -c 'import sys; sys.stdout.write("\374")'`
+  $ HGENCODING=iso-8859-1
+  $ export HGENCODING
+  $ hg email --date '1980-1-1 0:1' -m tmp.mbox -f quux -t "bar@${UUML}nicode.com" -s test -r 0
+  This patch series consists of 1 patches.
+  
+  Cc: 
+  
+  Writing [PATCH] test ...
+
+  $ cat tmp.mbox
+  From quux Tue Jan 01 00:01:01 1980
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Subject: [PATCH] test
+  X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
+  Message-Id: <8580ff50825a50c8f716.315532860@* (glob)
+  User-Agent: Mercurial-patchbomb/* (glob)
+  Date: Tue, 01 Jan 1980 00:01:00 +0000
+  From: quux
+  To: bar@xn--nicode-2ya.com
+  
+  # HG changeset patch
+  # User test
+  # Date 1 0
+  # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
+  # Parent  0000000000000000000000000000000000000000
+  a
+  
+  diff -r 000000000000 -r 8580ff50825a a
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/a	Thu Jan 01 00:00:01 1970 +0000
+  @@ -0,0 +1,1 @@
+  +a
+  
+  
+
+test outgoing:
+  $ hg up 1
+  0 files updated, 0 files merged, 6 files removed, 0 files unresolved
+
+  $ hg branch test
+  marked working directory as branch test
+
+  $ echo d > d
+  $ hg add d
+  $ hg ci -md -d '4 0'
+  $ hg email --date '1980-1-1 0:1' -n -t foo -s test -o ../t
+  comparing with ../t
+  searching for changes
+  From [test]: test
+  This patch series consists of 8 patches.
+  
+  
+  Write the introductory message for the patch series.
+  
+  Cc: 
+  
+  Displaying [PATCH 0 of 8] test ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Subject: [PATCH 0 of 8] test
+  Message-Id: <patchbomb.315532860@* (glob)
+  User-Agent: Mercurial-patchbomb/* (glob)
+  Date: Tue, 01 Jan 1980 00:01:00 +0000
+  From: test
+  To: foo
+  
+  
+  Displaying [PATCH 1 of 8] c ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Subject: [PATCH 1 of 8] c
+  X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
+  Message-Id: <ff2c9fa2018b15fa74b3.315532861@* (glob)
+  In-Reply-To: <patchbomb\.315532860@[^>]*> (re)
+  References: <patchbomb\.315532860@[^>]*> (re)
+  User-Agent: Mercurial-patchbomb/* (glob)
+  Date: Tue, 01 Jan 1980 00:01:01 +0000
+  From: test
+  To: foo
+  
+  # HG changeset patch
+  # User test
+  # Date 3 0
+  # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
+  # Parent  97d72e5f12c7e84f85064aa72e5a297142c36ed9
+  c
+  
+  diff -r 97d72e5f12c7 -r ff2c9fa2018b c
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/c	Thu Jan 01 00:00:03 1970 +0000
+  @@ -0,0 +1,1 @@
+  +c
+  
+  Displaying [PATCH 2 of 8] charset=utf-8; content-transfer-encoding: base64 ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 8bit
+  Subject: [PATCH 2 of 8] charset=utf-8; content-transfer-encoding: base64
+  X-Mercurial-Node: c3c9e37db9f4fe4882cda39baf42fed6bad8b15a
+  Message-Id: <c3c9e37db9f4fe4882cd.315532862@* (glob)
+  In-Reply-To: <patchbomb\.315532860@[^>]*> (re)
+  References: <patchbomb\.315532860@[^>]*> (re)
+  User-Agent: Mercurial-patchbomb/* (glob)
+  Date: Tue, 01 Jan 1980 00:01:02 +0000
+  From: test
+  To: foo
+  
+  # HG changeset patch
+  # User test
+  # Date 4 0
+  # Node ID c3c9e37db9f4fe4882cda39baf42fed6bad8b15a
+  # Parent  ff2c9fa2018b15fa74b33363bda9527323e2a99f
+  charset=utf-8; content-transfer-encoding: base64
+  
+  diff -r ff2c9fa2018b -r c3c9e37db9f4 description
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/description	Thu Jan 01 00:00:04 1970 +0000
+  @@ -0,0 +1,3 @@
+  +a multiline
+  +
+  +description
+  diff -r ff2c9fa2018b -r c3c9e37db9f4 utf
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/utf	Thu Jan 01 00:00:04 1970 +0000
+  @@ -0,0 +1,1 @@
+  +hömma!
+  
+  Displaying [PATCH 3 of 8] charset=utf-8; content-transfer-encoding: quoted-printable ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: quoted-printable
+  Subject: [PATCH 3 of 8] charset=utf-8;
+   content-transfer-encoding: quoted-printable
+  X-Mercurial-Node: c655633f8c87700bb38cc6a59a2753bdc5a6c376
+  Message-Id: <c655633f8c87700bb38c.315532863@* (glob)
+  In-Reply-To: <patchbomb\.315532860@[^>]*> (re)
+  References: <patchbomb\.315532860@[^>]*> (re)
+  User-Agent: Mercurial-patchbomb/* (glob)
+  Date: Tue, 01 Jan 1980 00:01:03 +0000
+  From: test
+  To: foo
+  
+  # HG changeset patch
+  # User test
+  # Date 4 0
+  # Node ID c655633f8c87700bb38cc6a59a2753bdc5a6c376
+  # Parent  c3c9e37db9f4fe4882cda39baf42fed6bad8b15a
+  charset=3Dutf-8; content-transfer-encoding: quoted-printable
+  
+  diff -r c3c9e37db9f4 -r c655633f8c87 qp
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/qp	Thu Jan 01 00:00:04 1970 +0000
+  @@ -0,0 +1,4 @@
+  +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
+  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+  +foo
+  +
+  +bar
+  
+  Displaying [PATCH 4 of 8] charset=us-ascii; content-transfer-encoding: 8bit ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 8bit
+  Subject: [PATCH 4 of 8] charset=us-ascii; content-transfer-encoding: 8bit
+  X-Mercurial-Node: 22d0f96be12f5945fd67d101af58f7bc8263c835
+  Message-Id: <22d0f96be12f5945fd67.315532864@* (glob)
+  In-Reply-To: <patchbomb\.315532860@[^>]*> (re)
+  References: <patchbomb\.315532860@[^>]*> (re)
+  User-Agent: Mercurial-patchbomb/* (glob)
+  Date: Tue, 01 Jan 1980 00:01:04 +0000
+  From: test
+  To: foo
+  
+  # HG changeset patch
+  # User test
+  # Date 5 0
+  # Node ID 22d0f96be12f5945fd67d101af58f7bc8263c835
+  # Parent  c655633f8c87700bb38cc6a59a2753bdc5a6c376
+  charset=us-ascii; content-transfer-encoding: 8bit
+  
+  diff -r c655633f8c87 -r 22d0f96be12f isolatin
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/isolatin	Thu Jan 01 00:00:05 1970 +0000
+  @@ -0,0 +1,1 @@
+  +hömma!
+  
+  Displaying [PATCH 5 of 8] Added tag zero, zero.foo for changeset 8580ff50825a ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Subject: [PATCH 5 of 8] Added tag zero, zero.foo for changeset 8580ff50825a
+  X-Mercurial-Node: dd9c2b4b8a8a0934d5523c15f2c119b362360903
+  Message-Id: <dd9c2b4b8a8a0934d552.315532865@* (glob)
+  In-Reply-To: <patchbomb\.315532860@[^>]*> (re)
+  References: <patchbomb\.315532860@[^>]*> (re)
+  User-Agent: Mercurial-patchbomb/* (glob)
+  Date: Tue, 01 Jan 1980 00:01:05 +0000
+  From: test
+  To: foo
+  
+  # HG changeset patch
+  # User test
+  # Date 0 0
+  # Node ID dd9c2b4b8a8a0934d5523c15f2c119b362360903
+  # Parent  22d0f96be12f5945fd67d101af58f7bc8263c835
+  Added tag zero, zero.foo for changeset 8580ff50825a
+  
+  diff -r 22d0f96be12f -r dd9c2b4b8a8a .hgtags
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/.hgtags	Thu Jan 01 00:00:00 1970 +0000
+  @@ -0,0 +1,2 @@
+  +8580ff50825a50c8f716709acdf8de0deddcd6ab zero
+  +8580ff50825a50c8f716709acdf8de0deddcd6ab zero.foo
+  
+  Displaying [PATCH 6 of 8] Added tag one, one.patch for changeset 97d72e5f12c7 ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Subject: [PATCH 6 of 8] Added tag one, one.patch for changeset 97d72e5f12c7
+  X-Mercurial-Node: eae5fcf795eee29d0e45ffc9f519a91cd79fc9ff
+  Message-Id: <eae5fcf795eee29d0e45.315532866@* (glob)
+  In-Reply-To: <patchbomb\.315532860@[^>]*> (re)
+  References: <patchbomb\.315532860@[^>]*> (re)
+  User-Agent: Mercurial-patchbomb/* (glob)
+  Date: Tue, 01 Jan 1980 00:01:06 +0000
+  From: test
+  To: foo
+  
+  # HG changeset patch
+  # User test
+  # Date 0 0
+  # Node ID eae5fcf795eee29d0e45ffc9f519a91cd79fc9ff
+  # Parent  dd9c2b4b8a8a0934d5523c15f2c119b362360903
+  Added tag one, one.patch for changeset 97d72e5f12c7
+  
+  diff -r dd9c2b4b8a8a -r eae5fcf795ee .hgtags
+  --- a/.hgtags	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/.hgtags	Thu Jan 01 00:00:00 1970 +0000
+  @@ -1,2 +1,4 @@
+   8580ff50825a50c8f716709acdf8de0deddcd6ab zero
+   8580ff50825a50c8f716709acdf8de0deddcd6ab zero.foo
+  +97d72e5f12c7e84f85064aa72e5a297142c36ed9 one
+  +97d72e5f12c7e84f85064aa72e5a297142c36ed9 one.patch
+  
+  Displaying [PATCH 7 of 8] Added tag two, two.diff for changeset ff2c9fa2018b ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Subject: [PATCH 7 of 8] Added tag two, two.diff for changeset ff2c9fa2018b
+  X-Mercurial-Node: e317db6a6f288748d1f6cb064f3810fcba66b1b6
+  Message-Id: <e317db6a6f288748d1f6.315532867@* (glob)
+  In-Reply-To: <patchbomb\.315532860@[^>]*> (re)
+  References: <patchbomb\.315532860@[^>]*> (re)
+  User-Agent: Mercurial-patchbomb/* (glob)
+  Date: Tue, 01 Jan 1980 00:01:07 +0000
+  From: test
+  To: foo
+  
+  # HG changeset patch
+  # User test
+  # Date 0 0
+  # Node ID e317db6a6f288748d1f6cb064f3810fcba66b1b6
+  # Parent  eae5fcf795eee29d0e45ffc9f519a91cd79fc9ff
+  Added tag two, two.diff for changeset ff2c9fa2018b
+  
+  diff -r eae5fcf795ee -r e317db6a6f28 .hgtags
+  --- a/.hgtags	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/.hgtags	Thu Jan 01 00:00:00 1970 +0000
+  @@ -2,3 +2,5 @@
+   8580ff50825a50c8f716709acdf8de0deddcd6ab zero.foo
+   97d72e5f12c7e84f85064aa72e5a297142c36ed9 one
+   97d72e5f12c7e84f85064aa72e5a297142c36ed9 one.patch
+  +ff2c9fa2018b15fa74b33363bda9527323e2a99f two
+  +ff2c9fa2018b15fa74b33363bda9527323e2a99f two.diff
+  
+  Displaying [PATCH 8 of 8] d ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Subject: [PATCH 8 of 8] d
+  X-Mercurial-Node: 2f9fa9b998c5fe3ac2bd9a2b14bfcbeecbc7c268
+  Message-Id: <2f9fa9b998c5fe3ac2bd\.315532868[^>]*> (re)
+  In-Reply-To: <patchbomb\.315532860@[^>]*> (re)
+  References: <patchbomb\.315532860@[^>]*> (re)
+  User-Agent: Mercurial-patchbomb/* (glob)
+  Date: Tue, 01 Jan 1980 00:01:08 +0000
+  From: test
+  To: foo
+  
+  # HG changeset patch
+  # User test
+  # Date 4 0
+  # Branch test
+  # Node ID 2f9fa9b998c5fe3ac2bd9a2b14bfcbeecbc7c268
+  # Parent  97d72e5f12c7e84f85064aa72e5a297142c36ed9
+  d
+  
+  diff -r 97d72e5f12c7 -r 2f9fa9b998c5 d
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/d	Thu Jan 01 00:00:04 1970 +0000
+  @@ -0,0 +1,1 @@
+  +d
+  
+
+dest#branch URIs:
+  $ hg email --date '1980-1-1 0:1' -n -t foo -s test -o ../t#test
+  comparing with ../t
+  searching for changes
+  From [test]: test
+  This patch series consists of 1 patches.
+  
+  Cc: 
+  
+  Displaying [PATCH] test ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Subject: [PATCH] test
+  X-Mercurial-Node: 2f9fa9b998c5fe3ac2bd9a2b14bfcbeecbc7c268
+  Message-Id: <2f9fa9b998c5fe3ac2bd.315532860@* (glob)
+  User-Agent: Mercurial-patchbomb/* (glob)
+  Date: Tue, 01 Jan 1980 00:01:00 +0000
+  From: test
+  To: foo
+  
+  # HG changeset patch
+  # User test
+  # Date 4 0
+  # Branch test
+  # Node ID 2f9fa9b998c5fe3ac2bd9a2b14bfcbeecbc7c268
+  # Parent  97d72e5f12c7e84f85064aa72e5a297142c36ed9
+  d
+  
+  diff -r 97d72e5f12c7 -r 2f9fa9b998c5 d
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/d	Thu Jan 01 00:00:04 1970 +0000
+  @@ -0,0 +1,1 @@
+  +d
+  
--- a/tests/test-paths	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-#!/bin/sh
-hg init a
-hg clone a b
-cd a
-echo '[paths]' >> .hg/hgrc
-echo 'dupe = ../b' >> .hg/hgrc
-hg in dupe | fgrep '../'
-cd ..
-hg -R a in dupe | fgrep '../'
-true
--- a/tests/test-paths.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-updating to branch default
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-paths.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,16 @@
+  $ hg init a
+  $ hg clone a b
+  updating to branch default
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd a
+  $ echo '[paths]' >> .hg/hgrc
+  $ echo 'dupe = ../b' >> .hg/hgrc
+  $ hg in dupe
+  comparing with */test-paths.t/b (glob)
+  no changes found
+  [1]
+  $ cd ..
+  $ hg -R a in dupe
+  comparing with */test-paths.t/b (glob)
+  no changes found
+  [1]
--- a/tests/test-permissions	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-#!/bin/sh
-
-hg init t
-cd t
-echo foo > a
-hg add a
-hg commit -m "1" -d "1000000 0"
-hg verify
-chmod -r .hg/store/data/a.i
-hg verify 2>/dev/null || echo verify failed
-chmod +r .hg/store/data/a.i
-hg verify 2>/dev/null || echo verify failed
-chmod -w .hg/store/data/a.i
-echo barber > a
-hg commit -m "2" -d "1000000 0" 2>/dev/null || echo commit failed
-chmod -w .
-hg diff --nodates
-chmod +w .
-
-chmod +w .hg/store/data/a.i
-mkdir dir
-touch dir/a
-hg status
-chmod -rx dir
-hg status
-# reenable perm to allow deletion
-chmod +rx dir
--- a/tests/test-permissions.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 1 changesets, 1 total revisions
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-verify failed
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 1 changesets, 1 total revisions
-commit failed
-diff -r c1fab96507ef a
---- a/a
-+++ b/a
-@@ -1,1 +1,1 @@
--foo
-+barber
-M a
-? dir/a
-dir: Permission denied
-M a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-permissions.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,69 @@
+  $ hg init t
+  $ cd t
+
+  $ echo foo > a
+  $ hg add a
+
+  $ hg commit -m "1"
+
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 1 changesets, 1 total revisions
+
+  $ chmod -r .hg/store/data/a.i
+
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  abort: Permission denied: * (glob)
+  [255]
+
+  $ chmod +r .hg/store/data/a.i
+
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 1 changesets, 1 total revisions
+
+  $ chmod -w .hg/store/data/a.i
+
+  $ echo barber > a
+  $ hg commit -m "2"
+  trouble committing a!
+  abort: Permission denied: * (glob)
+  [255]
+
+  $ chmod -w .
+
+  $ hg diff --nodates
+  diff -r 2a18120dc1c9 a
+  --- a/a
+  +++ b/a
+  @@ -1,1 +1,1 @@
+  -foo
+  +barber
+
+  $ chmod +w .
+
+  $ chmod +w .hg/store/data/a.i
+  $ mkdir dir
+  $ touch dir/a
+  $ hg status
+  M a
+  ? dir/a
+  $ chmod -rx dir
+  $ hg status
+  dir: Permission denied
+  M a
+
+Reenable perm to allow deletion:
+
+  $ chmod +rx dir
+
--- a/tests/test-pull	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-#!/bin/sh
-
-mkdir test
-cd test
-echo foo>foo
-hg init
-hg addremove
-hg commit -m 1
-hg verify
-hg serve -p $HGPORT -d --pid-file=hg.pid
-cat hg.pid >> $DAEMON_PIDS
-cd ..
-
-hg clone --pull http://foo:bar@localhost:$HGPORT/ copy | sed -e "s,:$HGPORT/,:\$HGPORT/,"
-cd copy
-hg verify
-hg co
-cat foo
-hg manifest --debug
-hg pull | sed -e "s,:$HGPORT/,:\$HGPORT/,"
-hg rollback --dry-run --verbose | sed -e "s,:$HGPORT/,:\$HGPORT/,"
-
-echo % issue 622
-cd ..
-hg init empty
-cd empty
-hg pull -u ../test
-
-echo % test file: uri handling
-hg pull -q file://../test-doesnt-exist 2>&1 \
-    | sed 's%abort: repository.*/test-doesnt-exist%abort: repository /test-doesnt-exist%'
-hg pull -q file:../test
-# It's tricky to make file:// URLs working on every platforms
-# with regular shell commands.
-URL=`python -c "import os; print 'file://foobar' + ('/' + os.getcwd().replace(os.sep, '/')).replace('//', '/') + '/../test'"`
-hg pull -q "$URL"
--- a/tests/test-pull-branch	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-#!/bin/sh
-
-hg init t
-cd t
-echo 1 > foo
-hg ci -Am1 # 0
-hg branch branchA
-echo a1 > foo
-hg ci -ma1 # 1
-
-cd ..
-hg init tt
-cd tt
-hg pull ../t
-hg up branchA
-
-cd ../t
-echo a2 > foo
-hg ci -ma2 # 2
-echo % create branch B
-hg up 0
-hg branch branchB
-echo b1 > foo
-hg ci -mb1 # 3
-
-cd ../tt
-echo % a new branch is there
-hg pull -u ../t
-
-echo % develop both branch
-cd ../t
-hg up branchA
-echo a3 > foo
-hg ci -ma3 # 4
-hg up branchB
-echo b2 > foo
-hg ci -mb2 # 5
-
-cd ../tt
-echo % should succeed, no new heads
-hg pull -u ../t
-
-echo % add an head on other branch
-cd ../t
-hg up branchA
-echo a4 > foo
-hg ci -ma4 # 6
-hg up branchB
-echo b3.1 > foo
-hg ci -m b3.1 # 7
-hg up 5
-echo b3.2 > foo
-hg ci -m b3.2 # 8
-
-cd ../tt
-echo % should succeed only one head on our branch
-hg pull -u ../t
-
-cd ../t
-hg up -C branchA
-echo a5.1 > foo
-hg ci -ma5.1 # 9
-hg up 6
-echo a5.2 > foo
-hg ci -ma5.2 # 10
-hg up 7
-echo b4.1 > foo
-hg ci -m b4.1 # 11
-hg up -C 8
-echo b4.2 > foo
-hg ci -m b4.2 # 12
-
-cd ../tt
-echo % should fail new head in our branch
-hg pull -u ../t
--- a/tests/test-pull-branch.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-adding foo
-marked working directory as branch branchA
-pulling from ../t
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 2 changes to 1 files
-(run 'hg update' to get a working copy)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% create branch B
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-marked working directory as branch branchB
-% a new branch is there
-pulling from ../t
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 2 changes to 1 files (+1 heads)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% develop both branch
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% should succeed, no new heads
-pulling from ../t
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 2 changes to 1 files
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% add an head on other branch
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-% should succeed only one head on our branch
-pulling from ../t
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 3 changesets with 3 changes to 1 files (+1 heads)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% should fail new head in our branch
-pulling from ../t
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 4 changesets with 4 changes to 1 files (+1 heads)
-not updating, since new heads added
-(run 'hg heads' to see heads, 'hg merge' to merge)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-pull-branch.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,136 @@
+  $ hg init t
+  $ cd t
+  $ echo 1 > foo
+  $ hg ci -Am1 # 0
+  adding foo
+  $ hg branch branchA
+  marked working directory as branch branchA
+  $ echo a1 > foo
+  $ hg ci -ma1 # 1
+
+  $ cd ..
+  $ hg init tt
+  $ cd tt
+  $ hg pull ../t
+  pulling from ../t
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 1 files
+  (run 'hg update' to get a working copy)
+  $ hg up branchA
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ cd ../t
+  $ echo a2 > foo
+  $ hg ci -ma2 # 2
+
+Create branch B:
+
+  $ hg up 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg branch branchB
+  marked working directory as branch branchB
+  $ echo b1 > foo
+  $ hg ci -mb1 # 3
+
+  $ cd ../tt
+
+A new branch is there
+
+  $ hg pull -u ../t
+  pulling from ../t
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 1 files (+1 heads)
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+Develop both branches:
+
+  $ cd ../t
+  $ hg up branchA
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo a3 > foo
+  $ hg ci -ma3 # 4
+  $ hg up branchB
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo b2 > foo
+  $ hg ci -mb2 # 5
+
+  $ cd ../tt
+
+Should succeed, no new heads:
+
+  $ hg pull -u ../t
+  pulling from ../t
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 1 files
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+Add a head on other branch:
+
+  $ cd ../t
+  $ hg up branchA
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo a4 > foo
+  $ hg ci -ma4 # 6
+  $ hg up branchB
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo b3.1 > foo
+  $ hg ci -m b3.1 # 7
+  $ hg up 5
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo b3.2 > foo
+  $ hg ci -m b3.2 # 8
+  created new head
+
+  $ cd ../tt
+
+Should succeed because there is only one head on our branch:
+
+  $ hg pull -u ../t
+  pulling from ../t
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 3 changesets with 3 changes to 1 files (+1 heads)
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ cd ../t
+  $ hg up -C branchA
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo a5.1 > foo
+  $ hg ci -ma5.1 # 9
+  $ hg up 6
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo a5.2 > foo
+  $ hg ci -ma5.2 # 10
+  created new head
+  $ hg up 7
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo b4.1 > foo
+  $ hg ci -m b4.1 # 11
+  $ hg up -C 8
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo b4.2 > foo
+  $ hg ci -m b4.2 # 12
+
+  $ cd ../tt
+
+  $ hg pull -u ../t
+  pulling from ../t
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 4 changesets with 4 changes to 1 files (+1 heads)
+  not updating, since new heads added
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+
--- a/tests/test-pull-permission	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-#!/bin/sh
-
-mkdir a
-cd a
-hg init
-echo foo > b
-hg add b
-hg ci -m "b" -d "1000000 0"
-
-chmod -w .hg/store
-
-cd ..
-
-hg clone a b
-
-chmod +w a/.hg/store # let test clean up
-
-cd b
-hg verify
--- a/tests/test-pull-permission.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 1 changesets, 1 total revisions
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-pull-permission.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,30 @@
+  $ mkdir a
+  $ cd a
+  $ hg init
+  $ echo foo > b
+  $ hg add b
+  $ hg ci -m "b"
+
+  $ chmod -w .hg/store
+
+  $ cd ..
+
+  $ hg clone a b
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ chmod +w a/.hg/store # let test clean up
+
+  $ cd b
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 1 changesets, 1 total revisions
+
--- a/tests/test-pull-r	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-#!/bin/sh
-
-hg init repo
-cd repo
-echo foo > foo
-hg ci -qAm 'add foo'
-echo >> foo
-hg ci -m 'change foo'
-hg up -qC 0
-echo bar > bar
-hg ci -qAm 'add bar'
-hg log
-cd ..
-hg init copy
-cd copy
-
-echo '% pull a missing revision'
-hg pull -qr missing ../repo
-
-echo '% pull multiple revisions with update'
-hg pull -qu -r 0 -r 1 ../repo
-hg -q parents
-hg rollback
-
-echo '% pull -r 0'
-hg pull -qr 0 ../repo
-hg log
-
-echo '% pull -r 1'
-hg pull -qr 1 ../repo
-hg log
-
-# this used to abort: received changelog group is empty
-echo '% pull -r 1 again'
-hg pull -qr 1 ../repo
--- a/tests/test-pull-r.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-changeset:   2:effea6de0384
-tag:         tip
-parent:      0:bbd179dfa0a7
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     add bar
-
-changeset:   1:ed1b79f46b9a
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     change foo
-
-changeset:   0:bbd179dfa0a7
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     add foo
-
-% pull a missing revision
-abort: unknown revision 'missing'!
-% pull multiple revisions with update
-0:bbd179dfa0a7
-rolling back to revision -1 (undo pull)
-% pull -r 0
-changeset:   0:bbd179dfa0a7
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     add foo
-
-% pull -r 1
-changeset:   1:ed1b79f46b9a
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     change foo
-
-changeset:   0:bbd179dfa0a7
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     add foo
-
-% pull -r 1 again
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-pull-r.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,72 @@
+  $ hg init repo
+  $ cd repo
+  $ echo foo > foo
+  $ hg ci -qAm 'add foo'
+  $ echo >> foo
+  $ hg ci -m 'change foo'
+  $ hg up -qC 0
+  $ echo bar > bar
+  $ hg ci -qAm 'add bar'
+
+  $ hg log
+  changeset:   2:effea6de0384
+  tag:         tip
+  parent:      0:bbd179dfa0a7
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add bar
+  
+  changeset:   1:ed1b79f46b9a
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     change foo
+  
+  changeset:   0:bbd179dfa0a7
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add foo
+  
+  $ cd ..
+  $ hg init copy
+  $ cd copy
+
+Pull a missing revision:
+
+  $ hg pull -qr missing ../repo
+  abort: unknown revision 'missing'!
+  [255]
+
+Pull multiple revisions with update:
+
+  $ hg pull -qu -r 0 -r 1 ../repo
+  $ hg -q parents
+  0:bbd179dfa0a7
+  $ hg rollback
+  rolling back to revision -1 (undo pull)
+
+  $ hg pull -qr 0 ../repo
+  $ hg log
+  changeset:   0:bbd179dfa0a7
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add foo
+  
+  $ hg pull -qr 1 ../repo
+  $ hg log
+  changeset:   1:ed1b79f46b9a
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     change foo
+  
+  changeset:   0:bbd179dfa0a7
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add foo
+  
+
+This used to abort: received changelog group is empty:
+
+  $ hg pull -qr 1 ../repo
+
--- a/tests/test-pull-update	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-#!/bin/sh
-#
-
-hg init t
-cd t
-echo 1 > foo
-hg ci -Am m
-
-cd ..
-hg clone t tt
-cd tt
-echo 1.1 > foo
-hg ci -Am m
-
-cd ../t
-echo 1.2 > foo
-hg ci -Am m
-echo % should fail
-hg pull -u ../tt
-
-cd ../tt
-echo % should fail
-hg pull -u ../t
-HGMERGE=true hg merge
-hg ci -mm
-
-cd ../t
-echo % should work
-hg pull -u ../tt
--- a/tests/test-pull-update.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-adding foo
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% should fail
-pulling from ../tt
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files (+1 heads)
-not updating, since new heads added
-(run 'hg heads' to see heads, 'hg merge' to merge)
-% should fail
-pulling from ../t
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files (+1 heads)
-not updating, since new heads added
-(run 'hg heads' to see heads, 'hg merge' to merge)
-merging foo
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-% should work
-pulling from ../tt
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files (-1 heads)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-pull-update.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,63 @@
+  $ hg init t
+  $ cd t
+  $ echo 1 > foo
+  $ hg ci -Am m
+  adding foo
+
+  $ cd ..
+  $ hg clone t tt
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd tt
+  $ echo 1.1 > foo
+  $ hg ci -Am m
+
+  $ cd ../t
+  $ echo 1.2 > foo
+  $ hg ci -Am m
+
+Should not update:
+
+  $ hg pull -u ../tt
+  pulling from ../tt
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files (+1 heads)
+  not updating, since new heads added
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+
+  $ cd ../tt
+
+Should not update:
+
+  $ hg pull -u ../t
+  pulling from ../t
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files (+1 heads)
+  not updating, since new heads added
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+
+  $ HGMERGE=true hg merge
+  merging foo
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg ci -mm
+
+  $ cd ../t
+
+Should work:
+
+  $ hg pull -u ../tt
+  pulling from ../tt
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files (-1 heads)
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
--- a/tests/test-pull.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-adding foo
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 1 changesets, 1 total revisions
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 1 changesets, 1 total revisions
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-foo
-2ed2a3912a0b24502043eae84ee4b279c18b90dd 644   foo
-pulling from http://foo:***@localhost:$HGPORT/
-searching for changes
-no changes found
-rolling back to revision -1 (undo pull: http://foo:***@localhost:$HGPORT/)
-% issue 622
-pulling from ../test
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% test file: uri handling
-abort: repository /test-doesnt-exist not found!
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-pull.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,81 @@
+  $ mkdir test
+  $ cd test
+
+  $ echo foo>foo
+  $ hg init
+  $ hg addremove
+  adding foo
+  $ hg commit -m 1
+
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 1 changesets, 1 total revisions
+
+  $ hg serve -p $HGPORT -d --pid-file=hg.pid
+  $ cat hg.pid >> $DAEMON_PIDS
+  $ cd ..
+
+  $ hg clone --pull http://foo:bar@localhost:$HGPORT/ copy
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ cd copy
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 1 changesets, 1 total revisions
+
+  $ hg co
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cat foo
+  foo
+
+  $ hg manifest --debug
+  2ed2a3912a0b24502043eae84ee4b279c18b90dd 644   foo
+
+  $ hg pull
+  pulling from http://foo:\*\*\*@localhost:.*/ (re)
+  searching for changes
+  no changes found
+
+  $ hg rollback --dry-run --verbose
+  rolling back to revision -1 \(undo pull: http://foo:\*\*\*@localhost:.*/\) (re)
+
+Issue 622:
+
+  $ cd ..
+  $ hg init empty
+  $ cd empty
+  $ hg pull -u ../test
+  pulling from ../test
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+Test 'file:' uri handling:
+
+  $ hg pull -q file://../test-doesnt-exist
+  abort: repository /test-doesnt-exist not found!
+  [255]
+
+  $ hg pull -q file:../test
+
+It's tricky to make file:// URLs working on every platform with
+regular shell commands.
+
+  $ URL=`python -c "import os; print 'file://foobar' + ('/' + os.getcwd().replace(os.sep, '/')).replace('//', '/') + '/../test'"`
+  $ hg pull -q "$URL"
+
--- a/tests/test-purge	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,138 +0,0 @@
-#!/bin/sh
-
-cat <<EOF >> $HGRCPATH
-[extensions]
-purge =
-EOF
-
-echo % init
-hg init t
-cd t
-
-echo % setup
-echo r1 > r1
-hg ci -qAmr1 -d'0 0'
-mkdir directory
-echo r2 > directory/r2
-hg ci -qAmr2 -d'1 0'
-echo 'ignored' > .hgignore
-hg ci -qAmr3 -d'2 0'
-
-echo % delete an empty directory
-mkdir empty_dir
-hg purge -p
-hg purge -v
-ls
-
-echo % delete an untracked directory
-mkdir untracked_dir
-touch untracked_dir/untracked_file1
-touch untracked_dir/untracked_file2
-hg purge -p
-hg purge -v
-ls
-
-echo % delete an untracked file
-touch untracked_file
-touch untracked_file_readonly
-python <<EOF
-import os, stat
-f= 'untracked_file_readonly'
-os.chmod(f, stat.S_IMODE(os.stat(f).st_mode) & ~stat.S_IWRITE)
-EOF
-hg purge -p
-hg purge -v
-ls
-
-echo % delete an untracked file in a tracked directory
-touch directory/untracked_file
-hg purge -p
-hg purge -v
-ls
-
-echo % delete nested directories
-mkdir -p untracked_directory/nested_directory
-hg purge -p
-hg purge -v
-ls
-
-echo % delete nested directories from a subdir
-mkdir -p untracked_directory/nested_directory
-cd directory
-hg purge -p
-hg purge -v
-cd ..
-ls
-
-echo % delete only part of the tree
-mkdir -p untracked_directory/nested_directory
-touch directory/untracked_file
-cd directory
-hg purge -p ../untracked_directory
-hg purge -v ../untracked_directory
-cd ..
-ls
-ls directory/untracked_file
-rm directory/untracked_file
-
-echo % skip ignored files if --all not specified
-touch ignored
-hg purge -p
-hg purge -v
-ls
-hg purge -p --all
-hg purge -v --all
-ls
-
-echo % abort with missing files until we support name mangling filesystems
-touch untracked_file
-rm r1
-# hide error messages to avoid changing the output when the text changes
-hg purge -p 2> /dev/null
-hg st
-
-hg purge -p
-hg purge -v 2> /dev/null
-hg st
-
-hg purge -v
-hg revert --all --quiet
-hg st -a
-
-echo '% tracked file in ignored directory (issue621)'
-echo directory >> .hgignore
-hg ci -m 'ignore directory'
-touch untracked_file
-hg purge -p
-hg purge -v
-
-echo % skip excluded files
-touch excluded_file
-hg purge -p -X excluded_file
-hg purge -v -X excluded_file
-ls
-rm excluded_file
-
-echo % skip files in excluded dirs
-mkdir excluded_dir
-touch excluded_dir/file
-hg purge -p -X excluded_dir
-hg purge -v -X excluded_dir
-ls
-ls excluded_dir
-rm -R excluded_dir
-
-echo % skip excluded empty dirs
-mkdir excluded_dir
-hg purge -p -X excluded_dir
-hg purge -v -X excluded_dir
-ls
-rmdir excluded_dir
-
-echo % skip patterns
-mkdir .svn
-touch .svn/foo
-mkdir directory/.svn
-touch directory/.svn/foo
-hg purge -p -X .svn -X '*/.svn'
-hg purge -p -X re:.*.svn
--- a/tests/test-purge.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-% init
-% setup
-% delete an empty directory
-empty_dir
-Removing directory empty_dir
-directory
-r1
-% delete an untracked directory
-untracked_dir/untracked_file1
-untracked_dir/untracked_file2
-Removing file untracked_dir/untracked_file1
-Removing file untracked_dir/untracked_file2
-Removing directory untracked_dir
-directory
-r1
-% delete an untracked file
-untracked_file
-untracked_file_readonly
-Removing file untracked_file
-Removing file untracked_file_readonly
-directory
-r1
-% delete an untracked file in a tracked directory
-directory/untracked_file
-Removing file directory/untracked_file
-directory
-r1
-% delete nested directories
-untracked_directory/nested_directory
-Removing directory untracked_directory/nested_directory
-Removing directory untracked_directory
-directory
-r1
-% delete nested directories from a subdir
-untracked_directory/nested_directory
-Removing directory untracked_directory/nested_directory
-Removing directory untracked_directory
-directory
-r1
-% delete only part of the tree
-untracked_directory/nested_directory
-Removing directory untracked_directory/nested_directory
-Removing directory untracked_directory
-directory
-r1
-directory/untracked_file
-% skip ignored files if --all not specified
-directory
-ignored
-r1
-ignored
-Removing file ignored
-directory
-r1
-% abort with missing files until we support name mangling filesystems
-untracked_file
-! r1
-? untracked_file
-untracked_file
-Removing file untracked_file
-! r1
-% tracked file in ignored directory (issue621)
-untracked_file
-Removing file untracked_file
-% skip excluded files
-directory
-excluded_file
-r1
-% skip files in excluded dirs
-directory
-excluded_dir
-r1
-file
-% skip excluded empty dirs
-directory
-excluded_dir
-r1
-% skip patterns
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-purge.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,216 @@
+  $ cat <<EOF >> $HGRCPATH
+  > [extensions]
+  > purge =
+  > EOF
+
+init
+
+  $ hg init t
+  $ cd t
+
+setup
+
+  $ echo r1 > r1
+  $ hg ci -qAmr1 -d'0 0'
+  $ mkdir directory
+  $ echo r2 > directory/r2
+  $ hg ci -qAmr2 -d'1 0'
+  $ echo 'ignored' > .hgignore
+  $ hg ci -qAmr3 -d'2 0'
+
+delete an empty directory
+
+  $ mkdir empty_dir
+  $ hg purge -p
+  empty_dir
+  $ hg purge -v
+  Removing directory empty_dir
+  $ ls
+  directory
+  r1
+
+delete an untracked directory
+
+  $ mkdir untracked_dir
+  $ touch untracked_dir/untracked_file1
+  $ touch untracked_dir/untracked_file2
+  $ hg purge -p
+  untracked_dir/untracked_file1
+  untracked_dir/untracked_file2
+  $ hg purge -v
+  Removing file untracked_dir/untracked_file1
+  Removing file untracked_dir/untracked_file2
+  Removing directory untracked_dir
+  $ ls
+  directory
+  r1
+
+delete an untracked file
+
+  $ touch untracked_file
+  $ touch untracked_file_readonly
+  $ python <<EOF
+  > import os, stat
+  > f= 'untracked_file_readonly'
+  > os.chmod(f, stat.S_IMODE(os.stat(f).st_mode) & ~stat.S_IWRITE)
+  > EOF
+  $ hg purge -p
+  untracked_file
+  untracked_file_readonly
+  $ hg purge -v
+  Removing file untracked_file
+  Removing file untracked_file_readonly
+  $ ls
+  directory
+  r1
+
+delete an untracked file in a tracked directory
+
+  $ touch directory/untracked_file
+  $ hg purge -p
+  directory/untracked_file
+  $ hg purge -v
+  Removing file directory/untracked_file
+  $ ls
+  directory
+  r1
+
+delete nested directories
+
+  $ mkdir -p untracked_directory/nested_directory
+  $ hg purge -p
+  untracked_directory/nested_directory
+  $ hg purge -v
+  Removing directory untracked_directory/nested_directory
+  Removing directory untracked_directory
+  $ ls
+  directory
+  r1
+
+delete nested directories from a subdir
+
+  $ mkdir -p untracked_directory/nested_directory
+  $ cd directory
+  $ hg purge -p
+  untracked_directory/nested_directory
+  $ hg purge -v
+  Removing directory untracked_directory/nested_directory
+  Removing directory untracked_directory
+  $ cd ..
+  $ ls
+  directory
+  r1
+
+delete only part of the tree
+
+  $ mkdir -p untracked_directory/nested_directory
+  $ touch directory/untracked_file
+  $ cd directory
+  $ hg purge -p ../untracked_directory
+  untracked_directory/nested_directory
+  $ hg purge -v ../untracked_directory
+  Removing directory untracked_directory/nested_directory
+  Removing directory untracked_directory
+  $ cd ..
+  $ ls
+  directory
+  r1
+  $ ls directory/untracked_file
+  directory/untracked_file
+  $ rm directory/untracked_file
+
+skip ignored files if --all not specified
+
+  $ touch ignored
+  $ hg purge -p
+  $ hg purge -v
+  $ ls
+  directory
+  ignored
+  r1
+  $ hg purge -p --all
+  ignored
+  $ hg purge -v --all
+  Removing file ignored
+  $ ls
+  directory
+  r1
+
+abort with missing files until we support name mangling filesystems
+
+  $ touch untracked_file
+  $ rm r1
+
+hide error messages to avoid changing the output when the text changes
+
+  $ hg purge -p 2> /dev/null
+  untracked_file
+  $ hg st
+  ! r1
+  ? untracked_file
+
+  $ hg purge -p
+  untracked_file
+  $ hg purge -v 2> /dev/null
+  Removing file untracked_file
+  $ hg st
+  ! r1
+
+  $ hg purge -v
+  $ hg revert --all --quiet
+  $ hg st -a
+
+tracked file in ignored directory (issue621)
+
+  $ echo directory >> .hgignore
+  $ hg ci -m 'ignore directory'
+  $ touch untracked_file
+  $ hg purge -p
+  untracked_file
+  $ hg purge -v
+  Removing file untracked_file
+
+skip excluded files
+
+  $ touch excluded_file
+  $ hg purge -p -X excluded_file
+  $ hg purge -v -X excluded_file
+  $ ls
+  directory
+  excluded_file
+  r1
+  $ rm excluded_file
+
+skip files in excluded dirs
+
+  $ mkdir excluded_dir
+  $ touch excluded_dir/file
+  $ hg purge -p -X excluded_dir
+  $ hg purge -v -X excluded_dir
+  $ ls
+  directory
+  excluded_dir
+  r1
+  $ ls excluded_dir
+  file
+  $ rm -R excluded_dir
+
+skip excluded empty dirs
+
+  $ mkdir excluded_dir
+  $ hg purge -p -X excluded_dir
+  $ hg purge -v -X excluded_dir
+  $ ls
+  directory
+  excluded_dir
+  r1
+  $ rmdir excluded_dir
+
+skip patterns
+
+  $ mkdir .svn
+  $ touch .svn/foo
+  $ mkdir directory/.svn
+  $ touch directory/.svn/foo
+  $ hg purge -p -X .svn -X '*/.svn'
+  $ hg purge -p -X re:.*.svn
--- a/tests/test-push-hook-lock	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-#!/bin/sh
-hg init 1
-echo '[ui]' >> 1/.hg/hgrc
-echo 'timeout = 10' >> 1/.hg/hgrc
-echo foo > 1/foo
-hg --cwd 1 ci -A -m foo
-hg clone 1 2
-hg clone 2 3
-echo '[hooks]' >> 2/.hg/hgrc
-echo 'changegroup.push = hg push -qf ../1' >> 2/.hg/hgrc
-echo bar >> 3/foo
-hg --cwd 3 ci -m bar
-hg --cwd 3 push ../2
--- a/tests/test-push-hook-lock.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-adding foo
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-pushing to ../2
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-push-hook-lock.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,31 @@
+  $ hg init 1
+
+  $ echo '[ui]' >> 1/.hg/hgrc
+  $ echo 'timeout = 10' >> 1/.hg/hgrc
+
+  $ echo foo > 1/foo
+  $ hg --cwd 1 ci -A -m foo
+  adding foo
+
+  $ hg clone 1 2
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ hg clone 2 3
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ echo '[hooks]' >> 2/.hg/hgrc
+  $ echo 'changegroup.push = hg push -qf ../1' >> 2/.hg/hgrc
+
+  $ echo bar >> 3/foo
+  $ hg --cwd 3 ci -m bar
+
+  $ hg --cwd 3 push ../2
+  pushing to ../2
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+
--- a/tests/test-push-r	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-#!/bin/sh
-
-hg init test
-cd test
-cat >>afile <<EOF
-0
-EOF
-hg add afile
-hg commit -m "0.0"
-cat >>afile <<EOF
-1
-EOF
-hg commit -m "0.1"
-cat >>afile <<EOF
-2
-EOF
-hg commit -m "0.2"
-cat >>afile <<EOF
-3
-EOF
-hg commit -m "0.3"
-hg update -C 0
-cat >>afile <<EOF
-1
-EOF
-hg commit -m "1.1"
-cat >>afile <<EOF
-2
-EOF
-hg commit -m "1.2"
-cat >fred <<EOF
-a line
-EOF
-cat >>afile <<EOF
-3
-EOF
-hg add fred
-hg commit -m "1.3"
-hg mv afile adifferentfile
-hg commit -m "1.3m"
-hg update -C 3
-hg mv afile anotherfile
-hg commit -m "0.3m"
-hg debugindex .hg/store/data/afile.i
-hg debugindex .hg/store/data/adifferentfile.i
-hg debugindex .hg/store/data/anotherfile.i
-hg debugindex .hg/store/data/fred.i
-hg debugindex .hg/store/00manifest.i
-hg verify
-cd ..
-for i in 0 1 2 3 4 5 6 7 8; do
-   mkdir test-"$i"
-   hg --cwd test-"$i" init
-   hg -R test push -r "$i" test-"$i"
-   cd test-"$i"
-   hg verify
-   cd ..
-done
-cd test-8
-hg pull ../test-7
-hg verify
--- a/tests/test-push-r.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,138 +0,0 @@
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-1 files updated, 0 files merged, 2 files removed, 0 files unresolved
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0       3      0       0 362fef284ce2 000000000000 000000000000
-     1         3       5      1       1 125144f7e028 362fef284ce2 000000000000
-     2         8       7      2       2 4c982badb186 125144f7e028 000000000000
-     3        15       9      3       3 19b1fc555737 4c982badb186 000000000000
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0      75      0       7 2565f3199a74 000000000000 000000000000
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0      75      0       8 2565f3199a74 000000000000 000000000000
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0       8      0       6 12ab3bcc5ea4 000000000000 000000000000
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0      48      0       0 43eadb1d2d06 000000000000 000000000000
-     1        48      48      1       1 8b89697eba2c 43eadb1d2d06 000000000000
-     2        96      48      2       2 626a32663c2f 8b89697eba2c 000000000000
-     3       144      48      3       3 f54c32f13478 626a32663c2f 000000000000
-     4       192      58      3       6 de68e904d169 626a32663c2f 000000000000
-     5       250      68      3       7 09bb521d218d de68e904d169 000000000000
-     6       318      54      6       8 1fde233dfb0f f54c32f13478 000000000000
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-4 files, 9 changesets, 7 total revisions
-pushing to test-0
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 1 changesets, 1 total revisions
-pushing to test-1
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 2 changes to 1 files
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 2 changesets, 2 total revisions
-pushing to test-2
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 3 changesets with 3 changes to 1 files
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 3 changesets, 3 total revisions
-pushing to test-3
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 4 changesets with 4 changes to 1 files
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 4 changesets, 4 total revisions
-pushing to test-4
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 2 changes to 1 files
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 2 changesets, 2 total revisions
-pushing to test-5
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 3 changesets with 3 changes to 1 files
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 3 changesets, 3 total revisions
-pushing to test-6
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 4 changesets with 5 changes to 2 files
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-2 files, 4 changesets, 5 total revisions
-pushing to test-7
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 5 changesets with 6 changes to 3 files
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-3 files, 5 changesets, 6 total revisions
-pushing to test-8
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 5 changesets with 5 changes to 2 files
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-2 files, 5 changesets, 5 total revisions
-pulling from ../test-7
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 4 changesets with 2 changes to 3 files (+1 heads)
-(run 'hg heads' to see heads, 'hg merge' to merge)
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-4 files, 9 changesets, 7 total revisions
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-push-r.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,230 @@
+  $ hg init test
+  $ cd test
+
+  $ cat >>afile <<EOF
+  > 0
+  > EOF
+  $ hg add afile
+  $ hg commit -m "0.0"
+
+  $ cat >>afile <<EOF
+  > 1
+  > EOF
+  $ hg commit -m "0.1"
+
+  $ cat >>afile <<EOF
+  > 2
+  > EOF
+  $ hg commit -m "0.2"
+
+  $ cat >>afile <<EOF
+  > 3
+  > EOF
+  $ hg commit -m "0.3"
+
+  $ hg update -C 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ cat >>afile <<EOF
+  > 1
+  > EOF
+  $ hg commit -m "1.1"
+  created new head
+
+  $ cat >>afile <<EOF
+  > 2
+  > EOF
+  $ hg commit -m "1.2"
+
+  $ cat >fred <<EOF
+  > a line
+  > EOF
+  $ cat >>afile <<EOF
+  > 3
+  > EOF
+  $ hg add fred
+  $ hg commit -m "1.3"
+
+  $ hg mv afile adifferentfile
+  $ hg commit -m "1.3m"
+
+  $ hg update -C 3
+  1 files updated, 0 files merged, 2 files removed, 0 files unresolved
+
+  $ hg mv afile anotherfile
+  $ hg commit -m "0.3m"
+
+  $ hg debugindex .hg/store/data/afile.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0       3      0       0 362fef284ce2 000000000000 000000000000
+       1         3       5      1       1 125144f7e028 362fef284ce2 000000000000
+       2         8       7      2       2 4c982badb186 125144f7e028 000000000000
+       3        15       9      3       3 19b1fc555737 4c982badb186 000000000000
+
+  $ hg debugindex .hg/store/data/adifferentfile.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0      75      0       7 2565f3199a74 000000000000 000000000000
+
+  $ hg debugindex .hg/store/data/anotherfile.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0      75      0       8 2565f3199a74 000000000000 000000000000
+
+  $ hg debugindex .hg/store/data/fred.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0       8      0       6 12ab3bcc5ea4 000000000000 000000000000
+
+  $ hg debugindex .hg/store/00manifest.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0      48      0       0 43eadb1d2d06 000000000000 000000000000
+       1        48      48      1       1 8b89697eba2c 43eadb1d2d06 000000000000
+       2        96      48      2       2 626a32663c2f 8b89697eba2c 000000000000
+       3       144      48      3       3 f54c32f13478 626a32663c2f 000000000000
+       4       192      58      3       6 de68e904d169 626a32663c2f 000000000000
+       5       250      68      3       7 09bb521d218d de68e904d169 000000000000
+       6       318      54      6       8 1fde233dfb0f f54c32f13478 000000000000
+
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  4 files, 9 changesets, 7 total revisions
+
+  $ cd ..
+
+  $ for i in 0 1 2 3 4 5 6 7 8; do
+  >    echo
+  >    mkdir test-"$i"
+  >    hg --cwd test-"$i" init
+  >    hg -R test push -r "$i" test-"$i"
+  >    cd test-"$i"
+  >    hg verify
+  >    cd ..
+  > done
+  
+  pushing to test-0
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 1 changesets, 1 total revisions
+  
+  pushing to test-1
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 1 files
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 2 changesets, 2 total revisions
+  
+  pushing to test-2
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 3 changesets with 3 changes to 1 files
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 3 changesets, 3 total revisions
+  
+  pushing to test-3
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 4 changesets with 4 changes to 1 files
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 4 changesets, 4 total revisions
+  
+  pushing to test-4
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 1 files
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 2 changesets, 2 total revisions
+  
+  pushing to test-5
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 3 changesets with 3 changes to 1 files
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 3 changesets, 3 total revisions
+  
+  pushing to test-6
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 4 changesets with 5 changes to 2 files
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  2 files, 4 changesets, 5 total revisions
+  
+  pushing to test-7
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 5 changesets with 6 changes to 3 files
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  3 files, 5 changesets, 6 total revisions
+  
+  pushing to test-8
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 5 changesets with 5 changes to 2 files
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  2 files, 5 changesets, 5 total revisions
+
+  $ cd test-8
+
+  $ hg pull ../test-7
+  pulling from ../test-7
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 4 changesets with 2 changes to 3 files (+1 heads)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  4 files, 9 changesets, 7 total revisions
+
--- a/tests/test-push-validation	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-#!/bin/sh
-
-hg init test
-cd test
-cat > .hg/hgrc <<EOF
-[server]
-validate=1
-EOF
-echo alpha > alpha
-echo beta > beta
-hg addr
-hg ci -m 1
-
-cd ..
-hg clone test test-clone
-
-cd test-clone
-cp .hg/store/data/beta.i tmp
-echo blah >> beta
-hg ci -m '2 (corrupt)'
-mv tmp .hg/store/data/beta.i
-hg push 2>&1 | "$TESTDIR/filtertmp.py"
--- a/tests/test-push-validation.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-adding alpha
-adding beta
-updating to branch default
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-pushing to $HGTMP/test-push-validation/test
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-transaction abort!
-rollback completed
-abort: missing file data for beta:dddc47b3ba30e54484720ce0f4f768a0f4b6efb9 - run hg verify
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-push-validation.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,52 @@
+  $ hg init test
+  $ cd test
+
+  $ cat > .hg/hgrc <<EOF
+  > [server]
+  > validate=1
+  > EOF
+
+  $ echo alpha > alpha
+  $ echo beta > beta
+  $ hg addr
+  adding alpha
+  adding beta
+  $ hg ci -m 1
+
+  $ cd ..
+  $ hg clone test test-clone
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ cd test-clone
+  $ cp .hg/store/data/beta.i tmp
+  $ echo blah >> beta
+  $ hg ci -m '2 (corrupt)'
+  $ mv tmp .hg/store/data/beta.i
+
+Expected to fail:
+
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+   beta@1: dddc47b3ba30 in manifests not found
+  2 files, 2 changesets, 2 total revisions
+  1 integrity errors encountered!
+  (first damaged changeset appears to be 1)
+  [1]
+
+Expected to fail:
+
+  $ hg push
+  pushing to * (glob)
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  transaction abort!
+  rollback completed
+  abort: missing file data for beta:dddc47b3ba30e54484720ce0f4f768a0f4b6efb9 - run hg verify
+  [255]
+
--- a/tests/test-push-warn	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,317 +0,0 @@
-#!/bin/sh
-
-echo "[extensions]" >> $HGRCPATH
-echo "graphlog=" >> $HGRCPATH
-
-mkdir a
-cd a
-hg init
-echo foo > t1
-hg add t1
-hg commit -m "1" -d "1000000 0"
-
-cd ..
-hg clone a b
-
-cd a
-echo foo > t2
-hg add t2
-hg commit -m "2" -d "1000000 0"
-
-cd ../b
-echo foo > t3
-hg add t3
-hg commit -m "3" -d "1000000 0"
-
-hg push ../a
-hg pull ../a
-hg push ../a
-hg merge
-hg commit -m "4" -d "1000000 0"
-hg push ../a
-cd ..
-
-hg init c
-cd c
-for i in 0 1 2; do
-    echo $i >> foo
-    hg ci -Am $i -d "1000000 0"
-done
-cd ..
-
-hg clone c d
-cd d
-for i in 0 1; do
-    hg co -C $i
-    echo d-$i >> foo
-    hg ci -m d-$i -d "1000000 0"
-done
-
-HGMERGE=true hg merge 3
-hg ci -m c-d -d "1000000 0"
-
-hg push ../c; echo $?
-hg push -r 2 ../c; echo $?
-hg push -r 3 ../c; echo $?
-hg push -r 3 -r 4 ../c; echo $?
-hg push -f -r 3 -r 4 ../c; echo $?
-hg push -r 5 ../c; echo $?
-hg in ../c
-
-echo % issue 450
-hg init ../e
-hg push -r 0 ../e ; echo $?
-hg push -r 1 ../e ; echo $?
-
-cd ..
-
-echo % issue 736
-hg init f
-cd f
-hg -q branch a
-echo 0 > foo
-hg -q ci -d "1000000 0" -Am 0
-echo 1 > foo
-hg -q ci -d "1000000 0" -m 1
-hg -q up 0
-echo 2 > foo
-hg -q ci -d "1000000 0" -m 2
-hg -q up 0
-hg -q branch b
-echo 3 > foo
-hg -q ci -d "1000000 0" -m 3
-cd ..
-
-hg -q clone f g
-cd g
-
-echo % push on existing branch and new branch
-hg -q up 1
-echo 4 > foo
-hg -q ci -d "1000000 0" -m 4
-hg -q up 0
-echo 5 > foo
-hg -q branch c
-hg -q ci -d "1000000 0" -m 5
-hg push ../f; echo $?
-hg push -r 4 -r 5 ../f; echo $?
-
-echo % multiple new branches
-hg -q branch d
-echo 6 > foo
-hg -q ci -d "1000000 0" -m 6
-hg push ../f; echo $?
-hg push -r 4 -r 6 ../f; echo $?
-cd ../g
-
-echo % fail on multiple head push
-hg -q up 1
-echo 7 > foo
-hg -q ci -d "1000000 0" -m 7
-hg push -r 4 -r 7 ../f; echo $?
-
-echo % push replacement head on existing branches
-hg -q up 3
-echo 8 > foo
-hg -q ci -d "1000000 0" -m 8
-hg push -r 7 -r 8 ../f; echo $?
-
-echo % merge of branch a to other branch b followed by unrelated push on branch a
-hg -q up 7
-HGMERGE=true hg -q merge 8
-hg -q ci -d "1000000 0" -m 9
-hg -q up 8
-echo 10 > foo
-hg -q ci -d "1000000 0" -m 10
-hg push -r 9 ../f; echo $?
-hg push -r 10 ../f; echo $?
-
-echo % cheating the counting algorithm
-hg -q up 9
-HGMERGE=true hg -q merge 2
-hg -q ci -d "1000000 0" -m 11
-hg -q up 1
-echo 12 > foo
-hg -q ci -d "1000000 0" -m 12
-hg push -r 11 -r 12 ../f; echo $?
-
-echo % failed push of new named branch
-echo 12 > foo
-hg -q ci -d "1000000 0" -m 12a
-hg -q up 11
-echo 13 > foo
-hg -q branch e
-hg -q ci -d "1000000 0" -m 13d
-hg push -r 12 -r 13 ../f; echo $?
-
-echo % using --new-branch to push new named branch
-hg push --new-branch -r 12 -r 13 ../f; echo $?
-
-echo % checking prepush logic does not allow silently pushing multiple new heads
-cd ..
-hg init h
-echo init > h/init
-hg -R h ci -Am init
-echo a > h/a
-hg -R h ci -Am a
-hg clone h i
-hg -R h up 0
-echo b > h/b
-hg -R h ci -Am b
-hg -R i up 0
-echo c > i/c
-hg -R i ci -Am c
-hg -R i push h
-echo
-
-echo % check prepush logic with merged branches
-hg init j
-hg -R j branch a
-echo init > j/foo
-hg -R j ci -Am init
-hg clone j k
-echo a1 > j/foo
-hg -R j ci -m a1
-hg -R k branch b
-echo b > k/foo
-hg -R k ci -m b
-hg -R k up 0
-hg -R k merge b
-hg -R k ci -m merge
-hg -R k push -r a j
-echo
-
-echo % prepush -r should not allow you to sneak in new heads
-hg init l
-cd l
-echo a >> foo
-hg -q add foo
-hg -q branch a
-hg -q ci -d '0 0' -ma
-hg -q up null
-echo a >> foo
-hg -q add foo
-hg -q branch b
-hg -q ci -d '0 0' -mb
-cd ..
-hg -q clone l m -u a
-cd m
-hg -q merge b
-hg -q ci -d '0 0' -mmb
-hg -q up 0
-echo a >> foo
-hg -q ci -ma2
-hg -q up 2
-echo a >> foo
-hg -q branch -f b
-hg -q ci -d '0 0' -mb2
-hg -q merge 3
-hg -q ci -d '0 0' -mma
-hg push ../l -b b
-cd ..
-
-echo % check prepush with new branch head on former topo non-head
-hg init n
-cd n
-hg branch A
-echo a >a
-hg ci -Ama
-hg branch B
-echo b >b
-hg ci -Amb
-# b is now branch head of B, and a topological head
-# a is now branch head of A, but not a topological head
-hg clone . inner
-cd inner
-hg up B
-echo b1 >b1
-hg ci -Amb1
-# in the clone b1 is now the head of B
-cd ..
-hg up 0
-echo a2 >a2
-hg ci -Ama2
-# a2 is now the new branch head of A, and a new topological head
-# it replaces a former inner branch head, so it should at most warn about A, not B
-echo %% glog of local
-hg glog --template "{rev}: {branches} {desc}\n"
-echo %% glog of remote
-hg glog -R inner --template "{rev}: {branches} {desc}\n"
-echo %% outgoing
-hg out inner --template "{rev}: {branches} {desc}\n"
-hg push inner
-cd ..
-
-echo % check prepush with new branch head on former topo head
-hg init o
-cd o
-hg branch A
-echo a >a
-hg ci -Ama
-hg branch B
-echo b >b
-hg ci -Amb
-# b is now branch head of B, and a topological head
-hg up 0
-echo a1 >a1
-hg ci -Ama1
-# a1 is now branch head of A, and a topological head
-hg clone . inner
-cd inner
-hg up B
-echo b1 >b1
-hg ci -Amb1
-# in the clone b1 is now the head of B
-cd ..
-echo a2 >a2
-hg ci -Ama2
-# a2 is now the new branch head of A, and a topological head
-# it replaces a former topological and branch head, so this should not warn
-echo %% glog of local
-hg glog --template "{rev}: {branches} {desc}\n"
-echo %% glog of remote
-hg glog -R inner --template "{rev}: {branches} {desc}\n"
-echo %% outgoing
-hg out inner --template "{rev}: {branches} {desc}\n"
-hg push inner
-cd ..
-
-echo % check prepush with new branch head and new child of former branch head
-echo % but child is on different branch
-hg init p
-cd p
-hg branch A
-echo a0 >a
-hg ci -Ama0
-echo a1 >a
-hg ci -ma1
-hg up null
-hg branch B
-echo b0 >b
-hg ci -Amb0
-echo b1 >b
-hg ci -mb1
-
-hg clone . inner
-
-hg up A
-hg branch -f B
-echo a3 >a
-hg ci -ma3
-hg up 3
-hg branch -f A
-echo b3 >b
-hg ci -mb3
-
-echo %% glog of local
-hg glog --template "{rev}: {branches} {desc}\n"
-echo %% glog of remote
-hg glog -R inner --template "{rev}: {branches} {desc}\n"
-echo %% outgoing
-hg out inner --template "{rev}: {branches} {desc}\n"
-hg push inner
-hg push inner -r4 -r5
-hg in inner
-cd ..
-
-exit 0
--- a/tests/test-push-warn.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,323 +0,0 @@
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-pushing to ../a
-searching for changes
-abort: push creates new remote heads on branch 'default'!
-(you should pull and merge or use push -f to force)
-pulling from ../a
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files (+1 heads)
-(run 'hg heads' to see heads, 'hg merge' to merge)
-pushing to ../a
-searching for changes
-abort: push creates new remote heads on branch 'default'!
-(did you forget to merge? use push -f to force)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-pushing to ../a
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 1 changes to 1 files
-adding foo
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-merging foo
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-pushing to ../c
-searching for changes
-abort: push creates new remote heads on branch 'default'!
-(did you forget to merge? use push -f to force)
-1
-pushing to ../c
-searching for changes
-no changes found
-0
-pushing to ../c
-searching for changes
-abort: push creates new remote heads on branch 'default'!
-(did you forget to merge? use push -f to force)
-1
-pushing to ../c
-searching for changes
-abort: push creates new remote heads on branch 'default'!
-(did you forget to merge? use push -f to force)
-1
-pushing to ../c
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 2 changes to 1 files (+2 heads)
-0
-pushing to ../c
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files (-1 heads)
-0
-comparing with ../c
-searching for changes
-no changes found
-% issue 450
-pushing to ../e
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-0
-pushing to ../e
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-0
-% issue 736
-% push on existing branch and new branch
-pushing to ../f
-searching for changes
-abort: push creates new remote branches: c!
-(use 'hg push --new-branch' to create new remote branches)
-1
-pushing to ../f
-searching for changes
-abort: push creates new remote branches: c!
-(use 'hg push --new-branch' to create new remote branches)
-1
-% multiple new branches
-pushing to ../f
-searching for changes
-abort: push creates new remote branches: c, d!
-(use 'hg push --new-branch' to create new remote branches)
-1
-pushing to ../f
-searching for changes
-abort: push creates new remote branches: c, d!
-(use 'hg push --new-branch' to create new remote branches)
-1
-% fail on multiple head push
-pushing to ../f
-searching for changes
-abort: push creates new remote heads on branch 'a'!
-(did you forget to merge? use push -f to force)
-1
-% push replacement head on existing branches
-pushing to ../f
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 2 changes to 1 files
-0
-% merge of branch a to other branch b followed by unrelated push on branch a
-pushing to ../f
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files (-1 heads)
-0
-pushing to ../f
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files (+1 heads)
-0
-% cheating the counting algorithm
-pushing to ../f
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 2 changes to 1 files
-0
-% failed push of new named branch
-pushing to ../f
-searching for changes
-abort: push creates new remote branches: e!
-(use 'hg push --new-branch' to create new remote branches)
-1
-% using --new-branch to push new named branch
-pushing to ../f
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-0
-% checking prepush logic does not allow silently pushing multiple new heads
-adding init
-adding a
-updating to branch default
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-adding b
-created new head
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-adding c
-created new head
-pushing to h
-searching for changes
-abort: push creates new remote heads on branch 'default'!
-(you should pull and merge or use push -f to force)
-
-% check prepush logic with merged branches
-marked working directory as branch a
-adding foo
-updating to branch a
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-marked working directory as branch b
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-pushing to j
-searching for changes
-abort: push creates new remote branches: b!
-(use 'hg push --new-branch' to create new remote branches)
-
-% prepush -r should not allow you to sneak in new heads
-pushing to ../l
-searching for changes
-abort: push creates new remote heads on branch 'a'!
-(did you forget to merge? use push -f to force)
-% check prepush with new branch head on former topo non-head
-marked working directory as branch A
-adding a
-marked working directory as branch B
-adding b
-updating to branch B
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-adding b1
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-adding a2
-%% glog of local
-@  2: A a2
-|
-| o  1: B b
-|/
-o  0: A a
-
-%% glog of remote
-@  2: B b1
-|
-o  1: B b
-|
-o  0: A a
-
-%% outgoing
-comparing with inner
-searching for changes
-2: A a2
-pushing to inner
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files (+1 heads)
-% check prepush with new branch head on former topo head
-marked working directory as branch A
-adding a
-marked working directory as branch B
-adding b
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-adding a1
-updating to branch A
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-adding b1
-adding a2
-%% glog of local
-@  3: A a2
-|
-o  2: A a1
-|
-| o  1: B b
-|/
-o  0: A a
-
-%% glog of remote
-@  3: B b1
-|
-| o  2: A a1
-| |
-o |  1: B b
-|/
-o  0: A a
-
-%% outgoing
-comparing with inner
-searching for changes
-3: A a2
-pushing to inner
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-% check prepush with new branch head and new child of former branch head
-% but child is on different branch
-marked working directory as branch A
-adding a
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-marked working directory as branch B
-adding b
-updating to branch B
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-marked working directory as branch B
-created new head
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-marked working directory as branch A
-created new head
-%% glog of local
-@  5: A b3
-|
-| o  4: B a3
-| |
-o |  3: B b1
-| |
-o |  2: B b0
- /
-o  1: A a1
-|
-o  0: A a0
-
-%% glog of remote
-@  3: B b1
-|
-o  2: B b0
-
-o  1: A a1
-|
-o  0: A a0
-
-%% outgoing
-comparing with inner
-searching for changes
-4: B a3
-5: A b3
-pushing to inner
-searching for changes
-abort: push creates new remote heads on branch 'A'!
-(did you forget to merge? use push -f to force)
-pushing to inner
-searching for changes
-abort: push creates new remote heads on branch 'A'!
-(did you forget to merge? use push -f to force)
-comparing with inner
-searching for changes
-no changes found
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-push-warn.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,699 @@
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "graphlog=" >> $HGRCPATH
+
+  $ mkdir a
+  $ cd a
+  $ hg init
+  $ echo foo > t1
+  $ hg add t1
+  $ hg commit -m "1"
+
+  $ cd ..
+  $ hg clone a b
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ cd a
+  $ echo foo > t2
+  $ hg add t2
+  $ hg commit -m "2"
+
+  $ cd ../b
+  $ echo foo > t3
+  $ hg add t3
+  $ hg commit -m "3"
+
+  $ hg push ../a
+  pushing to ../a
+  searching for changes
+  abort: push creates new remote heads on branch 'default'!
+  (you should pull and merge or use push -f to force)
+  [255]
+
+  $ hg pull ../a
+  pulling from ../a
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files (+1 heads)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+
+  $ hg push ../a
+  pushing to ../a
+  searching for changes
+  abort: push creates new remote heads on branch 'default'!
+  (did you forget to merge? use push -f to force)
+  [255]
+
+  $ hg merge
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+  $ hg commit -m "4"
+  $ hg push ../a
+  pushing to ../a
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 1 changes to 1 files
+
+  $ cd ..
+
+  $ hg init c
+  $ cd c
+  $ for i in 0 1 2; do
+  >     echo $i >> foo
+  >     hg ci -Am $i
+  > done
+  adding foo
+  $ cd ..
+
+  $ hg clone c d
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ cd d
+  $ for i in 0 1; do
+  >    hg co -C $i
+  >    echo d-$i >> foo
+  >    hg ci -m d-$i
+  > done
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  created new head
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  created new head
+
+  $ HGMERGE=true hg merge 3
+  merging foo
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+  $ hg ci -m c-d
+
+  $ hg push ../c
+  pushing to ../c
+  searching for changes
+  abort: push creates new remote heads on branch 'default'!
+  (did you forget to merge? use push -f to force)
+  [255]
+
+  $ hg push -r 2 ../c
+  pushing to ../c
+  searching for changes
+  no changes found
+
+  $ hg push -r 3 ../c
+  pushing to ../c
+  searching for changes
+  abort: push creates new remote heads on branch 'default'!
+  (did you forget to merge? use push -f to force)
+  [255]
+
+  $ hg push -r 3 -r 4 ../c
+  pushing to ../c
+  searching for changes
+  abort: push creates new remote heads on branch 'default'!
+  (did you forget to merge? use push -f to force)
+  [255]
+
+  $ hg push -f -r 3 -r 4 ../c
+  pushing to ../c
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 1 files (+2 heads)
+
+  $ hg push -r 5 ../c
+  pushing to ../c
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files (-1 heads)
+
+  $ hg in ../c
+  comparing with ../c
+  searching for changes
+  no changes found
+  [1]
+
+
+Issue 450:
+
+  $ hg init ../e
+  $ hg push -r 0 ../e
+  pushing to ../e
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+
+  $ hg push -r 1 ../e
+  pushing to ../e
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+
+  $ cd ..
+
+
+Issue 736:
+
+  $ hg init f
+  $ cd f
+  $ hg -q branch a
+  $ echo 0 > foo
+  $ hg -q ci -Am 0
+  $ echo 1 > foo
+  $ hg -q ci -m 1
+  $ hg -q up 0
+  $ echo 2 > foo
+  $ hg -q ci -m 2
+  $ hg -q up 0
+  $ hg -q branch b
+  $ echo 3 > foo
+  $ hg -q ci -m 3
+  $ cd ..
+
+  $ hg -q clone f g
+  $ cd g
+
+Push on existing branch and new branch:
+
+  $ hg -q up 1
+  $ echo 4 > foo
+  $ hg -q ci -m 4
+  $ hg -q up 0
+  $ echo 5 > foo
+  $ hg -q branch c
+  $ hg -q ci -m 5
+
+  $ hg push ../f
+  pushing to ../f
+  searching for changes
+  abort: push creates new remote branches: c!
+  (use 'hg push --new-branch' to create new remote branches)
+  [255]
+
+  $ hg push -r 4 -r 5 ../f
+  pushing to ../f
+  searching for changes
+  abort: push creates new remote branches: c!
+  (use 'hg push --new-branch' to create new remote branches)
+  [255]
+
+
+Multiple new branches:
+
+  $ hg -q branch d
+  $ echo 6 > foo
+  $ hg -q ci -m 6
+
+  $ hg push ../f
+  pushing to ../f
+  searching for changes
+  abort: push creates new remote branches: c, d!
+  (use 'hg push --new-branch' to create new remote branches)
+  [255]
+
+  $ hg push -r 4 -r 6 ../f
+  pushing to ../f
+  searching for changes
+  abort: push creates new remote branches: c, d!
+  (use 'hg push --new-branch' to create new remote branches)
+  [255]
+
+  $ cd ../g
+
+
+Fail on multiple head push:
+
+  $ hg -q up 1
+  $ echo 7 > foo
+  $ hg -q ci -m 7
+
+  $ hg push -r 4 -r 7 ../f
+  pushing to ../f
+  searching for changes
+  abort: push creates new remote heads on branch 'a'!
+  (did you forget to merge? use push -f to force)
+  [255]
+
+Push replacement head on existing branches:
+
+  $ hg -q up 3
+  $ echo 8 > foo
+  $ hg -q ci -m 8
+
+  $ hg push -r 7 -r 8 ../f
+  pushing to ../f
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 1 files
+
+
+Merge of branch a to other branch b followed by unrelated push
+on branch a:
+
+  $ hg -q up 7
+  $ HGMERGE=true hg -q merge 8
+  $ hg -q ci -m 9
+  $ hg -q up 8
+  $ echo 10 > foo
+  $ hg -q ci -m 10
+
+  $ hg push -r 9 ../f
+  pushing to ../f
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files (-1 heads)
+
+  $ hg push -r 10 ../f
+  pushing to ../f
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files (+1 heads)
+
+
+Cheating the counting algorithm:
+
+  $ hg -q up 9
+  $ HGMERGE=true hg -q merge 2
+  $ hg -q ci -m 11
+  $ hg -q up 1
+  $ echo 12 > foo
+  $ hg -q ci -m 12
+
+  $ hg push -r 11 -r 12 ../f
+  pushing to ../f
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 1 files
+
+
+Failed push of new named branch:
+
+  $ echo 12 > foo
+  $ hg -q ci -m 12a
+  [1]
+  $ hg -q up 11
+  $ echo 13 > foo
+  $ hg -q branch e
+  $ hg -q ci -m 13d
+
+  $ hg push -r 12 -r 13 ../f
+  pushing to ../f
+  searching for changes
+  abort: push creates new remote branches: e!
+  (use 'hg push --new-branch' to create new remote branches)
+  [255]
+
+
+Using --new-branch to push new named branch:
+
+  $ hg push --new-branch -r 12 -r 13 ../f
+  pushing to ../f
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+
+
+Checking prepush logic does not allow silently pushing 
+multiple new heads:
+
+  $ cd ..
+  $ hg init h
+  $ echo init > h/init
+  $ hg -R h ci -Am init
+  adding init
+  $ echo a > h/a
+  $ hg -R h ci -Am a
+  adding a
+  $ hg clone h i
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg -R h up 0
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo b > h/b
+  $ hg -R h ci -Am b
+  adding b
+  created new head
+  $ hg -R i up 0
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo c > i/c
+  $ hg -R i ci -Am c
+  adding c
+  created new head
+
+  $ hg -R i push h
+  pushing to h
+  searching for changes
+  abort: push creates new remote heads on branch 'default'!
+  (you should pull and merge or use push -f to force)
+  [255]
+
+
+Check prepush logic with merged branches:
+
+  $ hg init j
+  $ hg -R j branch a
+  marked working directory as branch a
+  $ echo init > j/foo
+  $ hg -R j ci -Am init
+  adding foo
+  $ hg clone j k
+  updating to branch a
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo a1 > j/foo
+  $ hg -R j ci -m a1
+  $ hg -R k branch b
+  marked working directory as branch b
+  $ echo b > k/foo
+  $ hg -R k ci -m b
+  $ hg -R k up 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ hg -R k merge b
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+  $ hg -R k ci -m merge
+
+  $ hg -R k push -r a j
+  pushing to j
+  searching for changes
+  abort: push creates new remote branches: b!
+  (use 'hg push --new-branch' to create new remote branches)
+  [255]
+
+
+Prepush -r should not allow you to sneak in new heads:
+
+  $ hg init l
+  $ cd l
+  $ echo a >> foo
+  $ hg -q add foo
+  $ hg -q branch a
+  $ hg -q ci -ma
+  $ hg -q up null
+  $ echo a >> foo
+  $ hg -q add foo
+  $ hg -q branch b
+  $ hg -q ci -mb
+  $ cd ..
+  $ hg -q clone l m -u a
+  $ cd m
+  $ hg -q merge b
+  $ hg -q ci -mmb
+  $ hg -q up 0
+  $ echo a >> foo
+  $ hg -q ci -ma2
+  $ hg -q up 2
+  $ echo a >> foo
+  $ hg -q branch -f b
+  $ hg -q ci -mb2
+  $ hg -q merge 3
+  $ hg -q ci -mma
+
+  $ hg push ../l -b b
+  pushing to ../l
+  searching for changes
+  abort: push creates new remote heads on branch 'a'!
+  (did you forget to merge? use push -f to force)
+  [255]
+
+  $ cd ..
+
+
+Check prepush with new branch head on former topo non-head:
+
+  $ hg init n
+  $ cd n
+  $ hg branch A
+  marked working directory as branch A
+  $ echo a >a
+  $ hg ci -Ama
+  adding a
+  $ hg branch B
+  marked working directory as branch B
+  $ echo b >b
+  $ hg ci -Amb
+  adding b
+
+b is now branch head of B, and a topological head
+a is now branch head of A, but not a topological head
+
+  $ hg clone . inner
+  updating to branch B
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd inner
+  $ hg up B
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo b1 >b1
+  $ hg ci -Amb1
+  adding b1
+
+in the clone b1 is now the head of B
+
+  $ cd ..
+  $ hg up 0
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo a2 >a2
+  $ hg ci -Ama2
+  adding a2
+
+a2 is now the new branch head of A, and a new topological head 
+it replaces a former inner branch head, so it should at most warn about
+A, not B
+
+glog of local:
+
+  $ hg glog --template "{rev}: {branches} {desc}\n"
+  @  2: A a2
+  |
+  | o  1: B b
+  |/
+  o  0: A a
+  
+glog of remote:
+
+  $ hg glog -R inner --template "{rev}: {branches} {desc}\n"
+  @  2: B b1
+  |
+  o  1: B b
+  |
+  o  0: A a
+  
+outgoing:
+
+  $ hg out inner --template "{rev}: {branches} {desc}\n"
+  comparing with inner
+  searching for changes
+  2: A a2
+
+  $ hg push inner
+  pushing to inner
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files (+1 heads)
+
+  $ cd ..
+
+
+Check prepush with new branch head on former topo head:
+
+  $ hg init o
+  $ cd o
+  $ hg branch A
+  marked working directory as branch A
+  $ echo a >a
+  $ hg ci -Ama
+  adding a
+  $ hg branch B
+  marked working directory as branch B
+  $ echo b >b
+  $ hg ci -Amb
+  adding b
+
+b is now branch head of B, and a topological head
+
+  $ hg up 0
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo a1 >a1
+  $ hg ci -Ama1
+  adding a1
+
+a1 is now branch head of A, and a topological head
+
+  $ hg clone . inner
+  updating to branch A
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd inner
+  $ hg up B
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo b1 >b1
+  $ hg ci -Amb1
+  adding b1
+
+in the clone b1 is now the head of B
+
+  $ cd ..
+  $ echo a2 >a2
+  $ hg ci -Ama2
+  adding a2
+
+a2 is now the new branch head of A, and a topological head
+it replaces a former topological and branch head, so this should not warn
+
+glog of local:
+
+  $ hg glog --template "{rev}: {branches} {desc}\n"
+  @  3: A a2
+  |
+  o  2: A a1
+  |
+  | o  1: B b
+  |/
+  o  0: A a
+  
+glog of remote:
+
+  $ hg glog -R inner --template "{rev}: {branches} {desc}\n"
+  @  3: B b1
+  |
+  | o  2: A a1
+  | |
+  o |  1: B b
+  |/
+  o  0: A a
+  
+outgoing:
+
+  $ hg out inner --template "{rev}: {branches} {desc}\n"
+  comparing with inner
+  searching for changes
+  3: A a2
+
+  $ hg push inner
+  pushing to inner
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+
+  $ cd ..
+
+
+Check prepush with new branch head and new child of former branch head
+but child is on different branch:
+
+  $ hg init p
+  $ cd p
+  $ hg branch A
+  marked working directory as branch A
+  $ echo a0 >a
+  $ hg ci -Ama0
+  adding a
+  $ echo a1 >a
+  $ hg ci -ma1
+  $ hg up null
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg branch B
+  marked working directory as branch B
+  $ echo b0 >b
+  $ hg ci -Amb0
+  adding b
+  $ echo b1 >b
+  $ hg ci -mb1
+
+  $ hg clone . inner
+  updating to branch B
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ hg up A
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg branch -f B
+  marked working directory as branch B
+  $ echo a3 >a
+  $ hg ci -ma3
+  created new head
+  $ hg up 3
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg branch -f A
+  marked working directory as branch A
+  $ echo b3 >b
+  $ hg ci -mb3
+  created new head
+
+glog of local:
+
+  $ hg glog --template "{rev}: {branches} {desc}\n"
+  @  5: A b3
+  |
+  | o  4: B a3
+  | |
+  o |  3: B b1
+  | |
+  o |  2: B b0
+   /
+  o  1: A a1
+  |
+  o  0: A a0
+  
+glog of remote:
+
+  $ hg glog -R inner --template "{rev}: {branches} {desc}\n"
+  @  3: B b1
+  |
+  o  2: B b0
+  
+  o  1: A a1
+  |
+  o  0: A a0
+  
+outgoing:
+
+  $ hg out inner --template "{rev}: {branches} {desc}\n"
+  comparing with inner
+  searching for changes
+  4: B a3
+  5: A b3
+
+  $ hg push inner
+  pushing to inner
+  searching for changes
+  abort: push creates new remote heads on branch 'A'!
+  (did you forget to merge? use push -f to force)
+  [255]
+
+  $ hg push inner -r4 -r5
+  pushing to inner
+  searching for changes
+  abort: push creates new remote heads on branch 'A'!
+  (did you forget to merge? use push -f to force)
+  [255]
+
+  $ hg in inner
+  comparing with inner
+  searching for changes
+  no changes found
+  [1]
--- a/tests/test-qrecord	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,100 +0,0 @@
-#!/bin/sh
-
-echo "[ui]" >> $HGRCPATH
-echo "interactive=true" >> $HGRCPATH
-echo "[extensions]"     >> $HGRCPATH
-echo "record="          >> $HGRCPATH
-
-echo "% help (no mq, so no qrecord)"
-
-hg help qrecord
-
-echo "mq="              >> $HGRCPATH
-
-echo "% help (mq present)"
-
-hg help qrecord
-
-hg init a
-cd a
-
-echo % base commit
-
-cat > 1.txt <<EOF
-1
-2
-3
-4
-5
-EOF
-cat > 2.txt <<EOF
-a
-b
-c
-d
-e
-f
-EOF
-mkdir dir
-cat > dir/a.txt <<EOF
-hello world
-
-someone
-up
-there
-loves
-me
-EOF
-
-hg add 1.txt 2.txt dir/a.txt
-hg commit -m 'initial checkin'
-
-echo % changing files
-
-sed -e 's/2/2 2/;s/4/4 4/' 1.txt > 1.txt.new
-sed -e 's/b/b b/' 2.txt > 2.txt.new
-sed -e 's/hello world/hello world!/' dir/a.txt > dir/a.txt.new
-
-mv -f 1.txt.new 1.txt
-mv -f 2.txt.new 2.txt
-mv -f dir/a.txt.new dir/a.txt
-
-echo % whole diff
-
-hg diff --nodates
-
-echo % qrecord a.patch
-
-hg qrecord -d '0 0' -m aaa a.patch <<EOF
-y
-y
-n
-y
-y
-n
-EOF
-
-echo
-echo % "after qrecord a.patch 'tip'"
-hg tip -p
-echo
-echo % "after qrecord a.patch 'diff'"
-hg diff --nodates
-
-echo % qrecord b.patch
-hg qrecord -d '0 0' -m bbb b.patch <<EOF
-y
-y
-y
-y
-EOF
-
-echo
-echo % "after qrecord b.patch 'tip'"
-hg tip -p
-echo
-echo % "after qrecord b.patch 'diff'"
-hg diff --nodates
-
-echo
-echo % --- end ---
--- a/tests/test-qrecord.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,220 +0,0 @@
-% help (no mq, so no qrecord)
-hg: unknown command 'qrecord'
-Mercurial Distributed SCM
-
-basic commands:
-
- add        add the specified files on the next commit
- annotate   show changeset information by line for each file
- clone      make a copy of an existing repository
- commit     commit the specified files or all outstanding changes
- diff       diff repository (or selected files)
- export     dump the header and diffs for one or more changesets
- forget     forget the specified files on the next commit
- init       create a new repository in the given directory
- log        show revision history of entire repository or files
- merge      merge working directory with another revision
- pull       pull changes from the specified source
- push       push changes to the specified destination
- remove     remove the specified files on the next commit
- serve      start stand-alone webserver
- status     show changed files in the working directory
- summary    summarize working directory state
- update     update working directory (or switch revisions)
-
-use "hg help" for the full list of commands or "hg -v" for details
-% help (mq present)
-hg qrecord [OPTION]... PATCH [FILE]...
-
-interactively record a new patch
-
-    See "hg help qnew" & "hg help record" for more information and usage.
-
-options:
-
- -e --edit                 edit commit message
- -g --git                  use git extended diff format
- -U --currentuser          add "From: <current user>" to patch
- -u --user USER            add "From: <USER>" to patch
- -D --currentdate          add "Date: <current date>" to patch
- -d --date DATE            add "Date: <DATE>" to patch
- -I --include PATTERN [+]  include names matching the given patterns
- -X --exclude PATTERN [+]  exclude names matching the given patterns
- -m --message TEXT         use text as commit message
- -l --logfile FILE         read commit message from file
-
-[+] marked option can be specified multiple times
-
-use "hg -v help qrecord" to show global options
-% base commit
-% changing files
-% whole diff
-diff -r 1057167b20ef 1.txt
---- a/1.txt
-+++ b/1.txt
-@@ -1,5 +1,5 @@
- 1
--2
-+2 2
- 3
--4
-+4 4
- 5
-diff -r 1057167b20ef 2.txt
---- a/2.txt
-+++ b/2.txt
-@@ -1,5 +1,5 @@
- a
--b
-+b b
- c
- d
- e
-diff -r 1057167b20ef dir/a.txt
---- a/dir/a.txt
-+++ b/dir/a.txt
-@@ -1,4 +1,4 @@
--hello world
-+hello world!
- 
- someone
- up
-% qrecord a.patch
-diff --git a/1.txt b/1.txt
-2 hunks, 4 lines changed
-examine changes to '1.txt'? [Ynsfdaq?] 
-@@ -1,3 +1,3 @@
- 1
--2
-+2 2
- 3
-record change 1/6 to '1.txt'? [Ynsfdaq?] 
-@@ -3,3 +3,3 @@
- 3
--4
-+4 4
- 5
-record change 2/6 to '1.txt'? [Ynsfdaq?] 
-diff --git a/2.txt b/2.txt
-1 hunks, 2 lines changed
-examine changes to '2.txt'? [Ynsfdaq?] 
-@@ -1,5 +1,5 @@
- a
--b
-+b b
- c
- d
- e
-record change 4/6 to '2.txt'? [Ynsfdaq?] 
-diff --git a/dir/a.txt b/dir/a.txt
-1 hunks, 2 lines changed
-examine changes to 'dir/a.txt'? [Ynsfdaq?] 
-
-% after qrecord a.patch 'tip'
-changeset:   1:5d1ca63427ee
-tag:         a.patch
-tag:         qbase
-tag:         qtip
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     aaa
-
-diff -r 1057167b20ef -r 5d1ca63427ee 1.txt
---- a/1.txt	Thu Jan 01 00:00:00 1970 +0000
-+++ b/1.txt	Thu Jan 01 00:00:00 1970 +0000
-@@ -1,5 +1,5 @@
- 1
--2
-+2 2
- 3
- 4
- 5
-diff -r 1057167b20ef -r 5d1ca63427ee 2.txt
---- a/2.txt	Thu Jan 01 00:00:00 1970 +0000
-+++ b/2.txt	Thu Jan 01 00:00:00 1970 +0000
-@@ -1,5 +1,5 @@
- a
--b
-+b b
- c
- d
- e
-
-
-% after qrecord a.patch 'diff'
-diff -r 5d1ca63427ee 1.txt
---- a/1.txt
-+++ b/1.txt
-@@ -1,5 +1,5 @@
- 1
- 2 2
- 3
--4
-+4 4
- 5
-diff -r 5d1ca63427ee dir/a.txt
---- a/dir/a.txt
-+++ b/dir/a.txt
-@@ -1,4 +1,4 @@
--hello world
-+hello world!
- 
- someone
- up
-% qrecord b.patch
-diff --git a/1.txt b/1.txt
-1 hunks, 2 lines changed
-examine changes to '1.txt'? [Ynsfdaq?] 
-@@ -1,5 +1,5 @@
- 1
- 2 2
- 3
--4
-+4 4
- 5
-record change 1/3 to '1.txt'? [Ynsfdaq?] 
-diff --git a/dir/a.txt b/dir/a.txt
-1 hunks, 2 lines changed
-examine changes to 'dir/a.txt'? [Ynsfdaq?] 
-@@ -1,4 +1,4 @@
--hello world
-+hello world!
- 
- someone
- up
-record change 3/3 to 'dir/a.txt'? [Ynsfdaq?] 
-
-% after qrecord b.patch 'tip'
-changeset:   2:b056198bf878
-tag:         b.patch
-tag:         qtip
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     bbb
-
-diff -r 5d1ca63427ee -r b056198bf878 1.txt
---- a/1.txt	Thu Jan 01 00:00:00 1970 +0000
-+++ b/1.txt	Thu Jan 01 00:00:00 1970 +0000
-@@ -1,5 +1,5 @@
- 1
- 2 2
- 3
--4
-+4 4
- 5
-diff -r 5d1ca63427ee -r b056198bf878 dir/a.txt
---- a/dir/a.txt	Thu Jan 01 00:00:00 1970 +0000
-+++ b/dir/a.txt	Thu Jan 01 00:00:00 1970 +0000
-@@ -1,4 +1,4 @@
--hello world
-+hello world!
- 
- someone
- up
-
-
-% after qrecord b.patch 'diff'
-
-% --- end ---
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-qrecord.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,306 @@
+Create configuration
+
+  $ echo "[ui]" >> $HGRCPATH
+  $ echo "interactive=true" >> $HGRCPATH
+  $ echo "[extensions]"     >> $HGRCPATH
+  $ echo "record="          >> $HGRCPATH
+
+help (no mq, so no qrecord)
+
+  $ hg help qrecord
+  hg: unknown command 'qrecord'
+  Mercurial Distributed SCM
+  
+  basic commands:
+  
+   add        add the specified files on the next commit
+   annotate   show changeset information by line for each file
+   clone      make a copy of an existing repository
+   commit     commit the specified files or all outstanding changes
+   diff       diff repository (or selected files)
+   export     dump the header and diffs for one or more changesets
+   forget     forget the specified files on the next commit
+   init       create a new repository in the given directory
+   log        show revision history of entire repository or files
+   merge      merge working directory with another revision
+   pull       pull changes from the specified source
+   push       push changes to the specified destination
+   remove     remove the specified files on the next commit
+   serve      start stand-alone webserver
+   status     show changed files in the working directory
+   summary    summarize working directory state
+   update     update working directory (or switch revisions)
+  
+  use "hg help" for the full list of commands or "hg -v" for details
+  [255]
+
+help (mq present)
+
+  $ echo "mq="              >> $HGRCPATH
+  $ hg help qrecord
+  hg qrecord [OPTION]... PATCH [FILE]...
+  
+  interactively record a new patch
+  
+      See "hg help qnew" & "hg help record" for more information and usage.
+  
+  options:
+  
+   -e --edit                 edit commit message
+   -g --git                  use git extended diff format
+   -U --currentuser          add "From: <current user>" to patch
+   -u --user USER            add "From: <USER>" to patch
+   -D --currentdate          add "Date: <current date>" to patch
+   -d --date DATE            add "Date: <DATE>" to patch
+   -I --include PATTERN [+]  include names matching the given patterns
+   -X --exclude PATTERN [+]  exclude names matching the given patterns
+   -m --message TEXT         use text as commit message
+   -l --logfile FILE         read commit message from file
+  
+  [+] marked option can be specified multiple times
+  
+  use "hg -v help qrecord" to show global options
+
+  $ hg init a
+  $ cd a
+
+Base commit
+
+  $ cat > 1.txt <<EOF
+  > 1
+  > 2
+  > 3
+  > 4
+  > 5
+  > EOF
+  $ cat > 2.txt <<EOF
+  > a
+  > b
+  > c
+  > d
+  > e
+  > f
+  > EOF
+
+  $ mkdir dir
+  $ cat > dir/a.txt <<EOF
+  > hello world
+  > 
+  > someone
+  > up
+  > there
+  > loves
+  > me
+  > EOF
+
+  $ hg add 1.txt 2.txt dir/a.txt
+  $ hg commit -m 'initial checkin'
+
+Changing files
+
+  $ sed -e 's/2/2 2/;s/4/4 4/' 1.txt > 1.txt.new
+  $ sed -e 's/b/b b/' 2.txt > 2.txt.new
+  $ sed -e 's/hello world/hello world!/' dir/a.txt > dir/a.txt.new
+
+  $ mv -f 1.txt.new 1.txt
+  $ mv -f 2.txt.new 2.txt
+  $ mv -f dir/a.txt.new dir/a.txt
+
+Whole diff
+
+  $ hg diff --nodates
+  diff -r 1057167b20ef 1.txt
+  --- a/1.txt
+  +++ b/1.txt
+  @@ -1,5 +1,5 @@
+   1
+  -2
+  +2 2
+   3
+  -4
+  +4 4
+   5
+  diff -r 1057167b20ef 2.txt
+  --- a/2.txt
+  +++ b/2.txt
+  @@ -1,5 +1,5 @@
+   a
+  -b
+  +b b
+   c
+   d
+   e
+  diff -r 1057167b20ef dir/a.txt
+  --- a/dir/a.txt
+  +++ b/dir/a.txt
+  @@ -1,4 +1,4 @@
+  -hello world
+  +hello world!
+   
+   someone
+   up
+
+qrecord a.patch
+
+  $ hg qrecord -d '0 0' -m aaa a.patch <<EOF
+  > y
+  > y
+  > n
+  > y
+  > y
+  > n
+  > EOF
+  diff --git a/1.txt b/1.txt
+  2 hunks, 2 lines changed
+  examine changes to '1.txt'? [Ynsfdaq?] 
+  @@ -1,3 +1,3 @@
+   1
+  -2
+  +2 2
+   3
+  record change 1/6 to '1.txt'? [Ynsfdaq?] 
+  @@ -3,3 +3,3 @@
+   3
+  -4
+  +4 4
+   5
+  record change 2/6 to '1.txt'? [Ynsfdaq?] 
+  diff --git a/2.txt b/2.txt
+  1 hunks, 1 lines changed
+  examine changes to '2.txt'? [Ynsfdaq?] 
+  @@ -1,5 +1,5 @@
+   a
+  -b
+  +b b
+   c
+   d
+   e
+  record change 4/6 to '2.txt'? [Ynsfdaq?] 
+  diff --git a/dir/a.txt b/dir/a.txt
+  1 hunks, 1 lines changed
+  examine changes to 'dir/a.txt'? [Ynsfdaq?] 
+
+After qrecord a.patch 'tip'"
+
+  $ hg tip -p
+  changeset:   1:5d1ca63427ee
+  tag:         a.patch
+  tag:         qbase
+  tag:         qtip
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     aaa
+  
+  diff -r 1057167b20ef -r 5d1ca63427ee 1.txt
+  --- a/1.txt	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/1.txt	Thu Jan 01 00:00:00 1970 +0000
+  @@ -1,5 +1,5 @@
+   1
+  -2
+  +2 2
+   3
+   4
+   5
+  diff -r 1057167b20ef -r 5d1ca63427ee 2.txt
+  --- a/2.txt	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/2.txt	Thu Jan 01 00:00:00 1970 +0000
+  @@ -1,5 +1,5 @@
+   a
+  -b
+  +b b
+   c
+   d
+   e
+  
+
+After qrecord a.patch 'diff'"
+
+  $ hg diff --nodates
+  diff -r 5d1ca63427ee 1.txt
+  --- a/1.txt
+  +++ b/1.txt
+  @@ -1,5 +1,5 @@
+   1
+   2 2
+   3
+  -4
+  +4 4
+   5
+  diff -r 5d1ca63427ee dir/a.txt
+  --- a/dir/a.txt
+  +++ b/dir/a.txt
+  @@ -1,4 +1,4 @@
+  -hello world
+  +hello world!
+   
+   someone
+   up
+
+qrecord b.patch
+
+  $ hg qrecord -d '0 0' -m bbb b.patch <<EOF
+  > y
+  > y
+  > y
+  > y
+  > EOF
+  diff --git a/1.txt b/1.txt
+  1 hunks, 1 lines changed
+  examine changes to '1.txt'? [Ynsfdaq?] 
+  @@ -1,5 +1,5 @@
+   1
+   2 2
+   3
+  -4
+  +4 4
+   5
+  record change 1/3 to '1.txt'? [Ynsfdaq?] 
+  diff --git a/dir/a.txt b/dir/a.txt
+  1 hunks, 1 lines changed
+  examine changes to 'dir/a.txt'? [Ynsfdaq?] 
+  @@ -1,4 +1,4 @@
+  -hello world
+  +hello world!
+   
+   someone
+   up
+  record change 3/3 to 'dir/a.txt'? [Ynsfdaq?] 
+
+After qrecord b.patch 'tip'
+
+  $ hg tip -p
+  changeset:   2:b056198bf878
+  tag:         b.patch
+  tag:         qtip
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     bbb
+  
+  diff -r 5d1ca63427ee -r b056198bf878 1.txt
+  --- a/1.txt	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/1.txt	Thu Jan 01 00:00:00 1970 +0000
+  @@ -1,5 +1,5 @@
+   1
+   2 2
+   3
+  -4
+  +4 4
+   5
+  diff -r 5d1ca63427ee -r b056198bf878 dir/a.txt
+  --- a/dir/a.txt	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/dir/a.txt	Thu Jan 01 00:00:00 1970 +0000
+  @@ -1,4 +1,4 @@
+  -hello world
+  +hello world!
+   
+   someone
+   up
+  
+
+After qrecord b.patch 'diff'
+
+  $ hg diff --nodates
+
+End
\ No newline at end of file
--- a/tests/test-race	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-#!/bin/sh
-
-mkdir t
-cd t
-hg init
-echo a > a
-hg add a
-hg commit -m test
-
-# do we ever miss a sub-second change?
-for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do
-    hg co -qC 0
-    echo b > a
-    hg st
-done
--- a/tests/test-race.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-M a
-M a
-M a
-M a
-M a
-M a
-M a
-M a
-M a
-M a
-M a
-M a
-M a
-M a
-M a
-M a
-M a
-M a
-M a
-M a
--- a/tests/test-rebuildstate	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-#!/bin/sh
-# basic test for hg debugrebuildstate
-
-hg init repo
-cd repo
-
-touch foo bar
-hg ci -Am 'add foo bar'
-
-touch baz
-hg add baz
-hg rm bar
-
-hg debugrebuildstate
-echo '% state dump after'
-hg debugstate --nodates | sort
-echo '% status'
-hg st -A
-
--- a/tests/test-rebuildstate.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-adding bar
-adding foo
-% state dump after
-n 666         -1 bar
-n 666         -1 foo
-% status
-! bar
-? baz
-C foo
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-rebuildstate.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,29 @@
+basic test for hg debugrebuildstate
+
+  $ hg init repo
+  $ cd repo
+
+  $ touch foo bar
+  $ hg ci -Am 'add foo bar'
+  adding bar
+  adding foo
+
+  $ touch baz
+  $ hg add baz
+  $ hg rm bar
+
+  $ hg debugrebuildstate
+
+state dump after
+
+  $ hg debugstate --nodates | sort
+  n 666         -1 bar
+  n 666         -1 foo
+
+status
+
+  $ hg st -A
+  ! bar
+  ? baz
+  C foo
+
--- a/tests/test-record	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,332 +0,0 @@
-#!/bin/sh
-
-echo "[ui]" >> $HGRCPATH
-echo "interactive=true" >> $HGRCPATH
-echo "[extensions]" >> $HGRCPATH
-echo "record=" >> $HGRCPATH
-
-echo % help
-
-hg help record
-
-hg init a
-cd a
-
-echo % select no files
-
-touch empty-rw
-hg add empty-rw
-hg record empty-rw<<EOF
-n
-EOF
-echo; hg tip -p
-
-echo % select files but no hunks
-
-hg record empty-rw<<EOF
-y
-n
-EOF
-echo; hg tip -p
-
-echo % record empty file
-
-hg record -d '0 0' -m empty empty-rw<<EOF
-y
-y
-EOF
-echo; hg tip -p
-
-echo % summary shows we updated to the new cset
-hg summary
-echo
-
-echo % rename empty file
-
-hg mv empty-rw empty-rename
-hg record -d '1 0' -m rename<<EOF
-y
-EOF
-echo; hg tip -p
-
-echo % copy empty file
-
-hg cp empty-rename empty-copy
-hg record -d '2 0' -m copy<<EOF
-y
-EOF
-echo; hg tip -p
-
-echo % delete empty file
-
-hg rm empty-copy
-hg record -d '3 0' -m delete<<EOF
-y
-EOF
-echo; hg tip -p
-
-echo % add binary file
-
-hg bundle --base -2 tip.bundle
-hg add tip.bundle
-hg record -d '4 0' -m binary<<EOF
-y
-EOF
-echo; hg tip -p
-
-echo % change binary file
-
-hg bundle --base -2 tip.bundle
-hg record -d '5 0' -m binary-change<<EOF
-y
-EOF
-echo; hg tip -p
-
-echo % rename and change binary file
-
-hg mv tip.bundle top.bundle
-hg bundle --base -2 top.bundle
-hg record -d '6 0' -m binary-change-rename<<EOF
-y
-EOF
-echo; hg tip -p
-
-echo % add plain file
-
-for i in 1 2 3 4 5 6 7 8 9 10; do
-    echo $i >> plain
-done
-
-hg add plain
-hg record -d '7 0' -m plain plain<<EOF
-y
-y
-EOF
-echo; hg tip -p
-
-echo % modify end of plain file
-
-echo 11 >> plain
-hg record -d '8 0' -m end plain <<EOF
-y
-y
-EOF
-
-echo % modify end of plain file, no EOL
-
-hg tip --template '{node}' >> plain
-hg record -d '9 0' -m noeol plain <<EOF
-y
-y
-EOF
-
-echo % modify end of plain file, add EOL
-
-echo >> plain
-hg record -d '10 0' -m eol plain <<EOF
-y
-y
-y
-EOF
-
-echo % modify beginning, trim end, record both
-
-rm plain
-for i in 2 2 3 4 5 6 7 8 9 10; do
-  echo $i >> plain
-done
-
-hg record -d '10 0' -m begin-and-end plain <<EOF
-y
-y
-y
-EOF
-echo; hg tip -p
-
-echo % trim beginning, modify end
-
-rm plain
-for i in 4 5 6 7 8 9 10.new; do
-  echo $i >> plain
-done
-
-echo % record end
-
-hg record -d '11 0' -m end-only plain <<EOF
-y
-n
-y
-EOF
-echo; hg tip -p
-
-echo % record beginning
-
-hg record -d '12 0' -m begin-only plain <<EOF
-y
-y
-EOF
-echo; hg tip -p
-
-echo % add to beginning, trim from end
-
-rm plain
-for i in 1 2 3 4 5 6 7 8 9; do
-  echo $i >> plain
-done
-
-echo % record end
-
-hg record --traceback -d '13 0' -m end-again plain<<EOF
-y
-n
-y
-EOF
-
-echo % add to beginning, middle, end
-
-rm plain
-for i in 1 2 3 4 5 5.new 5.reallynew 6 7 8 9 10 11; do
-  echo $i >> plain
-done
-
-echo % record beginning, middle
-
-hg record -d '14 0' -m middle-only plain <<EOF
-y
-y
-y
-n
-EOF
-echo; hg tip -p
-
-echo % record end
-
-hg record -d '15 0' -m end-only plain <<EOF
-y
-y
-EOF
-echo; hg tip -p
-
-mkdir subdir
-cd subdir
-echo a > a
-hg ci -d '16 0' -Amsubdir
-
-echo a >> a
-hg record -d '16 0' -m subdir-change a <<EOF
-y
-y
-EOF
-echo; hg tip -p
-
-echo a > f1
-echo b > f2
-hg add f1 f2
-
-hg ci -mz -d '17 0'
-
-echo a >> f1
-echo b >> f2
-
-echo % help, quit
-
-hg record <<EOF
-?
-q
-EOF
-
-echo % skip
-
-hg record <<EOF
-s
-EOF
-
-echo % no
-
-hg record <<EOF
-n
-EOF
-
-echo % f, quit
-
-hg record <<EOF
-f
-q
-EOF
-
-echo % s, all
-
-hg record -d '18 0' -mx <<EOF
-s
-a
-EOF
-echo; hg tip -p
-
-echo % f
-
-hg record -d '19 0' -my <<EOF
-f
-EOF
-echo; hg tip -p
-
-echo % preserve chmod +x
-
-chmod +x f1
-echo a >> f1
-hg record -d '20 0' -mz <<EOF
-y
-y
-y
-EOF
-echo; hg tip --config diff.git=True -p
-
-echo % preserve execute permission on original
-
-echo b >> f1
-hg record -d '21 0' -maa <<EOF
-y
-y
-y
-EOF
-echo; hg tip --config diff.git=True -p
-
-echo % preserve chmod -x
-
-chmod -x f1
-echo c >> f1
-hg record -d '22 0' -mab <<EOF
-y
-y
-y
-EOF
-echo; hg tip --config diff.git=True -p
-
-cd ..
-
-echo % abort early when a merge is in progress
-hg up 4
-touch iwillmergethat
-hg add iwillmergethat
-hg branch thatbranch
-hg ci -m'new head'
-hg up default
-hg merge thatbranch
-echo; hg record -m'will abort'
-hg up -C
-
-echo % with win32ext
-echo '[extensions]' >> .hg/hgrc
-echo 'win32text = ' >> .hg/hgrc
-echo '[decode]' >> .hg/hgrc
-echo '** = cleverdecode:' >> .hg/hgrc
-echo '[encode]' >> .hg/hgrc
-echo '** = cleverencode:' >> .hg/hgrc
-echo '[patch]' >> .hg/hgrc
-echo 'eol = crlf' >> .hg/hgrc
-
-echo d >> subdir/f1
-hg record -d '23 0' -mw1 <<EOF
-y
-y
-EOF
-echo; hg tip -p
--- a/tests/test-record.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,670 +0,0 @@
-% help
-hg record [OPTION]... [FILE]...
-
-interactively select changes to commit
-
-    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.
-
-    You will be prompted for whether to record changes to each modified file,
-    and for files with multiple changes, for each change to use. For each
-    query, the following responses are possible:
-
-      y - record this change
-      n - skip this change
-
-      s - skip remaining changes to this file
-      f - record remaining changes to this file
-
-      d - done, skip remaining changes and files
-      a - record all changes to all remaining files
-      q - quit, recording no changes
-
-      ? - display help
-
-    This command is not available when committing a merge.
-
-options:
-
- -A --addremove            mark new/missing files as added/removed before
-                           committing
-    --close-branch         mark a branch as closed, hiding it from the branch
-                           list
- -I --include PATTERN [+]  include names matching the given patterns
- -X --exclude PATTERN [+]  exclude names matching the given patterns
- -m --message TEXT         use text as commit message
- -l --logfile FILE         read commit message from file
- -d --date DATE            record datecode as commit date
- -u --user USER            record the specified user as committer
-
-[+] marked option can be specified multiple times
-
-use "hg -v help record" to show global options
-% select no files
-diff --git a/empty-rw b/empty-rw
-new file mode 100644
-examine changes to 'empty-rw'? [Ynsfdaq?] 
-no changes to record
-
-changeset:   -1:000000000000
-tag:         tip
-user:        
-date:        Thu Jan 01 00:00:00 1970 +0000
-
-
-% select files but no hunks
-diff --git a/empty-rw b/empty-rw
-new file mode 100644
-examine changes to 'empty-rw'? [Ynsfdaq?] 
-abort: empty commit message
-
-changeset:   -1:000000000000
-tag:         tip
-user:        
-date:        Thu Jan 01 00:00:00 1970 +0000
-
-
-% record empty file
-diff --git a/empty-rw b/empty-rw
-new file mode 100644
-examine changes to 'empty-rw'? [Ynsfdaq?] 
-
-changeset:   0:c0708cf4e46e
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     empty
-
-
-% summary shows we updated to the new cset
-parent: 0:c0708cf4e46e tip
- empty
-branch: default
-commit: (clean)
-update: (current)
-
-% rename empty file
-diff --git a/empty-rw b/empty-rename
-rename from empty-rw
-rename to empty-rename
-examine changes to 'empty-rw' and 'empty-rename'? [Ynsfdaq?] 
-
-changeset:   1:d695e8dcb197
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:01 1970 +0000
-summary:     rename
-
-
-% copy empty file
-diff --git a/empty-rename b/empty-copy
-copy from empty-rename
-copy to empty-copy
-examine changes to 'empty-rename' and 'empty-copy'? [Ynsfdaq?] 
-
-changeset:   2:1d4b90bea524
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:02 1970 +0000
-summary:     copy
-
-
-% delete empty file
-diff --git a/empty-copy b/empty-copy
-deleted file mode 100644
-examine changes to 'empty-copy'? [Ynsfdaq?] 
-
-changeset:   3:b39a238f01a1
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:03 1970 +0000
-summary:     delete
-
-
-% add binary file
-1 changesets found
-diff --git a/tip.bundle b/tip.bundle
-new file mode 100644
-this is a binary file
-examine changes to 'tip.bundle'? [Ynsfdaq?] 
-
-changeset:   4:ad816da3711e
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:04 1970 +0000
-summary:     binary
-
-diff -r b39a238f01a1 -r ad816da3711e tip.bundle
-Binary file tip.bundle has changed
-
-% change binary file
-1 changesets found
-diff --git a/tip.bundle b/tip.bundle
-this modifies a binary file (all or nothing)
-examine changes to 'tip.bundle'? [Ynsfdaq?] 
-
-changeset:   5:dccd6f3eb485
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:05 1970 +0000
-summary:     binary-change
-
-diff -r ad816da3711e -r dccd6f3eb485 tip.bundle
-Binary file tip.bundle has changed
-
-% rename and change binary file
-1 changesets found
-diff --git a/tip.bundle b/top.bundle
-rename from tip.bundle
-rename to top.bundle
-this modifies a binary file (all or nothing)
-examine changes to 'tip.bundle' and 'top.bundle'? [Ynsfdaq?] 
-
-changeset:   6:7fa44105f5b3
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:06 1970 +0000
-summary:     binary-change-rename
-
-diff -r dccd6f3eb485 -r 7fa44105f5b3 tip.bundle
-Binary file tip.bundle has changed
-diff -r dccd6f3eb485 -r 7fa44105f5b3 top.bundle
-Binary file top.bundle has changed
-
-% add plain file
-diff --git a/plain b/plain
-new file mode 100644
-examine changes to 'plain'? [Ynsfdaq?] 
-
-changeset:   7:11fb457c1be4
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:07 1970 +0000
-summary:     plain
-
-diff -r 7fa44105f5b3 -r 11fb457c1be4 plain
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/plain	Thu Jan 01 00:00:07 1970 +0000
-@@ -0,0 +1,10 @@
-+1
-+2
-+3
-+4
-+5
-+6
-+7
-+8
-+9
-+10
-
-% modify end of plain file
-diff --git a/plain b/plain
-1 hunks, 1 lines changed
-examine changes to 'plain'? [Ynsfdaq?] 
-@@ -8,3 +8,4 @@
- 8
- 9
- 10
-+11
-record this change to 'plain'? [Ynsfdaq?] 
-% modify end of plain file, no EOL
-diff --git a/plain b/plain
-1 hunks, 1 lines changed
-examine changes to 'plain'? [Ynsfdaq?] 
-@@ -9,3 +9,4 @@
- 9
- 10
- 11
-+7264f99c5f5ff3261504828afa4fb4d406c3af54
-\ No newline at end of file
-record this change to 'plain'? [Ynsfdaq?] 
-% modify end of plain file, add EOL
-diff --git a/plain b/plain
-1 hunks, 2 lines changed
-examine changes to 'plain'? [Ynsfdaq?] 
-@@ -9,4 +9,4 @@
- 9
- 10
- 11
--7264f99c5f5ff3261504828afa4fb4d406c3af54
-\ No newline at end of file
-+7264f99c5f5ff3261504828afa4fb4d406c3af54
-record this change to 'plain'? [Ynsfdaq?] 
-% modify beginning, trim end, record both
-diff --git a/plain b/plain
-2 hunks, 4 lines changed
-examine changes to 'plain'? [Ynsfdaq?] 
-@@ -1,4 +1,4 @@
--1
-+2
- 2
- 3
- 4
-record change 1/2 to 'plain'? [Ynsfdaq?] 
-@@ -8,5 +8,3 @@
- 8
- 9
- 10
--11
--7264f99c5f5ff3261504828afa4fb4d406c3af54
-record change 2/2 to 'plain'? [Ynsfdaq?] 
-
-changeset:   11:efca65c9b09e
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:10 1970 +0000
-summary:     begin-and-end
-
-diff -r cd07d48e8cbe -r efca65c9b09e plain
---- a/plain	Thu Jan 01 00:00:10 1970 +0000
-+++ b/plain	Thu Jan 01 00:00:10 1970 +0000
-@@ -1,4 +1,4 @@
--1
-+2
- 2
- 3
- 4
-@@ -8,5 +8,3 @@
- 8
- 9
- 10
--11
--7264f99c5f5ff3261504828afa4fb4d406c3af54
-
-% trim beginning, modify end
-% record end
-diff --git a/plain b/plain
-2 hunks, 5 lines changed
-examine changes to 'plain'? [Ynsfdaq?] 
-@@ -1,9 +1,6 @@
--2
--2
--3
- 4
- 5
- 6
- 7
- 8
- 9
-record change 1/2 to 'plain'? [Ynsfdaq?] 
-@@ -4,7 +1,7 @@
- 4
- 5
- 6
- 7
- 8
- 9
--10
-+10.new
-record change 2/2 to 'plain'? [Ynsfdaq?] 
-
-changeset:   12:7d1e66983c15
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:11 1970 +0000
-summary:     end-only
-
-diff -r efca65c9b09e -r 7d1e66983c15 plain
---- a/plain	Thu Jan 01 00:00:10 1970 +0000
-+++ b/plain	Thu Jan 01 00:00:11 1970 +0000
-@@ -7,4 +7,4 @@
- 7
- 8
- 9
--10
-+10.new
-
-% record beginning
-diff --git a/plain b/plain
-1 hunks, 3 lines changed
-examine changes to 'plain'? [Ynsfdaq?] 
-@@ -1,6 +1,3 @@
--2
--2
--3
- 4
- 5
- 6
-record this change to 'plain'? [Ynsfdaq?] 
-
-changeset:   13:a09fc62a0e61
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:12 1970 +0000
-summary:     begin-only
-
-diff -r 7d1e66983c15 -r a09fc62a0e61 plain
---- a/plain	Thu Jan 01 00:00:11 1970 +0000
-+++ b/plain	Thu Jan 01 00:00:12 1970 +0000
-@@ -1,6 +1,3 @@
--2
--2
--3
- 4
- 5
- 6
-
-% add to beginning, trim from end
-% record end
-diff --git a/plain b/plain
-2 hunks, 4 lines changed
-examine changes to 'plain'? [Ynsfdaq?] 
-@@ -1,6 +1,9 @@
-+1
-+2
-+3
- 4
- 5
- 6
- 7
- 8
- 9
-record change 1/2 to 'plain'? [Ynsfdaq?] 
-@@ -1,7 +4,6 @@
- 4
- 5
- 6
- 7
- 8
- 9
--10.new
-record change 2/2 to 'plain'? [Ynsfdaq?] 
-% add to beginning, middle, end
-% record beginning, middle
-diff --git a/plain b/plain
-3 hunks, 7 lines changed
-examine changes to 'plain'? [Ynsfdaq?] 
-@@ -1,2 +1,5 @@
-+1
-+2
-+3
- 4
- 5
-record change 1/3 to 'plain'? [Ynsfdaq?] 
-@@ -1,6 +4,8 @@
- 4
- 5
-+5.new
-+5.reallynew
- 6
- 7
- 8
- 9
-record change 2/3 to 'plain'? [Ynsfdaq?] 
-@@ -3,4 +8,6 @@
- 6
- 7
- 8
- 9
-+10
-+11
-record change 3/3 to 'plain'? [Ynsfdaq?] 
-
-changeset:   15:7d137997f3a6
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:14 1970 +0000
-summary:     middle-only
-
-diff -r c0b8e5fb0be6 -r 7d137997f3a6 plain
---- a/plain	Thu Jan 01 00:00:13 1970 +0000
-+++ b/plain	Thu Jan 01 00:00:14 1970 +0000
-@@ -1,5 +1,10 @@
-+1
-+2
-+3
- 4
- 5
-+5.new
-+5.reallynew
- 6
- 7
- 8
-
-% record end
-diff --git a/plain b/plain
-1 hunks, 2 lines changed
-examine changes to 'plain'? [Ynsfdaq?] 
-@@ -9,3 +9,5 @@
- 7
- 8
- 9
-+10
-+11
-record this change to 'plain'? [Ynsfdaq?] 
-
-changeset:   16:4959e3ff13eb
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:15 1970 +0000
-summary:     end-only
-
-diff -r 7d137997f3a6 -r 4959e3ff13eb plain
---- a/plain	Thu Jan 01 00:00:14 1970 +0000
-+++ b/plain	Thu Jan 01 00:00:15 1970 +0000
-@@ -9,3 +9,5 @@
- 7
- 8
- 9
-+10
-+11
-
-adding subdir/a
-diff --git a/subdir/a b/subdir/a
-1 hunks, 1 lines changed
-examine changes to 'subdir/a'? [Ynsfdaq?] 
-@@ -1,1 +1,2 @@
- a
-+a
-record this change to 'subdir/a'? [Ynsfdaq?] 
-
-changeset:   18:40698cd490b2
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:16 1970 +0000
-summary:     subdir-change
-
-diff -r 661eacdc08b9 -r 40698cd490b2 subdir/a
---- a/subdir/a	Thu Jan 01 00:00:16 1970 +0000
-+++ b/subdir/a	Thu Jan 01 00:00:16 1970 +0000
-@@ -1,1 +1,2 @@
- a
-+a
-
-% help, quit
-diff --git a/subdir/f1 b/subdir/f1
-1 hunks, 1 lines changed
-examine changes to 'subdir/f1'? [Ynsfdaq?] 
-y - record this change
-n - skip this change
-s - skip remaining changes to this file
-f - record remaining changes to this file
-d - done, skip remaining changes and files
-a - record all changes to all remaining files
-q - quit, recording no changes
-? - display help
-examine changes to 'subdir/f1'? [Ynsfdaq?] 
-abort: user quit
-% skip
-diff --git a/subdir/f1 b/subdir/f1
-1 hunks, 1 lines changed
-examine changes to 'subdir/f1'? [Ynsfdaq?] 
-diff --git a/subdir/f2 b/subdir/f2
-1 hunks, 1 lines changed
-examine changes to 'subdir/f2'? [Ynsfdaq?] abort: response expected
-% no
-diff --git a/subdir/f1 b/subdir/f1
-1 hunks, 1 lines changed
-examine changes to 'subdir/f1'? [Ynsfdaq?] 
-diff --git a/subdir/f2 b/subdir/f2
-1 hunks, 1 lines changed
-examine changes to 'subdir/f2'? [Ynsfdaq?] abort: response expected
-% f, quit
-diff --git a/subdir/f1 b/subdir/f1
-1 hunks, 1 lines changed
-examine changes to 'subdir/f1'? [Ynsfdaq?] 
-diff --git a/subdir/f2 b/subdir/f2
-1 hunks, 1 lines changed
-examine changes to 'subdir/f2'? [Ynsfdaq?] 
-abort: user quit
-% s, all
-diff --git a/subdir/f1 b/subdir/f1
-1 hunks, 1 lines changed
-examine changes to 'subdir/f1'? [Ynsfdaq?] 
-diff --git a/subdir/f2 b/subdir/f2
-1 hunks, 1 lines changed
-examine changes to 'subdir/f2'? [Ynsfdaq?] 
-
-changeset:   20:d2d8c25276a8
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:18 1970 +0000
-summary:     x
-
-diff -r 25eb2a7694fb -r d2d8c25276a8 subdir/f2
---- a/subdir/f2	Thu Jan 01 00:00:17 1970 +0000
-+++ b/subdir/f2	Thu Jan 01 00:00:18 1970 +0000
-@@ -1,1 +1,2 @@
- b
-+b
-
-% f
-diff --git a/subdir/f1 b/subdir/f1
-1 hunks, 1 lines changed
-examine changes to 'subdir/f1'? [Ynsfdaq?] 
-
-changeset:   21:1013f51ce32f
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:19 1970 +0000
-summary:     y
-
-diff -r d2d8c25276a8 -r 1013f51ce32f subdir/f1
---- a/subdir/f1	Thu Jan 01 00:00:18 1970 +0000
-+++ b/subdir/f1	Thu Jan 01 00:00:19 1970 +0000
-@@ -1,1 +1,2 @@
- a
-+a
-
-% preserve chmod +x
-diff --git a/subdir/f1 b/subdir/f1
-old mode 100644
-new mode 100755
-1 hunks, 1 lines changed
-examine changes to 'subdir/f1'? [Ynsfdaq?] 
-@@ -1,2 +1,3 @@
- a
- a
-+a
-record this change to 'subdir/f1'? [Ynsfdaq?] 
-
-changeset:   22:5df857735621
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:20 1970 +0000
-summary:     z
-
-diff --git a/subdir/f1 b/subdir/f1
-old mode 100644
-new mode 100755
---- a/subdir/f1
-+++ b/subdir/f1
-@@ -1,2 +1,3 @@
- a
- a
-+a
-
-% preserve execute permission on original
-diff --git a/subdir/f1 b/subdir/f1
-1 hunks, 1 lines changed
-examine changes to 'subdir/f1'? [Ynsfdaq?] 
-@@ -1,3 +1,4 @@
- a
- a
- a
-+b
-record this change to 'subdir/f1'? [Ynsfdaq?] 
-
-changeset:   23:a4ae36a78715
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:21 1970 +0000
-summary:     aa
-
-diff --git a/subdir/f1 b/subdir/f1
---- a/subdir/f1
-+++ b/subdir/f1
-@@ -1,3 +1,4 @@
- a
- a
- a
-+b
-
-% preserve chmod -x
-diff --git a/subdir/f1 b/subdir/f1
-old mode 100755
-new mode 100644
-1 hunks, 1 lines changed
-examine changes to 'subdir/f1'? [Ynsfdaq?] 
-@@ -2,3 +2,4 @@
- a
- a
- b
-+c
-record this change to 'subdir/f1'? [Ynsfdaq?] 
-
-changeset:   24:1460f6e47966
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:22 1970 +0000
-summary:     ab
-
-diff --git a/subdir/f1 b/subdir/f1
-old mode 100755
-new mode 100644
---- a/subdir/f1
-+++ b/subdir/f1
-@@ -2,3 +2,4 @@
- a
- a
- b
-+c
-
-% abort early when a merge is in progress
-1 files updated, 0 files merged, 5 files removed, 0 files unresolved
-marked working directory as branch thatbranch
-5 files updated, 0 files merged, 2 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-
-abort: cannot partially commit a merge (use hg commit instead)
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-% with win32ext
-diff --git a/subdir/f1 b/subdir/f1
-1 hunks, 1 lines changed
-examine changes to 'subdir/f1'? [Ynsfdaq?] 
-@@ -3,3 +3,4 @@
- a
- b
- c
-+d
-record this change to 'subdir/f1'? [Ynsfdaq?] 
-
-changeset:   26:5bacc1f6e9cf
-tag:         tip
-parent:      24:1460f6e47966
-user:        test
-date:        Thu Jan 01 00:00:23 1970 +0000
-summary:     w1
-
-diff -r 1460f6e47966 -r 5bacc1f6e9cf subdir/f1
---- a/subdir/f1	Thu Jan 01 00:00:22 1970 +0000
-+++ b/subdir/f1	Thu Jan 01 00:00:23 1970 +0000
-@@ -3,3 +3,4 @@
- a
- b
- c
-+d
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-record.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,934 @@
+Set up a repo
+
+  $ echo "[ui]" >> $HGRCPATH
+  $ echo "interactive=true" >> $HGRCPATH
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "record=" >> $HGRCPATH
+
+  $ hg init a
+  $ cd a
+
+Select no files
+
+  $ touch empty-rw
+  $ hg add empty-rw
+
+  $ hg record empty-rw<<EOF
+  > n
+  > EOF
+  diff --git a/empty-rw b/empty-rw
+  new file mode 100644
+  examine changes to 'empty-rw'? [Ynsfdaq?] 
+  no changes to record
+
+  $ hg tip -p
+  changeset:   -1:000000000000
+  tag:         tip
+  user:        
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  
+  
+
+Select files but no hunks
+
+  $ hg record empty-rw<<EOF
+  > y
+  > n
+  > EOF
+  diff --git a/empty-rw b/empty-rw
+  new file mode 100644
+  examine changes to 'empty-rw'? [Ynsfdaq?] 
+  abort: empty commit message
+  [255]
+
+  $ hg tip -p
+  changeset:   -1:000000000000
+  tag:         tip
+  user:        
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  
+  
+
+Record empty file
+
+  $ hg record -d '0 0' -m empty empty-rw<<EOF
+  > y
+  > y
+  > EOF
+  diff --git a/empty-rw b/empty-rw
+  new file mode 100644
+  examine changes to 'empty-rw'? [Ynsfdaq?] 
+
+  $ hg tip -p
+  changeset:   0:c0708cf4e46e
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     empty
+  
+  
+
+Summary shows we updated to the new cset
+
+  $ hg summary
+  parent: 0:c0708cf4e46e tip
+   empty
+  branch: default
+  commit: (clean)
+  update: (current)
+
+Rename empty file
+
+  $ hg mv empty-rw empty-rename
+  $ hg record -d '1 0' -m rename<<EOF
+  > y
+  > EOF
+  diff --git a/empty-rw b/empty-rename
+  rename from empty-rw
+  rename to empty-rename
+  examine changes to 'empty-rw' and 'empty-rename'? [Ynsfdaq?] 
+
+  $ hg tip -p
+  changeset:   1:d695e8dcb197
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:01 1970 +0000
+  summary:     rename
+  
+  
+
+Copy empty file
+
+  $ hg cp empty-rename empty-copy
+  $ hg record -d '2 0' -m copy<<EOF
+  > y
+  > EOF
+  diff --git a/empty-rename b/empty-copy
+  copy from empty-rename
+  copy to empty-copy
+  examine changes to 'empty-rename' and 'empty-copy'? [Ynsfdaq?] 
+
+  $ hg tip -p
+  changeset:   2:1d4b90bea524
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:02 1970 +0000
+  summary:     copy
+  
+  
+
+Delete empty file
+
+  $ hg rm empty-copy
+  $ hg record -d '3 0' -m delete<<EOF
+  > y
+  > EOF
+  diff --git a/empty-copy b/empty-copy
+  deleted file mode 100644
+  examine changes to 'empty-copy'? [Ynsfdaq?] 
+
+  $ hg tip -p
+  changeset:   3:b39a238f01a1
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:03 1970 +0000
+  summary:     delete
+  
+  
+
+Add binary file
+
+  $ hg bundle --base -2 tip.bundle
+  1 changesets found
+  $ hg add tip.bundle
+  $ hg record -d '4 0' -m binary<<EOF
+  > y
+  > EOF
+  diff --git a/tip.bundle b/tip.bundle
+  new file mode 100644
+  this is a binary file
+  examine changes to 'tip.bundle'? [Ynsfdaq?] 
+
+  $ hg tip -p
+  changeset:   4:ad816da3711e
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:04 1970 +0000
+  summary:     binary
+  
+  diff -r b39a238f01a1 -r ad816da3711e tip.bundle
+  Binary file tip.bundle has changed
+  
+
+Change binary file
+
+  $ hg bundle --base -2 tip.bundle
+  1 changesets found
+  $ hg record -d '5 0' -m binary-change<<EOF
+  > y
+  > EOF
+  diff --git a/tip.bundle b/tip.bundle
+  this modifies a binary file (all or nothing)
+  examine changes to 'tip.bundle'? [Ynsfdaq?] 
+
+  $ hg tip -p
+  changeset:   5:dccd6f3eb485
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:05 1970 +0000
+  summary:     binary-change
+  
+  diff -r ad816da3711e -r dccd6f3eb485 tip.bundle
+  Binary file tip.bundle has changed
+  
+
+Rename and change binary file
+
+  $ hg mv tip.bundle top.bundle
+  $ hg bundle --base -2 top.bundle
+  1 changesets found
+  $ hg record -d '6 0' -m binary-change-rename<<EOF
+  > y
+  > EOF
+  diff --git a/tip.bundle b/top.bundle
+  rename from tip.bundle
+  rename to top.bundle
+  this modifies a binary file (all or nothing)
+  examine changes to 'tip.bundle' and 'top.bundle'? [Ynsfdaq?] 
+
+  $ hg tip -p
+  changeset:   6:7fa44105f5b3
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:06 1970 +0000
+  summary:     binary-change-rename
+  
+  diff -r dccd6f3eb485 -r 7fa44105f5b3 tip.bundle
+  Binary file tip.bundle has changed
+  diff -r dccd6f3eb485 -r 7fa44105f5b3 top.bundle
+  Binary file top.bundle has changed
+  
+
+Add plain file
+
+  $ for i in 1 2 3 4 5 6 7 8 9 10; do
+  >     echo $i >> plain
+  > done
+
+  $ hg add plain
+  $ hg record -d '7 0' -m plain plain<<EOF
+  > y
+  > y
+  > EOF
+  diff --git a/plain b/plain
+  new file mode 100644
+  examine changes to 'plain'? [Ynsfdaq?] 
+
+  $ hg tip -p
+  changeset:   7:11fb457c1be4
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:07 1970 +0000
+  summary:     plain
+  
+  diff -r 7fa44105f5b3 -r 11fb457c1be4 plain
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/plain	Thu Jan 01 00:00:07 1970 +0000
+  @@ -0,0 +1,10 @@
+  +1
+  +2
+  +3
+  +4
+  +5
+  +6
+  +7
+  +8
+  +9
+  +10
+  
+
+Modify end of plain file
+
+  $ echo 11 >> plain
+  $ hg record -d '8 0' -m end plain <<EOF
+  > y
+  > y
+  > EOF
+  diff --git a/plain b/plain
+  1 hunks, 1 lines changed
+  examine changes to 'plain'? [Ynsfdaq?] 
+  @@ -8,3 +8,4 @@
+   8
+   9
+   10
+  +11
+  record this change to 'plain'? [Ynsfdaq?] 
+
+Modify end of plain file, no EOL
+
+  $ hg tip --template '{node}' >> plain
+  $ hg record -d '9 0' -m noeol plain <<EOF
+  > y
+  > y
+  > EOF
+  diff --git a/plain b/plain
+  1 hunks, 1 lines changed
+  examine changes to 'plain'? [Ynsfdaq?] 
+  @@ -9,3 +9,4 @@
+   9
+   10
+   11
+  +7264f99c5f5ff3261504828afa4fb4d406c3af54
+  \ No newline at end of file
+  record this change to 'plain'? [Ynsfdaq?] 
+
+Modify end of plain file, add EOL
+
+  $ echo >> plain
+  $ hg record -d '10 0' -m eol plain <<EOF
+  > y
+  > y
+  > y
+  > EOF
+  diff --git a/plain b/plain
+  1 hunks, 1 lines changed
+  examine changes to 'plain'? [Ynsfdaq?] 
+  @@ -9,4 +9,4 @@
+   9
+   10
+   11
+  -7264f99c5f5ff3261504828afa4fb4d406c3af54
+  \ No newline at end of file
+  +7264f99c5f5ff3261504828afa4fb4d406c3af54
+  record this change to 'plain'? [Ynsfdaq?] 
+
+Modify beginning, trim end, record both
+
+  $ rm plain
+  $ for i in 2 2 3 4 5 6 7 8 9 10; do
+  >   echo $i >> plain
+  > done
+
+  $ hg record -d '10 0' -m begin-and-end plain <<EOF
+  > y
+  > y
+  > y
+  > EOF
+  diff --git a/plain b/plain
+  2 hunks, 3 lines changed
+  examine changes to 'plain'? [Ynsfdaq?] 
+  @@ -1,4 +1,4 @@
+  -1
+  +2
+   2
+   3
+   4
+  record change 1/2 to 'plain'? [Ynsfdaq?] 
+  @@ -8,5 +8,3 @@
+   8
+   9
+   10
+  -11
+  -7264f99c5f5ff3261504828afa4fb4d406c3af54
+  record change 2/2 to 'plain'? [Ynsfdaq?] 
+
+  $ hg tip -p
+  changeset:   11:efca65c9b09e
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:10 1970 +0000
+  summary:     begin-and-end
+  
+  diff -r cd07d48e8cbe -r efca65c9b09e plain
+  --- a/plain	Thu Jan 01 00:00:10 1970 +0000
+  +++ b/plain	Thu Jan 01 00:00:10 1970 +0000
+  @@ -1,4 +1,4 @@
+  -1
+  +2
+   2
+   3
+   4
+  @@ -8,5 +8,3 @@
+   8
+   9
+   10
+  -11
+  -7264f99c5f5ff3261504828afa4fb4d406c3af54
+  
+
+Trim beginning, modify end
+
+  $ rm plain
+  > for i in 4 5 6 7 8 9 10.new; do
+  >   echo $i >> plain
+  > done
+
+Record end
+
+  $ hg record -d '11 0' -m end-only plain <<EOF
+  > y
+  > n
+  > y
+  > EOF
+  diff --git a/plain b/plain
+  2 hunks, 4 lines changed
+  examine changes to 'plain'? [Ynsfdaq?] 
+  @@ -1,9 +1,6 @@
+  -2
+  -2
+  -3
+   4
+   5
+   6
+   7
+   8
+   9
+  record change 1/2 to 'plain'? [Ynsfdaq?] 
+  @@ -4,7 +1,7 @@
+   4
+   5
+   6
+   7
+   8
+   9
+  -10
+  +10.new
+  record change 2/2 to 'plain'? [Ynsfdaq?] 
+
+  $ hg tip -p
+  changeset:   12:7d1e66983c15
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:11 1970 +0000
+  summary:     end-only
+  
+  diff -r efca65c9b09e -r 7d1e66983c15 plain
+  --- a/plain	Thu Jan 01 00:00:10 1970 +0000
+  +++ b/plain	Thu Jan 01 00:00:11 1970 +0000
+  @@ -7,4 +7,4 @@
+   7
+   8
+   9
+  -10
+  +10.new
+  
+
+Record beginning
+
+  $ hg record -d '12 0' -m begin-only plain <<EOF
+  > y
+  > y
+  > EOF
+  diff --git a/plain b/plain
+  1 hunks, 3 lines changed
+  examine changes to 'plain'? [Ynsfdaq?] 
+  @@ -1,6 +1,3 @@
+  -2
+  -2
+  -3
+   4
+   5
+   6
+  record this change to 'plain'? [Ynsfdaq?] 
+
+  $ hg tip -p
+  changeset:   13:a09fc62a0e61
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:12 1970 +0000
+  summary:     begin-only
+  
+  diff -r 7d1e66983c15 -r a09fc62a0e61 plain
+  --- a/plain	Thu Jan 01 00:00:11 1970 +0000
+  +++ b/plain	Thu Jan 01 00:00:12 1970 +0000
+  @@ -1,6 +1,3 @@
+  -2
+  -2
+  -3
+   4
+   5
+   6
+  
+
+Add to beginning, trim from end
+
+  $ rm plain
+  $ for i in 1 2 3 4 5 6 7 8 9; do
+  >  echo $i >> plain
+  > done
+
+Record end
+
+  $ hg record --traceback -d '13 0' -m end-again plain<<EOF
+  > y
+  > n
+  > y
+  > EOF
+  diff --git a/plain b/plain
+  2 hunks, 4 lines changed
+  examine changes to 'plain'? [Ynsfdaq?] 
+  @@ -1,6 +1,9 @@
+  +1
+  +2
+  +3
+   4
+   5
+   6
+   7
+   8
+   9
+  record change 1/2 to 'plain'? [Ynsfdaq?] 
+  @@ -1,7 +4,6 @@
+   4
+   5
+   6
+   7
+   8
+   9
+  -10.new
+  record change 2/2 to 'plain'? [Ynsfdaq?] 
+
+Add to beginning, middle, end
+
+  $ rm plain
+  $ for i in 1 2 3 4 5 5.new 5.reallynew 6 7 8 9 10 11; do
+  >   echo $i >> plain
+  > done
+
+Record beginning, middle
+
+  $ hg record -d '14 0' -m middle-only plain <<EOF
+  > y
+  > y
+  > y
+  > n
+  > EOF
+  diff --git a/plain b/plain
+  3 hunks, 7 lines changed
+  examine changes to 'plain'? [Ynsfdaq?] 
+  @@ -1,2 +1,5 @@
+  +1
+  +2
+  +3
+   4
+   5
+  record change 1/3 to 'plain'? [Ynsfdaq?] 
+  @@ -1,6 +4,8 @@
+   4
+   5
+  +5.new
+  +5.reallynew
+   6
+   7
+   8
+   9
+  record change 2/3 to 'plain'? [Ynsfdaq?] 
+  @@ -3,4 +8,6 @@
+   6
+   7
+   8
+   9
+  +10
+  +11
+  record change 3/3 to 'plain'? [Ynsfdaq?] 
+
+  $ hg tip -p
+  changeset:   15:7d137997f3a6
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:14 1970 +0000
+  summary:     middle-only
+  
+  diff -r c0b8e5fb0be6 -r 7d137997f3a6 plain
+  --- a/plain	Thu Jan 01 00:00:13 1970 +0000
+  +++ b/plain	Thu Jan 01 00:00:14 1970 +0000
+  @@ -1,5 +1,10 @@
+  +1
+  +2
+  +3
+   4
+   5
+  +5.new
+  +5.reallynew
+   6
+   7
+   8
+  
+
+Record end
+
+  $ hg record -d '15 0' -m end-only plain <<EOF
+  > y
+  > y
+  > EOF
+  diff --git a/plain b/plain
+  1 hunks, 2 lines changed
+  examine changes to 'plain'? [Ynsfdaq?] 
+  @@ -9,3 +9,5 @@
+   7
+   8
+   9
+  +10
+  +11
+  record this change to 'plain'? [Ynsfdaq?] 
+
+  $ hg tip -p
+  changeset:   16:4959e3ff13eb
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:15 1970 +0000
+  summary:     end-only
+  
+  diff -r 7d137997f3a6 -r 4959e3ff13eb plain
+  --- a/plain	Thu Jan 01 00:00:14 1970 +0000
+  +++ b/plain	Thu Jan 01 00:00:15 1970 +0000
+  @@ -9,3 +9,5 @@
+   7
+   8
+   9
+  +10
+  +11
+  
+
+  $ mkdir subdir
+  $ cd subdir
+  $ echo a > a
+  $ hg ci -d '16 0' -Amsubdir
+  adding subdir/a
+
+  $ echo a >> a
+  $ hg record -d '16 0' -m subdir-change a <<EOF
+  > y
+  > y
+  > EOF
+  diff --git a/subdir/a b/subdir/a
+  1 hunks, 1 lines changed
+  examine changes to 'subdir/a'? [Ynsfdaq?] 
+  @@ -1,1 +1,2 @@
+   a
+  +a
+  record this change to 'subdir/a'? [Ynsfdaq?] 
+
+  $ hg tip -p
+  changeset:   18:40698cd490b2
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:16 1970 +0000
+  summary:     subdir-change
+  
+  diff -r 661eacdc08b9 -r 40698cd490b2 subdir/a
+  --- a/subdir/a	Thu Jan 01 00:00:16 1970 +0000
+  +++ b/subdir/a	Thu Jan 01 00:00:16 1970 +0000
+  @@ -1,1 +1,2 @@
+   a
+  +a
+  
+
+  $ echo a > f1
+  $ echo b > f2
+  $ hg add f1 f2
+
+  $ hg ci -mz -d '17 0'
+
+  $ echo a >> f1
+  $ echo b >> f2
+
+Help, quit
+
+  $ hg record <<EOF
+  > ?
+  > q
+  > EOF
+  diff --git a/subdir/f1 b/subdir/f1
+  1 hunks, 1 lines changed
+  examine changes to 'subdir/f1'? [Ynsfdaq?] 
+  y - record this change
+  n - skip this change
+  s - skip remaining changes to this file
+  f - record remaining changes to this file
+  d - done, skip remaining changes and files
+  a - record all changes to all remaining files
+  q - quit, recording no changes
+  ? - display help
+  examine changes to 'subdir/f1'? [Ynsfdaq?] 
+  abort: user quit
+  [255]
+
+Skip
+
+  $ hg record <<EOF
+  > s
+  > EOF
+  diff --git a/subdir/f1 b/subdir/f1
+  1 hunks, 1 lines changed
+  examine changes to 'subdir/f1'? [Ynsfdaq?] 
+  diff --git a/subdir/f2 b/subdir/f2
+  1 hunks, 1 lines changed
+  examine changes to 'subdir/f2'? [Ynsfdaq?] abort: response expected
+  [255]
+
+No
+
+  $ hg record <<EOF
+  > n
+  > EOF
+  diff --git a/subdir/f1 b/subdir/f1
+  1 hunks, 1 lines changed
+  examine changes to 'subdir/f1'? [Ynsfdaq?] 
+  diff --git a/subdir/f2 b/subdir/f2
+  1 hunks, 1 lines changed
+  examine changes to 'subdir/f2'? [Ynsfdaq?] abort: response expected
+  [255]
+
+f, quit
+
+  $ hg record <<EOF
+  > f
+  > q
+  > EOF
+  diff --git a/subdir/f1 b/subdir/f1
+  1 hunks, 1 lines changed
+  examine changes to 'subdir/f1'? [Ynsfdaq?] 
+  diff --git a/subdir/f2 b/subdir/f2
+  1 hunks, 1 lines changed
+  examine changes to 'subdir/f2'? [Ynsfdaq?] 
+  abort: user quit
+  [255]
+
+s, all
+
+  $ hg record -d '18 0' -mx <<EOF
+  > s
+  > a
+  > EOF
+  diff --git a/subdir/f1 b/subdir/f1
+  1 hunks, 1 lines changed
+  examine changes to 'subdir/f1'? [Ynsfdaq?] 
+  diff --git a/subdir/f2 b/subdir/f2
+  1 hunks, 1 lines changed
+  examine changes to 'subdir/f2'? [Ynsfdaq?] 
+
+  $ hg tip -p
+  changeset:   20:d2d8c25276a8
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:18 1970 +0000
+  summary:     x
+  
+  diff -r 25eb2a7694fb -r d2d8c25276a8 subdir/f2
+  --- a/subdir/f2	Thu Jan 01 00:00:17 1970 +0000
+  +++ b/subdir/f2	Thu Jan 01 00:00:18 1970 +0000
+  @@ -1,1 +1,2 @@
+   b
+  +b
+  
+
+f
+
+  $ hg record -d '19 0' -my <<EOF
+  > f
+  > EOF
+  diff --git a/subdir/f1 b/subdir/f1
+  1 hunks, 1 lines changed
+  examine changes to 'subdir/f1'? [Ynsfdaq?] 
+
+  $ hg tip -p
+  changeset:   21:1013f51ce32f
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:19 1970 +0000
+  summary:     y
+  
+  diff -r d2d8c25276a8 -r 1013f51ce32f subdir/f1
+  --- a/subdir/f1	Thu Jan 01 00:00:18 1970 +0000
+  +++ b/subdir/f1	Thu Jan 01 00:00:19 1970 +0000
+  @@ -1,1 +1,2 @@
+   a
+  +a
+  
+
+Preserve chmod +x
+
+  $ chmod +x f1
+  $ echo a >> f1
+  $ hg record -d '20 0' -mz <<EOF
+  > y
+  > y
+  > y
+  > EOF
+  diff --git a/subdir/f1 b/subdir/f1
+  old mode 100644
+  new mode 100755
+  1 hunks, 1 lines changed
+  examine changes to 'subdir/f1'? [Ynsfdaq?] 
+  @@ -1,2 +1,3 @@
+   a
+   a
+  +a
+  record this change to 'subdir/f1'? [Ynsfdaq?] 
+
+  $ hg tip --config diff.git=True -p
+  changeset:   22:5df857735621
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:20 1970 +0000
+  summary:     z
+  
+  diff --git a/subdir/f1 b/subdir/f1
+  old mode 100644
+  new mode 100755
+  --- a/subdir/f1
+  +++ b/subdir/f1
+  @@ -1,2 +1,3 @@
+   a
+   a
+  +a
+  
+
+Preserve execute permission on original
+
+  $ echo b >> f1
+  $ hg record -d '21 0' -maa <<EOF
+  > y
+  > y
+  > y
+  > EOF
+  diff --git a/subdir/f1 b/subdir/f1
+  1 hunks, 1 lines changed
+  examine changes to 'subdir/f1'? [Ynsfdaq?] 
+  @@ -1,3 +1,4 @@
+   a
+   a
+   a
+  +b
+  record this change to 'subdir/f1'? [Ynsfdaq?] 
+
+  $ hg tip --config diff.git=True -p
+  changeset:   23:a4ae36a78715
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:21 1970 +0000
+  summary:     aa
+  
+  diff --git a/subdir/f1 b/subdir/f1
+  --- a/subdir/f1
+  +++ b/subdir/f1
+  @@ -1,3 +1,4 @@
+   a
+   a
+   a
+  +b
+  
+
+Preserve chmod -x
+
+  $ chmod -x f1
+  $ echo c >> f1
+  $ hg record -d '22 0' -mab <<EOF
+  > y
+  > y
+  > y
+  > EOF
+  diff --git a/subdir/f1 b/subdir/f1
+  old mode 100755
+  new mode 100644
+  1 hunks, 1 lines changed
+  examine changes to 'subdir/f1'? [Ynsfdaq?] 
+  @@ -2,3 +2,4 @@
+   a
+   a
+   b
+  +c
+  record this change to 'subdir/f1'? [Ynsfdaq?] 
+
+  $ hg tip --config diff.git=True -p
+  changeset:   24:1460f6e47966
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:22 1970 +0000
+  summary:     ab
+  
+  diff --git a/subdir/f1 b/subdir/f1
+  old mode 100755
+  new mode 100644
+  --- a/subdir/f1
+  +++ b/subdir/f1
+  @@ -2,3 +2,4 @@
+   a
+   a
+   b
+  +c
+  
+
+  $ cd ..
+
+Abort early when a merge is in progress
+
+  $ hg up 4
+  1 files updated, 0 files merged, 5 files removed, 0 files unresolved
+
+  $ touch iwillmergethat
+  $ hg add iwillmergethat
+
+  $ hg branch thatbranch
+  marked working directory as branch thatbranch
+
+  $ hg ci -m'new head'
+
+  $ hg up default
+  5 files updated, 0 files merged, 2 files removed, 0 files unresolved
+
+  $ hg merge thatbranch
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+  $ hg record -m'will abort'
+  abort: cannot partially commit a merge (use hg commit instead)
+  [255]
+
+  $ hg up -C
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+With win32text
+
+  $ echo '[extensions]' >> .hg/hgrc
+  $ echo 'win32text = ' >> .hg/hgrc
+  $ echo '[decode]' >> .hg/hgrc
+  $ echo '** = cleverdecode:' >> .hg/hgrc
+  $ echo '[encode]' >> .hg/hgrc
+  $ echo '** = cleverencode:' >> .hg/hgrc
+  $ echo '[patch]' >> .hg/hgrc
+  $ echo 'eol = crlf' >> .hg/hgrc
+
+  $ echo d >> subdir/f1
+  $ hg record -d '23 0' -mw1 <<EOF
+  > y
+  > y
+  > EOF
+  diff --git a/subdir/f1 b/subdir/f1
+  1 hunks, 1 lines changed
+  examine changes to 'subdir/f1'? [Ynsfdaq?] 
+  @@ -3,3 +3,4 @@
+   a
+   b
+   c
+  +d
+  record this change to 'subdir/f1'? [Ynsfdaq?] 
+
+  $ hg tip -p
+  changeset:   26:5bacc1f6e9cf
+  tag:         tip
+  parent:      24:1460f6e47966
+  user:        test
+  date:        Thu Jan 01 00:00:23 1970 +0000
+  summary:     w1
+  
+  diff -r 1460f6e47966 -r 5bacc1f6e9cf subdir/f1
+  --- a/subdir/f1	Thu Jan 01 00:00:22 1970 +0000
+  +++ b/subdir/f1	Thu Jan 01 00:00:23 1970 +0000
+  @@ -3,3 +3,4 @@
+   a
+   b
+   c
+  +d
+  
--- a/tests/test-relink	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-#!/bin/sh
-
-echo "[extensions]" >> $HGRCPATH
-echo "relink=" >> $HGRCPATH
-
-fix_path()
-{
-    tr '\\' /
-}
-
-cat > arelinked.py <<EOF
-import sys, os
-from mercurial import util
-path1, path2 = sys.argv[1:3]
-if util.samefile(path1, path2):
-    print '%s == %s' % (path1, path2)
-else:
-    print '%s != %s' % (path1, path2)
-EOF
-
-echo '% create source repository'
-hg init repo
-cd repo
-echo '[ui]' > .hg/hgrc
-echo 'username= A. Foo <a.foo@bar.com>' >> .hg/hgrc
-echo a > a
-echo b > b
-hg ci -Am addfile
-echo a >> a
-echo a >> b
-hg ci -Am changefiles
-# Test files are read in binary mode
-python -c "file('.hg/store/data/dummy.i', 'wb').write('a\r\nb\n')"
-cd ..
-
-echo '% clone and pull to break links'
-hg clone --pull -r0 repo clone
-cd clone
-echo '[ui]' >> .hg/hgrc
-echo 'username= A. Baz <a.baz@bar.com>' >> .hg/hgrc
-hg pull -q
-echo b >> b
-hg ci -m changeb
-python -c "file('.hg/store/data/dummy.i', 'wb').write('a\nb\r\n')"
-
-echo '% relink'
-hg relink --debug | sed 's:relinking.*store:relinking .hg/store:g' \
-    | fix_path
-cd ..
-
-echo '% check hardlinks'
-python arelinked.py repo/.hg/store/data/a.i clone/.hg/store/data/a.i
-python arelinked.py repo/.hg/store/data/b.i clone/.hg/store/data/b.i
-
--- a/tests/test-relink.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-% create source repository
-adding a
-adding b
-% clone and pull to break links
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 2 changes to 2 files
-updating to branch default
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-% relink
-relinking .hg/store
-tip has 2 files, estimated total number of files: 3
-collecting: 00changelog.i 1/3 files (33.33%)
-collecting: 00manifest.i 2/3 files (66.67%)
-collecting: a.i 3/3 files (100.00%)
-collecting: b.i 4/3 files (133.33%)
-collecting: dummy.i 5/3 files (166.67%)
-collected 5 candidate storage files
-not linkable: 00changelog.i
-not linkable: 00manifest.i
-pruning: data/a.i 3/5  files (60.00%)
-not linkable: data/b.i
-pruning: data/dummy.i 5/5  files (100.00%)
-pruned down to 2 probably relinkable files
-relinking: data/a.i 1/2  files (50.00%)
-not linkable: data/dummy.i
-relinked 1 files (136 bytes reclaimed)
-% check hardlinks
-repo/.hg/store/data/a.i == clone/.hg/store/data/a.i
-repo/.hg/store/data/b.i != clone/.hg/store/data/b.i
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-relink.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,89 @@
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "relink=" >> $HGRCPATH
+
+  $ fix_path() {
+  >     tr '\\' /
+  > }
+
+  $ cat > arelinked.py <<EOF
+  > import sys, os
+  > from mercurial import util
+  > path1, path2 = sys.argv[1:3]
+  > if util.samefile(path1, path2):
+  >     print '%s == %s' % (path1, path2)
+  > else:
+  >     print '%s != %s' % (path1, path2)
+  > EOF
+
+
+create source repository
+
+  $ hg init repo
+  $ cd repo
+  $ echo '[ui]' > .hg/hgrc
+  $ echo 'username= A. Foo <a.foo@bar.com>' >> .hg/hgrc
+  $ echo a > a
+  $ echo b > b
+  $ hg ci -Am addfile
+  adding a
+  adding b
+  $ echo a >> a
+  $ echo a >> b
+  $ hg ci -Am changefiles
+
+Test files are read in binary mode
+
+  $ python -c "file('.hg/store/data/dummy.i', 'wb').write('a\r\nb\n')"
+  $ cd ..
+
+
+clone and pull to break links
+
+  $ hg clone --pull -r0 repo clone
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 2 changes to 2 files
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd clone
+  $ echo '[ui]' >> .hg/hgrc
+  $ echo 'username= A. Baz <a.baz@bar.com>' >> .hg/hgrc
+  $ hg pull -q
+  $ echo b >> b
+  $ hg ci -m changeb
+  created new head
+  $ python -c "file('.hg/store/data/dummy.i', 'wb').write('a\nb\r\n')"
+
+
+relink
+
+  $ hg relink --debug | fix_path
+  relinking */.hg/store (glob)
+  tip has 2 files, estimated total number of files: 3
+  collecting: 00changelog.i 1/3 files (33.33%)
+  collecting: 00manifest.i 2/3 files (66.67%)
+  collecting: a.i 3/3 files (100.00%)
+  collecting: b.i 4/3 files (133.33%)
+  collecting: dummy.i 5/3 files (166.67%)
+  collected 5 candidate storage files
+  not linkable: 00changelog.i
+  not linkable: 00manifest.i
+  pruning: data/a.i 3/5  files (60.00%)
+  not linkable: data/b.i
+  pruning: data/dummy.i 5/5  files (100.00%)
+  pruned down to 2 probably relinkable files
+  relinking: data/a.i 1/2  files (50.00%)
+  not linkable: data/dummy.i
+  relinked 1 files (136 bytes reclaimed)
+  $ cd ..
+
+
+check hardlinks
+
+  $ python arelinked.py repo/.hg/store/data/a.i clone/.hg/store/data/a.i
+  repo/.hg/store/data/a.i == clone/.hg/store/data/a.i
+  $ python arelinked.py repo/.hg/store/data/b.i clone/.hg/store/data/b.i
+  repo/.hg/store/data/b.i != clone/.hg/store/data/b.i
+
--- a/tests/test-remove	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,120 +0,0 @@
-#!/bin/sh
-
-remove() {
-    hg rm $@
-    echo "exit code: $?"
-    hg st
-    # do not use ls -R, which recurses in .hg subdirs on Mac OS X 10.5
-    find . -name .hg -prune -o -type f -print | sort
-    hg up -C
-}
-
-hg init a
-cd a
-echo a > foo
-
-echo % file not managed
-remove foo
-
-hg add foo
-hg commit -m1
-
-# the table cases
-
-echo % 00 state added, options none
-echo b > bar
-hg add bar
-remove bar
-
-echo % 01 state clean, options none
-remove foo
-
-echo % 02 state modified, options none
-echo b >> foo
-remove foo
-
-echo % 03 state missing, options none
-rm foo
-remove foo
-
-echo % 10 state added, options -f
-echo b > bar
-hg add bar
-remove -f bar
-rm bar
-
-echo % 11 state clean, options -f
-remove -f foo
-
-echo % 12 state modified, options -f
-echo b >> foo
-remove -f foo
-
-echo % 13 state missing, options -f
-rm foo
-remove -f foo
-
-echo % 20 state added, options -A
-echo b > bar
-hg add bar
-remove -A bar
-
-echo % 21 state clean, options -A
-remove -A foo
-
-echo % 22 state modified, options -A
-echo b >> foo
-remove -A foo
-
-echo % 23 state missing, options -A
-rm foo
-remove -A foo
-
-echo % 30 state added, options -Af
-echo b > bar
-hg add bar
-remove -Af bar
-rm bar
-
-echo % 31 state clean, options -Af
-remove -Af foo
-
-echo % 32 state modified, options -Af
-echo b >> foo
-remove -Af foo
-
-echo % 33 state missing, options -Af
-rm foo
-remove -Af foo
-
-# test some directory stuff
-
-mkdir test
-echo a > test/foo
-echo b > test/bar
-hg ci -Am2
-
-echo % dir, options none
-rm test/bar
-remove test
-
-echo % dir, options -f
-rm test/bar
-remove -f test
-
-echo % dir, options -A
-rm test/bar
-remove -A test
-
-echo % dir, options -Af
-rm test/bar
-remove -Af test
-
-echo 'test remove dropping empty trees (issue1861)'
-mkdir -p issue1861/b/c
-echo x > issue1861/x
-echo y > issue1861/b/c/y
-hg ci -Am add
-hg rm issue1861/b
-hg ci -m remove
-ls issue1861
--- a/tests/test-remove-new	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-#!/bin/sh
-
-# test that 'hg commit' does not crash if the user removes a 
-# newly added file
-
-hg init
-echo This is file a1 > a
-hg add a
-hg commit -m "commit #0" -d "1000000 0"
-touch b
-hg add b
-rm b
-hg commit -A -m"comment #1" -d "1000000 0"
-exit 0
--- a/tests/test-remove-new.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-removing b
-nothing changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-remove-new.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,13 @@
+test that 'hg commit' does not crash if the user removes a newly added file
+
+  $ hg init
+  $ echo This is file a1 > a
+  $ hg add a
+  $ hg commit -m "commit #0"
+  $ touch b
+  $ hg add b
+  $ rm b
+  $ hg commit -A -m"comment #1"
+  removing b
+  nothing changed
+  [1]
--- a/tests/test-remove.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,139 +0,0 @@
-% file not managed
-not removing foo: file is untracked
-exit code: 1
-? foo
-./foo
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% 00 state added, options none
-not removing bar: file has been marked for add (use -f to force removal)
-exit code: 1
-A bar
-./bar
-./foo
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% 01 state clean, options none
-exit code: 0
-R foo
-? bar
-./bar
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% 02 state modified, options none
-not removing foo: file is modified (use -f to force removal)
-exit code: 1
-M foo
-? bar
-./bar
-./foo
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% 03 state missing, options none
-exit code: 0
-R foo
-? bar
-./bar
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% 10 state added, options -f
-exit code: 0
-? bar
-./bar
-./foo
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% 11 state clean, options -f
-exit code: 0
-R foo
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% 12 state modified, options -f
-exit code: 0
-R foo
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% 13 state missing, options -f
-exit code: 0
-R foo
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% 20 state added, options -A
-not removing bar: file still exists (use -f to force removal)
-exit code: 1
-A bar
-./bar
-./foo
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% 21 state clean, options -A
-not removing foo: file still exists (use -f to force removal)
-exit code: 1
-? bar
-./bar
-./foo
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% 22 state modified, options -A
-not removing foo: file still exists (use -f to force removal)
-exit code: 1
-M foo
-? bar
-./bar
-./foo
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% 23 state missing, options -A
-exit code: 0
-R foo
-? bar
-./bar
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% 30 state added, options -Af
-exit code: 0
-? bar
-./bar
-./foo
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% 31 state clean, options -Af
-exit code: 0
-R foo
-./foo
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% 32 state modified, options -Af
-exit code: 0
-R foo
-./foo
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% 33 state missing, options -Af
-exit code: 0
-R foo
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-adding test/bar
-adding test/foo
-% dir, options none
-removing test/bar
-removing test/foo
-exit code: 0
-R test/bar
-R test/foo
-./foo
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% dir, options -f
-removing test/bar
-removing test/foo
-exit code: 0
-R test/bar
-R test/foo
-./foo
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% dir, options -A
-not removing test/foo: file still exists (use -f to force removal)
-removing test/bar
-exit code: 1
-R test/bar
-./foo
-./test/foo
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% dir, options -Af
-removing test/bar
-removing test/foo
-exit code: 0
-R test/bar
-R test/foo
-./foo
-./test/foo
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-test remove dropping empty trees (issue1861)
-adding issue1861/b/c/y
-adding issue1861/x
-removing issue1861/b/c/y
-x
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-remove.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,256 @@
+  $ remove() {
+  >     hg rm $@
+  >     echo "exit code: $?" # no-check-code
+  >     hg st
+  >     # do not use ls -R, which recurses in .hg subdirs on Mac OS X 10.5
+  >     find . -name .hg -prune -o -type f -print | sort
+  >     hg up -C
+  > }
+
+  $ hg init a
+  $ cd a
+  $ echo a > foo
+
+file not managed
+
+  $ remove foo
+  not removing foo: file is untracked
+  exit code: 1
+  ? foo
+  ./foo
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ hg add foo
+  $ hg commit -m1
+
+the table cases
+00 state added, options none
+
+  $ echo b > bar
+  $ hg add bar
+  $ remove bar
+  not removing bar: file has been marked for add (use -f to force removal)
+  exit code: 1
+  A bar
+  ./bar
+  ./foo
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+01 state clean, options none
+
+  $ remove foo
+  exit code: 0
+  R foo
+  ? bar
+  ./bar
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+02 state modified, options none
+
+  $ echo b >> foo
+  $ remove foo
+  not removing foo: file is modified (use -f to force removal)
+  exit code: 1
+  M foo
+  ? bar
+  ./bar
+  ./foo
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+03 state missing, options none
+
+  $ rm foo
+  $ remove foo
+  exit code: 0
+  R foo
+  ? bar
+  ./bar
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+10 state added, options -f
+
+  $ echo b > bar
+  $ hg add bar
+  $ remove -f bar
+  exit code: 0
+  ? bar
+  ./bar
+  ./foo
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm bar
+
+11 state clean, options -f
+
+  $ remove -f foo
+  exit code: 0
+  R foo
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+12 state modified, options -f
+
+  $ echo b >> foo
+  $ remove -f foo
+  exit code: 0
+  R foo
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+13 state missing, options -f
+
+  $ rm foo
+  $ remove -f foo
+  exit code: 0
+  R foo
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+20 state added, options -A
+
+  $ echo b > bar
+  $ hg add bar
+  $ remove -A bar
+  not removing bar: file still exists (use -f to force removal)
+  exit code: 1
+  A bar
+  ./bar
+  ./foo
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+21 state clean, options -A
+
+  $ remove -A foo
+  not removing foo: file still exists (use -f to force removal)
+  exit code: 1
+  ? bar
+  ./bar
+  ./foo
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+22 state modified, options -A
+
+  $ echo b >> foo
+  $ remove -A foo
+  not removing foo: file still exists (use -f to force removal)
+  exit code: 1
+  M foo
+  ? bar
+  ./bar
+  ./foo
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+23 state missing, options -A
+
+  $ rm foo
+  $ remove -A foo
+  exit code: 0
+  R foo
+  ? bar
+  ./bar
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+30 state added, options -Af
+
+  $ echo b > bar
+  $ hg add bar
+  $ remove -Af bar
+  exit code: 0
+  ? bar
+  ./bar
+  ./foo
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm bar
+
+31 state clean, options -Af
+
+  $ remove -Af foo
+  exit code: 0
+  R foo
+  ./foo
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+32 state modified, options -Af
+
+  $ echo b >> foo
+  $ remove -Af foo
+  exit code: 0
+  R foo
+  ./foo
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+33 state missing, options -Af
+
+  $ rm foo
+  $ remove -Af foo
+  exit code: 0
+  R foo
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+test some directory stuff
+
+  $ mkdir test
+  $ echo a > test/foo
+  $ echo b > test/bar
+  $ hg ci -Am2
+  adding test/bar
+  adding test/foo
+
+dir, options none
+
+  $ rm test/bar
+  $ remove test
+  removing test/bar
+  removing test/foo
+  exit code: 0
+  R test/bar
+  R test/foo
+  ./foo
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+dir, options -f
+
+  $ rm test/bar
+  $ remove -f test
+  removing test/bar
+  removing test/foo
+  exit code: 0
+  R test/bar
+  R test/foo
+  ./foo
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+dir, options -A
+
+  $ rm test/bar
+  $ remove -A test
+  not removing test/foo: file still exists (use -f to force removal)
+  removing test/bar
+  exit code: 1
+  R test/bar
+  ./foo
+  ./test/foo
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+dir, options -Af
+
+  $ rm test/bar
+  $ remove -Af test
+  removing test/bar
+  removing test/foo
+  exit code: 0
+  R test/bar
+  R test/foo
+  ./foo
+  ./test/foo
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+test remove dropping empty trees (issue1861)
+
+  $ mkdir -p issue1861/b/c
+  $ echo x > issue1861/x
+  $ echo y > issue1861/b/c/y
+  $ hg ci -Am add
+  adding issue1861/b/c/y
+  adding issue1861/x
+  $ hg rm issue1861/b
+  removing issue1861/b/c/y
+  $ hg ci -m remove
+  $ ls issue1861
+  x
--- a/tests/test-rename	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,267 +0,0 @@
-#!/bin/sh
-
-hg init
-mkdir d1 d1/d11 d2
-echo d1/a > d1/a
-echo d1/ba > d1/ba
-echo d1/a1 > d1/d11/a1
-echo d1/b > d1/b
-echo d2/b > d2/b
-hg add d1/a d1/b d1/ba d1/d11/a1 d2/b
-hg commit -m "1" -d "1000000 0"
-
-echo "# rename a single file"
-hg rename d1/d11/a1 d2/c
-hg sum
-hg status -C
-hg update -C
-rm d2/c
-
-echo "# rename --after a single file"
-mv d1/d11/a1 d2/c
-hg rename --after d1/d11/a1 d2/c
-hg status -C
-hg update -C
-rm d2/c
-
-echo '# rename --after a single file when src and tgt already tracked'
-mv d1/d11/a1 d2/c
-hg addrem
-hg rename --after d1/d11/a1 d2/c
-hg status -C
-hg update -C
-rm d2/c
-
-echo "# rename --after a single file to a nonexistant target filename"
-hg rename --after d1/a dummy
-
-echo "# move a single file to an existing directory"
-hg rename d1/d11/a1 d2
-hg status -C
-hg update -C
-rm d2/a1
-
-echo "# move --after a single file to an existing directory"
-mv d1/d11/a1 d2
-hg rename --after d1/d11/a1 d2
-hg status -C
-hg update -C
-rm d2/a1
-
-echo "# rename a file using a relative path"
-(cd d1/d11; hg rename ../../d2/b e)
-hg status -C
-hg update -C
-rm d1/d11/e
-
-echo "# rename --after a file using a relative path"
-(cd d1/d11; mv ../../d2/b e; hg rename --after ../../d2/b e)
-hg status -C
-hg update -C
-rm d1/d11/e
-
-echo "# rename directory d1 as d3"
-hg rename d1/ d3
-hg status -C
-hg update -C
-rm -rf d3
-
-echo "# rename --after directory d1 as d3"
-mv d1 d3
-hg rename --after d1 d3
-hg status -C
-hg update -C
-rm -rf d3
-
-echo "# move a directory using a relative path"
-(cd d2; mkdir d3; hg rename ../d1/d11 d3)
-hg status -C
-hg update -C
-rm -rf d2/d3
-
-echo "# move --after a directory using a relative path"
-(cd d2; mkdir d3; mv ../d1/d11 d3; hg rename --after ../d1/d11 d3)
-hg status -C
-hg update -C
-rm -rf d2/d3
-
-echo "# move directory d1/d11 to an existing directory d2 (removes empty d1)"
-hg rename d1/d11/ d2
-hg status -C
-hg update -C
-rm -rf d2/d11
-
-echo "# move directories d1 and d2 to a new directory d3"
-mkdir d3
-hg rename d1 d2 d3
-hg status -C
-hg update -C
-rm -rf d3
-
-echo "# move --after directories d1 and d2 to a new directory d3"
-mkdir d3
-mv d1 d2 d3
-hg rename --after d1 d2 d3
-hg status -C
-hg update -C
-rm -rf d3
-
-echo "# move everything under directory d1 to existing directory d2, do not"
-echo "# overwrite existing files (d2/b)"
-hg rename d1/* d2
-hg status -C
-diff d1/b d2/b
-hg update -C
-rm d2/a d2/ba d2/d11/a1
-
-echo "# attempt to move one file into a non-existent directory"
-hg rename d1/a dx/
-hg status -C
-hg update -C
-
-echo "# attempt to move potentially more than one file into a non-existent"
-echo "# directory"
-hg rename 'glob:d1/**' dx
-
-echo "# move every file under d1 to d2/d21 (glob)"
-mkdir d2/d21
-hg rename 'glob:d1/**' d2/d21
-hg status -C
-hg update -C
-rm -rf d2/d21
-
-echo "# move --after some files under d1 to d2/d21 (glob)"
-mkdir d2/d21
-mv d1/a d1/d11/a1 d2/d21
-hg rename --after 'glob:d1/**' d2/d21
-hg status -C
-hg update -C
-rm -rf d2/d21
-
-echo "# move every file under d1 starting with an 'a' to d2/d21 (regexp)"
-mkdir d2/d21
-hg rename 're:d1/([^a][^/]*/)*a.*' d2/d21
-hg status -C
-hg update -C
-rm -rf d2/d21
-
-echo "# attempt to overwrite an existing file"
-echo "ca" > d1/ca
-hg rename d1/ba d1/ca
-hg status -C
-hg update -C
-
-echo "# forced overwrite of an existing file"
-echo "ca" > d1/ca
-hg rename --force d1/ba d1/ca
-hg status -C
-hg update -C
-rm d1/ca
-
-echo "# attempt to overwrite an existing broken symlink"
-ln -s ba d1/ca
-hg rename --traceback d1/ba d1/ca
-hg status -C
-hg update -C
-rm d1/ca
-
-echo "# replace a symlink with a file"
-ln -s ba d1/ca
-hg rename --force d1/ba d1/ca
-hg status -C
-hg update -C
-rm d1/ca
-
-echo "# do not copy more than one source file to the same destination file"
-mkdir d3
-hg rename d1/* d2/* d3
-hg status -C
-hg update -C
-rm -rf d3
-
-echo "# move a whole subtree with \"hg rename .\""
-mkdir d3
-(cd d1; hg rename . ../d3)
-hg status -C
-hg update -C
-rm -rf d3
-
-echo "# move a whole subtree with \"hg rename --after .\""
-mkdir d3
-mv d1/* d3
-(cd d1; hg rename --after . ../d3)
-hg status -C
-hg update -C
-rm -rf d3
-
-echo "# move the parent tree with \"hg rename ..\""
-(cd d1/d11; hg rename .. ../../d3)
-hg status -C
-hg update -C
-rm -rf d3
-
-echo "# skip removed files"
-hg remove d1/b
-hg rename d1 d3
-hg status -C
-hg update -C
-rm -rf d3
-
-echo "# transitive rename"
-hg rename d1/b d1/bb
-hg rename d1/bb d1/bc
-hg status -C
-hg update -C
-rm d1/bc
-
-echo "# transitive rename --after"
-hg rename d1/b d1/bb
-mv d1/bb d1/bc
-hg rename --after d1/bb d1/bc
-hg status -C
-hg update -C
-rm d1/bc
-
-echo "# idempotent renames (d1/b -> d1/bb followed by d1/bb -> d1/b)"
-hg rename d1/b d1/bb
-echo "some stuff added to d1/bb" >> d1/bb
-hg rename d1/bb d1/b
-hg status -C
-hg update -C
-
-echo '# overwriting with renames (issue1959)'
-hg rename d1/a d1/c
-hg rename d1/b d1/a
-hg status -C
-hg diff --git
-hg update -C
-
-echo "# check illegal path components"
-
-hg rename d1/d11/a1 .hg/foo
-hg status -C
-hg rename d1/d11/a1 ../foo
-hg status -C
-
-mv d1/d11/a1 .hg/foo
-hg rename --after d1/d11/a1 .hg/foo
-hg status -C
-hg update -C
-rm .hg/foo
-
-hg rename d1/d11/a1 .hg
-hg status -C
-hg rename d1/d11/a1 ..
-hg status -C
-
-mv d1/d11/a1 .hg
-hg rename --after d1/d11/a1 .hg
-hg status -C
-hg update -C
-rm .hg/a1
-
-(cd d1/d11; hg rename ../../d2/b ../../.hg/foo)
-hg status -C
-(cd d1/d11; hg rename ../../d2/b ../../../foo)
-hg status -C
-
--- a/tests/test-rename-after-merge	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-#!/bin/sh
-
-# Test issue 746: renaming files brought by the
-# second parent of a merge was broken.
-
-echo % create source repository
-hg init t
-cd t
-echo a > a
-hg ci -Am a
-cd ..
-
-echo % fork source repository
-hg clone t t2
-cd t2
-echo b > b
-hg ci -Am b
-
-echo % update source repository
-cd ../t
-echo a >> a
-hg ci -m a2
-
-echo % merge repositories
-hg pull ../t2
-hg merge
-hg st
-
-echo % rename b as c
-hg mv b c
-hg st
-echo % rename back c as b
-hg mv c b
-hg st
-cd ..
-
-# Test issue 1476: renaming a first parent file into
-# another first parent file while none of them belong to
-# the second parent was broken
-echo % test issue 1476
-hg init repo1476
-cd repo1476
-echo a > a
-hg ci -Am adda
-echo b1 > b1
-echo b2 > b2
-hg ci -Am changea
-hg up -C 0
-echo c1 > c1
-echo c2 > c2
-hg ci -Am addcandd
-echo % merge heads
-hg merge
-hg mv -Af c1 c2
-echo % commit issue 1476
-hg ci -m merge
-hg log -r tip -C -v | grep copies
-hg rollback
-hg up -C .
-echo % merge heads again
-hg merge
-hg mv -Af b1 b2
-echo % commit issue 1476 with a rename on the other side
-hg ci -m merge
-hg log -r tip -C -v | grep copies
-
-
-
--- a/tests/test-rename-after-merge.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-% create source repository
-adding a
-% fork source repository
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-adding b
-% update source repository
-% merge repositories
-pulling from ../t2
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files (+1 heads)
-(run 'hg heads' to see heads, 'hg merge' to merge)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-M b
-% rename b as c
-A c
-R b
-% rename back c as b
-M b
-% test issue 1476
-adding a
-adding b1
-adding b2
-0 files updated, 0 files merged, 2 files removed, 0 files unresolved
-adding c1
-adding c2
-created new head
-% merge heads
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-% commit issue 1476
-copies:      c2 (c1)
-rolling back to revision 2 (undo commit)
-2 files updated, 0 files merged, 2 files removed, 0 files unresolved
-% merge heads again
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-% commit issue 1476 with a rename on the other side
-copies:      b2 (b1)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-rename-after-merge.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,119 @@
+Test issue 746: renaming files brought by the second parent of a merge
+was broken.
+
+Create source repository:
+
+  $ hg init t
+  $ cd t
+  $ echo a > a
+  $ hg ci -Am a
+  adding a
+  $ cd ..
+
+Fork source repository:
+
+  $ hg clone t t2
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd t2
+  $ echo b > b
+  $ hg ci -Am b
+  adding b
+
+Update source repository:
+
+  $ cd ../t
+  $ echo a >> a
+  $ hg ci -m a2
+
+Merge repositories:
+
+  $ hg pull ../t2
+  pulling from ../t2
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files (+1 heads)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+
+  $ hg merge
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+  $ hg st
+  M b
+
+Rename b as c:
+
+  $ hg mv b c
+  $ hg st
+  A c
+  R b
+
+Rename back c as b:
+
+  $ hg mv c b
+  $ hg st
+  M b
+
+  $ cd ..
+
+Test issue 1476: renaming a first parent file into another first
+parent file while none of them belong to the second parent was broken
+
+  $ hg init repo1476
+  $ cd repo1476
+  $ echo a > a
+  $ hg ci -Am adda
+  adding a
+  $ echo b1 > b1
+  $ echo b2 > b2
+  $ hg ci -Am changea
+  adding b1
+  adding b2
+  $ hg up -C 0
+  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  $ echo c1 > c1
+  $ echo c2 > c2
+  $ hg ci -Am addcandd
+  adding c1
+  adding c2
+  created new head
+
+Merge heads:
+
+  $ hg merge
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+  $ hg mv -Af c1 c2
+
+Commit issue 1476:
+
+  $ hg ci -m merge
+
+  $ hg log -r tip -C -v | grep copies
+  copies:      c2 (c1)
+
+  $ hg rollback
+  rolling back to revision 2 (undo commit)
+
+  $ hg up -C .
+  2 files updated, 0 files merged, 2 files removed, 0 files unresolved
+
+Merge heads again:
+
+  $ hg merge
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+  $ hg mv -Af b1 b2
+
+Commit issue 1476 with a rename on the other side:
+
+  $ hg ci -m merge
+
+  $ hg log -r tip -C -v | grep copies
+  copies:      b2 (b1)
+
--- a/tests/test-rename-dir-merge	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-#!/bin/sh
-
-mkdir t
-cd t
-hg init
-
-mkdir a
-echo foo > a/a
-echo bar > a/b
-hg ci -Am "0"
-
-hg co -C 0
-hg mv a b
-hg ci -m "1 mv a/ b/"
-
-hg co -C 0
-echo baz > a/c
-echo quux > a/d
-hg add a/c
-hg ci -m "2 add a/c"
-
-hg merge --debug 1
-echo a/* b/*
-hg st -C
-hg ci -m "3 merge 2+1"
-hg debugrename b/c
-
-hg co -C 1
-hg merge --debug 2
-echo a/* b/*
-hg st -C
-hg ci -m "4 merge 1+2"
-hg debugrename b/c
--- a/tests/test-rename-dir-merge.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-adding a/a
-adding a/b
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-moving a/a to b/a
-moving a/b to b/b
-2 files updated, 0 files merged, 2 files removed, 0 files unresolved
-created new head
-  searching for copies back to rev 1
-  unmatched files in local:
-   a/c
-   a/d
-  unmatched files in other:
-   b/a
-   b/b
-  all copies found (* = to merge, ! = divergent):
-   b/a -> a/a 
-   b/b -> a/b 
-  checking for directory renames
-  dir a/ -> b/
-  file a/c -> b/c
-  file a/d -> b/d
-resolving manifests
- overwrite None partial False
- ancestor f9b20c0d4c51 local ce36d17b18fb+ remote 397f8b00a740
- a/d: remote renamed directory to b/d -> d
- a/c: remote renamed directory to b/c -> d
- a/b: other deleted -> r
- a/a: other deleted -> r
- b/a: remote created -> g
- b/b: remote created -> g
-updating: a/a 1/6 files (16.67%)
-removing a/a
-updating: a/b 2/6 files (33.33%)
-removing a/b
-updating: a/c 3/6 files (50.00%)
-moving a/c to b/c
-updating: a/d 4/6 files (66.67%)
-moving a/d to b/d
-updating: b/a 5/6 files (83.33%)
-getting b/a
-updating: b/b 6/6 files (100.00%)
-getting b/b
-4 files updated, 0 files merged, 2 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-a/* b/a b/b b/c b/d
-M b/a
-M b/b
-A b/c
-  a/c
-R a/a
-R a/b
-R a/c
-? b/d
-b/c renamed from a/c:354ae8da6e890359ef49ade27b68bbc361f3ca88
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-  searching for copies back to rev 1
-  unmatched files in local:
-   b/a
-   b/b
-   b/d
-  unmatched files in other:
-   a/c
-  all copies found (* = to merge, ! = divergent):
-   b/a -> a/a 
-   b/b -> a/b 
-  checking for directory renames
-  dir a/ -> b/
-  file a/c -> b/c
-resolving manifests
- overwrite None partial False
- ancestor f9b20c0d4c51 local 397f8b00a740+ remote ce36d17b18fb
- None: local renamed directory to b/c -> d
-updating:None 1/1 files (100.00%)
-getting a/c to b/c
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-a/* b/a b/b b/c b/d
-A b/c
-  a/c
-? b/d
-created new head
-b/c renamed from a/c:354ae8da6e890359ef49ade27b68bbc361f3ca88
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-rename-dir-merge.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,165 @@
+  $ mkdir t
+  $ cd t
+  $ hg init
+
+  $ mkdir a
+  $ echo foo > a/a
+  $ echo bar > a/b
+  $ hg ci -Am "0"
+  adding a/a
+  adding a/b
+
+  $ hg co -C 0
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg mv a b
+  moving a/a to b/a
+  moving a/b to b/b
+  $ hg ci -m "1 mv a/ b/"
+
+  $ hg co -C 0
+  2 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  $ echo baz > a/c
+  $ echo quux > a/d
+  $ hg add a/c
+  $ hg ci -m "2 add a/c"
+  created new head
+
+  $ hg merge --debug 1
+    searching for copies back to rev 1
+    unmatched files in local:
+     a/c
+     a/d
+    unmatched files in other:
+     b/a
+     b/b
+    all copies found (* = to merge, ! = divergent):
+     b/a -> a/a 
+     b/b -> a/b 
+    checking for directory renames
+    dir a/ -> b/
+    file a/c -> b/c
+    file a/d -> b/d
+  resolving manifests
+   overwrite None partial False
+   ancestor f9b20c0d4c51 local ce36d17b18fb+ remote 397f8b00a740
+   a/d: remote renamed directory to b/d -> d
+   a/c: remote renamed directory to b/c -> d
+   a/b: other deleted -> r
+   a/a: other deleted -> r
+   b/a: remote created -> g
+   b/b: remote created -> g
+  updating: a/a 1/6 files (16.67%)
+  removing a/a
+  updating: a/b 2/6 files (33.33%)
+  removing a/b
+  updating: a/c 3/6 files (50.00%)
+  moving a/c to b/c
+  updating: a/d 4/6 files (66.67%)
+  moving a/d to b/d
+  updating: b/a 5/6 files (83.33%)
+  getting b/a
+  updating: b/b 6/6 files (100.00%)
+  getting b/b
+  4 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+  $ echo a/* b/*
+  a/* b/a b/b b/c b/d
+  $ hg st -C
+  M b/a
+  M b/b
+  A b/c
+    a/c
+  R a/a
+  R a/b
+  R a/c
+  ? b/d
+  $ hg ci -m "3 merge 2+1"
+  $ hg debugrename b/c
+  b/c renamed from a/c:354ae8da6e890359ef49ade27b68bbc361f3ca88
+
+  $ hg co -C 1
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg merge --debug 2
+    searching for copies back to rev 1
+    unmatched files in local:
+     b/a
+     b/b
+     b/d
+    unmatched files in other:
+     a/c
+    all copies found (* = to merge, ! = divergent):
+     b/a -> a/a 
+     b/b -> a/b 
+    checking for directory renames
+    dir a/ -> b/
+    file a/c -> b/c
+  resolving manifests
+   overwrite None partial False
+   ancestor f9b20c0d4c51 local 397f8b00a740+ remote ce36d17b18fb
+   None: local renamed directory to b/c -> d
+  updating:None 1/1 files (100.00%)
+  getting a/c to b/c
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+  $ echo a/* b/*
+  a/* b/a b/b b/c b/d
+  $ hg st -C
+  A b/c
+    a/c
+  ? b/d
+  $ hg ci -m "4 merge 1+2"
+  created new head
+  $ hg debugrename b/c
+  b/c renamed from a/c:354ae8da6e890359ef49ade27b68bbc361f3ca88
+
+
+Second scenario with two repos:
+
+  $ cd ..
+  $ mkdir r1
+  $ cd r1
+  $ hg init
+  $ mkdir a
+  $ echo foo > a/f
+  $ hg add a
+  adding a/f
+  $ hg ci -m "a/f == foo"
+  $ cd ..
+
+  $ hg clone r1 r2
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd r2
+  $ hg mv a b
+  moving a/f to b/f
+  $ echo foo1 > b/f
+  $ hg ci -m" a -> b, b/f == foo1"
+  $ cd ..
+
+  $ cd r1
+  $ mkdir a/aa
+  $ echo bar > a/aa/g
+  $ hg add a/aa
+  adding a/aa/g
+  $ hg ci -m "a/aa/g"
+  $ hg pull ../r2
+  pulling from ../r2
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files (+1 heads)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+
+  $ hg merge
+  2 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+  $ hg st -C
+  M b/f
+  A b/aa/g
+    a/aa/g
+  R a/aa/g
+  R a/f
--- a/tests/test-rename-dir-merge2	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-#!/bin/sh
-
-mkdir r1
-cd r1
-hg init
-mkdir a
-echo foo > a/f
-hg add a
-hg ci -m "a/f == foo"
-cd ..
-
-hg clone r1 r2
-cd r2
-hg mv a b
-echo foo1 > b/f
-hg ci -m" a -> b, b/f == foo1"
-cd ..
-
-cd r1
-mkdir a/aa
-echo bar > a/aa/g
-hg add a/aa
-hg ci -m "a/aa/g"
-hg pull ../r2
-
-hg merge
-
-hg st -C
--- a/tests/test-rename-dir-merge2.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-adding a/f
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-moving a/f to b/f
-adding a/aa/g
-pulling from ../r2
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files (+1 heads)
-(run 'hg heads' to see heads, 'hg merge' to merge)
-2 files updated, 0 files merged, 1 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-M b/f
-A b/aa/g
-  a/aa/g
-R a/aa/g
-R a/f
--- a/tests/test-rename-merge1	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-#!/bin/sh
-
-mkdir t
-cd t
-hg init
-echo "[merge]" >> .hg/hgrc
-echo "followcopies = 1" >> .hg/hgrc
-echo foo > a
-echo foo > a2
-hg add a a2
-hg ci -m "start"
-hg mv a b
-hg mv a2 b2
-hg ci -m "rename"
-echo "checkout"
-hg co 0
-echo blahblah > a
-echo blahblah > a2
-hg mv a2 c2
-hg ci -m "modify"
-echo "merge"
-hg merge -y --debug
-hg status -AC
-cat b
-hg ci -m "merge"
-hg debugindex .hg/store/data/b.i
-hg debugrename b
--- a/tests/test-rename-merge1.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-checkout
-2 files updated, 0 files merged, 2 files removed, 0 files unresolved
-created new head
-merge
-  searching for copies back to rev 1
-  unmatched files in local:
-   c2
-  unmatched files in other:
-   b
-   b2
-  all copies found (* = to merge, ! = divergent):
-   c2 -> a2 !
-   b -> a *
-   b2 -> a2 !
-  checking for directory renames
- a2: divergent renames -> dr
-resolving manifests
- overwrite None partial False
- ancestor af1939970a1c local 044f8520aeeb+ remote 85c198ef2f6c
- a: remote moved to b -> m
- b2: remote created -> g
-preserving a for resolve of b
-removing a
-updating: a 1/3 files (33.33%)
-picked tool 'internal:merge' for b (binary False symlink False)
-merging a and b to b
-my b@044f8520aeeb+ other b@85c198ef2f6c ancestor a@af1939970a1c
- premerge successful
-updating: a2 2/3 files (66.67%)
-warning: detected divergent renames of a2 to:
- c2
- b2
-updating: b2 3/3 files (100.00%)
-getting b2
-1 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-M b
-  a
-M b2
-R a
-C c2
-blahblah
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0      67      0       1 57eacc201a7f 000000000000 000000000000
-     1        67      72      1       3 4727ba907962 000000000000 57eacc201a7f
-b renamed from a:dd03b83622e78778b403775d0d074b9ac7387a66
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-rename-merge1.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,77 @@
+  $ hg init
+
+  $ echo "[merge]" >> .hg/hgrc
+  $ echo "followcopies = 1" >> .hg/hgrc
+
+  $ echo foo > a
+  $ echo foo > a2
+  $ hg add a a2
+  $ hg ci -m "start"
+
+  $ hg mv a b
+  $ hg mv a2 b2
+  $ hg ci -m "rename"
+
+  $ hg co 0
+  2 files updated, 0 files merged, 2 files removed, 0 files unresolved
+
+  $ echo blahblah > a
+  $ echo blahblah > a2
+  $ hg mv a2 c2
+  $ hg ci -m "modify"
+  created new head
+
+  $ hg merge -y --debug
+    searching for copies back to rev 1
+    unmatched files in local:
+     c2
+    unmatched files in other:
+     b
+     b2
+    all copies found (* = to merge, ! = divergent):
+     c2 -> a2 !
+     b -> a *
+     b2 -> a2 !
+    checking for directory renames
+   a2: divergent renames -> dr
+  resolving manifests
+   overwrite None partial False
+   ancestor af1939970a1c local 044f8520aeeb+ remote 85c198ef2f6c
+   a: remote moved to b -> m
+   b2: remote created -> g
+  preserving a for resolve of b
+  removing a
+  updating: a 1/3 files (33.33%)
+  picked tool 'internal:merge' for b (binary False symlink False)
+  merging a and b to b
+  my b@044f8520aeeb+ other b@85c198ef2f6c ancestor a@af1939970a1c
+   premerge successful
+  updating: a2 2/3 files (66.67%)
+  warning: detected divergent renames of a2 to:
+   c2
+   b2
+  updating: b2 3/3 files (100.00%)
+  getting b2
+  1 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+  $ hg status -AC
+  M b
+    a
+  M b2
+  R a
+  C c2
+
+  $ cat b
+  blahblah
+
+  $ hg ci -m "merge"
+
+  $ hg debugindex .hg/store/data/b.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0      67      0       1 57eacc201a7f 000000000000 000000000000
+       1        67      72      1       3 4727ba907962 000000000000 57eacc201a7f
+
+  $ hg debugrename b
+  b renamed from a:dd03b83622e78778b403775d0d074b9ac7387a66
+
--- a/tests/test-rename.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,348 +0,0 @@
-# rename a single file
-parent: 0:6f9914c7a010 tip
- 1
-branch: default
-commit: 1 renamed
-update: (current)
-A d2/c
-  d1/d11/a1
-R d1/d11/a1
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# rename --after a single file
-A d2/c
-  d1/d11/a1
-R d1/d11/a1
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# rename --after a single file when src and tgt already tracked
-removing d1/d11/a1
-adding d2/c
-A d2/c
-  d1/d11/a1
-R d1/d11/a1
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# rename --after a single file to a nonexistant target filename
-d1/a: not recording move - dummy does not exist
-# move a single file to an existing directory
-A d2/a1
-  d1/d11/a1
-R d1/d11/a1
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# move --after a single file to an existing directory
-A d2/a1
-  d1/d11/a1
-R d1/d11/a1
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# rename a file using a relative path
-A d1/d11/e
-  d2/b
-R d2/b
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# rename --after a file using a relative path
-A d1/d11/e
-  d2/b
-R d2/b
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# rename directory d1 as d3
-moving d1/a to d3/a
-moving d1/b to d3/b
-moving d1/ba to d3/ba
-moving d1/d11/a1 to d3/d11/a1
-A d3/a
-  d1/a
-A d3/b
-  d1/b
-A d3/ba
-  d1/ba
-A d3/d11/a1
-  d1/d11/a1
-R d1/a
-R d1/b
-R d1/ba
-R d1/d11/a1
-4 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# rename --after directory d1 as d3
-moving d1/a to d3/a
-moving d1/b to d3/b
-moving d1/ba to d3/ba
-moving d1/d11/a1 to d3/d11/a1
-A d3/a
-  d1/a
-A d3/b
-  d1/b
-A d3/ba
-  d1/ba
-A d3/d11/a1
-  d1/d11/a1
-R d1/a
-R d1/b
-R d1/ba
-R d1/d11/a1
-4 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# move a directory using a relative path
-moving ../d1/d11/a1 to d3/d11/a1
-A d2/d3/d11/a1
-  d1/d11/a1
-R d1/d11/a1
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# move --after a directory using a relative path
-moving ../d1/d11/a1 to d3/d11/a1
-A d2/d3/d11/a1
-  d1/d11/a1
-R d1/d11/a1
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# move directory d1/d11 to an existing directory d2 (removes empty d1)
-moving d1/d11/a1 to d2/d11/a1
-A d2/d11/a1
-  d1/d11/a1
-R d1/d11/a1
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# move directories d1 and d2 to a new directory d3
-moving d1/a to d3/d1/a
-moving d1/b to d3/d1/b
-moving d1/ba to d3/d1/ba
-moving d1/d11/a1 to d3/d1/d11/a1
-moving d2/b to d3/d2/b
-A d3/d1/a
-  d1/a
-A d3/d1/b
-  d1/b
-A d3/d1/ba
-  d1/ba
-A d3/d1/d11/a1
-  d1/d11/a1
-A d3/d2/b
-  d2/b
-R d1/a
-R d1/b
-R d1/ba
-R d1/d11/a1
-R d2/b
-5 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# move --after directories d1 and d2 to a new directory d3
-moving d1/a to d3/d1/a
-moving d1/b to d3/d1/b
-moving d1/ba to d3/d1/ba
-moving d1/d11/a1 to d3/d1/d11/a1
-moving d2/b to d3/d2/b
-A d3/d1/a
-  d1/a
-A d3/d1/b
-  d1/b
-A d3/d1/ba
-  d1/ba
-A d3/d1/d11/a1
-  d1/d11/a1
-A d3/d2/b
-  d2/b
-R d1/a
-R d1/b
-R d1/ba
-R d1/d11/a1
-R d2/b
-5 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# move everything under directory d1 to existing directory d2, do not
-# overwrite existing files (d2/b)
-d2/b: not overwriting - file exists
-moving d1/d11/a1 to d2/d11/a1
-A d2/a
-  d1/a
-A d2/ba
-  d1/ba
-A d2/d11/a1
-  d1/d11/a1
-R d1/a
-R d1/ba
-R d1/d11/a1
-1c1
-< d1/b
----
-> d2/b
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# attempt to move one file into a non-existent directory
-abort: destination dx/ is not a directory
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# attempt to move potentially more than one file into a non-existent
-# directory
-abort: with multiple sources, destination must be an existing directory
-# move every file under d1 to d2/d21 (glob)
-moving d1/a to d2/d21/a
-moving d1/b to d2/d21/b
-moving d1/ba to d2/d21/ba
-moving d1/d11/a1 to d2/d21/a1
-A d2/d21/a
-  d1/a
-A d2/d21/a1
-  d1/d11/a1
-A d2/d21/b
-  d1/b
-A d2/d21/ba
-  d1/ba
-R d1/a
-R d1/b
-R d1/ba
-R d1/d11/a1
-4 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# move --after some files under d1 to d2/d21 (glob)
-moving d1/a to d2/d21/a
-d1/b: not recording move - d2/d21/b does not exist
-d1/ba: not recording move - d2/d21/ba does not exist
-moving d1/d11/a1 to d2/d21/a1
-A d2/d21/a
-  d1/a
-A d2/d21/a1
-  d1/d11/a1
-R d1/a
-R d1/d11/a1
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# move every file under d1 starting with an 'a' to d2/d21 (regexp)
-moving d1/a to d2/d21/a
-moving d1/d11/a1 to d2/d21/a1
-A d2/d21/a
-  d1/a
-A d2/d21/a1
-  d1/d11/a1
-R d1/a
-R d1/d11/a1
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# attempt to overwrite an existing file
-d1/ca: not overwriting - file exists
-? d1/ca
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# forced overwrite of an existing file
-A d1/ca
-  d1/ba
-R d1/ba
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# attempt to overwrite an existing broken symlink
-d1/ca: not overwriting - file exists
-? d1/ca
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# replace a symlink with a file
-A d1/ca
-  d1/ba
-R d1/ba
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# do not copy more than one source file to the same destination file
-moving d1/d11/a1 to d3/d11/a1
-d3/b: not overwriting - d2/b collides with d1/b
-A d3/a
-  d1/a
-A d3/b
-  d1/b
-A d3/ba
-  d1/ba
-A d3/d11/a1
-  d1/d11/a1
-R d1/a
-R d1/b
-R d1/ba
-R d1/d11/a1
-4 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# move a whole subtree with "hg rename ."
-moving a to ../d3/d1/a
-moving b to ../d3/d1/b
-moving ba to ../d3/d1/ba
-moving d11/a1 to ../d3/d1/d11/a1
-A d3/d1/a
-  d1/a
-A d3/d1/b
-  d1/b
-A d3/d1/ba
-  d1/ba
-A d3/d1/d11/a1
-  d1/d11/a1
-R d1/a
-R d1/b
-R d1/ba
-R d1/d11/a1
-4 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# move a whole subtree with "hg rename --after ."
-moving a to ../d3/a
-moving b to ../d3/b
-moving ba to ../d3/ba
-moving d11/a1 to ../d3/d11/a1
-A d3/a
-  d1/a
-A d3/b
-  d1/b
-A d3/ba
-  d1/ba
-A d3/d11/a1
-  d1/d11/a1
-R d1/a
-R d1/b
-R d1/ba
-R d1/d11/a1
-4 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# move the parent tree with "hg rename .."
-moving ../a to ../../d3/a
-moving ../b to ../../d3/b
-moving ../ba to ../../d3/ba
-moving a1 to ../../d3/d11/a1
-A d3/a
-  d1/a
-A d3/b
-  d1/b
-A d3/ba
-  d1/ba
-A d3/d11/a1
-  d1/d11/a1
-R d1/a
-R d1/b
-R d1/ba
-R d1/d11/a1
-4 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# skip removed files
-moving d1/a to d3/a
-moving d1/ba to d3/ba
-moving d1/d11/a1 to d3/d11/a1
-A d3/a
-  d1/a
-A d3/ba
-  d1/ba
-A d3/d11/a1
-  d1/d11/a1
-R d1/a
-R d1/b
-R d1/ba
-R d1/d11/a1
-4 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# transitive rename
-A d1/bc
-  d1/b
-R d1/b
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# transitive rename --after
-A d1/bc
-  d1/b
-R d1/b
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# idempotent renames (d1/b -> d1/bb followed by d1/bb -> d1/b)
-M d1/b
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# overwriting with renames (issue1959)
-A d1/a
-  d1/b
-A d1/c
-  d1/a
-R d1/b
-diff --git a/d1/b b/d1/a
-rename from d1/b
-rename to d1/a
-diff --git a/d1/a b/d1/c
-copy from d1/a
-copy to d1/c
-2 files updated, 0 files merged, 1 files removed, 0 files unresolved
-# check illegal path components
-abort: path contains illegal component: .hg/foo
-abort: ../foo not under root
-abort: path contains illegal component: .hg/foo
-! d1/d11/a1
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-abort: path contains illegal component: .hg/a1
-abort: ../a1 not under root
-abort: path contains illegal component: .hg/a1
-! d1/d11/a1
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-abort: path contains illegal component: .hg/foo
-abort: ../../../foo not under root
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-rename.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,621 @@
+  $ hg init
+  $ mkdir d1 d1/d11 d2
+  $ echo d1/a > d1/a
+  $ echo d1/ba > d1/ba
+  $ echo d1/a1 > d1/d11/a1
+  $ echo d1/b > d1/b
+  $ echo d2/b > d2/b
+  $ hg add d1/a d1/b d1/ba d1/d11/a1 d2/b
+  $ hg commit -m "1"
+
+rename a single file
+
+  $ hg rename d1/d11/a1 d2/c
+  $ hg sum
+  parent: 0:9b4b6e7b2c26 tip
+   1
+  branch: default
+  commit: 1 renamed
+  update: (current)
+  $ hg status -C
+  A d2/c
+    d1/d11/a1
+  R d1/d11/a1
+  $ hg update -C
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm d2/c
+
+rename --after a single file
+
+  $ mv d1/d11/a1 d2/c
+  $ hg rename --after d1/d11/a1 d2/c
+  $ hg status -C
+  A d2/c
+    d1/d11/a1
+  R d1/d11/a1
+  $ hg update -C
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm d2/c
+
+rename --after a single file when src and tgt already tracked
+
+  $ mv d1/d11/a1 d2/c
+  $ hg addrem -s 0
+  removing d1/d11/a1
+  adding d2/c
+  $ hg rename --after d1/d11/a1 d2/c
+  $ hg status -C
+  A d2/c
+    d1/d11/a1
+  R d1/d11/a1
+  $ hg update -C
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm d2/c
+
+rename --after a single file to a nonexistant target filename
+
+  $ hg rename --after d1/a dummy
+  d1/a: not recording move - dummy does not exist
+
+move a single file to an existing directory
+
+  $ hg rename d1/d11/a1 d2
+  $ hg status -C
+  A d2/a1
+    d1/d11/a1
+  R d1/d11/a1
+  $ hg update -C
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm d2/a1
+
+move --after a single file to an existing directory
+
+  $ mv d1/d11/a1 d2
+  $ hg rename --after d1/d11/a1 d2
+  $ hg status -C
+  A d2/a1
+    d1/d11/a1
+  R d1/d11/a1
+  $ hg update -C
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm d2/a1
+
+rename a file using a relative path
+
+  $ (cd d1/d11; hg rename ../../d2/b e)
+  $ hg status -C
+  A d1/d11/e
+    d2/b
+  R d2/b
+  $ hg update -C
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm d1/d11/e
+
+rename --after a file using a relative path
+
+  $ (cd d1/d11; mv ../../d2/b e; hg rename --after ../../d2/b e)
+  $ hg status -C
+  A d1/d11/e
+    d2/b
+  R d2/b
+  $ hg update -C
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm d1/d11/e
+
+rename directory d1 as d3
+
+  $ hg rename d1/ d3
+  moving d1/a to d3/a
+  moving d1/b to d3/b
+  moving d1/ba to d3/ba
+  moving d1/d11/a1 to d3/d11/a1
+  $ hg status -C
+  A d3/a
+    d1/a
+  A d3/b
+    d1/b
+  A d3/ba
+    d1/ba
+  A d3/d11/a1
+    d1/d11/a1
+  R d1/a
+  R d1/b
+  R d1/ba
+  R d1/d11/a1
+  $ hg update -C
+  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm -rf d3
+
+rename --after directory d1 as d3
+
+  $ mv d1 d3
+  $ hg rename --after d1 d3
+  moving d1/a to d3/a
+  moving d1/b to d3/b
+  moving d1/ba to d3/ba
+  moving d1/d11/a1 to d3/d11/a1
+  $ hg status -C
+  A d3/a
+    d1/a
+  A d3/b
+    d1/b
+  A d3/ba
+    d1/ba
+  A d3/d11/a1
+    d1/d11/a1
+  R d1/a
+  R d1/b
+  R d1/ba
+  R d1/d11/a1
+  $ hg update -C
+  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm -rf d3
+
+move a directory using a relative path
+
+  $ (cd d2; mkdir d3; hg rename ../d1/d11 d3)
+  moving ../d1/d11/a1 to d3/d11/a1
+  $ hg status -C
+  A d2/d3/d11/a1
+    d1/d11/a1
+  R d1/d11/a1
+  $ hg update -C
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm -rf d2/d3
+
+move --after a directory using a relative path
+
+  $ (cd d2; mkdir d3; mv ../d1/d11 d3; hg rename --after ../d1/d11 d3)
+  moving ../d1/d11/a1 to d3/d11/a1
+  $ hg status -C
+  A d2/d3/d11/a1
+    d1/d11/a1
+  R d1/d11/a1
+  $ hg update -C
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm -rf d2/d3
+
+move directory d1/d11 to an existing directory d2 (removes empty d1)
+
+  $ hg rename d1/d11/ d2
+  moving d1/d11/a1 to d2/d11/a1
+  $ hg status -C
+  A d2/d11/a1
+    d1/d11/a1
+  R d1/d11/a1
+  $ hg update -C
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm -rf d2/d11
+
+move directories d1 and d2 to a new directory d3
+
+  $ mkdir d3
+  $ hg rename d1 d2 d3
+  moving d1/a to d3/d1/a
+  moving d1/b to d3/d1/b
+  moving d1/ba to d3/d1/ba
+  moving d1/d11/a1 to d3/d1/d11/a1
+  moving d2/b to d3/d2/b
+  $ hg status -C
+  A d3/d1/a
+    d1/a
+  A d3/d1/b
+    d1/b
+  A d3/d1/ba
+    d1/ba
+  A d3/d1/d11/a1
+    d1/d11/a1
+  A d3/d2/b
+    d2/b
+  R d1/a
+  R d1/b
+  R d1/ba
+  R d1/d11/a1
+  R d2/b
+  $ hg update -C
+  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm -rf d3
+
+move --after directories d1 and d2 to a new directory d3
+
+  $ mkdir d3
+  $ mv d1 d2 d3
+  $ hg rename --after d1 d2 d3
+  moving d1/a to d3/d1/a
+  moving d1/b to d3/d1/b
+  moving d1/ba to d3/d1/ba
+  moving d1/d11/a1 to d3/d1/d11/a1
+  moving d2/b to d3/d2/b
+  $ hg status -C
+  A d3/d1/a
+    d1/a
+  A d3/d1/b
+    d1/b
+  A d3/d1/ba
+    d1/ba
+  A d3/d1/d11/a1
+    d1/d11/a1
+  A d3/d2/b
+    d2/b
+  R d1/a
+  R d1/b
+  R d1/ba
+  R d1/d11/a1
+  R d2/b
+  $ hg update -C
+  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm -rf d3
+
+move everything under directory d1 to existing directory d2, do not
+overwrite existing files (d2/b)
+
+  $ hg rename d1/* d2
+  d2/b: not overwriting - file exists
+  moving d1/d11/a1 to d2/d11/a1
+  $ hg status -C
+  A d2/a
+    d1/a
+  A d2/ba
+    d1/ba
+  A d2/d11/a1
+    d1/d11/a1
+  R d1/a
+  R d1/ba
+  R d1/d11/a1
+  $ diff -u d1/b d2/b
+  --- d1/b	* (glob)
+  +++ d2/b	* (glob)
+  @@ -1 +1 @@
+  -d1/b
+  +d2/b
+  [1]
+  $ hg update -C
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm d2/a d2/ba d2/d11/a1
+
+attempt to move one file into a non-existent directory
+
+  $ hg rename d1/a dx/
+  abort: destination dx/ is not a directory
+  [255]
+  $ hg status -C
+  $ hg update -C
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+attempt to move potentially more than one file into a non-existent directory
+
+  $ hg rename 'glob:d1/**' dx
+  abort: with multiple sources, destination must be an existing directory
+  [255]
+
+move every file under d1 to d2/d21 (glob)
+
+  $ mkdir d2/d21
+  $ hg rename 'glob:d1/**' d2/d21
+  moving d1/a to d2/d21/a
+  moving d1/b to d2/d21/b
+  moving d1/ba to d2/d21/ba
+  moving d1/d11/a1 to d2/d21/a1
+  $ hg status -C
+  A d2/d21/a
+    d1/a
+  A d2/d21/a1
+    d1/d11/a1
+  A d2/d21/b
+    d1/b
+  A d2/d21/ba
+    d1/ba
+  R d1/a
+  R d1/b
+  R d1/ba
+  R d1/d11/a1
+  $ hg update -C
+  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm -rf d2/d21
+
+move --after some files under d1 to d2/d21 (glob)
+
+  $ mkdir d2/d21
+  $ mv d1/a d1/d11/a1 d2/d21
+  $ hg rename --after 'glob:d1/**' d2/d21
+  moving d1/a to d2/d21/a
+  d1/b: not recording move - d2/d21/b does not exist
+  d1/ba: not recording move - d2/d21/ba does not exist
+  moving d1/d11/a1 to d2/d21/a1
+  $ hg status -C
+  A d2/d21/a
+    d1/a
+  A d2/d21/a1
+    d1/d11/a1
+  R d1/a
+  R d1/d11/a1
+  $ hg update -C
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm -rf d2/d21
+
+move every file under d1 starting with an 'a' to d2/d21 (regexp)
+
+  $ mkdir d2/d21
+  $ hg rename 're:d1/([^a][^/]*/)*a.*' d2/d21
+  moving d1/a to d2/d21/a
+  moving d1/d11/a1 to d2/d21/a1
+  $ hg status -C
+  A d2/d21/a
+    d1/a
+  A d2/d21/a1
+    d1/d11/a1
+  R d1/a
+  R d1/d11/a1
+  $ hg update -C
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm -rf d2/d21
+
+attempt to overwrite an existing file
+
+  $ echo "ca" > d1/ca
+  $ hg rename d1/ba d1/ca
+  d1/ca: not overwriting - file exists
+  $ hg status -C
+  ? d1/ca
+  $ hg update -C
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+forced overwrite of an existing file
+
+  $ echo "ca" > d1/ca
+  $ hg rename --force d1/ba d1/ca
+  $ hg status -C
+  A d1/ca
+    d1/ba
+  R d1/ba
+  $ hg update -C
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm d1/ca
+
+attempt to overwrite an existing broken symlink
+
+  $ ln -s ba d1/ca
+  $ hg rename --traceback d1/ba d1/ca
+  d1/ca: not overwriting - file exists
+  $ hg status -C
+  ? d1/ca
+  $ hg update -C
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm d1/ca
+
+replace a symlink with a file
+
+  $ ln -s ba d1/ca
+  $ hg rename --force d1/ba d1/ca
+  $ hg status -C
+  A d1/ca
+    d1/ba
+  R d1/ba
+  $ hg update -C
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm d1/ca
+
+do not copy more than one source file to the same destination file
+
+  $ mkdir d3
+  $ hg rename d1/* d2/* d3
+  moving d1/d11/a1 to d3/d11/a1
+  d3/b: not overwriting - d2/b collides with d1/b
+  $ hg status -C
+  A d3/a
+    d1/a
+  A d3/b
+    d1/b
+  A d3/ba
+    d1/ba
+  A d3/d11/a1
+    d1/d11/a1
+  R d1/a
+  R d1/b
+  R d1/ba
+  R d1/d11/a1
+  $ hg update -C
+  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm -rf d3
+
+move a whole subtree with \"hg rename .\"
+
+  $ mkdir d3
+  $ (cd d1; hg rename . ../d3)
+  moving a to ../d3/d1/a
+  moving b to ../d3/d1/b
+  moving ba to ../d3/d1/ba
+  moving d11/a1 to ../d3/d1/d11/a1
+  $ hg status -C
+  A d3/d1/a
+    d1/a
+  A d3/d1/b
+    d1/b
+  A d3/d1/ba
+    d1/ba
+  A d3/d1/d11/a1
+    d1/d11/a1
+  R d1/a
+  R d1/b
+  R d1/ba
+  R d1/d11/a1
+  $ hg update -C
+  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm -rf d3
+
+move a whole subtree with \"hg rename --after .\"
+
+  $ mkdir d3
+  $ mv d1/* d3
+  $ (cd d1; hg rename --after . ../d3)
+  moving a to ../d3/a
+  moving b to ../d3/b
+  moving ba to ../d3/ba
+  moving d11/a1 to ../d3/d11/a1
+  $ hg status -C
+  A d3/a
+    d1/a
+  A d3/b
+    d1/b
+  A d3/ba
+    d1/ba
+  A d3/d11/a1
+    d1/d11/a1
+  R d1/a
+  R d1/b
+  R d1/ba
+  R d1/d11/a1
+  $ hg update -C
+  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm -rf d3
+
+move the parent tree with \"hg rename ..\"
+
+  $ (cd d1/d11; hg rename .. ../../d3)
+  moving ../a to ../../d3/a
+  moving ../b to ../../d3/b
+  moving ../ba to ../../d3/ba
+  moving a1 to ../../d3/d11/a1
+  $ hg status -C
+  A d3/a
+    d1/a
+  A d3/b
+    d1/b
+  A d3/ba
+    d1/ba
+  A d3/d11/a1
+    d1/d11/a1
+  R d1/a
+  R d1/b
+  R d1/ba
+  R d1/d11/a1
+  $ hg update -C
+  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm -rf d3
+
+skip removed files
+
+  $ hg remove d1/b
+  $ hg rename d1 d3
+  moving d1/a to d3/a
+  moving d1/ba to d3/ba
+  moving d1/d11/a1 to d3/d11/a1
+  $ hg status -C
+  A d3/a
+    d1/a
+  A d3/ba
+    d1/ba
+  A d3/d11/a1
+    d1/d11/a1
+  R d1/a
+  R d1/b
+  R d1/ba
+  R d1/d11/a1
+  $ hg update -C
+  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm -rf d3
+
+transitive rename
+
+  $ hg rename d1/b d1/bb
+  $ hg rename d1/bb d1/bc
+  $ hg status -C
+  A d1/bc
+    d1/b
+  R d1/b
+  $ hg update -C
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm d1/bc
+
+transitive rename --after
+
+  $ hg rename d1/b d1/bb
+  $ mv d1/bb d1/bc
+  $ hg rename --after d1/bb d1/bc
+  $ hg status -C
+  A d1/bc
+    d1/b
+  R d1/b
+  $ hg update -C
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm d1/bc
+
+  $ echo "# idempotent renames (d1/b -> d1/bb followed by d1/bb -> d1/b)"
+  # idempotent renames (d1/b -> d1/bb followed by d1/bb -> d1/b)
+  $ hg rename d1/b d1/bb
+  $ echo "some stuff added to d1/bb" >> d1/bb
+  $ hg rename d1/bb d1/b
+  $ hg status -C
+  M d1/b
+  $ hg update -C
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+overwriting with renames (issue1959)
+
+  $ hg rename d1/a d1/c
+  $ hg rename d1/b d1/a
+  $ hg status -C
+  A d1/a
+    d1/b
+  A d1/c
+    d1/a
+  R d1/b
+  $ hg diff --git
+  diff --git a/d1/b b/d1/a
+  rename from d1/b
+  rename to d1/a
+  diff --git a/d1/a b/d1/c
+  copy from d1/a
+  copy to d1/c
+  $ hg update -C
+  2 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+check illegal path components
+
+  $ hg rename d1/d11/a1 .hg/foo
+  abort: path contains illegal component: .hg/foo
+  [255]
+  $ hg status -C
+  $ hg rename d1/d11/a1 ../foo
+  abort: ../foo not under root
+  [255]
+  $ hg status -C
+
+  $ mv d1/d11/a1 .hg/foo
+  $ hg rename --after d1/d11/a1 .hg/foo
+  abort: path contains illegal component: .hg/foo
+  [255]
+  $ hg status -C
+  ! d1/d11/a1
+  $ hg update -C
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm .hg/foo
+
+  $ hg rename d1/d11/a1 .hg
+  abort: path contains illegal component: .hg/a1
+  [255]
+  $ hg status -C
+  $ hg rename d1/d11/a1 ..
+  abort: ../a1 not under root
+  [255]
+  $ hg status -C
+
+  $ mv d1/d11/a1 .hg
+  $ hg rename --after d1/d11/a1 .hg
+  abort: path contains illegal component: .hg/a1
+  [255]
+  $ hg status -C
+  ! d1/d11/a1
+  $ hg update -C
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm .hg/a1
+
+  $ (cd d1/d11; hg rename ../../d2/b ../../.hg/foo)
+  abort: path contains illegal component: .hg/foo
+  [255]
+  $ hg status -C
+  $ (cd d1/d11; hg rename ../../d2/b ../../../foo)
+  abort: ../../../foo not under root
+  [255]
+  $ hg status -C
+
--- a/tests/test-requires	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-#!/bin/sh
-
-mkdir t
-cd t
-hg init
-echo a > a
-hg add a
-hg commit -m test -d "1000000 0"
-rm .hg/requires
-hg tip
-echo indoor-pool > .hg/requires
-hg tip
-
-true
--- a/tests/test-requires.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-abort: index 00changelog.i unknown format 2!
-abort: requirement 'indoor-pool' not supported!
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-requires.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,14 @@
+  $ mkdir t
+  $ cd t
+  $ hg init
+  $ echo a > a
+  $ hg add a
+  $ hg commit -m test
+  $ rm .hg/requires
+  $ hg tip
+  abort: index 00changelog.i unknown format 2!
+  [255]
+  $ echo indoor-pool > .hg/requires
+  $ hg tip
+  abort: requirement 'indoor-pool' not supported!
+  [255]
--- a/tests/test-resolve	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-#!/bin/sh
-
-# test that a commit clears the merge state.
-
-hg init repo
-cd repo
-
-echo foo > file
-hg commit -Am 'add file'
-
-echo bar >> file
-hg commit -Am 'append bar'
-
-echo % create a second head
-hg up -C 0
-echo baz >> file
-hg commit -Am 'append baz'
-
-echo % failing merge
-HGMERGE=internal:fail hg merge
-
-echo resolved > file
-hg resolve -m file
-hg commit -m 'resolved'
-
-echo % resolve -l, should be empty
-hg resolve -l
-
-# test crashed merge with empty mergestate
-mkdir .hg/merge
-touch .hg/merge/state
-echo % resolve -l, should be empty
-hg resolve -l
--- a/tests/test-resolve.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-adding file
-% create a second head
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-% failing merge
-0 files updated, 0 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
-% resolve -l, should be empty
-% resolve -l, should be empty
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-resolve.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,44 @@
+test that a commit clears the merge state.
+
+  $ hg init repo
+  $ cd repo
+
+  $ echo foo > file
+  $ hg commit -Am 'add file'
+  adding file
+
+  $ echo bar >> file
+  $ hg commit -Am 'append bar'
+
+
+create a second head
+
+  $ hg up -C 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo baz >> file
+  $ hg commit -Am 'append baz'
+  created new head
+
+failing merge
+
+  $ HGMERGE=internal:fail hg merge
+  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
+  [1]
+
+  $ echo resolved > file
+  $ hg resolve -m file
+  $ hg commit -m 'resolved'
+
+resolve -l, should be empty
+
+  $ hg resolve -l
+
+test crashed merge with empty mergestate
+
+  $ mkdir .hg/merge
+  $ touch .hg/merge/state
+
+resolve -l, should be empty
+
+  $ hg resolve -l
--- a/tests/test-revert	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,151 +0,0 @@
-#!/bin/sh
-
-hg init repo
-cd repo
-echo 123 > a
-echo 123 > c
-echo 123 > e
-hg add a c e
-hg commit -m "first" -d "1000000 0" a c e
-echo 123 > b
-echo %% should show b unknown
-hg status
-echo 12 > c
-echo %% should show b unknown and c modified
-hg status
-hg add b
-echo %% should show b added and c modified
-hg status
-hg rm a
-echo %% should show a removed, b added and c modified
-hg status
-hg revert a
-echo %% should show b added, copy saved, and c modified
-hg status
-hg revert b
-echo %% should show b unknown, and c modified
-hg status
-hg revert --no-backup c
-echo %% should show unknown: b
-hg status
-hg add b
-echo %% should show b added
-hg status b
-rm b
-echo %% should show b deleted
-hg status b
-hg revert -v b
-echo %% should not find b
-hg status b
-echo %% should show a c e
-ls
-echo %% should verbosely save backup to e.orig
-echo z > e
-hg revert --all -v
-echo %% should say no changes needed
-hg revert a
-echo %% should say file not managed
-echo q > q
-hg revert q
-rm q
-echo %% should say file not found
-hg revert notfound
-touch d
-hg add d
-hg rm a
-hg commit -m "second" -d "1000000 0"
-echo z > z
-hg add z
-hg st
-echo %% should add a, remove d, forget z
-hg revert --all -r0
-echo %% should forget a, undelete d
-hg revert --all -rtip
-rm a *.orig
-echo %% should silently add a
-hg revert -r0 a
-hg st a
-hg rm d
-hg st d
-echo %% should silently keep d removed
-hg revert -r0 d
-hg st d
-
-hg update -C
-chmod +x c
-hg revert --all
-echo %% should print non-executable
-test -x c || echo non-executable
-
-chmod +x c
-hg commit -d '1000001 0' -m exe
-
-chmod -x c
-hg revert --all
-echo %% should print executable
-test -x c && echo executable
-
-cd ..
-
-echo %% issue 241
-hg init a
-cd a
-echo a >> a
-hg commit -A -d '1 0' -m a
-echo a >> a
-hg commit -d '2 0' -m a
-hg update 0
-mkdir b
-echo b > b/b
-
-echo % should fail - no arguments
-hg revert -rtip
-
-echo % should succeed
-hg revert --all -rtip
-
-echo %% issue332
-hg ci -A -m b -d '1000001 0'
-echo foobar > b/b
-mkdir newdir
-echo foo > newdir/newfile
-hg add newdir/newfile
-hg revert b newdir
-echo foobar > b/b
-hg revert .
-
-echo % reverting a rename target should revert the source
-hg mv a newa
-hg revert newa
-hg st a newa
-
-cd ..
-
-hg init ignored
-cd ignored
-echo '^ignored$' > .hgignore
-echo '^ignoreddir$' >> .hgignore
-echo '^removed$' >> .hgignore
-
-mkdir ignoreddir
-touch ignoreddir/file
-touch ignoreddir/removed
-touch ignored
-touch removed
-echo '%% 4 ignored files (we will add/commit everything)'
-hg st -A -X .hgignore
-hg ci -qAm 'add files' ignored ignoreddir/file ignoreddir/removed removed
-
-echo >> ignored
-echo >> ignoreddir/file
-hg rm removed ignoreddir/removed
-echo '%% should revert ignored* and undelete *removed'
-hg revert -a --no-backup
-hg st -mardi
-
-hg up -qC
-echo >> ignored
-hg rm removed
-echo %% should silently revert the named files
-hg revert --no-backup ignored removed
-hg st -mardi
--- a/tests/test-revert-flags	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-#!/bin/sh
-
-"$TESTDIR/hghave" execbit || exit 80
-
-hg init repo
-cd repo
-echo foo > foo
-chmod 644 foo
-hg ci -qAm '644'
-
-chmod 755 foo
-hg ci -qAm '755'
-
-echo '% reverting to rev 0'
-hg revert -a -r 0
-hg st
-hg diff --git
--- a/tests/test-revert-flags.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-% reverting to rev 0
-reverting foo
-M foo
-diff --git a/foo b/foo
-old mode 100755
-new mode 100644
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-revert-flags.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,21 @@
+  $ "$TESTDIR/hghave" execbit || exit 80
+
+  $ hg init repo
+  $ cd repo
+  $ echo foo > foo
+  $ chmod 644 foo
+  $ hg ci -qAm '644'
+
+  $ chmod 755 foo
+  $ hg ci -qAm '755'
+
+reverting to rev 0
+
+  $ hg revert -a -r 0
+  reverting foo
+  $ hg st
+  M foo
+  $ hg diff --git
+  diff --git a/foo b/foo
+  old mode 100755
+  new mode 100644
--- a/tests/test-revert-unknown	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-#!/bin/sh
-
-hg init
-touch unknown
-
-touch a
-hg add a
-hg ci -m "1" -d "1000000 0"
-
-touch b
-hg add b
-hg ci -m "2" -d "1000000 0"
-
-echo %% Should show unknown
-hg status
-hg revert -r 0 --all
-echo %% Should show unknown and b removed
-hg status
-echo %% Should show a and unknown
-ls
--- a/tests/test-revert-unknown.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-%% Should show unknown
-? unknown
-removing b
-%% Should show unknown and b removed
-R b
-? unknown
-%% Should show a and unknown
-a
-unknown
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-revert-unknown.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,29 @@
+  $ hg init
+  $ touch unknown
+
+  $ touch a
+  $ hg add a
+  $ hg ci -m "1"
+
+  $ touch b
+  $ hg add b
+  $ hg ci -m "2"
+
+Should show unknown
+
+  $ hg status
+  ? unknown
+  $ hg revert -r 0 --all
+  removing b
+
+Should show unknown and b removed
+
+  $ hg status
+  R b
+  ? unknown
+
+Should show a and unknown
+
+  $ ls
+  a
+  unknown
--- a/tests/test-revert.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
-%% should show b unknown
-? b
-%% should show b unknown and c modified
-M c
-? b
-%% should show b added and c modified
-M c
-A b
-%% should show a removed, b added and c modified
-M c
-A b
-R a
-%% should show b added, copy saved, and c modified
-M c
-A b
-%% should show b unknown, and c modified
-M c
-? b
-%% should show unknown: b
-? b
-%% should show b added
-A b
-%% should show b deleted
-! b
-forgetting b
-%% should not find b
-b: No such file or directory
-%% should show a c e
-a
-c
-e
-%% should verbosely save backup to e.orig
-saving current version of e as e.orig
-reverting e
-%% should say no changes needed
-no changes needed to a
-%% should say file not managed
-file not managed: q
-%% should say file not found
-notfound: no such file in rev 095eacd0c0d7
-A z
-? e.orig
-%% should add a, remove d, forget z
-adding a
-removing d
-forgetting z
-%% should forget a, undelete d
-forgetting a
-undeleting d
-%% should silently add a
-A a
-R d
-%% should silently keep d removed
-R d
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-reverting c
-%% should print non-executable
-non-executable
-reverting c
-%% should print executable
-executable
-%% issue 241
-adding a
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% should fail - no arguments
-abort: no files or directories specified; use --all to revert the whole repo
-% should succeed
-reverting a
-%% issue332
-adding b/b
-created new head
-reverting b/b
-forgetting newdir/newfile
-reverting b/b
-% reverting a rename target should revert the source
-? newa
-%% 4 ignored files (we will add/commit everything)
-I ignored
-I ignoreddir/file
-I ignoreddir/removed
-I removed
-%% should revert ignored* and undelete *removed
-reverting ignored
-reverting ignoreddir/file
-undeleting ignoreddir/removed
-undeleting removed
-%% should silently revert the named files
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-revert.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,264 @@
+  $ hg init repo
+  $ cd repo
+  $ echo 123 > a
+  $ echo 123 > c
+  $ echo 123 > e
+  $ hg add a c e
+  $ hg commit -m "first" a c e
+  $ echo 123 > b
+
+should show b unknown
+
+  $ hg status
+  ? b
+  $ echo 12 > c
+
+should show b unknown and c modified
+
+  $ hg status
+  M c
+  ? b
+  $ hg add b
+
+should show b added and c modified
+
+  $ hg status
+  M c
+  A b
+  $ hg rm a
+
+should show a removed, b added and c modified
+
+  $ hg status
+  M c
+  A b
+  R a
+  $ hg revert a
+
+should show b added, copy saved, and c modified
+
+  $ hg status
+  M c
+  A b
+  $ hg revert b
+
+should show b unknown, and c modified
+
+  $ hg status
+  M c
+  ? b
+  $ hg revert --no-backup c
+
+should show unknown: b
+
+  $ hg status
+  ? b
+  $ hg add b
+
+should show b added
+
+  $ hg status b
+  A b
+  $ rm b
+
+should show b deleted
+
+  $ hg status b
+  ! b
+  $ hg revert -v b
+  forgetting b
+
+should not find b
+
+  $ hg status b
+  b: No such file or directory
+
+should show a c e
+
+  $ ls
+  a
+  c
+  e
+
+should verbosely save backup to e.orig
+
+  $ echo z > e
+  $ hg revert --all -v
+  saving current version of e as e.orig
+  reverting e
+
+should say no changes needed
+
+  $ hg revert a
+  no changes needed to a
+
+should say file not managed
+
+  $ echo q > q
+  $ hg revert q
+  file not managed: q
+  $ rm q
+
+should say file not found
+
+  $ hg revert notfound
+  notfound: no such file in rev 334a9e57682c
+  $ touch d
+  $ hg add d
+  $ hg rm a
+  $ hg commit -m "second"
+  $ echo z > z
+  $ hg add z
+  $ hg st
+  A z
+  ? e.orig
+
+should add a, remove d, forget z
+
+  $ hg revert --all -r0
+  adding a
+  removing d
+  forgetting z
+
+should forget a, undelete d
+
+  $ hg revert --all -rtip
+  forgetting a
+  undeleting d
+  $ rm a *.orig
+
+should silently add a
+
+  $ hg revert -r0 a
+  $ hg st a
+  A a
+  $ hg rm d
+  $ hg st d
+  R d
+
+should silently keep d removed
+
+  $ hg revert -r0 d
+  $ hg st d
+  R d
+
+  $ hg update -C
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ chmod +x c
+  $ hg revert --all
+  reverting c
+
+should print non-executable
+
+  $ test -x c || echo non-executable
+  non-executable
+
+  $ chmod +x c
+  $ hg commit -m exe
+
+  $ chmod -x c
+  $ hg revert --all
+  reverting c
+
+should print executable
+
+  $ test -x c && echo executable
+  executable
+
+  $ cd ..
+
+
+issue 241
+
+  $ hg init a
+  $ cd a
+  $ echo a >> a
+  $ hg commit -A -d '1 0' -m a
+  adding a
+  $ echo a >> a
+  $ hg commit -d '2 0' -m a
+  $ hg update 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ mkdir b
+  $ echo b > b/b
+
+should fail - no arguments
+
+  $ hg revert -rtip
+  abort: no files or directories specified; use --all to revert the whole repo
+  [255]
+
+should succeed
+
+  $ hg revert --all -rtip
+  reverting a
+
+
+issue332
+
+  $ hg ci -A -m b
+  adding b/b
+  created new head
+  $ echo foobar > b/b
+  $ mkdir newdir
+  $ echo foo > newdir/newfile
+  $ hg add newdir/newfile
+  $ hg revert b newdir
+  reverting b/b
+  forgetting newdir/newfile
+  $ echo foobar > b/b
+  $ hg revert .
+  reverting b/b
+
+
+reverting a rename target should revert the source
+
+  $ hg mv a newa
+  $ hg revert newa
+  $ hg st a newa
+  ? newa
+
+  $ cd ..
+
+  $ hg init ignored
+  $ cd ignored
+  $ echo '^ignored$' > .hgignore
+  $ echo '^ignoreddir$' >> .hgignore
+  $ echo '^removed$' >> .hgignore
+
+  $ mkdir ignoreddir
+  $ touch ignoreddir/file
+  $ touch ignoreddir/removed
+  $ touch ignored
+  $ touch removed
+
+4 ignored files (we will add/commit everything)
+
+  $ hg st -A -X .hgignore
+  I ignored
+  I ignoreddir/file
+  I ignoreddir/removed
+  I removed
+  $ hg ci -qAm 'add files' ignored ignoreddir/file ignoreddir/removed removed
+
+  $ echo >> ignored
+  $ echo >> ignoreddir/file
+  $ hg rm removed ignoreddir/removed
+
+should revert ignored* and undelete *removed
+
+  $ hg revert -a --no-backup
+  reverting ignored
+  reverting ignoreddir/file
+  undeleting ignoreddir/removed
+  undeleting removed
+  $ hg st -mardi
+
+  $ hg up -qC
+  $ echo >> ignored
+  $ hg rm removed
+
+should silently revert the named files
+
+  $ hg revert --no-backup ignored removed
+  $ hg st -mardi
--- a/tests/test-revlog-group-emptyiter	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-#! /bin/sh
-
-# issue 1678
-
-echo "# -- setting up base repo"
-hg init a
-cd a
-touch a
-hg ci -Am a
-cd ..
-
-echo "# -- cloning base repo"
-hg clone a b
-cd b
-
-echo "# -- setting up cset to push"
-hg up null
-touch a
-hg ci -Am b # different msg so we get a clog new entry
-
-echo "# -- pushing"
-hg push -f ../a
-
--- a/tests/test-revlog-group-emptyiter.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-# -- setting up base repo
-adding a
-# -- cloning base repo
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# -- setting up cset to push
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-adding a
-created new head
-# -- pushing
-pushing to ../a
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 0 changes to 0 files (+1 heads)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-revlog-group-emptyiter.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,34 @@
+issue 1678
+
+setting up base repo
+  $ hg init a
+  $ cd a
+  $ touch a
+  $ hg ci -Am a
+  adding a
+  $ cd ..
+
+cloning base repo
+  $ hg clone a b
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd b
+
+setting up cset to push
+  $ hg up null
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ touch a
+different msg so we get a clog new entry
+  $ hg ci -Am b
+  adding a
+  created new head
+
+pushing
+  $ hg push -f ../a
+  pushing to ../a
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 0 changes to 0 files (+1 heads)
+
--- a/tests/test-revlog-packentry	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-#!/bin/sh
-
-hg init repo
-cd repo
-
-touch foo
-hg ci -Am 'add foo'
-
-hg up -C null
-# this should be stored as a delta against rev 0
-echo foo bar baz > foo
-hg ci -Am 'add foo again'
-
-hg debugindex .hg/store/data/foo.i
--- a/tests/test-revlog-packentry.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-adding foo
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-adding foo
-created new head
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0       0      0       0 b80de5d13875 000000000000 000000000000
-     1         0      24      0       1 0376abec49b8 000000000000 000000000000
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-revlog-packentry.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,21 @@
+  $ hg init repo
+  $ cd repo
+
+  $ touch foo
+  $ hg ci -Am 'add foo'
+  adding foo
+
+  $ hg up -C null
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+this should be stored as a delta against rev 0
+
+  $ echo foo bar baz > foo
+  $ hg ci -Am 'add foo again'
+  adding foo
+  created new head
+
+  $ hg debugindex .hg/store/data/foo.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0       0      0       0 b80de5d13875 000000000000 000000000000
+       1         0      24      0       1 0376abec49b8 000000000000 000000000000
--- a/tests/test-revset	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,146 +0,0 @@
-#!/bin/sh
-
-HGENCODING=utf-8
-export HGENCODING
-
-try() {
-	echo '% hg debugrevspec' $@
-	hg debugrevspec --debug $@
-}
-
-log() {
-    echo "% log '$1'"
-    hg log --template '{rev}\n' -r "$1"
-}
-
-hg init repo
-cd repo
-
-echo a > a
-hg branch a
-hg ci -Aqm0
-
-echo b > b
-hg branch b
-hg ci -Aqm1
-
-rm a
-hg branch a-b-c-
-hg ci -Aqm2 -u Bob
-
-hg co 1
-hg branch +a+b+c+
-hg ci -Aqm3
-
-hg co 2  # interleave
-echo bb > b
-hg branch -- -a-b-c-
-hg ci -Aqm4 -d "May 12 2005"
-
-hg co 3
-hg branch /a/b/c/
-hg ci -Aqm"5 bug"
-
-hg merge 4
-hg branch _a_b_c_
-hg ci -Aqm"6 issue619"
-
-hg branch .a.b.c.
-hg ci -Aqm7
-
-hg branch all
-hg ci --close-branch -Aqm8
-
-hg co 4
-hg branch é
-hg ci -Aqm9
-
-hg tag -r6 1.0
-
-hg clone --quiet -U -r 7 . ../remote1
-hg clone --quiet -U -r 8 . ../remote2
-echo "[paths]" >> .hg/hgrc
-echo "default = ../remote1" >> .hg/hgrc
-
-# names that should work without quoting
-try a
-try b-a
-try _a_b_c_
-try _a_b_c_-a
-try .a.b.c.
-try .a.b.c.-a
-try -- '-a-b-c-' # complains
-log -a-b-c- # succeeds with fallback
-try -- -a-b-c--a # complains
-try é
-
-# quoting needed
-try '"-a-b-c-"-a'
-
-log '1 or 2'
-log '1|2'
-log '1 and 2'
-log '1&2'
-try '1&2|3' # precedence - and is higher
-try '1|2&3' 
-try '1&2&3' # associativity
-try '1|(2|3)'
-log '1.0' # tag
-log 'a' # branch
-log '2785f51ee' 
-log 'date(2005)'
-log 'date(this is a test)'
-log 'date()'
-log 'date'
-log 'date(' 
-log 'date(tip)'
-log '"date"'
-log 'date(2005) and 1::'
-
-log 'ancestor(1)'
-log 'ancestor(4,5)'
-log 'ancestor(4,5) and 4'
-log 'ancestors(5)'
-log 'author(bob)'
-log 'branch(é)'
-log 'children(ancestor(4,5))'
-log 'closed()'
-log 'contains(a)'
-log 'descendants(2 or 3)'
-log 'file(b)'
-log 'follow()'
-log 'grep("issue\d+")'
-try 'grep("(")' # invalid regular expression
-log 'head()'
-log 'heads(6::)'
-log 'keyword(issue)'
-log 'limit(head(), 1)'
-log 'max(contains(a))'
-log 'merge()'
-log 'modifies(b)'
-log 'outgoing()'
-log 'outgoing("../remote1")'
-log 'outgoing("../remote2")'
-log 'p1(merge())'
-log 'p2(merge())'
-log 'parents(merge())'
-log 'removes(a)'
-log 'roots(all())'
-log 'reverse(2 or 3 or 4 or 5)'
-log 'sort(limit(reverse(all()), 3))'
-log 'sort(2 or 3 or 4 or 5, date)'
-log 'tagged()'
-log 'user(bob)'
-
-log '4::8'
-log '4:8'
-
-log 'sort(!merge() & (modifies(b) | user(bob) | keyword(bug) | keyword(issue) & 1::9), "-date")'
-
-log 'not 0 and 0:2'
-log 'not 1 and 0:2'
-log 'not 2 and 0:2'
-log '(1 and 2)::'
-log '(1 and 2):'
-log '(1 and 2):3'
-log 'sort(head(), -rev)'
--- a/tests/test-revset.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,238 +0,0 @@
-marked working directory as branch a
-marked working directory as branch b
-marked working directory as branch a-b-c-
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-marked working directory as branch +a+b+c+
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-marked working directory as branch -a-b-c-
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-marked working directory as branch /a/b/c/
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-marked working directory as branch _a_b_c_
-marked working directory as branch .a.b.c.
-marked working directory as branch all
-abort: can only close branch heads
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-marked working directory as branch é
-% hg debugrevspec a
-('symbol', 'a')
-0
-% hg debugrevspec b-a
-('minus', ('symbol', 'b'), ('symbol', 'a'))
-1
-% hg debugrevspec _a_b_c_
-('symbol', '_a_b_c_')
-6
-% hg debugrevspec _a_b_c_-a
-('minus', ('symbol', '_a_b_c_'), ('symbol', 'a'))
-6
-% hg debugrevspec .a.b.c.
-('symbol', '.a.b.c.')
-7
-% hg debugrevspec .a.b.c.-a
-('minus', ('symbol', '.a.b.c.'), ('symbol', 'a'))
-7
-% hg debugrevspec -- -a-b-c-
-hg: parse error at 7: not a prefix: end
-% log '-a-b-c-'
-4
-% hg debugrevspec -- -a-b-c--a
-('minus', ('minus', ('minus', ('negate', ('symbol', 'a')), ('symbol', 'b')), ('symbol', 'c')), ('negate', ('symbol', 'a')))
-abort: unknown revision '-a'!
-% hg debugrevspec é
-('symbol', '\xc3\xa9')
-9
-% hg debugrevspec "-a-b-c-"-a
-('minus', ('string', '-a-b-c-'), ('symbol', 'a'))
-4
-% log '1 or 2'
-1
-2
-% log '1|2'
-1
-2
-% log '1 and 2'
-% log '1&2'
-% hg debugrevspec 1&2|3
-('or', ('and', ('symbol', '1'), ('symbol', '2')), ('symbol', '3'))
-3
-% hg debugrevspec 1|2&3
-('or', ('symbol', '1'), ('and', ('symbol', '2'), ('symbol', '3')))
-1
-% hg debugrevspec 1&2&3
-('and', ('and', ('symbol', '1'), ('symbol', '2')), ('symbol', '3'))
-% hg debugrevspec 1|(2|3)
-('or', ('symbol', '1'), ('group', ('or', ('symbol', '2'), ('symbol', '3'))))
-1
-2
-3
-% log '1.0'
-6
-% log 'a'
-0
-% log '2785f51ee'
-0
-% log 'date(2005)'
-4
-% log 'date(this is a test)'
-hg: parse error at 10: unexpected token: symbol
-% log 'date()'
-hg: parse error: date wants a string
-% log 'date'
-hg: parse error: can't use date here
-% log 'date('
-hg: parse error at 5: not a prefix: end
-% log 'date(tip)'
-abort: invalid date: 'tip' 
-% log '"date"'
-abort: unknown revision 'date'!
-% log 'date(2005) and 1::'
-4
-% log 'ancestor(1)'
-hg: parse error: ancestor wants two arguments
-% log 'ancestor(4,5)'
-1
-% log 'ancestor(4,5) and 4'
-% log 'ancestors(5)'
-0
-1
-3
-5
-% log 'author(bob)'
-2
-% log 'branch(é)'
-8
-9
-% log 'children(ancestor(4,5))'
-2
-3
-% log 'closed()'
-% log 'contains(a)'
-0
-1
-3
-5
-% log 'descendants(2 or 3)'
-2
-3
-4
-5
-6
-7
-8
-9
-% log 'file(b)'
-1
-4
-% log 'follow()'
-0
-1
-2
-4
-8
-9
-% log 'grep("issue\d+")'
-6
-% hg debugrevspec grep("(")
-('func', ('symbol', 'grep'), ('string', '('))
-hg: parse error: invalid match pattern: unbalanced parenthesis
-% log 'head()'
-0
-1
-2
-3
-4
-5
-6
-7
-9
-% log 'heads(6::)'
-7
-% log 'keyword(issue)'
-6
-% log 'limit(head(), 1)'
-0
-% log 'max(contains(a))'
-5
-% log 'merge()'
-6
-% log 'modifies(b)'
-4
-% log 'outgoing()'
-8
-9
-% log 'outgoing("../remote1")'
-8
-9
-% log 'outgoing("../remote2")'
-3
-5
-6
-7
-9
-% log 'p1(merge())'
-5
-% log 'p2(merge())'
-4
-% log 'parents(merge())'
-4
-5
-% log 'removes(a)'
-2
-6
-% log 'roots(all())'
-0
-% log 'reverse(2 or 3 or 4 or 5)'
-5
-4
-3
-2
-% log 'sort(limit(reverse(all()), 3))'
-7
-8
-9
-% log 'sort(2 or 3 or 4 or 5, date)'
-2
-3
-5
-4
-% log 'tagged()'
-6
-% log 'user(bob)'
-2
-% log '4::8'
-4
-8
-% log '4:8'
-4
-5
-6
-7
-8
-% log 'sort(!merge() & (modifies(b) | user(bob) | keyword(bug) | keyword(issue) & 1::9), "-date")'
-4
-2
-5
-% log 'not 0 and 0:2'
-1
-2
-% log 'not 1 and 0:2'
-0
-2
-% log 'not 2 and 0:2'
-0
-1
-% log '(1 and 2)::'
-% log '(1 and 2):'
-% log '(1 and 2):3'
-% log 'sort(head(), -rev)'
-9
-7
-6
-5
-4
-3
-2
-1
-0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-revset.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,321 @@
+  $ HGENCODING=utf-8
+  $ export HGENCODING
+
+  $ try() {
+  >   hg debugrevspec --debug $@
+  > }
+
+  $ log() {
+  >   hg log --template '{rev}\n' -r "$1"
+  > }
+
+  $ hg init repo
+  $ cd repo
+
+  $ echo a > a
+  $ hg branch a
+  marked working directory as branch a
+  $ hg ci -Aqm0
+
+  $ echo b > b
+  $ hg branch b
+  marked working directory as branch b
+  $ hg ci -Aqm1
+
+  $ rm a
+  $ hg branch a-b-c-
+  marked working directory as branch a-b-c-
+  $ hg ci -Aqm2 -u Bob
+
+  $ hg co 1
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg branch +a+b+c+
+  marked working directory as branch +a+b+c+
+  $ hg ci -Aqm3
+
+  $ hg co 2  # interleave
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo bb > b
+  $ hg branch -- -a-b-c-
+  marked working directory as branch -a-b-c-
+  $ hg ci -Aqm4 -d "May 12 2005"
+
+  $ hg co 3
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg branch /a/b/c/
+  marked working directory as branch /a/b/c/
+  $ hg ci -Aqm"5 bug"
+
+  $ hg merge 4
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg branch _a_b_c_
+  marked working directory as branch _a_b_c_
+  $ hg ci -Aqm"6 issue619"
+
+  $ hg branch .a.b.c.
+  marked working directory as branch .a.b.c.
+  $ hg ci -Aqm7
+
+  $ hg branch all
+  marked working directory as branch all
+  $ hg ci --close-branch -Aqm8
+  abort: can only close branch heads
+  [255]
+
+  $ hg co 4
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg branch é
+  marked working directory as branch é
+  $ hg ci -Aqm9
+
+  $ hg tag -r6 1.0
+
+  $ hg clone --quiet -U -r 7 . ../remote1
+  $ hg clone --quiet -U -r 8 . ../remote2
+  $ echo "[paths]" >> .hg/hgrc
+  $ echo "default = ../remote1" >> .hg/hgrc
+
+names that should work without quoting
+
+  $ try a
+  ('symbol', 'a')
+  0
+  $ try b-a
+  ('minus', ('symbol', 'b'), ('symbol', 'a'))
+  1
+  $ try _a_b_c_
+  ('symbol', '_a_b_c_')
+  6
+  $ try _a_b_c_-a
+  ('minus', ('symbol', '_a_b_c_'), ('symbol', 'a'))
+  6
+  $ try .a.b.c.
+  ('symbol', '.a.b.c.')
+  7
+  $ try .a.b.c.-a
+  ('minus', ('symbol', '.a.b.c.'), ('symbol', 'a'))
+  7
+  $ try -- '-a-b-c-' # complains
+  hg: parse error at 7: not a prefix: end
+  [255]
+  $ log -a-b-c- # succeeds with fallback
+  4
+  $ try -- -a-b-c--a # complains
+  ('minus', ('minus', ('minus', ('negate', ('symbol', 'a')), ('symbol', 'b')), ('symbol', 'c')), ('negate', ('symbol', 'a')))
+  abort: unknown revision '-a'!
+  [255]
+  $ try é
+  ('symbol', '\xc3\xa9')
+  9
+
+quoting needed
+
+  $ try '"-a-b-c-"-a'
+  ('minus', ('string', '-a-b-c-'), ('symbol', 'a'))
+  4
+
+  $ log '1 or 2'
+  1
+  2
+  $ log '1|2'
+  1
+  2
+  $ log '1 and 2'
+  $ log '1&2'
+  $ try '1&2|3' # precedence - and is higher
+  ('or', ('and', ('symbol', '1'), ('symbol', '2')), ('symbol', '3'))
+  3
+  $ try '1|2&3'
+  ('or', ('symbol', '1'), ('and', ('symbol', '2'), ('symbol', '3')))
+  1
+  $ try '1&2&3' # associativity
+  ('and', ('and', ('symbol', '1'), ('symbol', '2')), ('symbol', '3'))
+  $ try '1|(2|3)'
+  ('or', ('symbol', '1'), ('group', ('or', ('symbol', '2'), ('symbol', '3'))))
+  1
+  2
+  3
+  $ log '1.0' # tag
+  6
+  $ log 'a' # branch
+  0
+  $ log '2785f51ee'
+  0
+  $ log 'date(2005)'
+  4
+  $ log 'date(this is a test)'
+  hg: parse error at 10: unexpected token: symbol
+  [255]
+  $ log 'date()'
+  hg: parse error: date wants a string
+  [255]
+  $ log 'date'
+  hg: parse error: can't use date here
+  [255]
+  $ log 'date('
+  hg: parse error at 5: not a prefix: end
+  [255]
+  $ log 'date(tip)'
+  abort: invalid date: 'tip'
+  [255]
+  $ log '"date"'
+  abort: unknown revision 'date'!
+  [255]
+  $ log 'date(2005) and 1::'
+  4
+
+  $ log 'ancestor(1)'
+  hg: parse error: ancestor wants two arguments
+  [255]
+  $ log 'ancestor(4,5)'
+  1
+  $ log 'ancestor(4,5) and 4'
+  $ log 'ancestors(5)'
+  0
+  1
+  3
+  5
+  $ log 'author(bob)'
+  2
+  $ log 'branch(é)'
+  8
+  9
+  $ log 'children(ancestor(4,5))'
+  2
+  3
+  $ log 'closed()'
+  $ log 'contains(a)'
+  0
+  1
+  3
+  5
+  $ log 'descendants(2 or 3)'
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+  $ log 'file(b)'
+  1
+  4
+  $ log 'follow()'
+  0
+  1
+  2
+  4
+  8
+  9
+  $ log 'grep("issue\d+")'
+  6
+  $ try 'grep("(")' # invalid regular expression
+  ('func', ('symbol', 'grep'), ('string', '('))
+  hg: parse error: invalid match pattern: unbalanced parenthesis
+  [255]
+  $ log 'head()'
+  0
+  1
+  2
+  3
+  4
+  5
+  6
+  7
+  9
+  $ log 'heads(6::)'
+  7
+  $ log 'keyword(issue)'
+  6
+  $ log 'limit(head(), 1)'
+  0
+  $ log 'max(contains(a))'
+  5
+  $ log 'min(contains(a))'
+  0
+  $ log 'merge()'
+  6
+  $ log 'modifies(b)'
+  4
+  $ log 'outgoing()'
+  8
+  9
+  $ log 'outgoing("../remote1")'
+  8
+  9
+  $ log 'outgoing("../remote2")'
+  3
+  5
+  6
+  7
+  9
+  $ log 'p1(merge())'
+  5
+  $ log 'p2(merge())'
+  4
+  $ log 'parents(merge())'
+  4
+  5
+  $ log 'removes(a)'
+  2
+  6
+  $ log 'roots(all())'
+  0
+  $ log 'reverse(2 or 3 or 4 or 5)'
+  5
+  4
+  3
+  2
+  $ log 'sort(limit(reverse(all()), 3))'
+  7
+  8
+  9
+  $ log 'sort(2 or 3 or 4 or 5, date)'
+  2
+  3
+  5
+  4
+  $ log 'tagged()'
+  6
+  $ log 'user(bob)'
+  2
+
+  $ log '4::8'
+  4
+  8
+  $ log '4:8'
+  4
+  5
+  6
+  7
+  8
+
+  $ log 'sort(!merge() & (modifies(b) | user(bob) | keyword(bug) | keyword(issue) & 1::9), "-date")'
+  4
+  2
+  5
+
+  $ log 'not 0 and 0:2'
+  1
+  2
+  $ log 'not 1 and 0:2'
+  0
+  2
+  $ log 'not 2 and 0:2'
+  0
+  1
+  $ log '(1 and 2)::'
+  $ log '(1 and 2):'
+  $ log '(1 and 2):3'
+  $ log 'sort(head(), -rev)'
+  9
+  7
+  6
+  5
+  4
+  3
+  2
+  1
+  0
--- a/tests/test-rollback	Wed Sep 22 17:13:49 2010 -0500
+++ b/tests/test-rollback	Wed Sep 22 18:29:41 2010 -0500
@@ -5,7 +5,7 @@
 hg init
 echo a > a
 hg add a
-hg commit -m "test" -d "1000000 0"
+hg commit -m "test"
 hg verify
 hg parents
 hg status
--- a/tests/test-rollback.out	Wed Sep 22 17:13:49 2010 -0500
+++ b/tests/test-rollback.out	Wed Sep 22 18:29:41 2010 -0500
@@ -3,10 +3,10 @@
 crosschecking files in changesets and manifests
 checking files
 1 files, 1 changesets, 1 total revisions
-changeset:   0:0acdaf898367
+changeset:   0:acb14030fe0a
 tag:         tip
 user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
+date:        Thu Jan 01 00:00:00 1970 +0000
 summary:     test
 
 rolling back to revision -1 (undo commit)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-run-tests.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,37 @@
+Simple commands:
+
+  $ echo foo
+  foo
+  $ printf 'bar\nbaz\n' | cat
+  bar
+  baz
+
+Multi-line command:
+
+  $ foo() {
+  >     echo bar
+  > }
+  $ foo
+  bar
+
+Regular expressions:
+
+  $ echo foobarbaz
+  foobar.* (re)
+  $ echo barbazquux
+  .*quux.* (re)
+
+Globs:
+
+  $ printf '* \\foobarbaz {10}\n'
+  \* \\fo?bar* {10} (glob)
+
+Literal match ending in " (re)":
+
+  $ echo 'foo (re)'
+  foo (re)
+
+Exit code:
+
+  $ false
+  [1]
--- a/tests/test-serve	Wed Sep 22 17:13:49 2010 -0500
+++ b/tests/test-serve	Wed Sep 22 18:29:41 2010 -0500
@@ -10,7 +10,11 @@
     echo % errors
     cat errors.log
     sleep 1
-    kill `cat hg.pid`
+    if [ "$KILLQUIETLY" = "Y" ]; then
+        kill `cat hg.pid` 2>/dev/null
+    else
+        kill `cat hg.pid`
+    fi
     sleep 1
 }
 
@@ -36,6 +40,9 @@
 echo % With -v and -p HGPORT2
 hgserve -p "$HGPORT2"
 
+echo '% With -v and -p http (should fail)'
+KILLQUIETLY=Y hgserve -p http; KILLQUIETLY=N
+
 echo % With --prefix foo
 hgserve --prefix foo
 
--- a/tests/test-serve.out	Wed Sep 22 17:13:49 2010 -0500
+++ b/tests/test-serve.out	Wed Sep 22 18:29:41 2010 -0500
@@ -7,6 +7,10 @@
 % With -v and -p HGPORT2
 listening at http://localhost/ (bound to 127.0.0.1:HGPORT2)
 % errors
+% With -v and -p http (should fail)
+abort: cannot start server at 'localhost:80': Permission denied
+abort: child process failed to start
+% errors
 % With --prefix foo
 listening at http://localhost/foo/ (bound to 127.0.0.1:HGPORT1)
 % errors
--- a/tests/test-simple-update	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-#!/bin/sh
-
-set -e
-
-mkdir test
-cd test
-echo foo>foo
-hg init
-hg addremove
-hg commit -m "1"
-hg verify
-
-hg clone . ../branch
-cd ../branch
-hg co
-echo bar>>foo
-hg commit -m "2"
-
-cd ../test
-hg pull ../branch
-hg verify
-hg co
-cat foo
-hg manifest --debug
--- a/tests/test-simple-update.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-adding foo
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 1 changesets, 1 total revisions
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-pulling from ../branch
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-(run 'hg update' to get a working copy)
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 2 changesets, 2 total revisions
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-foo
-bar
-6f4310b00b9a147241b071a60c28a650827fb03d 644   foo
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-simple-update.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,52 @@
+  $ mkdir test
+  $ cd test
+  $ echo foo>foo
+  $ hg init
+  $ hg addremove
+  adding foo
+  $ hg commit -m "1"
+
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 1 changesets, 1 total revisions
+
+  $ hg clone . ../branch
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd ../branch
+  $ hg co
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo bar>>foo
+  $ hg commit -m "2"
+
+  $ cd ../test
+
+  $ hg pull ../branch
+  pulling from ../branch
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  (run 'hg update' to get a working copy)
+
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 2 changesets, 2 total revisions
+
+  $ hg co
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ cat foo
+  foo
+  bar
+
+  $ hg manifest --debug
+  6f4310b00b9a147241b071a60c28a650827fb03d 644   foo
+
--- a/tests/test-ssh	Wed Sep 22 17:13:49 2010 -0500
+++ b/tests/test-ssh	Wed Sep 22 18:29:41 2010 -0500
@@ -37,7 +37,7 @@
 cd remote
 echo this > foo
 echo this > fooO
-hg ci -A -m "init" -d "1000000 0" foo fooO
+hg ci -A -m "init" foo fooO
 echo '[server]' > .hg/hgrc
 echo 'uncompressed = True' >> .hg/hgrc
 echo '[hooks]' >> .hg/hgrc
@@ -71,7 +71,7 @@
 
 echo "# local change"
 echo bleah > foo
-hg ci -m "add" -d "1000000 0"
+hg ci -m "add"
 
 echo "# updating rc"
 echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc
@@ -95,13 +95,13 @@
 hg cat -r tip foo
 
 echo z > z
-hg ci -A -m z -d '1000001 0' z
+hg ci -A -m z z
 # a bad, evil hook that prints to stdout
 echo 'changegroup.stdout = python ../badhook' >> .hg/hgrc
 
 cd ../local
 echo r > r
-hg ci -A -m z -d '1000002 0' r
+hg ci -A -m z r
 
 echo "# push should succeed even though it has an unexpected response"
 hg push
--- a/tests/test-ssh.out	Wed Sep 22 17:13:49 2010 -0500
+++ b/tests/test-ssh.out	Wed Sep 22 18:29:41 2010 -0500
@@ -37,19 +37,19 @@
 # find outgoing
 comparing with ssh://user@dummy/remote
 searching for changes
-changeset:   1:572896fe480d
+changeset:   1:a28a9d1a809c
 tag:         tip
 user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
+date:        Thu Jan 01 00:00:00 1970 +0000
 summary:     add
 
 # find incoming on the remote side
 comparing with ssh://user@dummy/local
 searching for changes
-changeset:   1:572896fe480d
+changeset:   1:a28a9d1a809c
 tag:         tip
 user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
+date:        Thu Jan 01 00:00:00 1970 +0000
 summary:     add
 
 # push
@@ -60,10 +60,10 @@
 remote: adding file changes
 remote: added 1 changesets with 1 changes to 1 files
 # check remote tip
-changeset:   1:572896fe480d
+changeset:   1:a28a9d1a809c
 tag:         tip
 user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
+date:        Thu Jan 01 00:00:00 1970 +0000
 summary:     add
 
 checking changesets
@@ -82,17 +82,17 @@
 remote: adding file changes
 remote: added 1 changesets with 1 changes to 1 files
 remote: KABOOM
-changeset:   3:ac7448082955
+changeset:   3:1383141674ec
 tag:         tip
-parent:      1:572896fe480d
+parent:      1:a28a9d1a809c
 user:        test
-date:        Mon Jan 12 13:46:42 1970 +0000
+date:        Thu Jan 01 00:00:00 1970 +0000
 summary:     z
 
-changeset:   2:187c6caa0d1e
-parent:      0:e34318c26897
+changeset:   2:6c0482d977a3
+parent:      0:1160648e36ce
 user:        test
-date:        Mon Jan 12 13:46:41 1970 +0000
+date:        Thu Jan 01 00:00:00 1970 +0000
 summary:     z
 
 Got arguments 1:user@dummy 2:hg -R nonexistent serve --stdio
@@ -102,6 +102,6 @@
 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
 Got arguments 1:user@dummy 2:hg -R local serve --stdio
 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
-changegroup-in-remote hook: HG_NODE=572896fe480d7581849806ee402175c49cb20037 HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1 
+changegroup-in-remote hook: HG_NODE=a28a9d1a809cab7d4e2fde4bee738a9ede948b60 HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1 
 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
-changegroup-in-remote hook: HG_NODE=ac7448082955a0b2ff5cb4512c1e061c779bbc79 HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1 
+changegroup-in-remote hook: HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6 HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1 
--- a/tests/test-static-http	Wed Sep 22 17:13:49 2010 -0500
+++ b/tests/test-static-http	Wed Sep 22 18:29:41 2010 -0500
@@ -29,7 +29,7 @@
 hg init
 echo foo > bar
 hg add bar
-hg commit -m"test" -d "1000000 0"
+hg commit -m"test"
 hg tip
 
 cd ..
@@ -42,7 +42,7 @@
 
 cd ../remote
 echo baz > quux
-hg commit -A -mtest2 -d '100000000 0'
+hg commit -A -mtest2
 # check for HTTP opener failures when cachefile does not exist
 rm .hg/*.cache
 
@@ -54,7 +54,7 @@
 echo '% trying to push'
 hg update
 echo more foo >> bar
-hg commit -m"test" -d "100000000 0"
+hg commit -m"test"
 hg push | sed -e "s,:$HGPORT/,:\$HGPORT/,"
 
 echo '% trying clone -r'
--- a/tests/test-static-http.out	Wed Sep 22 17:13:49 2010 -0500
+++ b/tests/test-static-http.out	Wed Sep 22 18:29:41 2010 -0500
@@ -1,10 +1,10 @@
 abort: error: Connection refused
 255
 copy: No such file or directory
-changeset:   0:53e17d176ae6
+changeset:   0:61c9426e69fe
 tag:         tip
 user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
+date:        Thu Jan 01 00:00:00 1970 +0000
 summary:     test
 
 requesting all changes
@@ -21,7 +21,7 @@
 1 files, 1 changesets, 1 total revisions
 foo
 adding quux
-changegroup hook: HG_NODE=34401e0e9971e9720b613d9089ffa9a6eefb3d2d HG_SOURCE=pull HG_URL=http://localhost:$HGPORT/remote 
+changegroup hook: HG_NODE=822d6e31f08b9d6e3b898ce5e52efc0a4bf4905a HG_SOURCE=pull HG_URL=http://localhost:$HGPORT/remote 
 pulling from static-http://localhost:$HGPORT/remote
 searching for changes
 adding changesets
--- a/tests/test-status	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,117 +0,0 @@
-#!/bin/sh
-
-hg init repo1
-cd repo1
-mkdir a b a/1 b/1 b/2
-touch in_root a/in_a b/in_b a/1/in_a_1 b/1/in_b_1 b/2/in_b_2
-echo "hg status in repo root:"
-hg status
-echo "hg status . in repo root:"
-hg status .
-for dir in a b a/1 b/1 b/2; do
-    echo "hg status in $dir:"
-    hg status --cwd "$dir"
-    echo "hg status . in $dir:"
-    hg status --cwd "$dir" .
-    echo "hg status .. in $dir:"
-    hg status --cwd "$dir" ..
-done
-cd ..
-
-hg init repo2
-cd repo2
-touch modified removed deleted ignored
-echo "^ignored$" > .hgignore
-hg ci -A -m 'initial checkin' -d "1000000 0"
-touch modified added unknown ignored
-hg add added
-hg remove removed
-rm deleted
-echo "hg status:"
-hg status
-echo "hg status modified added removed deleted unknown never-existed ignored:"
-hg status modified added removed deleted unknown never-existed ignored
-hg copy modified copied
-echo "hg status -C:"
-hg status -C
-echo "hg status -A:"
-hg status -A
-echo "^ignoreddir$" > .hgignore
-mkdir ignoreddir
-touch ignoreddir/file
-echo "hg status ignoreddir/file:"
-hg status ignoreddir/file
-echo "hg status -i ignoreddir/file:"
-hg status -i ignoreddir/file
-cd ..
-
-# check 'status -q' and some combinations
-hg init repo3
-cd repo3
-touch modified removed deleted ignored
-echo "^ignored$" > .hgignore
-hg commit -A -m 'initial checkin'
-touch added unknown ignored
-hg add added
-echo "test" >> modified
-hg remove removed
-rm deleted
-hg copy modified copied
-
-# Run status with 2 different flags.
-# Check if result is the same or different.
-# If result is not as expected, raise error
-assert() {
-    hg status $1 > ../a
-    hg status $2 > ../b
-    out=`diff ../a ../b`
-    if [ $? -ne 0 ]; then
-        out=1
-    else
-        out=0
-    fi
-    if [ $3 -eq 0 ]; then
-        df="same"
-    else
-        df="different"
-    fi
-    if [ $out -ne $3 ]; then
-        echo "Error on $1 and $2, should be $df."
-    fi
-}
-
-# assert flag1 flag2 [0-same | 1-different]
-assert "-q" "-mard"      0
-assert "-A" "-marduicC"  0
-assert "-qA" "-mardcC"   0
-assert "-qAui" "-A"      0
-assert "-qAu" "-marducC" 0
-assert "-qAi" "-mardicC" 0
-assert "-qu" "-u"        0
-assert "-q" "-u"         1
-assert "-m" "-a"         1
-assert "-r" "-d"         1
-cd ..
-
-hg init repo4
-cd repo4
-touch modified removed deleted
-hg ci -q -A -m 'initial checkin' -d "1000000 0"
-touch added unknown
-hg add added
-hg remove removed
-rm deleted
-echo x > modified
-hg copy modified copied
-hg ci -m 'test checkin' -d "1000001 0"
-rm *
-touch unrelated
-hg ci -q -A -m 'unrelated checkin' -d "1000002 0"
-echo "hg status --change 1:"
-hg status --change 1
-echo "hg status --change 1 unrelated:"
-hg status --change 1 unrelated
-echo "hg status -C --change 1 added modified copied removed deleted:"
-hg status -C --change 1 added modified copied removed deleted
-echo "hg status -A --change 1"
-hg status -A --change 1
--- a/tests/test-status-color	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,122 +0,0 @@
-#!/bin/sh
-
-echo "[extensions]" >> $HGRCPATH
-echo "color=" >> $HGRCPATH
-echo "[color]" >> $HGRCPATH
-echo "mode=ansi" >> $HGRCPATH
-
-hg init repo1
-cd repo1
-mkdir a b a/1 b/1 b/2
-touch in_root a/in_a b/in_b a/1/in_a_1 b/1/in_b_1 b/2/in_b_2
-echo "hg status in repo root:"
-hg status --color=always
-echo "hg status . in repo root:"
-hg status --color=always .
-for dir in a b a/1 b/1 b/2; do
-    echo "hg status in $dir:"
-    hg status --color=always --cwd "$dir"
-    echo "hg status . in $dir:"
-    hg status --color=always --cwd "$dir" .
-    echo "hg status .. in $dir:"
-    hg status --color=always --cwd "$dir" ..
-done
-cd ..
-
-hg init repo2
-cd repo2
-touch modified removed deleted ignored
-echo "^ignored$" > .hgignore
-hg ci -A -m 'initial checkin' -d "1000000 0"
-touch modified added unknown ignored
-hg add added
-hg remove removed
-rm deleted
-echo "hg status:"
-hg status --color=always
-echo "hg status modified added removed deleted unknown never-existed ignored:"
-hg status --color=always modified added removed deleted unknown never-existed ignored
-hg copy modified copied
-echo "hg status -C:"
-hg status --color=always -C
-echo "hg status -A:"
-hg status --color=always -A
-echo "^ignoreddir$" > .hgignore
-mkdir ignoreddir
-touch ignoreddir/file
-echo "hg status ignoreddir/file:"
-hg status --color=always ignoreddir/file
-echo "hg status -i ignoreddir/file:"
-hg status --color=always -i ignoreddir/file
-cd ..
-
-# check 'status -q' and some combinations
-hg init repo3
-cd repo3
-touch modified removed deleted ignored
-echo "^ignored$" > .hgignore
-hg commit -A -m 'initial checkin'
-touch added unknown ignored
-hg add added
-echo "test" >> modified
-hg remove removed
-rm deleted
-hg copy modified copied
-
-echo "% test unknown color"
-hg --config color.status.modified=periwinkle status --color=always
-
-# Run status with 2 different flags.
-# Check if result is the same or different.
-# If result is not as expected, raise error
-assert() {
-    hg status --color=always $1 > ../a
-    hg status --color=always $2 > ../b
-    out=`diff ../a ../b`
-    if [ $? -ne 0 ]; then
-        out=1
-    else
-        out=0
-    fi
-    if [ $3 -eq 0 ]; then
-        df="same"
-    else
-        df="different"
-    fi
-    if [ $out -ne $3 ]; then
-        echo "Error on $1 and $2, should be $df."
-    fi
-}
-
-# assert flag1 flag2 [0-same | 1-different]
-assert "-q" "-mard"      0
-assert "-A" "-marduicC"  0
-assert "-qA" "-mardcC"   0
-assert "-qAui" "-A"      0
-assert "-qAu" "-marducC" 0
-assert "-qAi" "-mardicC" 0
-assert "-qu" "-u"        0
-assert "-q" "-u"         1
-assert "-m" "-a"         1
-assert "-r" "-d"         1
-
-cd ..
-
-# test 'resolve -l'
-hg init repo4
-cd repo4
-echo "file a" > a
-echo "file b" > b
-hg add a b
-hg commit -m "initial"
-echo "file a change 1" > a
-echo "file b change 1" > b
-hg commit -m "head 1"
-hg update 0
-echo "file a change 2" > a
-echo "file b change 2" > b
-hg commit -m "head 2"
-hg merge
-hg resolve -m b
-echo "hg resolve with one unresolved, one resolved:"
-hg resolve --color=always -l
--- a/tests/test-status-color.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,147 +0,0 @@
-hg status in repo root:
-? a/1/in_a_1
-? a/in_a
-? b/1/in_b_1
-? b/2/in_b_2
-? b/in_b
-? in_root
-hg status . in repo root:
-? a/1/in_a_1
-? a/in_a
-? b/1/in_b_1
-? b/2/in_b_2
-? b/in_b
-? in_root
-hg status in a:
-? a/1/in_a_1
-? a/in_a
-? b/1/in_b_1
-? b/2/in_b_2
-? b/in_b
-? in_root
-hg status . in a:
-? 1/in_a_1
-? in_a
-hg status .. in a:
-? 1/in_a_1
-? in_a
-? ../b/1/in_b_1
-? ../b/2/in_b_2
-? ../b/in_b
-? ../in_root
-hg status in b:
-? a/1/in_a_1
-? a/in_a
-? b/1/in_b_1
-? b/2/in_b_2
-? b/in_b
-? in_root
-hg status . in b:
-? 1/in_b_1
-? 2/in_b_2
-? in_b
-hg status .. in b:
-? ../a/1/in_a_1
-? ../a/in_a
-? 1/in_b_1
-? 2/in_b_2
-? in_b
-? ../in_root
-hg status in a/1:
-? a/1/in_a_1
-? a/in_a
-? b/1/in_b_1
-? b/2/in_b_2
-? b/in_b
-? in_root
-hg status . in a/1:
-? in_a_1
-hg status .. in a/1:
-? in_a_1
-? ../in_a
-hg status in b/1:
-? a/1/in_a_1
-? a/in_a
-? b/1/in_b_1
-? b/2/in_b_2
-? b/in_b
-? in_root
-hg status . in b/1:
-? in_b_1
-hg status .. in b/1:
-? in_b_1
-? ../2/in_b_2
-? ../in_b
-hg status in b/2:
-? a/1/in_a_1
-? a/in_a
-? b/1/in_b_1
-? b/2/in_b_2
-? b/in_b
-? in_root
-hg status . in b/2:
-? in_b_2
-hg status .. in b/2:
-? ../1/in_b_1
-? in_b_2
-? ../in_b
-adding .hgignore
-adding deleted
-adding modified
-adding removed
-hg status:
-A added
-R removed
-! deleted
-? unknown
-hg status modified added removed deleted unknown never-existed ignored:
-never-existed: No such file or directory
-A added
-R removed
-! deleted
-? unknown
-hg status -C:
-A added
-A copied
-  modified
-R removed
-! deleted
-? unknown
-hg status -A:
-A added
-A copied
-  modified
-R removed
-! deleted
-? unknown
-I ignored
-C .hgignore
-C modified
-hg status ignoreddir/file:
-hg status -i ignoreddir/file:
-I ignoreddir/file
-adding .hgignore
-adding deleted
-adding modified
-adding removed
-% test unknown color
-ignoring unknown color/effect 'periwinkle' (configured in color.status.modified)
-M modified
-A added
-A copied
-R removed
-! deleted
-? unknown
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-merging a
-warning: conflicts during merge.
-merging a failed!
-merging b
-warning: conflicts during merge.
-merging b failed!
-0 files updated, 0 files merged, 0 files removed, 2 files unresolved
-use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
-hg resolve with one unresolved, one resolved:
-U a
-R b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-status-color.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,279 @@
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "color=" >> $HGRCPATH
+  $ echo "[color]" >> $HGRCPATH
+  $ echo "mode=ansi" >> $HGRCPATH
+
+  $ hg init repo1
+  $ cd repo1
+  $ mkdir a b a/1 b/1 b/2
+  $ touch in_root a/in_a b/in_b a/1/in_a_1 b/1/in_b_1 b/2/in_b_2
+
+hg status in repo root:
+
+  $ hg status --color=always
+  ? a/1/in_a_1
+  ? a/in_a
+  ? b/1/in_b_1
+  ? b/2/in_b_2
+  ? b/in_b
+  ? in_root
+
+hg status . in repo root:
+
+  $ hg status --color=always .
+  ? a/1/in_a_1
+  ? a/in_a
+  ? b/1/in_b_1
+  ? b/2/in_b_2
+  ? b/in_b
+  ? in_root
+
+  $ hg status --color=always --cwd a
+  ? a/1/in_a_1
+  ? a/in_a
+  ? b/1/in_b_1
+  ? b/2/in_b_2
+  ? b/in_b
+  ? in_root
+  $ hg status --color=always --cwd a .
+  ? 1/in_a_1
+  ? in_a
+  $ hg status --color=always --cwd a ..
+  ? 1/in_a_1
+  ? in_a
+  ? ../b/1/in_b_1
+  ? ../b/2/in_b_2
+  ? ../b/in_b
+  ? ../in_root
+
+  $ hg status --color=always --cwd b
+  ? a/1/in_a_1
+  ? a/in_a
+  ? b/1/in_b_1
+  ? b/2/in_b_2
+  ? b/in_b
+  ? in_root
+  $ hg status --color=always --cwd b .
+  ? 1/in_b_1
+  ? 2/in_b_2
+  ? in_b
+  $ hg status --color=always --cwd b ..
+  ? ../a/1/in_a_1
+  ? ../a/in_a
+  ? 1/in_b_1
+  ? 2/in_b_2
+  ? in_b
+  ? ../in_root
+
+  $ hg status --color=always --cwd a/1
+  ? a/1/in_a_1
+  ? a/in_a
+  ? b/1/in_b_1
+  ? b/2/in_b_2
+  ? b/in_b
+  ? in_root
+  $ hg status --color=always --cwd a/1 .
+  ? in_a_1
+  $ hg status --color=always --cwd a/1 ..
+  ? in_a_1
+  ? ../in_a
+
+  $ hg status --color=always --cwd b/1
+  ? a/1/in_a_1
+  ? a/in_a
+  ? b/1/in_b_1
+  ? b/2/in_b_2
+  ? b/in_b
+  ? in_root
+  $ hg status --color=always --cwd b/1 .
+  ? in_b_1
+  $ hg status --color=always --cwd b/1 ..
+  ? in_b_1
+  ? ../2/in_b_2
+  ? ../in_b
+
+  $ hg status --color=always --cwd b/2
+  ? a/1/in_a_1
+  ? a/in_a
+  ? b/1/in_b_1
+  ? b/2/in_b_2
+  ? b/in_b
+  ? in_root
+  $ hg status --color=always --cwd b/2 .
+  ? in_b_2
+  $ hg status --color=always --cwd b/2 ..
+  ? ../1/in_b_1
+  ? in_b_2
+  ? ../in_b
+  $ cd ..
+
+  $ hg init repo2
+  $ cd repo2
+  $ touch modified removed deleted ignored
+  $ echo "^ignored$" > .hgignore
+  $ hg ci -A -m 'initial checkin'
+  adding .hgignore
+  adding deleted
+  adding modified
+  adding removed
+  $ touch modified added unknown ignored
+  $ hg add added
+  $ hg remove removed
+  $ rm deleted
+
+hg status:
+
+  $ hg status --color=always
+  A added
+  R removed
+  ! deleted
+  ? unknown
+
+hg status modified added removed deleted unknown never-existed ignored:
+
+  $ hg status --color=always modified added removed deleted unknown never-existed ignored
+  never-existed: No such file or directory
+  A added
+  R removed
+  ! deleted
+  ? unknown
+
+  $ hg copy modified copied
+
+hg status -C:
+
+  $ hg status --color=always -C
+  A added
+  A copied
+    modified
+  R removed
+  ! deleted
+  ? unknown
+
+hg status -A:
+
+  $ hg status --color=always -A
+  A added
+  A copied
+    modified
+  R removed
+  ! deleted
+  ? unknown
+  I ignored
+  C .hgignore
+  C modified
+
+
+  $ echo "^ignoreddir$" > .hgignore
+  $ mkdir ignoreddir
+  $ touch ignoreddir/file
+
+hg status ignoreddir/file:
+
+  $ hg status --color=always ignoreddir/file
+
+hg status -i ignoreddir/file:
+
+  $ hg status --color=always -i ignoreddir/file
+  I ignoreddir/file
+  $ cd ..
+
+check 'status -q' and some combinations
+
+  $ hg init repo3
+  $ cd repo3
+  $ touch modified removed deleted ignored
+  $ echo "^ignored$" > .hgignore
+  $ hg commit -A -m 'initial checkin'
+  adding .hgignore
+  adding deleted
+  adding modified
+  adding removed
+  $ touch added unknown ignored
+  $ hg add added
+  $ echo "test" >> modified
+  $ hg remove removed
+  $ rm deleted
+  $ hg copy modified copied
+
+test unknown color
+
+  $ hg --config color.status.modified=periwinkle status --color=always
+  ignoring unknown color/effect 'periwinkle' (configured in color.status.modified)
+  M modified
+  A added
+  A copied
+  R removed
+  ! deleted
+  ? unknown
+
+Run status with 2 different flags.
+Check if result is the same or different.
+If result is not as expected, raise error
+
+  $ assert() {
+  >     hg status --color=always $1 > ../a
+  >     hg status --color=always $2 > ../b
+  >     if diff ../a ../b > /dev/null; then
+  >         out=0
+  >     else
+  >         out=1
+  >     fi
+  >     if [ $3 -eq 0 ]; then
+  >         df="same"
+  >     else
+  >         df="different"
+  >     fi
+  >     if [ $out -ne $3 ]; then
+  >         echo "Error on $1 and $2, should be $df."
+  >     fi
+  > }
+
+assert flag1 flag2 [0-same | 1-different]
+
+  $ assert "-q" "-mard"      0
+  $ assert "-A" "-marduicC"  0
+  $ assert "-qA" "-mardcC"   0
+  $ assert "-qAui" "-A"      0
+  $ assert "-qAu" "-marducC" 0
+  $ assert "-qAi" "-mardicC" 0
+  $ assert "-qu" "-u"        0
+  $ assert "-q" "-u"         1
+  $ assert "-m" "-a"         1
+  $ assert "-r" "-d"         1
+  $ cd ..
+
+test 'resolve -l'
+
+  $ hg init repo4
+  $ cd repo4
+  $ echo "file a" > a
+  $ echo "file b" > b
+  $ hg add a b
+  $ hg commit -m "initial"
+  $ echo "file a change 1" > a
+  $ echo "file b change 1" > b
+  $ hg commit -m "head 1"
+  $ hg update 0
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo "file a change 2" > a
+  $ echo "file b change 2" > b
+  $ hg commit -m "head 2"
+  created new head
+  $ hg merge
+  merging a
+  warning: conflicts during merge.
+  merging a failed!
+  merging b
+  warning: conflicts during merge.
+  merging b failed!
+  0 files updated, 0 files merged, 0 files removed, 2 files unresolved
+  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
+  [1]
+  $ hg resolve -m b
+
+hg resolve with one unresolved, one resolved:
+
+  $ hg resolve --color=always -l
+  U a
+  R b
--- a/tests/test-status.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,145 +0,0 @@
-hg status in repo root:
-? a/1/in_a_1
-? a/in_a
-? b/1/in_b_1
-? b/2/in_b_2
-? b/in_b
-? in_root
-hg status . in repo root:
-? a/1/in_a_1
-? a/in_a
-? b/1/in_b_1
-? b/2/in_b_2
-? b/in_b
-? in_root
-hg status in a:
-? a/1/in_a_1
-? a/in_a
-? b/1/in_b_1
-? b/2/in_b_2
-? b/in_b
-? in_root
-hg status . in a:
-? 1/in_a_1
-? in_a
-hg status .. in a:
-? 1/in_a_1
-? in_a
-? ../b/1/in_b_1
-? ../b/2/in_b_2
-? ../b/in_b
-? ../in_root
-hg status in b:
-? a/1/in_a_1
-? a/in_a
-? b/1/in_b_1
-? b/2/in_b_2
-? b/in_b
-? in_root
-hg status . in b:
-? 1/in_b_1
-? 2/in_b_2
-? in_b
-hg status .. in b:
-? ../a/1/in_a_1
-? ../a/in_a
-? 1/in_b_1
-? 2/in_b_2
-? in_b
-? ../in_root
-hg status in a/1:
-? a/1/in_a_1
-? a/in_a
-? b/1/in_b_1
-? b/2/in_b_2
-? b/in_b
-? in_root
-hg status . in a/1:
-? in_a_1
-hg status .. in a/1:
-? in_a_1
-? ../in_a
-hg status in b/1:
-? a/1/in_a_1
-? a/in_a
-? b/1/in_b_1
-? b/2/in_b_2
-? b/in_b
-? in_root
-hg status . in b/1:
-? in_b_1
-hg status .. in b/1:
-? in_b_1
-? ../2/in_b_2
-? ../in_b
-hg status in b/2:
-? a/1/in_a_1
-? a/in_a
-? b/1/in_b_1
-? b/2/in_b_2
-? b/in_b
-? in_root
-hg status . in b/2:
-? in_b_2
-hg status .. in b/2:
-? ../1/in_b_1
-? in_b_2
-? ../in_b
-adding .hgignore
-adding deleted
-adding modified
-adding removed
-hg status:
-A added
-R removed
-! deleted
-? unknown
-hg status modified added removed deleted unknown never-existed ignored:
-never-existed: No such file or directory
-A added
-R removed
-! deleted
-? unknown
-hg status -C:
-A added
-A copied
-  modified
-R removed
-! deleted
-? unknown
-hg status -A:
-A added
-A copied
-  modified
-R removed
-! deleted
-? unknown
-I ignored
-C .hgignore
-C modified
-hg status ignoreddir/file:
-hg status -i ignoreddir/file:
-I ignoreddir/file
-adding .hgignore
-adding deleted
-adding modified
-adding removed
-hg status --change 1:
-M modified
-A added
-A copied
-R removed
-hg status --change 1 unrelated:
-hg status -C --change 1 added modified copied removed deleted:
-M modified
-A added
-A copied
-  modified
-R removed
-hg status -A --change 1
-M modified
-A added
-A copied
-  modified
-R removed
-C deleted
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-status.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,274 @@
+  $ hg init repo1
+  $ cd repo1
+  $ mkdir a b a/1 b/1 b/2
+  $ touch in_root a/in_a b/in_b a/1/in_a_1 b/1/in_b_1 b/2/in_b_2
+
+hg status in repo root:
+
+  $ hg status
+  ? a/1/in_a_1
+  ? a/in_a
+  ? b/1/in_b_1
+  ? b/2/in_b_2
+  ? b/in_b
+  ? in_root
+
+hg status . in repo root:
+
+  $ hg status .
+  ? a/1/in_a_1
+  ? a/in_a
+  ? b/1/in_b_1
+  ? b/2/in_b_2
+  ? b/in_b
+  ? in_root
+
+  $ hg status --cwd a
+  ? a/1/in_a_1
+  ? a/in_a
+  ? b/1/in_b_1
+  ? b/2/in_b_2
+  ? b/in_b
+  ? in_root
+  $ hg status --cwd a .
+  ? 1/in_a_1
+  ? in_a
+  $ hg status --cwd a ..
+  ? 1/in_a_1
+  ? in_a
+  ? ../b/1/in_b_1
+  ? ../b/2/in_b_2
+  ? ../b/in_b
+  ? ../in_root
+
+  $ hg status --cwd b
+  ? a/1/in_a_1
+  ? a/in_a
+  ? b/1/in_b_1
+  ? b/2/in_b_2
+  ? b/in_b
+  ? in_root
+  $ hg status --cwd b .
+  ? 1/in_b_1
+  ? 2/in_b_2
+  ? in_b
+  $ hg status --cwd b ..
+  ? ../a/1/in_a_1
+  ? ../a/in_a
+  ? 1/in_b_1
+  ? 2/in_b_2
+  ? in_b
+  ? ../in_root
+
+  $ hg status --cwd a/1
+  ? a/1/in_a_1
+  ? a/in_a
+  ? b/1/in_b_1
+  ? b/2/in_b_2
+  ? b/in_b
+  ? in_root
+  $ hg status --cwd a/1 .
+  ? in_a_1
+  $ hg status --cwd a/1 ..
+  ? in_a_1
+  ? ../in_a
+
+  $ hg status --cwd b/1
+  ? a/1/in_a_1
+  ? a/in_a
+  ? b/1/in_b_1
+  ? b/2/in_b_2
+  ? b/in_b
+  ? in_root
+  $ hg status --cwd b/1 .
+  ? in_b_1
+  $ hg status --cwd b/1 ..
+  ? in_b_1
+  ? ../2/in_b_2
+  ? ../in_b
+
+  $ hg status --cwd b/2
+  ? a/1/in_a_1
+  ? a/in_a
+  ? b/1/in_b_1
+  ? b/2/in_b_2
+  ? b/in_b
+  ? in_root
+  $ hg status --cwd b/2 .
+  ? in_b_2
+  $ hg status --cwd b/2 ..
+  ? ../1/in_b_1
+  ? in_b_2
+  ? ../in_b
+  $ cd ..
+
+  $ hg init repo2
+  $ cd repo2
+  $ touch modified removed deleted ignored
+  $ echo "^ignored$" > .hgignore
+  $ hg ci -A -m 'initial checkin'
+  adding .hgignore
+  adding deleted
+  adding modified
+  adding removed
+  $ touch modified added unknown ignored
+  $ hg add added
+  $ hg remove removed
+  $ rm deleted
+
+hg status:
+
+  $ hg status
+  A added
+  R removed
+  ! deleted
+  ? unknown
+
+hg status modified added removed deleted unknown never-existed ignored:
+
+  $ hg status modified added removed deleted unknown never-existed ignored
+  never-existed: No such file or directory
+  A added
+  R removed
+  ! deleted
+  ? unknown
+
+  $ hg copy modified copied
+
+hg status -C:
+
+  $ hg status -C
+  A added
+  A copied
+    modified
+  R removed
+  ! deleted
+  ? unknown
+
+hg status -A:
+
+  $ hg status -A
+  A added
+  A copied
+    modified
+  R removed
+  ! deleted
+  ? unknown
+  I ignored
+  C .hgignore
+  C modified
+
+
+  $ echo "^ignoreddir$" > .hgignore
+  $ mkdir ignoreddir
+  $ touch ignoreddir/file
+
+hg status ignoreddir/file:
+
+  $ hg status ignoreddir/file
+
+hg status -i ignoreddir/file:
+
+  $ hg status -i ignoreddir/file
+  I ignoreddir/file
+  $ cd ..
+
+Check 'status -q' and some combinations
+
+  $ hg init repo3
+  $ cd repo3
+  $ touch modified removed deleted ignored
+  $ echo "^ignored$" > .hgignore
+  $ hg commit -A -m 'initial checkin'
+  adding .hgignore
+  adding deleted
+  adding modified
+  adding removed
+  $ touch added unknown ignored
+  $ hg add added
+  $ echo "test" >> modified
+  $ hg remove removed
+  $ rm deleted
+  $ hg copy modified copied
+
+Run status with 2 different flags.
+Check if result is the same or different.
+If result is not as expected, raise error
+
+  $ assert() {
+  >     hg status $1 > ../a
+  >     hg status $2 > ../b
+  >     if diff ../a ../b > /dev/null; then
+  >         out=0
+  >     else
+  >         out=1
+  >     fi
+  >     if [ $3 -eq 0 ]; then
+  >         df="same"
+  >     else
+  >         df="different"
+  >     fi
+  >     if [ $out -ne $3 ]; then
+  >         echo "Error on $1 and $2, should be $df."
+  >     fi
+  > }
+
+Assert flag1 flag2 [0-same | 1-different]
+
+  $ assert "-q" "-mard"      0
+  $ assert "-A" "-marduicC"  0
+  $ assert "-qA" "-mardcC"   0
+  $ assert "-qAui" "-A"      0
+  $ assert "-qAu" "-marducC" 0
+  $ assert "-qAi" "-mardicC" 0
+  $ assert "-qu" "-u"        0
+  $ assert "-q" "-u"         1
+  $ assert "-m" "-a"         1
+  $ assert "-r" "-d"         1
+  $ cd ..
+
+  $ hg init repo4
+  $ cd repo4
+  $ touch modified removed deleted
+  $ hg ci -q -A -m 'initial checkin'
+  $ touch added unknown
+  $ hg add added
+  $ hg remove removed
+  $ rm deleted
+  $ echo x > modified
+  $ hg copy modified copied
+  $ hg ci -m 'test checkin' -d "1000001 0"
+  $ rm *
+  $ touch unrelated
+  $ hg ci -q -A -m 'unrelated checkin' -d "1000002 0"
+
+hg status --change 1:
+
+  $ hg status --change 1
+  M modified
+  A added
+  A copied
+  R removed
+
+hg status --change 1 unrelated:
+
+  $ hg status --change 1 unrelated
+
+hg status -C --change 1 added modified copied removed deleted:
+
+  $ hg status -C --change 1 added modified copied removed deleted
+  M modified
+  A added
+  A copied
+    modified
+  R removed
+
+hg status -A --change 1:
+
+  $ hg status -A --change 1
+  M modified
+  A added
+  A copied
+    modified
+  R removed
+  C deleted
--- a/tests/test-strict	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-#!/bin/sh
-
-hg init
-
-echo a > a
-hg ci -Ama
-
-hg an a
-
-echo "[ui]" >> $HGRCPATH
-echo "strict=True" >> $HGRCPATH
-
-hg an a
-hg annotate a
-
-echo % should succeed - up is an alias, not an abbreviation
-
-hg up
--- a/tests/test-strict.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-adding a
-0: a
-hg: unknown command 'an'
-Mercurial Distributed SCM
-
-basic commands:
-
- add        add the specified files on the next commit
- annotate   show changeset information by line for each file
- clone      make a copy of an existing repository
- commit     commit the specified files or all outstanding changes
- diff       diff repository (or selected files)
- export     dump the header and diffs for one or more changesets
- forget     forget the specified files on the next commit
- init       create a new repository in the given directory
- log        show revision history of entire repository or files
- merge      merge working directory with another revision
- pull       pull changes from the specified source
- push       push changes to the specified destination
- remove     remove the specified files on the next commit
- serve      start stand-alone webserver
- status     show changed files in the working directory
- summary    summarize working directory state
- update     update working directory (or switch revisions)
-
-use "hg help" for the full list of commands or "hg -v" for details
-0: a
-% should succeed - up is an alias, not an abbreviation
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-strict.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,45 @@
+  $ hg init
+
+  $ echo a > a
+  $ hg ci -Ama
+  adding a
+
+  $ hg an a
+  0: a
+
+  $ echo "[ui]" >> $HGRCPATH
+  $ echo "strict=True" >> $HGRCPATH
+
+  $ hg an a
+  hg: unknown command 'an'
+  Mercurial Distributed SCM
+  
+  basic commands:
+  
+   add        add the specified files on the next commit
+   annotate   show changeset information by line for each file
+   clone      make a copy of an existing repository
+   commit     commit the specified files or all outstanding changes
+   diff       diff repository (or selected files)
+   export     dump the header and diffs for one or more changesets
+   forget     forget the specified files on the next commit
+   init       create a new repository in the given directory
+   log        show revision history of entire repository or files
+   merge      merge working directory with another revision
+   pull       pull changes from the specified source
+   push       push changes to the specified destination
+   remove     remove the specified files on the next commit
+   serve      start stand-alone webserver
+   status     show changed files in the working directory
+   summary    summarize working directory state
+   update     update working directory (or switch revisions)
+  
+  use "hg help" for the full list of commands or "hg -v" for details
+  [255]
+  $ hg annotate a
+  0: a
+
+should succeed - up is an alias, not an abbreviation
+
+  $ hg up
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
--- a/tests/test-subrepo	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,244 +0,0 @@
-#!/bin/sh
-
-rm -rf sub
-mkdir sub
-cd sub
-hg init t
-cd t
-
-echo % first revision, no sub
-echo a > a
-hg ci -Am0
-
-echo % add first sub
-echo s = s > .hgsub
-hg add .hgsub
-hg init s
-echo a > s/a
-
-# issue2232 - committing a subrepo without .hgsub
-hg ci -mbad s
-
-hg -R s ci -Ams0
-hg sum
-hg ci -m1
-
-# issue 2022 - update -C
-echo b > s/a
-hg sum
-hg co -C 1
-hg sum
-
-echo % add sub sub
-echo ss = ss > s/.hgsub
-hg init s/ss
-echo a > s/ss/a
-hg -R s add s/.hgsub
-hg -R s/ss add s/ss/a
-hg sum
-hg ci -m2
-hg sum
-
-echo % bump sub rev
-echo b > s/a
-hg -R s ci -ms1
-hg ci -m3
-
-echo % leave sub dirty
-echo c > s/a
-hg ci -m4
-hg tip -R s
-
-echo % check caching
-hg co 0
-hg debugsub
-echo % restore
-hg co
-hg debugsub
-
-echo % new branch for merge tests
-hg co 1
-echo t = t >> .hgsub
-hg init t
-echo t > t/t
-hg -R t add t
-echo % 5
-hg ci -m5 # add sub
-echo t2 > t/t
-echo % 6
-hg st -R s
-hg ci -m6 # change sub
-hg debugsub
-echo t3 > t/t
-echo % 7
-hg ci -m7 # change sub again for conflict test
-hg rm .hgsub
-echo % 8
-hg ci -m8 # remove sub
-
-echo % merge tests
-hg co -C 3
-hg merge 5 # test adding
-hg debugsub
-hg ci -m9
-hg merge 6 --debug # test change
-hg debugsub
-echo conflict > t/t
-hg ci -m10
-HGMERGE=internal:merge hg merge --debug 7 # test conflict
-echo % should conflict
-cat t/t
-
-echo % clone
-cd ..
-hg clone t tc | sed 's|from .*/sub|from .../sub|g'
-cd tc
-hg debugsub
-
-echo % push
-echo bah > t/t
-hg ci -m11
-hg push | sed 's/ .*sub/ ...sub/g'
-
-echo % push -f
-echo bah > s/a
-hg ci -m12
-hg push | sed 's/ .*sub/ ...sub/g'
-hg push -f | sed 's/ .*sub/ ...sub/g'
-
-echo % update
-cd ../t
-hg up -C # discard our earlier merge
-echo blah > t/t
-hg ci -m13
-
-echo % pull
-cd ../tc
-hg pull | sed 's/ .*sub/ ...sub/g'
-# should pull t
-hg up | sed 's|from .*/sub|from .../sub|g'
-cat t/t
-
-echo % bogus subrepo path aborts
-echo 'bogus=[boguspath' >> .hgsub
-hg ci -m 'bogus subrepo path'
-
-echo % issue 1986
-cd ..
-rm -rf sub
-hg init main
-cd main
-
-hg init s           # subrepo layout
-cd s                #
-echo a > a          #   o   5 br
-hg ci -Am1          #  /|
-hg branch br        # o |   4 default
-echo a >> a         # | |
-hg ci -m1           # | o   3 br
-hg up default       # |/|
-echo b > b          # o |   2 default
-hg ci -Am1          # | |
-hg up br            # | o   1 br
-hg merge tip        # |/
-hg ci -m1           # o     0 default
-hg up 2
-echo c > c
-hg ci -Am1
-hg up 3
-hg merge 4
-hg ci -m1
-
-cd ..                         # main repo layout:
-echo 's = s' > .hgsub         #
-hg -R s up 2                  #   * <-- try to merge default into br again
-hg ci -Am1                    # .`|
-hg branch br                  # . o   5 br      --> substate = 5
-echo b > b                    # . |
-hg -R s up 3                  # o |   4 default --> substate = 4
-hg ci -Am1                    # | |
-hg up default                 # | o   3 br      --> substate = 2
-echo c > c                    # |/|
-hg ci -Am1                    # o |   2 default --> substate = 2
-hg up 1                       # | |     
-hg merge 2                    # | o   1 br      --> substate = 3
-hg ci -m1                     # |/    
-hg up 2                       # o     0 default --> substate = 2
-hg -R s up 4
-echo d > d
-hg ci -Am1
-hg up 3
-hg -R s up 5
-echo e > e
-hg ci -Am1
-
-hg up 5
-hg merge 4    # try to merge default into br again
-cd ..
-
-echo % test subrepo delete from .hgsubstate
-hg init testdelete
-mkdir testdelete/nested testdelete/nested2
-hg init testdelete/nested
-hg init testdelete/nested2
-echo test > testdelete/nested/foo
-echo test > testdelete/nested2/foo
-hg -R testdelete/nested add
-hg -R testdelete/nested2 add
-hg -R testdelete/nested ci -m test
-hg -R testdelete/nested2 ci -m test
-echo nested = nested > testdelete/.hgsub
-echo nested2 = nested2 >> testdelete/.hgsub
-hg -R testdelete add
-hg -R testdelete ci -m "nested 1 & 2 added"
-echo nested = nested > testdelete/.hgsub
-hg -R testdelete ci -m "nested 2 deleted"
-cat testdelete/.hgsubstate | sed "s:.* ::"
-hg -R testdelete remove testdelete/.hgsub
-hg -R testdelete ci -m ".hgsub deleted"
-cat testdelete/.hgsubstate
-
-echo % test repository cloning
-mkdir mercurial mercurial2
-hg init nested_absolute
-echo test > nested_absolute/foo
-hg -R nested_absolute add
-hg -R nested_absolute ci -mtest
-cd mercurial
-hg init nested_relative
-echo test2 > nested_relative/foo2
-hg -R nested_relative add
-hg -R nested_relative ci -mtest2
-hg init main
-echo "nested_relative = ../nested_relative" > main/.hgsub
-echo "nested_absolute = `pwd`/nested_absolute" >> main/.hgsub
-hg -R main add
-hg -R main ci -m "add subrepos"
-cd ..
-hg clone mercurial/main mercurial2/main
-cat mercurial2/main/nested_absolute/.hg/hgrc \
-    mercurial2/main/nested_relative/.hg/hgrc \
-    | "$TESTDIR/filtertmp.py"
-rm -rf mercurial mercurial2
-
-echo % issue 1977
-hg init repo
-hg init repo/s
-echo a > repo/s/a
-hg -R repo/s ci -Am0
-echo s = s > repo/.hgsub
-hg -R repo ci -Am1
-hg clone repo repo2 | sed 's|from .*/sub|from .../sub|g'
-hg -q -R repo2 pull -u
-echo 1 > repo2/s/a
-hg -R repo2/s ci -m2
-hg -q -R repo2/s push
-hg -R repo2/s up -C 0
-echo 2 > repo2/s/a
-hg -R repo2/s ci -m3
-hg -R repo2 ci -m3
-hg -q -R repo2 push
-hg -R repo update
-rm -rf repo2 repo
-
-exit 0
--- a/tests/test-subrepo-deep-nested-change	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-#!/bin/sh
-
-echo % Preparing the subrepository 'sub2'
-hg init sub2
-echo sub2 > sub2/sub2
-hg add -R sub2
-hg commit -R sub2 -m "sub2 import"
-
-echo % Preparing the 'sub1' repo which depends on the subrepo 'sub2'
-hg init sub1
-echo sub1 > sub1/sub1
-echo "sub2 = ../sub2" > sub1/.hgsub
-hg clone sub2 sub1/sub2 | sed 's/ .*sub/ ...sub/g'
-hg add -R sub1
-hg commit -R sub1 -m "sub1 import"
-
-echo % Preparing the 'main' repo which depends on the subrepo 'sub1'
-hg init main
-echo main > main/main
-echo "sub1 = ../sub1" > main/.hgsub
-hg clone sub1 main/sub1  | sed 's/ .*sub/ ...sub/g'
-hg add -R main
-hg commit -R main -m "main import"
-
-echo % Cleaning both repositories, just as a clone -U
-hg up -C -R sub2 null
-hg up -C -R sub1 null
-hg up -C -R main null
-rm -rf main/sub1
-rm -rf sub1/sub2
-
-echo % Clone main
-hg clone main cloned | sed 's/ .*sub/ ...sub/g' 
-
-echo % Checking cloned repo ids
-printf "cloned " ; hg id -R cloned
-printf "cloned/sub1 " ; hg id -R cloned/sub1
-printf "cloned/sub1/sub2 " ; hg id -R cloned/sub1/sub2
-
-echo % debugsub output for main and sub1
-hg debugsub -R cloned
-hg debugsub -R cloned/sub1
-
-echo % Modifying deeply nested 'sub2'
-echo modified > cloned/sub1/sub2/sub2
-hg commit -m "deep nested modif should trigger a commit" -R cloned
-
-echo % Checking modified node ids
-printf "cloned " ; hg id -R cloned
-printf "cloned/sub1 " ; hg id -R cloned/sub1
-printf "cloned/sub1/sub2 " ; hg id -R cloned/sub1/sub2
-
-echo % debugsub output for main and sub1
-hg debugsub -R cloned
-hg debugsub -R cloned/sub1
-
-exit 0
--- a/tests/test-subrepo-deep-nested-change.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-% Preparing the subrepository sub2
-adding sub2/sub2
-% Preparing the sub1 repo which depends on the subrepo sub2
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-adding sub1/.hgsub
-adding sub1/sub1
-committing subrepository sub2
-% Preparing the main repo which depends on the subrepo sub1
-updating to branch default
-pulling ...sub2
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-adding main/.hgsub
-adding main/main
-committing subrepository sub1
-% Cleaning both repositories, just as a clone -U
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-0 files updated, 0 files merged, 3 files removed, 0 files unresolved
-0 files updated, 0 files merged, 3 files removed, 0 files unresolved
-% Clone main
-updating to branch default
-pulling ...sub1
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 3 changes to 3 files
-pulling ...sub2
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% Checking cloned repo ids
-cloned 7f491f53a367 tip
-cloned/sub1 fc3b4ce2696f tip
-cloned/sub1/sub2 c57a0840e3ba tip
-% debugsub output for main and sub1
-path sub1
- source   ../sub1
- revision fc3b4ce2696f7741438c79207583768f2ce6b0dd
-path sub2
- source   ../sub2
- revision c57a0840e3badd667ef3c3ef65471609acb2ba3c
-% Modifying deeply nested sub2
-committing subrepository sub1
-committing subrepository sub1/sub2
-% Checking modified node ids
-cloned ffe6649062fe tip
-cloned/sub1 2ecb03bf44a9 tip
-cloned/sub1/sub2 53dd3430bcaf tip
-% debugsub output for main and sub1
-path sub1
- source   ../sub1
- revision 2ecb03bf44a94e749e8669481dd9069526ce7cb9
-path sub2
- source   ../sub2
- revision 53dd3430bcaf5ab4a7c48262bcad6d441f510487
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-subrepo-deep-nested-change.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,117 @@
+Preparing the subrepository 'sub2'
+
+  $ hg init sub2
+  $ echo sub2 > sub2/sub2
+  $ hg add -R sub2
+  adding sub2/sub2
+  $ hg commit -R sub2 -m "sub2 import"
+
+Preparing the 'sub1' repo which depends on the subrepo 'sub2'
+
+  $ hg init sub1
+  $ echo sub1 > sub1/sub1
+  $ echo "sub2 = ../sub2" > sub1/.hgsub
+  $ hg clone sub2 sub1/sub2
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg add -R sub1
+  adding sub1/.hgsub
+  adding sub1/sub1
+  $ hg commit -R sub1 -m "sub1 import"
+  committing subrepository sub2
+
+Preparing the 'main' repo which depends on the subrepo 'sub1'
+
+  $ hg init main
+  $ echo main > main/main
+  $ echo "sub1 = ../sub1" > main/.hgsub
+  $ hg clone sub1 main/sub1
+  updating to branch default
+  pulling subrepo sub2 from */sub2 (glob)
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg add -R main
+  adding main/.hgsub
+  adding main/main
+  $ hg commit -R main -m "main import"
+  committing subrepository sub1
+
+Cleaning both repositories, just as a clone -U
+
+  $ hg up -C -R sub2 null
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg up -C -R sub1 null
+  0 files updated, 0 files merged, 3 files removed, 0 files unresolved
+  $ hg up -C -R main null
+  0 files updated, 0 files merged, 3 files removed, 0 files unresolved
+  $ rm -rf main/sub1
+  $ rm -rf sub1/sub2
+
+Clone main
+
+  $ hg clone main cloned
+  updating to branch default
+  pulling subrepo sub1 from */sub1 (glob)
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 3 changes to 3 files
+  pulling subrepo sub1/sub2 from */sub2 (glob)
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+Checking cloned repo ids
+
+  $ printf "cloned " ; hg id -R cloned
+  cloned 7f491f53a367 tip
+  $ printf "cloned/sub1 " ; hg id -R cloned/sub1
+  cloned/sub1 fc3b4ce2696f tip
+  $ printf "cloned/sub1/sub2 " ; hg id -R cloned/sub1/sub2
+  cloned/sub1/sub2 c57a0840e3ba tip
+
+debugsub output for main and sub1
+
+  $ hg debugsub -R cloned
+  path sub1
+   source   ../sub1
+   revision fc3b4ce2696f7741438c79207583768f2ce6b0dd
+  $ hg debugsub -R cloned/sub1
+  path sub2
+   source   ../sub2
+   revision c57a0840e3badd667ef3c3ef65471609acb2ba3c
+
+Modifying deeply nested 'sub2'
+
+  $ echo modified > cloned/sub1/sub2/sub2
+  $ hg commit -m "deep nested modif should trigger a commit" -R cloned
+  committing subrepository sub1
+  committing subrepository sub1/sub2
+
+Checking modified node ids
+
+  $ printf "cloned " ; hg id -R cloned
+  cloned ffe6649062fe tip
+  $ printf "cloned/sub1 " ; hg id -R cloned/sub1
+  cloned/sub1 2ecb03bf44a9 tip
+  $ printf "cloned/sub1/sub2 " ; hg id -R cloned/sub1/sub2
+  cloned/sub1/sub2 53dd3430bcaf tip
+
+debugsub output for main and sub1
+
+  $ hg debugsub -R cloned
+  path sub1
+   source   ../sub1
+   revision 2ecb03bf44a94e749e8669481dd9069526ce7cb9
+  $ hg debugsub -R cloned/sub1
+  path sub2
+   source   ../sub2
+   revision 53dd3430bcaf5ab4a7c48262bcad6d441f510487
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-subrepo-paths.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,32 @@
+  $ hg init outer
+  $ cd outer
+
+hg debugsub with no remapping
+
+  $ echo 'sub = http://example.net/libfoo' > .hgsub
+  $ hg add .hgsub
+
+  $ hg debugsub
+  path sub
+   source   http://example.net/libfoo
+   revision 
+
+hg debugsub with remapping
+
+  $ echo '[subpaths]' > .hg/hgrc
+  $ printf 'http://example.net/lib(.*) = C:\\libs\\\\1-lib\\\n' >> .hg/hgrc
+
+  $ hg debugsub
+  path sub
+   source   C:\libs\foo-lib\
+   revision 
+
+test bad subpaths pattern
+
+  $ cat > .hg/hgrc <<EOF
+  > [subpaths]
+  > .* = \1
+  > EOF
+  $ hg debugsub
+  abort: bad subrepository pattern in */test-subrepo-paths.t/outer/.hg/hgrc:2: invalid group reference (glob)
+  [255]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-subrepo-recursion.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,343 @@
+Make status look into subrepositories by default:
+
+  $ echo '[defaults]' >> $HGRCPATH
+  $ echo 'status = -S' >> $HGRCPATH
+  $ echo 'diff = --nodates -S' >> $HGRCPATH
+
+Create test repository:
+
+  $ hg init repo
+  $ cd repo
+  $ echo x1 > x.txt
+
+  $ hg init foo
+  $ cd foo
+  $ echo y1 > y.txt
+
+  $ hg init bar
+  $ cd bar
+  $ echo z1 > z.txt
+
+  $ cd ..
+  $ echo 'bar = bar' > .hgsub
+
+  $ cd ..
+  $ echo 'foo = foo' > .hgsub
+
+Add files --- .hgsub files must go first to trigger subrepos:
+
+  $ hg add -S .hgsub
+  $ hg add -S foo/.hgsub
+  $ hg add -S foo/bar
+  adding foo/bar/z.txt
+  $ hg add -S
+  adding x.txt
+  adding foo/y.txt
+
+Test recursive status without committing anything:
+
+  $ hg status
+  A .hgsub
+  A foo/.hgsub
+  A foo/bar/z.txt
+  A foo/y.txt
+  A x.txt
+
+Test recursive diff without committing anything:
+
+  $ hg diff foo
+  diff -r 000000000000 foo/.hgsub
+  --- /dev/null
+  +++ b/foo/.hgsub
+  @@ -0,0 +1,1 @@
+  +bar = bar
+  diff -r 000000000000 foo/y.txt
+  --- /dev/null
+  +++ b/foo/y.txt
+  @@ -0,0 +1,1 @@
+  +y1
+  diff -r 000000000000 foo/bar/z.txt
+  --- /dev/null
+  +++ b/foo/bar/z.txt
+  @@ -0,0 +1,1 @@
+  +z1
+
+Commits:
+
+  $ hg commit -m 0-0-0
+  committing subrepository foo
+  committing subrepository foo/bar
+
+  $ cd foo
+  $ echo y2 >> y.txt
+  $ hg commit -m 0-1-0
+
+  $ cd bar
+  $ echo z2 >> z.txt
+  $ hg commit -m 0-1-1
+
+  $ cd ..
+  $ hg commit -m 0-2-1
+  committing subrepository bar
+
+  $ cd ..
+  $ hg commit -m 1-2-1
+  committing subrepository foo
+
+Change working directory:
+
+  $ echo y3 >> foo/y.txt
+  $ echo z3 >> foo/bar/z.txt
+  $ hg status
+  M foo/bar/z.txt
+  M foo/y.txt
+  $ hg diff
+  diff -r d254738c5f5e foo/y.txt
+  --- a/foo/y.txt
+  +++ b/foo/y.txt
+  @@ -1,2 +1,3 @@
+   y1
+   y2
+  +y3
+  diff -r 9647f22de499 foo/bar/z.txt
+  --- a/foo/bar/z.txt
+  +++ b/foo/bar/z.txt
+  @@ -1,2 +1,3 @@
+   z1
+   z2
+  +z3
+
+Status call crossing repository boundaries:
+
+  $ hg status foo/bar/z.txt
+  M foo/bar/z.txt
+  $ hg status -I 'foo/?.txt'
+  M foo/y.txt
+  $ hg status -I '**/?.txt'
+  M foo/bar/z.txt
+  M foo/y.txt
+  $ hg diff -I '**/?.txt'
+  diff -r d254738c5f5e foo/y.txt
+  --- a/foo/y.txt
+  +++ b/foo/y.txt
+  @@ -1,2 +1,3 @@
+   y1
+   y2
+  +y3
+  diff -r 9647f22de499 foo/bar/z.txt
+  --- a/foo/bar/z.txt
+  +++ b/foo/bar/z.txt
+  @@ -1,2 +1,3 @@
+   z1
+   z2
+  +z3
+
+Status from within a subdirectory:
+
+  $ mkdir dir
+  $ cd dir
+  $ echo a1 > a.txt
+  $ hg status
+  M foo/bar/z.txt
+  M foo/y.txt
+  ? dir/a.txt
+  $ hg diff
+  diff -r d254738c5f5e foo/y.txt
+  --- a/foo/y.txt
+  +++ b/foo/y.txt
+  @@ -1,2 +1,3 @@
+   y1
+   y2
+  +y3
+  diff -r 9647f22de499 foo/bar/z.txt
+  --- a/foo/bar/z.txt
+  +++ b/foo/bar/z.txt
+  @@ -1,2 +1,3 @@
+   z1
+   z2
+  +z3
+
+Status with relative path:
+
+  $ hg status ..
+  M ../foo/bar/z.txt
+  M ../foo/y.txt
+  ? a.txt
+  $ hg diff ..
+  diff -r d254738c5f5e foo/y.txt
+  --- a/foo/y.txt
+  +++ b/foo/y.txt
+  @@ -1,2 +1,3 @@
+   y1
+   y2
+  +y3
+  diff -r 9647f22de499 foo/bar/z.txt
+  --- a/foo/bar/z.txt
+  +++ b/foo/bar/z.txt
+  @@ -1,2 +1,3 @@
+   z1
+   z2
+  +z3
+  $ cd ..
+
+Cleanup and final commit:
+
+  $ rm -r dir
+  $ hg commit -m 2-3-2
+  committing subrepository foo
+  committing subrepository foo/bar
+
+Log with the relationships between repo and its subrepo:
+
+  $ hg log --template '{rev}:{node|short} {desc}\n'
+  2:1326fa26d0c0 2-3-2
+  1:4b3c9ff4f66b 1-2-1
+  0:23376cbba0d8 0-0-0
+
+  $ hg -R foo log --template '{rev}:{node|short} {desc}\n'
+  3:65903cebad86 2-3-2
+  2:d254738c5f5e 0-2-1
+  1:8629ce7dcc39 0-1-0
+  0:af048e97ade2 0-0-0
+
+  $ hg -R foo/bar log --template '{rev}:{node|short} {desc}\n'
+  2:31ecbdafd357 2-3-2
+  1:9647f22de499 0-1-1
+  0:4904098473f9 0-0-0
+
+Status between revisions:
+
+  $ hg status
+  $ hg status --rev 0:1
+  M .hgsubstate
+  M foo/.hgsubstate
+  M foo/bar/z.txt
+  M foo/y.txt
+  $ hg diff -I '**/?.txt' --rev 0:1
+  diff -r af048e97ade2 -r d254738c5f5e foo/y.txt
+  --- a/foo/y.txt
+  +++ b/foo/y.txt
+  @@ -1,1 +1,2 @@
+   y1
+  +y2
+  diff -r 4904098473f9 -r 9647f22de499 foo/bar/z.txt
+  --- a/foo/bar/z.txt
+  +++ b/foo/bar/z.txt
+  @@ -1,1 +1,2 @@
+   z1
+  +z2
+
+Test archiving to a directory tree:
+
+  $ hg archive --subrepos ../archive
+  $ find ../archive | sort
+  ../archive
+  ../archive/.hg_archival.txt
+  ../archive/.hgsub
+  ../archive/.hgsubstate
+  ../archive/foo
+  ../archive/foo/.hgsub
+  ../archive/foo/.hgsubstate
+  ../archive/foo/bar
+  ../archive/foo/bar/z.txt
+  ../archive/foo/y.txt
+  ../archive/x.txt
+
+Test archiving to zip file (unzip output is unstable):
+
+  $ hg archive --subrepos ../archive.zip
+
+Clone and test outgoing:
+
+  $ cd ..
+  $ hg clone repo repo2
+  updating to branch default
+  pulling subrepo foo from */test-subrepo-recursion.t/repo/foo (glob)
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 4 changesets with 7 changes to 3 files
+  pulling subrepo foo/bar from */test-subrepo-recursion.t/repo/foo/bar (glob)
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 3 changesets with 3 changes to 1 files
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd repo2
+  $ hg outgoing -S
+  comparing with */test-subrepo-recursion.t/repo (glob)
+  searching for changes
+  no changes found
+  comparing with */test-subrepo-recursion.t/repo/foo (glob)
+  searching for changes
+  no changes found
+  [1]
+
+Make nested change:
+
+  $ echo y4 >> foo/y.txt
+  $ hg diff
+  diff -r 65903cebad86 foo/y.txt
+  --- a/foo/y.txt
+  +++ b/foo/y.txt
+  @@ -1,3 +1,4 @@
+   y1
+   y2
+   y3
+  +y4
+  $ hg commit -m 3-4-2
+  committing subrepository foo
+  $ hg outgoing -S
+  comparing with */test-subrepo-recursion.t/repo (glob)
+  searching for changes
+  changeset:   3:2655b8ecc4ee
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     3-4-2
+  
+  comparing with */test-subrepo-recursion.t/repo/foo (glob)
+  searching for changes
+  changeset:   4:e96193d6cb36
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     3-4-2
+  
+
+Switch to original repo and setup default path:
+
+  $ cd ../repo
+  $ echo '[paths]' >> .hg/hgrc
+  $ echo 'default = ../repo2' >> .hg/hgrc
+
+Test incoming:
+
+  $ hg incoming -S
+  comparing with */test-subrepo-recursion.t/repo2 (glob)
+  searching for changes
+  changeset:   3:2655b8ecc4ee
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     3-4-2
+  
+  comparing with */test-subrepo-recursion.t/repo2/foo (glob)
+  searching for changes
+  changeset:   4:e96193d6cb36
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     3-4-2
+  
+  $ hg incoming -S --bundle incoming.hg
+  abort: cannot combine --bundle and --subrepos
+  [255]
+
+Test missing subrepo:
+
+  $ rm -r foo
+  $ hg status
+  warning: unknown revision '65903cebad86f1a84bd4f1134f62fa7dcb7a1c98' in foo
--- a/tests/test-subrepo-relative-path	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-#!/bin/sh
-
-echo % Preparing the subrepository 'sub'
-hg init sub
-echo sub > sub/sub
-hg add -R sub
-hg commit -R sub -m "sub import"
-
-echo % Preparing the 'main' repo which depends on the subrepo 'sub'
-hg init main
-echo main > main/main
-echo "sub = ../sub" > main/.hgsub
-hg clone sub main/sub | sed 's/ .*sub/ ...sub/g'
-hg add -R main
-hg commit -R main -m "main import"
-
-echo % Cleaning both repositories, just as a clone -U
-hg up -C -R sub null
-hg up -C -R main null
-rm -rf main/sub
-
-echo % Serving them both using hgweb
-printf '[paths]\n/main = main\nsub = sub\n' > webdir.conf
-hg serve --webdir-conf webdir.conf -a localhost -p $HGPORT \
-   -A /dev/null -E /dev/null --pid-file hg.pid -d
-cat hg.pid >> $DAEMON_PIDS
-
-echo % Clone main from hgweb
-hg clone "http://localhost:$HGPORT/main" cloned | sed 's/ .*sub/ ...sub/g' 
-
-echo % Checking cloned repo ids
-hg id -R cloned
-hg id -R cloned/sub
-
-echo % subrepo debug for 'main' clone
-hg debugsub -R cloned
-
-"$TESTDIR/killdaemons.py"
-
-exit 0
--- a/tests/test-subrepo-relative-path.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-% Preparing the subrepository sub
-adding sub/sub
-% Preparing the main repo which depends on the subrepo sub
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-adding main/.hgsub
-adding main/main
-committing subrepository sub
-% Cleaning both repositories, just as a clone -U
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-0 files updated, 0 files merged, 3 files removed, 0 files unresolved
-% Serving them both using hgweb
-% Clone main from hgweb
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 3 changes to 3 files
-updating to branch default
-pulling ...sub
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% Checking cloned repo ids
-fdfeeb3e979e tip
-863c1745b441 tip
-% subrepo debug for main clone
-path sub
- source   ../sub
- revision 863c1745b441bd97a8c4a096e87793073f4fb215
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-subrepo-relative-path.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,69 @@
+Preparing the subrepository 'sub'
+
+  $ hg init sub
+  $ echo sub > sub/sub
+  $ hg add -R sub
+  adding sub/sub
+  $ hg commit -R sub -m "sub import"
+
+Preparing the 'main' repo which depends on the subrepo 'sub'
+
+  $ hg init main
+  $ echo main > main/main
+  $ echo "sub = ../sub" > main/.hgsub
+  $ hg clone sub main/sub
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg add -R main
+  adding main/.hgsub
+  adding main/main
+  $ hg commit -R main -m "main import"
+  committing subrepository sub
+
+Cleaning both repositories, just as a clone -U
+
+  $ hg up -C -R sub null
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg up -C -R main null
+  0 files updated, 0 files merged, 3 files removed, 0 files unresolved
+  $ rm -rf main/sub
+
+Serving them both using hgweb
+
+  $ printf '[paths]\n/main = main\nsub = sub\n' > webdir.conf
+  $ hg serve --webdir-conf webdir.conf -a localhost -p $HGPORT \
+  >    -A /dev/null -E /dev/null --pid-file hg.pid -d
+  $ cat hg.pid >> $DAEMON_PIDS
+
+Clone main from hgweb
+
+  $ hg clone "http://localhost:$HGPORT/main" cloned
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 3 changes to 3 files
+  updating to branch default
+  pulling subrepo sub from http://localhost:[0-9]+/sub (re)
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+Checking cloned repo ids
+
+  $ hg id -R cloned
+  fdfeeb3e979e tip
+  $ hg id -R cloned/sub
+  863c1745b441 tip
+
+subrepo debug for 'main' clone
+
+  $ hg debugsub -R cloned
+  path sub
+   source   ../sub
+   revision 863c1745b441bd97a8c4a096e87793073f4fb215
+
+  $ "$TESTDIR/killdaemons.py"
--- a/tests/test-subrepo-svn	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,113 +0,0 @@
-#!/bin/sh
-
-"$TESTDIR/hghave" svn || exit 80
-
-fix_path()
-{
-    tr '\\' /
-}
-
-escapedwd=`pwd | fix_path`
-# SVN wants all paths to start with a slash. Unfortunately,
-# Windows ones don't. Handle that.
-expr "$escapedwd" : "\/" > /dev/null
-if [ $? -ne 0 ]; then
-    escapedwd="/$escapedwd"
-fi
-escapedwd=`python -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$escapedwd"`
-filterpath="s|$escapedwd|/root|"
-filteroutofdate='s/ in transaction.*/ is out of date/;s/Out of date: /File /'
-filterexternal="s|Fetching external item into '.*/s/externals'|Fetching external item into 's/externals'|g"
-
-echo % create subversion repo
-
-SVNREPO="file://$escapedwd/svn-repo"
-WCROOT="`pwd`/svn-wc"
-svnadmin create svn-repo
-svn co "$SVNREPO" svn-wc
-cd svn-wc
-mkdir src
-echo alpha > src/alpha
-svn add src
-mkdir externals
-echo other > externals/other
-svn add externals
-svn ci -m 'Add alpha'
-svn up
-cat > extdef <<EOF
-externals -r1 $SVNREPO/externals
-EOF
-svn propset -F extdef svn:externals src
-svn ci -m 'Setting externals'
-cd ..
-
-echo % create hg repo
-mkdir sub
-cd sub
-hg init t
-cd t
-
-echo % first revision, no sub
-echo a > a
-hg ci -Am0
-
-echo % add first svn sub with leading whitespaces
-echo "s = [svn]       $SVNREPO/src" >> .hgsub
-svn co --quiet "$SVNREPO"/src s
-hg add .hgsub
-hg ci -m1
-echo % debugsub
-hg debugsub | sed "$filterpath"
-
-echo
-echo % change file in svn and hg, commit
-echo a >> a
-echo alpha >> s/alpha
-hg commit -m 'Message!' | sed "$filterexternal" \
-    | sed 's:Sending.*s/alpha:Sending        s/alpha:g'
-hg debugsub | sed "$filterpath"
-
-echo
-echo a > s/a
-echo % should be empty despite change to s/a
-hg st
-
-echo
-echo % add a commit from svn
-cd "$WCROOT"/src
-svn up
-echo xyz >> alpha
-svn propset svn:mime-type 'text/xml' alpha
-svn ci -m 'amend a from svn'
-cd ../../sub/t
-
-echo % this commit from hg will fail
-echo zzz >> s/alpha
-hg ci -m 'amend alpha from hg' 2>&1 | sed "$filteroutofdate"
-svn revert -q s/alpha
-
-echo % this commit fails because of meta changes
-svn propset svn:mime-type 'text/html' s/alpha
-hg ci -m 'amend alpha from hg' 2>&1 | sed "$filteroutofdate"
-svn revert -q s/alpha
-
-echo % this commit fails because of externals changes
-echo zzz > s/externals/other
-hg ci -m 'amend externals from hg'
-svn revert -q s/externals/other
-
-echo % this commit fails because of externals meta changes
-svn propset svn:mime-type 'text/html' s/externals/other
-hg ci -m 'amend externals from hg'
-svn revert -q s/externals/other
-
-echo
-echo % clone
-cd ..
-hg clone t tc | fix_path
-cd tc
-echo % debugsub in clone
-hg debugsub | sed "$filterpath"
-
-echo % verify subrepo is contained within the repo directory
-python -c "import os.path; print os.path.exists('s')"
--- a/tests/test-subrepo-svn.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +0,0 @@
-% create subversion repo
-Checked out revision 0.
-A         src
-A         src/alpha
-A         externals
-A         externals/other
-Adding         externals
-Adding         externals/other
-Adding         src
-Adding         src/alpha
-Transmitting file data ..
-Committed revision 1.
-At revision 1.
-property 'svn:externals' set on 'src'
-Sending        src
-
-Committed revision 2.
-% create hg repo
-% first revision, no sub
-adding a
-% add first svn sub with leading whitespaces
-committing subrepository s
-% debugsub
-path s
- source   file:///root/svn-repo/src
- revision 2
-
-% change file in svn and hg, commit
-committing subrepository s
-Sending        s/alpha
-Transmitting file data .
-Committed revision 3.
-
-Fetching external item into 's/externals'
-External at revision 1.
-
-At revision 3.
-path s
- source   file:///root/svn-repo/src
- revision 3
-
-% should be empty despite change to s/a
-
-% add a commit from svn
-U    alpha
-
-Fetching external item into 'externals'
-A    externals/other
-Updated external to revision 1.
-
-Updated to revision 3.
-property 'svn:mime-type' set on 'alpha'
-Sending        src/alpha
-Transmitting file data .
-Committed revision 4.
-% this commit from hg will fail
-committing subrepository s
-abort: svn: Commit failed (details follow):
-svn: File '/src/alpha' is out of date
-% this commit fails because of meta changes
-property 'svn:mime-type' set on 's/alpha'
-committing subrepository s
-abort: svn: Commit failed (details follow):
-svn: File '/src/alpha' is out of date
-% this commit fails because of externals changes
-committing subrepository s
-abort: cannot commit svn externals
-% this commit fails because of externals meta changes
-property 'svn:mime-type' set on 's/externals/other'
-committing subrepository s
-abort: cannot commit svn externals
-
-% clone
-updating to branch default
-A    tc/s/alpha
- U   tc/s
-
-Fetching external item into 'tc/s/externals'
-A    tc/s/externals/other
-Checked out external at revision 1.
-
-Checked out revision 3.
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% debugsub in clone
-path s
- source   file:///root/svn-repo/src
- revision 3
-% verify subrepo is contained within the repo directory
-True
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-subrepo-svn.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,201 @@
+  $ "$TESTDIR/hghave" svn || exit 80
+
+  $ fix_path()
+  > {
+  >     tr '\\' /
+  > }
+
+SVN wants all paths to start with a slash. Unfortunately, Windows ones
+don't. Handle that.
+
+  $ escapedwd=`pwd | fix_path`
+  $ expr "$escapedwd" : / > /dev/null || escapedwd="/$escapedwd"
+  $ escapedwd=`python -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$escapedwd"`
+
+create subversion repo
+
+  $ SVNREPO="file://$escapedwd/svn-repo"
+  $ WCROOT="`pwd`/svn-wc"
+  $ svnadmin create svn-repo
+  $ svn co "$SVNREPO" svn-wc
+  Checked out revision 0.
+  $ cd svn-wc
+  $ mkdir src
+  $ echo alpha > src/alpha
+  $ svn add src
+  A         src
+  A         src/alpha
+  $ mkdir externals
+  $ echo other > externals/other
+  $ svn add externals
+  A         externals
+  A         externals/other
+  $ svn ci -m 'Add alpha'
+  Adding         externals
+  Adding         externals/other
+  Adding         src
+  Adding         src/alpha
+  Transmitting file data ..
+  Committed revision 1.
+  $ svn up
+  At revision 1.
+  $ echo "externals -r1 $SVNREPO/externals" > extdef
+  $ svn propset -F extdef svn:externals src
+  property 'svn:externals' set on 'src'
+  $ svn ci -m 'Setting externals'
+  Sending        src
+  
+  Committed revision 2.
+  $ cd ..
+
+create hg repo
+
+  $ mkdir sub
+  $ cd sub
+  $ hg init t
+  $ cd t
+
+first revision, no sub
+
+  $ echo a > a
+  $ hg ci -Am0
+  adding a
+
+add first svn sub with leading whitespaces
+
+  $ echo "s = [svn]       $SVNREPO/src" >> .hgsub
+  $ svn co --quiet "$SVNREPO"/src s
+  $ hg add .hgsub
+  $ hg ci -m1
+  committing subrepository s
+
+debugsub
+
+  $ hg debugsub
+  path s
+   source   file:///*/svn-repo/src (glob)
+   revision 2
+
+change file in svn and hg, commit
+
+  $ echo a >> a
+  $ echo alpha >> s/alpha
+  $ hg commit -m 'Message!'
+  committing subrepository s
+  Sending*s/alpha (glob)
+  Transmitting file data .
+  Committed revision 3.
+  
+  Fetching external item into '*/s/externals' (glob)
+  External at revision 1.
+  
+  At revision 3.
+  $ hg debugsub
+  path s
+   source   file:///*/svn-repo/src (glob)
+   revision 3
+
+  $ echo a > s/a
+
+should be empty despite change to s/a
+
+  $ hg st
+
+add a commit from svn
+
+  $ cd "$WCROOT"/src
+  $ svn up
+  U    alpha
+  
+  Fetching external item into 'externals'
+  A    externals/other
+  Updated external to revision 1.
+  
+  Updated to revision 3.
+  $ echo xyz >> alpha
+  $ svn propset svn:mime-type 'text/xml' alpha
+  property 'svn:mime-type' set on 'alpha'
+  $ svn ci -m 'amend a from svn'
+  Sending        src/alpha
+  Transmitting file data .
+  Committed revision 4.
+  $ cd ../../sub/t
+
+this commit from hg will fail
+
+  $ echo zzz >> s/alpha
+  $ hg ci -m 'amend alpha from hg'
+  committing subrepository s
+  abort: svn: Commit failed (details follow):
+  svn: (Out of date)?.*/src/alpha.*(is out of date)? (re)
+  [255]
+  $ svn revert -q s/alpha
+
+this commit fails because of meta changes
+
+  $ svn propset svn:mime-type 'text/html' s/alpha
+  property 'svn:mime-type' set on 's/alpha'
+  $ hg ci -m 'amend alpha from hg'
+  committing subrepository s
+  abort: svn: Commit failed (details follow):
+  svn: (Out of date)?.*/src/alpha.*(is out of date)? (re)
+  [255]
+  $ svn revert -q s/alpha
+
+this commit fails because of externals changes
+
+  $ echo zzz > s/externals/other
+  $ hg ci -m 'amend externals from hg'
+  committing subrepository s
+  abort: cannot commit svn externals
+  [255]
+  $ hg diff --subrepos -r 1:2 | grep -v diff
+  --- a/.hgsubstate	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/.hgsubstate	Thu Jan 01 00:00:00 1970 +0000
+  @@ -1,1 +1,1 @@
+  -2 s
+  +3 s
+  --- a/a	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/a	Thu Jan 01 00:00:00 1970 +0000
+  @@ -1,1 +1,2 @@
+   a
+  +a
+  $ svn revert -q s/externals/other
+
+this commit fails because of externals meta changes
+
+  $ svn propset svn:mime-type 'text/html' s/externals/other
+  property 'svn:mime-type' set on 's/externals/other'
+  $ hg ci -m 'amend externals from hg'
+  committing subrepository s
+  abort: cannot commit svn externals
+  [255]
+  $ svn revert -q s/externals/other
+
+clone
+
+  $ cd ..
+  $ hg clone t tc | fix_path
+  updating to branch default
+  A    tc/s/alpha
+   U   tc/s
+  
+  Fetching external item into 'tc/s/externals'
+  A    tc/s/externals/other
+  Checked out external at revision 1.
+  
+  Checked out revision 3.
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd tc
+
+debugsub in clone
+
+  $ hg debugsub
+  path s
+   source   file:///*/svn-repo/src (glob)
+   revision 3
+
+verify subrepo is contained within the repo directory
+
+  $ python -c "import os.path; print os.path.exists('s')"
+  True
--- a/tests/test-subrepo.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,303 +0,0 @@
-% first revision, no sub
-adding a
-% add first sub
-abort: can't commit subrepos without .hgsub
-adding a
-parent: 0:f7b1eb17ad24 tip
- 0
-branch: default
-commit: 1 added, 1 subrepos
-update: (current)
-committing subrepository s
-parent: 1:7cf8cfea66e4 tip
- 1
-branch: default
-commit: 1 subrepos
-update: (current)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-parent: 1:7cf8cfea66e4 tip
- 1
-branch: default
-commit: (clean)
-update: (current)
-% add sub sub
-parent: 1:7cf8cfea66e4 tip
- 1
-branch: default
-commit: 1 subrepos
-update: (current)
-committing subrepository s
-committing subrepository s/ss
-parent: 2:df30734270ae tip
- 2
-branch: default
-commit: (clean)
-update: (current)
-% bump sub rev
-committing subrepository s
-% leave sub dirty
-committing subrepository s
-changeset:   3:1c833a7a9e3a
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     4
-
-% check caching
-0 files updated, 0 files merged, 2 files removed, 0 files unresolved
-% restore
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-path s
- source   s
- revision 1c833a7a9e3a4445c711aaf0f012379cd0d4034e
-% new branch for merge tests
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-adding t/t
-% 5
-committing subrepository t
-created new head
-% 6
-committing subrepository t
-path s
- source   s
- revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
-path t
- source   t
- revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
-% 7
-committing subrepository t
-% 8
-% merge tests
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-path s
- source   s
- revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
-path t
- source   t
- revision 60ca1237c19474e7a3978b0dc1ca4e6f36d51382
-created new head
-  searching for copies back to rev 2
-resolving manifests
- overwrite None partial False
- ancestor 1f14a2e2d3ec local f0d2028bf86d+ remote 1831e14459c4
- .hgsubstate: versions differ -> m
-updating: .hgsubstate 1/1 files (100.00%)
-subrepo merge f0d2028bf86d+ 1831e14459c4 1f14a2e2d3ec
-  subrepo t: other changed, get t:6747d179aa9a688023c4b0cad32e4c92bb7f34ad:hg
-getting subrepo t
-resolving manifests
- overwrite True partial False
- ancestor 60ca1237c194+ local 60ca1237c194+ remote 6747d179aa9a
- t: remote is newer -> g
-updating: t 1/1 files (100.00%)
-getting t
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-path s
- source   s
- revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
-path t
- source   t
- revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
-committing subrepository t
-  searching for copies back to rev 2
-resolving manifests
- overwrite None partial False
- ancestor 1831e14459c4 local e45c8b14af55+ remote f94576341bcf
- .hgsubstate: versions differ -> m
-updating: .hgsubstate 1/1 files (100.00%)
-subrepo merge e45c8b14af55+ f94576341bcf 1831e14459c4
-  subrepo t: both sides changed, merge with t:7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4:hg
-merging subrepo t
-  searching for copies back to rev 2
-resolving manifests
- overwrite None partial False
- ancestor 6747d179aa9a local 20a0db6fbf6c+ remote 7af322bc1198
- t: versions differ -> m
-preserving t for resolve of t
-updating: t 1/1 files (100.00%)
-picked tool 'internal:merge' for t (binary False symlink False)
-merging t
-my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a
-warning: conflicts during merge.
-merging t failed!
-0 files updated, 0 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-% should conflict
-<<<<<<< local
-conflict
-=======
-t3
->>>>>>> other
-% clone
-updating to branch default
-pulling subrepo s from .../sub/t/s
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 4 changesets with 5 changes to 3 files
-pulling subrepo s/ss from .../sub/t/s/ss
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-pulling subrepo t from .../sub/t/t
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 4 changesets with 4 changes to 1 files (+1 heads)
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-path s
- source   s
- revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
-path t
- source   t
- revision 20a0db6fbf6c3d2836e6519a642ae929bfc67c0e
-% push
-committing subrepository t
-pushing ...sub/t
-pushing ...sub/t/s/ss
-searching for changes
-no changes found
-pushing ...sub/t/s
-searching for changes
-no changes found
-pushing ...sub/t/t
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-% push -f
-committing subrepository s
-abort: push creates new remote heads on branch 'default'!
-pushing ...sub/t
-pushing ...sub/t/s/ss
-searching for changes
-no changes found
-pushing ...sub/t/s
-searching for changes
-(did you forget to merge? use push -f to force)
-pushing ...sub/t
-pushing ...sub/t/s/ss
-searching for changes
-no changes found
-pushing ...sub/t/s
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files (+1 heads)
-pushing ...sub/t/t
-searching for changes
-no changes found
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-% update
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-committing subrepository t
-% pull
-pulling ...sub/t
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-(run 'hg update' to get a working copy)
-pulling subrepo t from .../sub/t/t
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-blah
-% bogus subrepo path aborts
-abort: missing ] in subrepo source
-% issue 1986
-adding a
-marked working directory as branch br
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-adding b
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-adding c
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-adding .hgsub
-committing subrepository s
-marked working directory as branch br
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-adding b
-committing subrepository s
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-adding c
-2 files updated, 0 files merged, 1 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-adding d
-committing subrepository s
-2 files updated, 0 files merged, 1 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-adding e
-committing subrepository s
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-% test subrepo delete from .hgsubstate
-adding testdelete/nested/foo
-adding testdelete/nested2/foo
-adding testdelete/.hgsub
-committing subrepository nested2
-committing subrepository nested
-nested
-% test repository cloning
-adding nested_absolute/foo
-adding nested_relative/foo2
-adding main/.hgsub
-committing subrepository nested_relative
-committing subrepository nested_absolute
-updating to branch default
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-[paths]
-default = $HGTMP/test-subrepo/sub/mercurial/nested_absolute
-[paths]
-default = $HGTMP/test-subrepo/sub/mercurial/nested_relative
-% issue 1977
-adding a
-adding .hgsub
-committing subrepository s
-updating to branch default
-pulling subrepo s from .../sub/repo/s
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-committing subrepository s
-abort: push creates new remote heads on branch 'default'!
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-subrepo.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,586 @@
+  $ rm -rf sub
+  $ mkdir sub
+  $ cd sub
+  $ hg init t
+  $ cd t
+
+first revision, no sub
+
+  $ echo a > a
+  $ hg ci -Am0
+  adding a
+
+add first sub
+
+  $ echo s = s > .hgsub
+  $ hg add .hgsub
+  $ hg init s
+  $ echo a > s/a
+
+issue2232 - committing a subrepo without .hgsub
+
+  $ hg ci -mbad s
+  abort: can't commit subrepos without .hgsub
+  [255]
+
+  $ hg -R s ci -Ams0
+  adding a
+  $ hg sum
+  parent: 0:f7b1eb17ad24 tip
+   0
+  branch: default
+  commit: 1 added, 1 subrepos
+  update: (current)
+  $ hg ci -m1
+  committing subrepository s
+
+issue 2022 - update -C
+
+  $ echo b > s/a
+  $ hg sum
+  parent: 1:7cf8cfea66e4 tip
+   1
+  branch: default
+  commit: 1 subrepos
+  update: (current)
+  $ hg co -C 1
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg sum
+  parent: 1:7cf8cfea66e4 tip
+   1
+  branch: default
+  commit: (clean)
+  update: (current)
+
+add sub sub
+
+  $ echo ss = ss > s/.hgsub
+  $ hg init s/ss
+  $ echo a > s/ss/a
+  $ hg -R s add s/.hgsub
+  $ hg -R s/ss add s/ss/a
+  $ hg sum
+  parent: 1:7cf8cfea66e4 tip
+   1
+  branch: default
+  commit: 1 subrepos
+  update: (current)
+  $ hg ci -m2
+  committing subrepository s
+  committing subrepository s/ss
+  $ hg sum
+  parent: 2:df30734270ae tip
+   2
+  branch: default
+  commit: (clean)
+  update: (current)
+
+bump sub rev
+
+  $ echo b > s/a
+  $ hg -R s ci -ms1
+  $ hg ci -m3
+  committing subrepository s
+
+leave sub dirty
+
+  $ echo c > s/a
+  $ hg ci -m4
+  committing subrepository s
+  $ hg tip -R s
+  changeset:   3:1c833a7a9e3a
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     4
+  
+
+check caching
+
+  $ hg co 0
+  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  $ hg debugsub
+
+restore
+
+  $ hg co
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg debugsub
+  path s
+   source   s
+   revision 1c833a7a9e3a4445c711aaf0f012379cd0d4034e
+
+new branch for merge tests
+
+  $ hg co 1
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo t = t >> .hgsub
+  $ hg init t
+  $ echo t > t/t
+  $ hg -R t add t
+  adding t/t
+
+5
+
+  $ hg ci -m5 # add sub
+  committing subrepository t
+  created new head
+  $ echo t2 > t/t
+
+6
+
+  $ hg st -R s
+  $ hg ci -m6 # change sub
+  committing subrepository t
+  $ hg debugsub
+  path s
+   source   s
+   revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
+  path t
+   source   t
+   revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
+  $ echo t3 > t/t
+
+7
+
+  $ hg ci -m7 # change sub again for conflict test
+  committing subrepository t
+  $ hg rm .hgsub
+
+8
+
+  $ hg ci -m8 # remove sub
+
+merge tests
+
+  $ hg co -C 3
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg merge 5 # test adding
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg debugsub
+  path s
+   source   s
+   revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
+  path t
+   source   t
+   revision 60ca1237c19474e7a3978b0dc1ca4e6f36d51382
+  $ hg ci -m9
+  created new head
+  $ hg merge 6 --debug # test change
+    searching for copies back to rev 2
+  resolving manifests
+   overwrite None partial False
+   ancestor 1f14a2e2d3ec local f0d2028bf86d+ remote 1831e14459c4
+   .hgsubstate: versions differ -> m
+  updating: .hgsubstate 1/1 files (100.00%)
+  subrepo merge f0d2028bf86d+ 1831e14459c4 1f14a2e2d3ec
+    subrepo t: other changed, get t:6747d179aa9a688023c4b0cad32e4c92bb7f34ad:hg
+  getting subrepo t
+  resolving manifests
+   overwrite True partial False
+   ancestor 60ca1237c194+ local 60ca1237c194+ remote 6747d179aa9a
+   t: remote is newer -> g
+  updating: t 1/1 files (100.00%)
+  getting t
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg debugsub
+  path s
+   source   s
+   revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
+  path t
+   source   t
+   revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
+  $ echo conflict > t/t
+  $ hg ci -m10
+  committing subrepository t
+  $ HGMERGE=internal:merge hg merge --debug 7 # test conflict
+    searching for copies back to rev 2
+  resolving manifests
+   overwrite None partial False
+   ancestor 1831e14459c4 local e45c8b14af55+ remote f94576341bcf
+   .hgsubstate: versions differ -> m
+  updating: .hgsubstate 1/1 files (100.00%)
+  subrepo merge e45c8b14af55+ f94576341bcf 1831e14459c4
+    subrepo t: both sides changed, merge with t:7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4:hg
+  merging subrepo t
+    searching for copies back to rev 2
+  resolving manifests
+   overwrite None partial False
+   ancestor 6747d179aa9a local 20a0db6fbf6c+ remote 7af322bc1198
+   t: versions differ -> m
+  preserving t for resolve of t
+  updating: t 1/1 files (100.00%)
+  picked tool 'internal:merge' for t (binary False symlink False)
+  merging t
+  my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a
+  warning: conflicts during merge.
+  merging t failed!
+  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+should conflict
+
+  $ cat t/t
+  <<<<<<< local
+  conflict
+  =======
+  t3
+  >>>>>>> other
+
+clone
+
+  $ cd ..
+  $ hg clone t tc
+  updating to branch default
+  pulling subrepo s from */sub/t/s (glob)
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 4 changesets with 5 changes to 3 files
+  pulling subrepo s/ss from */sub/t/s/ss (glob)
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  pulling subrepo t from */sub/t/t (glob)
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 4 changesets with 4 changes to 1 files (+1 heads)
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd tc
+  $ hg debugsub
+  path s
+   source   s
+   revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
+  path t
+   source   t
+   revision 20a0db6fbf6c3d2836e6519a642ae929bfc67c0e
+
+push
+
+  $ echo bah > t/t
+  $ hg ci -m11
+  committing subrepository t
+  $ hg push
+  pushing *sub/t (glob)
+  pushing *sub/t/s/ss (glob)
+  searching for changes
+  no changes found
+  pushing *sub/t/s (glob)
+  searching for changes
+  no changes found
+  pushing *sub/t/t (glob)
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+
+push -f
+
+  $ echo bah > s/a
+  $ hg ci -m12
+  committing subrepository s
+  $ hg push
+  pushing *sub/t (glob)
+  pushing *sub/t/s/ss (glob)
+  searching for changes
+  no changes found
+  pushing *sub/t/s (glob)
+  searching for changes
+  abort: push creates new remote heads on branch 'default'!
+  (did you forget to merge? use push -f to force)
+  [255]
+  $ hg push -f
+  pushing *sub/t (glob)
+  pushing *sub/t/s/ss (glob)
+  searching for changes
+  no changes found
+  pushing *sub/t/s (glob)
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files (+1 heads)
+  pushing *sub/t/t (glob)
+  searching for changes
+  no changes found
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+
+update
+
+  $ cd ../t
+  $ hg up -C # discard our earlier merge
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo blah > t/t
+  $ hg ci -m13
+  committing subrepository t
+
+pull
+
+  $ cd ../tc
+  $ hg pull
+  pulling *sub/t (glob)
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  (run 'hg update' to get a working copy)
+
+should pull t
+
+  $ hg up
+  pulling subrepo t from */sub/t/t (glob)
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cat t/t
+  blah
+
+bogus subrepo path aborts
+
+  $ echo 'bogus=[boguspath' >> .hgsub
+  $ hg ci -m 'bogus subrepo path'
+  abort: missing ] in subrepo source
+  [255]
+
+issue 1986
+
+# subrepo layout
+#
+#   o   5 br
+#  /|
+# o |   4 default
+# | |
+# | o   3 br
+# |/|
+# o |   2 default
+# | |
+# | o   1 br
+# |/
+# o     0 default
+
+  $ cd ..
+  $ rm -rf sub
+  $ hg init main
+  $ cd main
+  $ hg init s
+  $ cd s
+  $ echo a > a
+  $ hg ci -Am1
+  adding a
+  $ hg branch br
+  marked working directory as branch br
+  $ echo a >> a
+  $ hg ci -m1
+  $ hg up default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo b > b
+  $ hg ci -Am1
+  adding b
+  $ hg up br
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg merge tip
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg ci -m1
+  $ hg up 2
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo c > c
+  $ hg ci -Am1
+  adding c
+  $ hg up 3
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg merge 4
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg ci -m1
+
+# main repo layout:
+#
+#   * <-- try to merge default into br again
+# .`|
+# . o   5 br      --> substate = 5
+# . |
+# o |   4 default --> substate = 4
+# | |
+# | o   3 br      --> substate = 2
+# |/|
+# o |   2 default --> substate = 2
+# | |
+# | o   1 br      --> substate = 3
+# |/
+# o     0 default --> substate = 2
+
+  $ cd ..
+  $ echo 's = s' > .hgsub
+  $ hg -R s up 2
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg ci -Am1
+  adding .hgsub
+  committing subrepository s
+  $ hg branch br
+  marked working directory as branch br
+  $ echo b > b
+  $ hg -R s up 3
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg ci -Am1
+  adding b
+  committing subrepository s
+  $ hg up default
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo c > c
+  $ hg ci -Am1
+  adding c
+  $ hg up 1
+  2 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg merge 2
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg ci -m1
+  $ hg up 2
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg -R s up 4
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo d > d
+  $ hg ci -Am1
+  adding d
+  committing subrepository s
+  $ hg up 3
+  2 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg -R s up 5
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo e > e
+  $ hg ci -Am1
+  adding e
+  committing subrepository s
+
+  $ hg up 5
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg merge 4    # try to merge default into br again
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ cd ..
+
+test subrepo delete from .hgsubstate
+
+  $ hg init testdelete
+  $ mkdir testdelete/nested testdelete/nested2
+  $ hg init testdelete/nested
+  $ hg init testdelete/nested2
+  $ echo test > testdelete/nested/foo
+  $ echo test > testdelete/nested2/foo
+  $ hg -R testdelete/nested add
+  adding testdelete/nested/foo
+  $ hg -R testdelete/nested2 add
+  adding testdelete/nested2/foo
+  $ hg -R testdelete/nested ci -m test
+  $ hg -R testdelete/nested2 ci -m test
+  $ echo nested = nested > testdelete/.hgsub
+  $ echo nested2 = nested2 >> testdelete/.hgsub
+  $ hg -R testdelete add
+  adding testdelete/.hgsub
+  $ hg -R testdelete ci -m "nested 1 & 2 added"
+  committing subrepository nested
+  committing subrepository nested2
+  $ echo nested = nested > testdelete/.hgsub
+  $ hg -R testdelete ci -m "nested 2 deleted"
+  $ cat testdelete/.hgsubstate
+  bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested
+  $ hg -R testdelete remove testdelete/.hgsub
+  $ hg -R testdelete ci -m ".hgsub deleted"
+  $ cat testdelete/.hgsubstate
+
+test repository cloning
+
+  $ mkdir mercurial mercurial2
+  $ hg init nested_absolute
+  $ echo test > nested_absolute/foo
+  $ hg -R nested_absolute add
+  adding nested_absolute/foo
+  $ hg -R nested_absolute ci -mtest
+  $ cd mercurial
+  $ hg init nested_relative
+  $ echo test2 > nested_relative/foo2
+  $ hg -R nested_relative add
+  adding nested_relative/foo2
+  $ hg -R nested_relative ci -mtest2
+  $ hg init main
+  $ echo "nested_relative = ../nested_relative" > main/.hgsub
+  $ echo "nested_absolute = `pwd`/nested_absolute" >> main/.hgsub
+  $ hg -R main add
+  adding main/.hgsub
+  $ hg -R main ci -m "add subrepos"
+  committing subrepository nested_absolute
+  committing subrepository nested_relative
+  $ cd ..
+  $ hg clone mercurial/main mercurial2/main
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cat mercurial2/main/nested_absolute/.hg/hgrc \
+  >     mercurial2/main/nested_relative/.hg/hgrc
+  [paths]
+  default = */test-subrepo.t/sub/mercurial/nested_absolute (glob)
+  [paths]
+  default = */test-subrepo.t/sub/mercurial/nested_relative (glob)
+  $ rm -rf mercurial mercurial2
+
+issue 1977
+
+  $ hg init repo
+  $ hg init repo/s
+  $ echo a > repo/s/a
+  $ hg -R repo/s ci -Am0
+  adding a
+  $ echo s = s > repo/.hgsub
+  $ hg -R repo ci -Am1
+  adding .hgsub
+  committing subrepository s
+  $ hg clone repo repo2
+  updating to branch default
+  pulling subrepo s from */sub/repo/s (glob)
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg -q -R repo2 pull -u
+  $ echo 1 > repo2/s/a
+  $ hg -R repo2/s ci -m2
+  $ hg -q -R repo2/s push
+  $ hg -R repo2/s up -C 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo 2 > repo2/s/a
+  $ hg -R repo2/s ci -m3
+  created new head
+  $ hg -R repo2 ci -m3
+  committing subrepository s
+  $ hg -q -R repo2 push
+  abort: push creates new remote heads on branch 'default'!
+  (did you forget to merge? use push -f to force)
+  [255]
+  $ hg -R repo update
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm -rf repo2 repo
--- a/tests/test-symlink-addremove	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-#!/bin/sh
-
-"$TESTDIR/hghave" symlink || exit 80
-
-hg init a
-cd a
-
-echo '% directory moved and symlinked'
-mkdir foo
-touch foo/a
-hg ci -Ama
-mv foo bar
-ln -s bar foo
-echo '% now addremove should remove old files'
-hg addremove
--- a/tests/test-symlink-addremove.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-% directory moved and symlinked
-adding foo/a
-% now addremove should remove old files
-adding bar/a
-adding foo
-removing foo/a
--- a/tests/test-symlink-basic	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-#!/bin/sh
-
-"$TESTDIR/hghave" symlink || exit 80
-
-hg init a
-cd a
-ln -s nothing dangling
-hg commit -m 'commit symlink without adding' dangling
-hg add dangling
-hg commit -m 'add symlink'
-
-hg tip -v
-hg manifest --debug
-echo '% rev 0:'
-$TESTDIR/readlink.py dangling
-
-rm dangling
-ln -s void dangling
-hg commit -m 'change symlink'
-echo '% rev 1:'
-$TESTDIR/readlink.py dangling
-
-echo '% modifying link'
-rm dangling
-ln -s empty dangling
-$TESTDIR/readlink.py dangling
-
-echo '% reverting to rev 0:'
-hg revert -r 0 -a
-$TESTDIR/readlink.py dangling
-
-echo '% backups:'
-$TESTDIR/readlink.py *.orig
-
-rm *.orig
-hg up -C
-echo '% copies'
-hg cp -v dangling dangling2
-hg st -Cmard
-$TESTDIR/readlink.py dangling dangling2
-
-echo '% issue995'
-hg up -C
-mkdir dir
-ln -s dir dirlink
-hg ci -qAm 'add dirlink'
-mkdir newdir
-mv dir newdir/dir
-mv dirlink newdir/dirlink
-hg mv -A dirlink newdir/dirlink
--- a/tests/test-symlink-basic.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-abort: dangling: file not tracked!
-changeset:   0:cabd88b706fc
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-files:       dangling
-description:
-add symlink
-
-
-2564acbe54bbbedfbf608479340b359f04597f80 644 @ dangling
-% rev 0:
-dangling -> nothing
-% rev 1:
-dangling -> void
-% modifying link
-dangling -> empty
-% reverting to rev 0:
-reverting dangling
-dangling -> nothing
-% backups:
-dangling.orig -> empty
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% copies
-copying dangling to dangling2
-A dangling2
-  dangling
-dangling -> void
-dangling2 -> void
-% issue995
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
--- a/tests/test-symlink-root	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-#!/bin/sh
-
-"$TESTDIR/hghave" symlink || exit 80
-
-hg init a
-ln -s a link
-cd a
-echo foo > foo
-hg status
-hg status ../link
--- a/tests/test-symlink-root.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-? foo
-? foo
--- a/tests/test-symlinks	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-#!/bin/sh
-#Test bug regarding symlinks that showed up in hg 0.7
-#Author: Matthew Elder <sseses@gmail.com>
-
-"$TESTDIR/hghave" symlink || exit 80
-
-#make and initialize repo
-hg init test; cd test;
-
-#make a file and a symlink
-touch foo; ln -s foo bar;
-
-#import with addremove -- symlink walking should _not_ screwup.
-hg addremove
-
-#commit -- the symlink should _not_ appear added to dir state
-hg commit -m 'initial'
-
-#add a new file so hg will let me commit again
-touch bomb
-
-#again, symlink should _not_ show up on dir state
-hg addremove
-
-#Assert screamed here before, should go by without consequence
-hg commit -m 'is there a bug?'
-
-cd .. ; rm -r test
-hg init test; cd test;
-
-mkdir dir
-touch a.c dir/a.o dir/b.o
-# test what happens if we want to trick hg
-hg commit -A -m 0
-echo "relglob:*.o" > .hgignore
-rm a.c
-rm dir/a.o
-rm dir/b.o
-mkdir dir/a.o
-ln -s nonexist dir/b.o
-mkfifo a.c
-# it should show a.c, dir/a.o and dir/b.o deleted
-hg status
-hg status a.c
-
-echo '# test absolute path through symlink outside repo'
-cd ..
-p=`pwd`
-hg init x
-ln -s x y
-cd x
-touch f
-hg add f
-hg status "$p"/y/f
-
-echo '# try symlink outside repo to file inside'
-ln -s x/f ../z
-# this should fail
-hg status ../z && { echo hg mistakenly exited with status 0; exit 1; } || :
-
-cd .. ; rm -r test
-hg init test; cd test;
-
-echo '# try cloning symlink in a subdir'
-echo '1. commit a symlink'
-mkdir -p a/b/c
-cd a/b/c
-ln -s /path/to/symlink/source demo
-cd ../../..
-hg stat
-hg commit -A -m 'add symlink in a/b/c subdir'
-echo '2. clone it'
-cd ..
-hg clone test testclone
-
-echo '# git symlink diff'
-cd testclone
-hg diff --git -r null:tip
-hg export --git tip > ../sl.diff
-echo '# import git symlink diff'
-hg rm a/b/c/demo
-hg commit -m'remove link'
-hg import ../sl.diff
-hg diff --git -r 1:tip
--- a/tests/test-symlinks.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-adding bar
-adding foo
-adding bomb
-adding a.c
-adding dir/a.o
-adding dir/b.o
-M dir/b.o
-! a.c
-! dir/a.o
-? .hgignore
-a.c: unsupported file type (type is fifo)
-! a.c
-# test absolute path through symlink outside repo
-A f
-# try symlink outside repo to file inside
-abort: ../z not under root
-# try cloning symlink in a subdir
-1. commit a symlink
-? a/b/c/demo
-adding a/b/c/demo
-2. clone it
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# git symlink diff
-diff --git a/a/b/c/demo b/a/b/c/demo
-new file mode 120000
---- /dev/null
-+++ b/a/b/c/demo
-@@ -0,0 +1,1 @@
-+/path/to/symlink/source
-\ No newline at end of file
-# import git symlink diff
-applying ../sl.diff
-diff --git a/a/b/c/demo b/a/b/c/demo
-new file mode 120000
---- /dev/null
-+++ b/a/b/c/demo
-@@ -0,0 +1,1 @@
-+/path/to/symlink/source
-\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-symlinks.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,254 @@
+  $ "$TESTDIR/hghave" symlink || exit 80
+
+== tests added in 0.7 ==
+
+  $ hg init test-symlinks-0.7; cd test-symlinks-0.7;
+  $ touch foo; ln -s foo bar;
+
+import with addremove -- symlink walking should _not_ screwup.
+
+  $ hg addremove
+  adding bar
+  adding foo
+
+commit -- the symlink should _not_ appear added to dir state
+
+  $ hg commit -m 'initial'
+
+  $ touch bomb
+
+again, symlink should _not_ show up on dir state
+
+  $ hg addremove
+  adding bomb
+
+Assert screamed here before, should go by without consequence
+
+  $ hg commit -m 'is there a bug?'
+  $ cd ..
+
+
+== fifo & ignore ==
+
+  $ hg init test; cd test;
+
+  $ mkdir dir
+  $ touch a.c dir/a.o dir/b.o
+
+test what happens if we want to trick hg
+
+  $ hg commit -A -m 0
+  adding a.c
+  adding dir/a.o
+  adding dir/b.o
+  $ echo "relglob:*.o" > .hgignore
+  $ rm a.c
+  $ rm dir/a.o
+  $ rm dir/b.o
+  $ mkdir dir/a.o
+  $ ln -s nonexist dir/b.o
+  $ mkfifo a.c
+
+it should show a.c, dir/a.o and dir/b.o deleted
+
+  $ hg status
+  M dir/b.o
+  ! a.c
+  ! dir/a.o
+  ? .hgignore
+  $ hg status a.c
+  a.c: unsupported file type (type is fifo)
+  ! a.c
+  $ cd ..
+
+
+== symlinks from outside the tree ==
+
+test absolute path through symlink outside repo
+
+  $ p=`pwd`
+  $ hg init x
+  $ ln -s x y
+  $ cd x
+  $ touch f
+  $ hg add f
+  $ hg status "$p"/y/f
+  A f
+
+try symlink outside repo to file inside
+
+  $ ln -s x/f ../z
+
+this should fail
+
+  $ hg status ../z && { echo hg mistakenly exited with status 0; exit 1; } || :
+  abort: ../z not under root
+  $ cd ..
+
+
+== cloning symlinks ==
+  $ hg init clone; cd clone;
+
+try cloning symlink in a subdir
+1. commit a symlink
+
+  $ mkdir -p a/b/c
+  $ cd a/b/c
+  $ ln -s /path/to/symlink/source demo
+  $ cd ../../..
+  $ hg stat
+  ? a/b/c/demo
+  $ hg commit -A -m 'add symlink in a/b/c subdir'
+  adding a/b/c/demo
+
+2. clone it
+
+  $ cd ..
+  $ hg clone clone clonedest
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+
+== symlink and git diffs ==
+
+git symlink diff
+
+  $ cd clonedest
+  $ hg diff --git -r null:tip
+  diff --git a/a/b/c/demo b/a/b/c/demo
+  new file mode 120000
+  --- /dev/null
+  +++ b/a/b/c/demo
+  @@ -0,0 +1,1 @@
+  +/path/to/symlink/source
+  \ No newline at end of file
+  $ hg export --git tip > ../sl.diff
+
+import git symlink diff
+
+  $ hg rm a/b/c/demo
+  $ hg commit -m'remove link'
+  $ hg import ../sl.diff
+  applying ../sl.diff
+  $ hg diff --git -r 1:tip
+  diff --git a/a/b/c/demo b/a/b/c/demo
+  new file mode 120000
+  --- /dev/null
+  +++ b/a/b/c/demo
+  @@ -0,0 +1,1 @@
+  +/path/to/symlink/source
+  \ No newline at end of file
+
+== symlinks and addremove ==
+
+directory moved and symlinked
+
+  $ mkdir foo
+  $ touch foo/a
+  $ hg ci -Ama
+  adding foo/a
+  $ mv foo bar
+  $ ln -s bar foo
+
+now addremove should remove old files
+
+  $ hg addremove
+  adding bar/a
+  adding foo
+  removing foo/a
+  $ cd ..
+
+== root of repository is symlinked ==
+
+  $ hg init root
+  $ ln -s root link
+  $ cd root
+  $ echo foo > foo
+  $ hg status
+  ? foo
+  $ hg status ../link
+  ? foo
+  $ cd ..
+
+
+
+
+  $ hg init b
+  $ cd b
+  $ ln -s nothing dangling
+  $ hg commit -m 'commit symlink without adding' dangling
+  abort: dangling: file not tracked!
+  [255]
+  $ hg add dangling
+  $ hg commit -m 'add symlink'
+
+  $ hg tip -v
+  changeset:   0:cabd88b706fc
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files:       dangling
+  description:
+  add symlink
+  
+  
+  $ hg manifest --debug
+  2564acbe54bbbedfbf608479340b359f04597f80 644 @ dangling
+  $ $TESTDIR/readlink.py dangling
+  dangling -> nothing
+
+  $ rm dangling
+  $ ln -s void dangling
+  $ hg commit -m 'change symlink'
+  $ $TESTDIR/readlink.py dangling
+  dangling -> void
+
+
+modifying link
+
+  $ rm dangling
+  $ ln -s empty dangling
+  $ $TESTDIR/readlink.py dangling
+  dangling -> empty
+
+
+reverting to rev 0:
+
+  $ hg revert -r 0 -a
+  reverting dangling
+  $ $TESTDIR/readlink.py dangling
+  dangling -> nothing
+
+
+backups:
+
+  $ $TESTDIR/readlink.py *.orig
+  dangling.orig -> empty
+  $ rm *.orig
+  $ hg up -C
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+copies
+
+  $ hg cp -v dangling dangling2
+  copying dangling to dangling2
+  $ hg st -Cmard
+  A dangling2
+    dangling
+  $ $TESTDIR/readlink.py dangling dangling2
+  dangling -> void
+  dangling2 -> void
+
+
+issue995
+
+  $ hg up -C
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ mkdir dir
+  $ ln -s dir dirlink
+  $ hg ci -qAm 'add dirlink'
+  $ mkdir newdir
+  $ mv dir newdir/dir
+  $ mv dirlink newdir/dirlink
+  $ hg mv -A dirlink newdir/dirlink
+
--- a/tests/test-tag	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-#!/bin/sh
-
-hg init test
-cd test
-
-echo a > a
-hg add a
-hg commit -m "test" -d "1000000 0"
-hg history
-
-hg tag ' '
-
-hg tag -d "1000000 0" "bleah"
-hg history
-
-echo foo >> .hgtags
-hg tag -d "1000000 0" "bleah2" || echo "failed"
-
-hg revert .hgtags
-hg tag -d "1000000 0" -r 0 x y z y y z || echo "failed"
-hg tag -d "1000000 0" tap nada dot tip null . || echo "failed"
-hg tag -d "1000000 0" "bleah" || echo "failed"
-hg tag -d "1000000 0" "blecch" "bleah" || echo "failed"
-
-hg tag -d "1000000 0" --remove "blecch" || echo "failed"
-hg tag -d "1000000 0" --remove "bleah" "blecch" "blough" || echo "failed"
-
-hg tag -d "1000000 0" -r 0 "bleah0"
-hg tag -l -d "1000000 0" -r 1 "bleah1"
-hg tag -d "1000000 0" gack gawk gorp
-hg tag -d "1000000 0" -f gack
-hg tag -d "1000000 0" --remove gack gorp
-
-cat .hgtags
-cat .hg/localtags
-
-hg update 0
-hg tag -d "1000000 0" "foobar"
-cat .hgtags
-cat .hg/localtags
-
-hg tag -l 'xx
-newline'
-hg tag -l 'xx:xx'
-
-echo % cloning local tags
-cd ..
-hg -R test log -r0:5
-hg clone -q -rbleah1 test test1
-hg -R test1 parents --style=compact
-hg clone -q -r5 test#bleah1 test2
-hg -R test2 parents --style=compact
-hg clone -q -U test#bleah1 test3
-hg -R test3 parents --style=compact
-
-cd test
-echo % issue 601
-python << EOF
-f = file('.hg/localtags'); last = f.readlines()[-1][:-1]; f.close()
-f = file('.hg/localtags', 'w'); f.write(last); f.close()
-EOF
-cat .hg/localtags
-hg tag -l localnewline
-cat .hg/localtags
-
-python << EOF
-f = file('.hgtags'); last = f.readlines()[-1][:-1]; f.close()
-f = file('.hgtags', 'w'); f.write(last); f.close()
-EOF
-hg ci -d '1000000 0' -m'broken manual edit of .hgtags'
-cat .hgtags
-hg tag -d '1000000 0' newline
-cat .hgtags
-
-echo % tag and branch using same name
-hg branch tag-and-branch-same-name
-hg ci -m"discouraged"
-hg tag tag-and-branch-same-name
-
-echo '% test custom commit messages'
-cat > $HGTMP/editor <<'__EOF__'
-#!/bin/sh
-echo "custom tag message" > "$1"
-echo "second line" >> "$1"
-__EOF__
-chmod +x "$HGTMP"/editor
-HGEDITOR="'$HGTMP'"/editor hg tag custom-tag -e
-hg log -l1 --template "{desc}\n"
--- a/tests/test-tag.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +0,0 @@
-changeset:   0:0acdaf898367
-tag:         tip
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     test
-
-abort: tag names cannot consist entirely of whitespace
-changeset:   1:3ecf002a1c57
-tag:         tip
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     Added tag bleah for changeset 0acdaf898367
-
-changeset:   0:0acdaf898367
-tag:         bleah
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     test
-
-abort: working copy of .hgtags is changed (please commit .hgtags manually)
-failed
-abort: tag names must be unique
-failed
-abort: the name 'tip' is reserved
-failed
-abort: tag 'bleah' already exists (use -f to force)
-failed
-abort: tag 'bleah' already exists (use -f to force)
-failed
-abort: tag 'blecch' does not exist
-failed
-abort: tag 'blecch' does not exist
-failed
-0acdaf8983679e0aac16e811534eb49d7ee1f2b4 bleah
-0acdaf8983679e0aac16e811534eb49d7ee1f2b4 bleah0
-868cc8fbb43b754ad09fa109885d243fc49adae7 gack
-868cc8fbb43b754ad09fa109885d243fc49adae7 gawk
-868cc8fbb43b754ad09fa109885d243fc49adae7 gorp
-868cc8fbb43b754ad09fa109885d243fc49adae7 gack
-3807bcf62c5614cb6c16436b514d7764ca5f1631 gack
-3807bcf62c5614cb6c16436b514d7764ca5f1631 gack
-0000000000000000000000000000000000000000 gack
-868cc8fbb43b754ad09fa109885d243fc49adae7 gorp
-0000000000000000000000000000000000000000 gorp
-3ecf002a1c572a2f3bb4e665417e60fca65bbd42 bleah1
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-0acdaf8983679e0aac16e811534eb49d7ee1f2b4 foobar
-3ecf002a1c572a2f3bb4e665417e60fca65bbd42 bleah1
-abort: '\n' cannot be used in a tag name
-abort: ':' cannot be used in a tag name
-% cloning local tags
-changeset:   0:0acdaf898367
-tag:         bleah
-tag:         bleah0
-tag:         foobar
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     test
-
-changeset:   1:3ecf002a1c57
-tag:         bleah1
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     Added tag bleah for changeset 0acdaf898367
-
-changeset:   2:868cc8fbb43b
-tag:         gawk
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     Added tag bleah0 for changeset 0acdaf898367
-
-changeset:   3:3807bcf62c56
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     Added tag gack, gawk, gorp for changeset 868cc8fbb43b
-
-changeset:   4:140c6e8597b4
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     Added tag gack for changeset 3807bcf62c56
-
-changeset:   5:470a65fa7cc9
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     Removed tag gack, gorp
-
-1[tip]   3ecf002a1c57   1970-01-12 13:46 +0000   test
-  Added tag bleah for changeset 0acdaf898367
-
-5[tip]   470a65fa7cc9   1970-01-12 13:46 +0000   test
-  Removed tag gack, gorp
-
-% issue 601
-3ecf002a1c572a2f3bb4e665417e60fca65bbd42 bleah13ecf002a1c572a2f3bb4e665417e60fca65bbd42 bleah1
-f68b039e72eacbb2e68b0543e1f6e50990aa2bb5 localnewline
-0acdaf8983679e0aac16e811534eb49d7ee1f2b4 foobar0acdaf8983679e0aac16e811534eb49d7ee1f2b4 foobar
-6ae703d793c8b1f097116869275ecd97b2977a2b newline
-% tag and branch using same name
-marked working directory as branch tag-and-branch-same-name
-warning: tag tag-and-branch-same-name conflicts with existing branch name
-% test custom commit messages
-custom tag message
-second line
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-tag.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,197 @@
+  $ hg init test
+  $ cd test
+
+  $ echo a > a
+  $ hg add a
+  $ hg commit -m "test"
+  $ hg history
+  changeset:   0:acb14030fe0a
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     test
+  
+
+  $ hg tag ' '
+  abort: tag names cannot consist entirely of whitespace
+  [255]
+
+  $ hg tag "bleah"
+  $ hg history
+  changeset:   1:d4f0d2909abc
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     Added tag bleah for changeset acb14030fe0a
+  
+  changeset:   0:acb14030fe0a
+  tag:         bleah
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     test
+  
+
+  $ echo foo >> .hgtags
+  $ hg tag "bleah2"
+  abort: working copy of .hgtags is changed (please commit .hgtags manually)
+  [255]
+
+  $ hg revert .hgtags
+  $ hg tag -r 0 x y z y y z
+  abort: tag names must be unique
+  [255]
+  $ hg tag tap nada dot tip null .
+  abort: the name 'tip' is reserved
+  [255]
+  $ hg tag "bleah"
+  abort: tag 'bleah' already exists (use -f to force)
+  [255]
+  $ hg tag "blecch" "bleah"
+  abort: tag 'bleah' already exists (use -f to force)
+  [255]
+
+  $ hg tag --remove "blecch"
+  abort: tag 'blecch' does not exist
+  [255]
+  $ hg tag --remove "bleah" "blecch" "blough"
+  abort: tag 'blecch' does not exist
+  [255]
+
+  $ hg tag -r 0 "bleah0"
+  $ hg tag -l -r 1 "bleah1"
+  $ hg tag gack gawk gorp
+  $ hg tag -f gack
+  $ hg tag --remove gack gorp
+
+  $ cat .hgtags
+  acb14030fe0a21b60322c440ad2d20cf7685a376 bleah
+  acb14030fe0a21b60322c440ad2d20cf7685a376 bleah0
+  336fccc858a4eb69609a291105009e484a6b6b8d gack
+  336fccc858a4eb69609a291105009e484a6b6b8d gawk
+  336fccc858a4eb69609a291105009e484a6b6b8d gorp
+  336fccc858a4eb69609a291105009e484a6b6b8d gack
+  799667b6f2d9b957f73fa644a918c2df22bab58f gack
+  799667b6f2d9b957f73fa644a918c2df22bab58f gack
+  0000000000000000000000000000000000000000 gack
+  336fccc858a4eb69609a291105009e484a6b6b8d gorp
+  0000000000000000000000000000000000000000 gorp
+  $ cat .hg/localtags
+  d4f0d2909abc9290e2773c08837d70c1794e3f5a bleah1
+
+  $ hg update 0
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg tag "foobar"
+  $ cat .hgtags
+  acb14030fe0a21b60322c440ad2d20cf7685a376 foobar
+  $ cat .hg/localtags
+  d4f0d2909abc9290e2773c08837d70c1794e3f5a bleah1
+
+  $ hg tag -l 'xx
+  > newline'
+  abort: '\n' cannot be used in a tag name
+  [255]
+  $ hg tag -l 'xx:xx'
+  abort: ':' cannot be used in a tag name
+  [255]
+
+cloning local tags
+
+  $ cd ..
+  $ hg -R test log -r0:5
+  changeset:   0:acb14030fe0a
+  tag:         bleah
+  tag:         bleah0
+  tag:         foobar
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     test
+  
+  changeset:   1:d4f0d2909abc
+  tag:         bleah1
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     Added tag bleah for changeset acb14030fe0a
+  
+  changeset:   2:336fccc858a4
+  tag:         gawk
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     Added tag bleah0 for changeset acb14030fe0a
+  
+  changeset:   3:799667b6f2d9
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     Added tag gack, gawk, gorp for changeset 336fccc858a4
+  
+  changeset:   4:154eeb7c0138
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     Added tag gack for changeset 799667b6f2d9
+  
+  changeset:   5:b4bb47aaff09
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     Removed tag gack, gorp
+  
+  $ hg clone -q -rbleah1 test test1
+  $ hg -R test1 parents --style=compact
+  1[tip]   d4f0d2909abc   1970-01-01 00:00 +0000   test
+    Added tag bleah for changeset acb14030fe0a
+  
+  $ hg clone -q -r5 test#bleah1 test2
+  $ hg -R test2 parents --style=compact
+  5[tip]   b4bb47aaff09   1970-01-01 00:00 +0000   test
+    Removed tag gack, gorp
+  
+  $ hg clone -q -U test#bleah1 test3
+  $ hg -R test3 parents --style=compact
+
+  $ cd test
+
+issue 601
+
+  $ python << EOF
+  > f = file('.hg/localtags'); last = f.readlines()[-1][:-1]; f.close()
+  > f = file('.hg/localtags', 'w'); f.write(last); f.close()
+  > EOF
+  $ cat .hg/localtags; echo
+  d4f0d2909abc9290e2773c08837d70c1794e3f5a bleah1
+  $ hg tag -l localnewline
+  $ cat .hg/localtags; echo
+  d4f0d2909abc9290e2773c08837d70c1794e3f5a bleah1
+  c2899151f4e76890c602a2597a650a72666681bf localnewline
+  
+
+  $ python << EOF
+  > f = file('.hgtags'); last = f.readlines()[-1][:-1]; f.close()
+  > f = file('.hgtags', 'w'); f.write(last); f.close()
+  > EOF
+  $ hg ci -m'broken manual edit of .hgtags'
+  $ cat .hgtags; echo
+  acb14030fe0a21b60322c440ad2d20cf7685a376 foobar
+  $ hg tag newline
+  $ cat .hgtags; echo
+  acb14030fe0a21b60322c440ad2d20cf7685a376 foobar
+  a0eea09de1eeec777b46f2085260a373b2fbc293 newline
+  
+
+tag and branch using same name
+
+  $ hg branch tag-and-branch-same-name
+  marked working directory as branch tag-and-branch-same-name
+  $ hg ci -m"discouraged"
+  $ hg tag tag-and-branch-same-name
+  warning: tag tag-and-branch-same-name conflicts with existing branch name
+
+test custom commit messages
+
+  $ cat > $HGTMP/editor <<'__EOF__'
+  > #!/bin/sh
+  > echo "custom tag message" > "$1"
+  > echo "second line" >> "$1"
+  > __EOF__
+  $ chmod +x "$HGTMP"/editor
+  $ HGEDITOR="'$HGTMP'"/editor hg tag custom-tag -e
+  $ hg log -l1 --template "{desc}\n"
+  custom tag message
+  second line
--- a/tests/test-tags	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,214 +0,0 @@
-#!/bin/sh
-
-cacheexists() {
-    [ -f .hg/tags.cache ] && echo "tag cache exists" || echo "no tag cache"
-}
-
-# XXX need to test that the tag cache works when we strip an old head
-# and add a new one rooted off non-tip: i.e. node and rev of tip are the
-# same, but stuff has changed behind tip.
-
-echo "% setup"
-mkdir t
-cd t
-hg init
-cacheexists
-hg id
-cacheexists
-echo a > a
-hg add a
-hg commit -m "test"
-hg co
-hg identify
-cacheexists
-
-echo "% create local tag with long name"
-T=`hg identify --debug --id`
-hg tag -l "This is a local tag with a really long name!"
-hg tags
-rm .hg/localtags
-
-echo "% create a tag behind hg's back"
-echo "$T first" > .hgtags
-cat .hgtags
-hg add .hgtags
-hg commit -m "add tags"
-hg tags
-hg identify
-
-# repeat with cold tag cache
-echo "% identify with cold cache"
-rm -f .hg/tags.cache
-hg identify
-
-# and again, but now unable to write tag cache
-echo "% identify with unwritable cache"
-rm -f .hg/tags.cache
-chmod 555 .hg
-hg identify
-chmod 755 .hg
-
-echo "% create a branch"
-echo bb > a
-hg status
-hg identify
-hg co first
-hg id
-hg -v id
-hg status
-echo 1 > b
-hg add b
-hg commit -m "branch"
-hg id
-
-echo "% merge the two heads"
-hg merge 1
-hg id
-hg status
-
-hg commit -m "merge"
-
-echo "% create fake head, make sure tag not visible afterwards"
-cp .hgtags tags
-hg tag last
-hg rm .hgtags
-hg commit -m "remove"
-
-mv tags .hgtags
-hg add .hgtags
-hg commit -m "readd"
-
-hg tags
-
-echo "% add invalid tags"
-echo "spam" >> .hgtags
-echo >> .hgtags
-echo "foo bar" >> .hgtags
-echo "$T invalid" | sed "s/..../a5a5/" >> .hg/localtags
-echo "committing .hgtags:"
-cat .hgtags 
-hg commit -m "tags"
-
-echo "% report tag parse error on other head"
-hg up 3
-echo 'x y' >> .hgtags
-hg commit -m "head"
-
-hg tags
-hg tip
-
-echo "% test tag precedence rules"
-cd ..
-hg init t2
-cd t2
-echo foo > foo
-hg add foo
-hg ci -m 'add foo'      # rev 0
-hg tag bar              # rev 1
-echo >> foo
-hg ci -m 'change foo 1' # rev 2
-hg up -C 1
-hg tag -r 1 -f bar      # rev 3
-hg up -C 1
-echo >> foo
-hg ci -m 'change foo 2' # rev 4
-hg tags
-hg tags         # repeat in case of cache effects
-
-dumptags() {
-    rev=$1
-    echo "rev $rev: .hgtags:"
-    hg cat -r$rev .hgtags
-}
-
-echo "% detailed dump of tag info"
-echo "heads:"
-hg heads -q             # expect 4, 3, 2
-dumptags 2
-dumptags 3
-dumptags 4
-echo ".hg/tags.cache:"
-[ -f .hg/tags.cache ] && cat .hg/tags.cache || echo "no such file"
-
-echo "% test tag removal"
-hg tag --remove bar     # rev 5
-hg tip -vp
-hg tags
-hg tags                 # again, try to expose cache bugs
-
-echo '% remove nonexistent tag'
-hg tag --remove foobar
-hg tip
-
-echo "% rollback undoes tag operation"
-hg rollback             # destroy rev 5 (restore bar)
-hg tags
-hg tags
-
-echo "% test tag rank"
-cd ..
-hg init t3
-cd t3
-echo foo > foo
-hg add foo
-hg ci -m 'add foo'       # rev 0
-hg tag -f bar            # rev 1 bar -> 0
-hg tag -f bar            # rev 2 bar -> 1
-hg tag -fr 0 bar         # rev 3 bar -> 0
-hg tag -fr 1 bar         # rev 4 bar -> 1
-hg tag -fr 0 bar         # rev 5 bar -> 0
-hg tags
-hg co 3
-echo barbar > foo
-hg ci -m 'change foo'    # rev 6
-hg tags
-
-echo "% don't allow moving tag without -f"
-hg tag -r 3 bar
-hg tags
-
-echo "% strip 1: expose an old head"
-hg --config extensions.mq= strip 5 > /dev/null 2>&1
-hg tags                  # partly stale cache
-hg tags                  # up-to-date cache
-echo "% strip 2: destroy whole branch, no old head exposed"
-hg --config extensions.mq= strip 4 > /dev/null 2>&1 
-hg tags                  # partly stale
-rm -f .hg/tags.cache
-hg tags                  # cold cache
-
-echo "% test tag rank with 3 heads"
-cd ..
-hg init t4
-cd t4
-echo foo > foo
-hg add
-hg ci -m 'add foo'                 # rev 0
-hg tag bar                         # rev 1 bar -> 0
-hg tag -f bar                      # rev 2 bar -> 1
-hg up -qC 0
-hg tag -fr 2 bar                   # rev 3 bar -> 2
-hg tags
-hg up -qC 0
-hg tag -m 'retag rev 0' -fr 0 bar  # rev 4 bar -> 0, but bar stays at 2
-echo "% bar should still point to rev 2"
-hg tags
-
-
-echo "% remove local as global and global as local"
-# test that removing global/local tags does not get confused when trying
-# to remove a tag of type X which actually only exists as a type Y
-cd ..
-hg init t5
-cd t5
-echo foo > foo
-hg add
-hg ci -m 'add foo'                 # rev 0
-
-hg tag -r 0 -l localtag
-hg tag --remove localtag
-
-hg tag -r 0 globaltag
-hg tag --remove -l globaltag
-hg tags -v
-exit 0
--- a/tests/test-tags.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,153 +0,0 @@
-% setup
-no tag cache
-000000000000 tip
-no tag cache
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-acb14030fe0a tip
-tag cache exists
-% create local tag with long name
-tip                                0:acb14030fe0a
-This is a local tag with a really long name!     0:acb14030fe0a
-% create a tag behind hg's back
-acb14030fe0a21b60322c440ad2d20cf7685a376 first
-tip                                1:b9154636be93
-first                              0:acb14030fe0a
-b9154636be93 tip
-% identify with cold cache
-b9154636be93 tip
-% identify with unwritable cache
-b9154636be93 tip
-% create a branch
-M a
-b9154636be93+ tip
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-acb14030fe0a+ first
-acb14030fe0a+ first
-M a
-created new head
-c8edf04160c7 tip
-% merge the two heads
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-c8edf04160c7+b9154636be93+ tip
-M .hgtags
-% create fake head, make sure tag not visible afterwards
-tip                                6:35ff301afafe
-first                              0:acb14030fe0a
-% add invalid tags
-committing .hgtags:
-acb14030fe0a21b60322c440ad2d20cf7685a376 first
-spam
-
-foo bar
-% report tag parse error on other head
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-.hgtags@75d9f02dfe28, line 2: cannot parse entry
-.hgtags@75d9f02dfe28, line 4: node 'foo' is not well formed
-.hgtags@c4be69a18c11, line 2: node 'x' is not well formed
-tip                                8:c4be69a18c11
-first                              0:acb14030fe0a
-changeset:   8:c4be69a18c11
-tag:         tip
-parent:      3:ac5e980c4dc0
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     head
-
-% test tag precedence rules
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-tip                                4:0c192d7d5e6b
-bar                                1:78391a272241
-tip                                4:0c192d7d5e6b
-bar                                1:78391a272241
-% detailed dump of tag info
-heads:
-4:0c192d7d5e6b
-3:6fa450212aeb
-2:7a94127795a3
-rev 2: .hgtags:
-bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
-rev 3: .hgtags:
-bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
-bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
-78391a272241d70354aa14c874552cad6b51bb42 bar
-rev 4: .hgtags:
-bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
-.hg/tags.cache:
-4 0c192d7d5e6b78a714de54a2e9627952a877e25a 0c04f2a8af31de17fab7422878ee5a2dadbc943d
-3 6fa450212aeb2a21ed616a54aea39a4a27894cd7 7d3b718c964ef37b89e550ebdafd5789e76ce1b0
-2 7a94127795a33c10a370c93f731fd9fea0b79af6 0c04f2a8af31de17fab7422878ee5a2dadbc943d
-
-78391a272241d70354aa14c874552cad6b51bb42 bar
-% test tag removal
-changeset:   5:5f6e8655b1c7
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-files:       .hgtags
-description:
-Removed tag bar
-
-
-diff -r 0c192d7d5e6b -r 5f6e8655b1c7 .hgtags
---- a/.hgtags	Thu Jan 01 00:00:00 1970 +0000
-+++ b/.hgtags	Thu Jan 01 00:00:00 1970 +0000
-@@ -1,1 +1,3 @@
- bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
-+78391a272241d70354aa14c874552cad6b51bb42 bar
-+0000000000000000000000000000000000000000 bar
-
-tip                                5:5f6e8655b1c7
-tip                                5:5f6e8655b1c7
-% remove nonexistent tag
-abort: tag 'foobar' does not exist
-changeset:   5:5f6e8655b1c7
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     Removed tag bar
-
-% rollback undoes tag operation
-rolling back to revision 4 (undo commit)
-tip                                4:0c192d7d5e6b
-bar                                1:78391a272241
-tip                                4:0c192d7d5e6b
-bar                                1:78391a272241
-% test tag rank
-tip                                5:85f05169d91d
-bar                                0:bbd179dfa0a7
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-tip                                6:735c3ca72986
-bar                                0:bbd179dfa0a7
-% don't allow moving tag without -f
-abort: tag 'bar' already exists (use -f to force)
-tip                                6:735c3ca72986
-bar                                0:bbd179dfa0a7
-% strip 1: expose an old head
-tip                                5:735c3ca72986
-bar                                1:78391a272241
-tip                                5:735c3ca72986
-bar                                1:78391a272241
-% strip 2: destroy whole branch, no old head exposed
-tip                                4:735c3ca72986
-bar                                0:bbd179dfa0a7
-tip                                4:735c3ca72986
-bar                                0:bbd179dfa0a7
-% test tag rank with 3 heads
-adding foo
-tip                                3:197c21bbbf2c
-bar                                2:6fa450212aeb
-% bar should still point to rev 2
-tip                                4:3b4b14ed0202
-bar                                2:6fa450212aeb
-% remove local as global and global as local
-adding foo
-abort: tag 'localtag' is not a global tag
-abort: tag 'globaltag' is not a local tag
-tip                                1:a0b6fe111088
-localtag                           0:bbd179dfa0a7 local
-globaltag                          0:bbd179dfa0a7
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-tags.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,370 @@
+Helper functions:
+
+  $ cacheexists() {
+  >   [ -f .hg/tags.cache ] && echo "tag cache exists" || echo "no tag cache"
+  > }
+
+  $ dumptags() {
+  >     rev=$1
+  >     echo "rev $rev: .hgtags:"
+  >     hg cat -r$rev .hgtags
+  > }
+
+# XXX need to test that the tag cache works when we strip an old head
+# and add a new one rooted off non-tip: i.e. node and rev of tip are the
+# same, but stuff has changed behind tip.
+
+Setup:
+
+  $ hg init t
+  $ cd t
+  $ cacheexists
+  no tag cache
+  $ hg id
+  000000000000 tip
+  $ cacheexists
+  no tag cache
+  $ echo a > a
+  $ hg add a
+  $ hg commit -m "test"
+  $ hg co
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg identify
+  acb14030fe0a tip
+  $ cacheexists
+  tag cache exists
+
+Create local tag with long name:
+
+  $ T=`hg identify --debug --id`
+  $ hg tag -l "This is a local tag with a really long name!"
+  $ hg tags
+  tip                                0:acb14030fe0a
+  This is a local tag with a really long name!     0:acb14030fe0a
+  $ rm .hg/localtags
+
+Create a tag behind hg's back:
+
+  $ echo "$T first" > .hgtags
+  $ cat .hgtags
+  acb14030fe0a21b60322c440ad2d20cf7685a376 first
+  $ hg add .hgtags
+  $ hg commit -m "add tags"
+  $ hg tags
+  tip                                1:b9154636be93
+  first                              0:acb14030fe0a
+  $ hg identify
+  b9154636be93 tip
+
+Repeat with cold tag cache:
+
+  $ rm -f .hg/tags.cache
+  $ hg identify
+  b9154636be93 tip
+
+And again, but now unable to write tag cache:
+
+  $ rm -f .hg/tags.cache
+  $ chmod 555 .hg
+  $ hg identify
+  b9154636be93 tip
+  $ chmod 755 .hg
+
+Create a branch:
+
+  $ echo bb > a
+  $ hg status
+  M a
+  $ hg identify
+  b9154636be93+ tip
+  $ hg co first
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg id
+  acb14030fe0a+ first
+  $ hg -v id
+  acb14030fe0a+ first
+  $ hg status
+  M a
+  $ echo 1 > b
+  $ hg add b
+  $ hg commit -m "branch"
+  created new head
+  $ hg id
+  c8edf04160c7 tip
+
+Merge the two heads:
+
+  $ hg merge 1
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg id
+  c8edf04160c7+b9154636be93+ tip
+  $ hg status
+  M .hgtags
+  $ hg commit -m "merge"
+
+Create a fake head, make sure tag not visible afterwards:
+
+  $ cp .hgtags tags
+  $ hg tag last
+  $ hg rm .hgtags
+  $ hg commit -m "remove"
+
+  $ mv tags .hgtags
+  $ hg add .hgtags
+  $ hg commit -m "readd"
+  $ 
+  $ hg tags
+  tip                                6:35ff301afafe
+  first                              0:acb14030fe0a
+
+Add invalid tags:
+
+  $ echo "spam" >> .hgtags
+  $ echo >> .hgtags
+  $ echo "foo bar" >> .hgtags
+  $ echo "a5a5 invalid" >> .hg/localtags
+  $ echo "committing .hgtags:"
+  committing .hgtags:
+  $ cat .hgtags 
+  acb14030fe0a21b60322c440ad2d20cf7685a376 first
+  spam
+  
+  foo bar
+  $ hg commit -m "tags"
+
+Report tag parse error on other head:
+
+  $ hg up 3
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo 'x y' >> .hgtags
+  $ hg commit -m "head"
+  created new head
+
+  $ hg tags
+  .hgtags@75d9f02dfe28, line 2: cannot parse entry
+  .hgtags@75d9f02dfe28, line 4: node 'foo' is not well formed
+  .hgtags@c4be69a18c11, line 2: node 'x' is not well formed
+  tip                                8:c4be69a18c11
+  first                              0:acb14030fe0a
+  $ hg tip
+  changeset:   8:c4be69a18c11
+  tag:         tip
+  parent:      3:ac5e980c4dc0
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     head
+  
+
+Test tag precedence rules:
+
+  $ cd ..
+  $ hg init t2
+  $ cd t2
+  $ echo foo > foo
+  $ hg add foo
+  $ hg ci -m 'add foo'      # rev 0
+  $ hg tag bar              # rev 1
+  $ echo >> foo
+  $ hg ci -m 'change foo 1' # rev 2
+  $ hg up -C 1
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg tag -r 1 -f bar      # rev 3
+  $ hg up -C 1
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo >> foo
+  $ hg ci -m 'change foo 2' # rev 4
+  created new head
+  $ hg tags
+  tip                                4:0c192d7d5e6b
+  bar                                1:78391a272241
+
+Repeat in case of cache effects:
+
+  $ hg tags
+  tip                                4:0c192d7d5e6b
+  bar                                1:78391a272241
+
+Detailed dump of tag info:
+
+  $ hg heads -q             # expect 4, 3, 2
+  4:0c192d7d5e6b
+  3:6fa450212aeb
+  2:7a94127795a3
+  $ dumptags 2
+  rev 2: .hgtags:
+  bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
+  $ dumptags 3
+  rev 3: .hgtags:
+  bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
+  bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
+  78391a272241d70354aa14c874552cad6b51bb42 bar
+  $ dumptags 4
+  rev 4: .hgtags:
+  bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
+
+Dump cache:
+
+  $ cat .hg/tags.cache
+  4 0c192d7d5e6b78a714de54a2e9627952a877e25a 0c04f2a8af31de17fab7422878ee5a2dadbc943d
+  3 6fa450212aeb2a21ed616a54aea39a4a27894cd7 7d3b718c964ef37b89e550ebdafd5789e76ce1b0
+  2 7a94127795a33c10a370c93f731fd9fea0b79af6 0c04f2a8af31de17fab7422878ee5a2dadbc943d
+  
+  78391a272241d70354aa14c874552cad6b51bb42 bar
+
+Test tag removal:
+
+  $ hg tag --remove bar     # rev 5
+  $ hg tip -vp
+  changeset:   5:5f6e8655b1c7
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files:       .hgtags
+  description:
+  Removed tag bar
+  
+  
+  diff -r 0c192d7d5e6b -r 5f6e8655b1c7 .hgtags
+  --- a/.hgtags	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/.hgtags	Thu Jan 01 00:00:00 1970 +0000
+  @@ -1,1 +1,3 @@
+   bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
+  +78391a272241d70354aa14c874552cad6b51bb42 bar
+  +0000000000000000000000000000000000000000 bar
+  
+  $ hg tags
+  tip                                5:5f6e8655b1c7
+  $ hg tags                 # again, try to expose cache bugs
+  tip                                5:5f6e8655b1c7
+
+Remove nonexistent tag:
+
+  $ hg tag --remove foobar
+  abort: tag 'foobar' does not exist
+  [255]
+  $ hg tip
+  changeset:   5:5f6e8655b1c7
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     Removed tag bar
+  
+
+Undo a tag with rollback:
+
+  $ hg rollback             # destroy rev 5 (restore bar)
+  rolling back to revision 4 (undo commit)
+  $ hg tags
+  tip                                4:0c192d7d5e6b
+  bar                                1:78391a272241
+  $ hg tags
+  tip                                4:0c192d7d5e6b
+  bar                                1:78391a272241
+
+Test tag rank:
+
+  $ cd ..
+  $ hg init t3
+  $ cd t3
+  $ echo foo > foo
+  $ hg add foo
+  $ hg ci -m 'add foo'       # rev 0
+  $ hg tag -f bar            # rev 1 bar -> 0
+  $ hg tag -f bar            # rev 2 bar -> 1
+  $ hg tag -fr 0 bar         # rev 3 bar -> 0
+  $ hg tag -fr 1 bar         # rev 4 bar -> 1
+  $ hg tag -fr 0 bar         # rev 5 bar -> 0
+  $ hg tags
+  tip                                5:85f05169d91d
+  bar                                0:bbd179dfa0a7
+  $ hg co 3
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo barbar > foo
+  $ hg ci -m 'change foo'    # rev 6
+  created new head
+  $ hg tags
+  tip                                6:735c3ca72986
+  bar                                0:bbd179dfa0a7
+
+Don't allow moving tag without -f:
+
+  $ hg tag -r 3 bar
+  abort: tag 'bar' already exists (use -f to force)
+  [255]
+  $ hg tags
+  tip                                6:735c3ca72986
+  bar                                0:bbd179dfa0a7
+
+Strip 1: expose an old head:
+
+  $ hg --config extensions.mq= strip 5
+  saved backup bundle to * (glob)
+  $ hg tags                  # partly stale cache
+  tip                                5:735c3ca72986
+  bar                                1:78391a272241
+  $ hg tags                  # up-to-date cache
+  tip                                5:735c3ca72986
+  bar                                1:78391a272241
+
+Strip 2: destroy whole branch, no old head exposed
+
+  $ hg --config extensions.mq= strip 4
+  saved backup bundle to * (glob)
+  $ hg tags                  # partly stale
+  tip                                4:735c3ca72986
+  bar                                0:bbd179dfa0a7
+  $ rm -f .hg/tags.cache
+  $ hg tags                  # cold cache
+  tip                                4:735c3ca72986
+  bar                                0:bbd179dfa0a7
+
+Test tag rank with 3 heads:
+
+  $ cd ..
+  $ hg init t4
+  $ cd t4
+  $ echo foo > foo
+  $ hg add
+  adding foo
+  $ hg ci -m 'add foo'                 # rev 0
+  $ hg tag bar                         # rev 1 bar -> 0
+  $ hg tag -f bar                      # rev 2 bar -> 1
+  $ hg up -qC 0
+  $ hg tag -fr 2 bar                   # rev 3 bar -> 2
+  $ hg tags
+  tip                                3:197c21bbbf2c
+  bar                                2:6fa450212aeb
+  $ hg up -qC 0
+  $ hg tag -m 'retag rev 0' -fr 0 bar  # rev 4 bar -> 0, but bar stays at 2
+
+Bar should still point to rev 2:
+
+  $ hg tags
+  tip                                4:3b4b14ed0202
+  bar                                2:6fa450212aeb
+
+Test that removing global/local tags does not get confused when trying
+to remove a tag of type X which actually only exists as a type Y:
+
+  $ cd ..
+  $ hg init t5
+  $ cd t5
+  $ echo foo > foo
+  $ hg add
+  adding foo
+  $ hg ci -m 'add foo'                 # rev 0
+
+  $ hg tag -r 0 -l localtag
+  $ hg tag --remove localtag
+  abort: tag 'localtag' is not a global tag
+  [255]
+  $ 
+  $ hg tag -r 0 globaltag
+  $ hg tag --remove -l globaltag
+  abort: tag 'globaltag' is not a local tag
+  [255]
+  $ hg tags -v
+  tip                                1:a0b6fe111088
+  localtag                           0:bbd179dfa0a7 local
+  globaltag                          0:bbd179dfa0a7
--- a/tests/test-transplant	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,168 +0,0 @@
-#!/bin/sh
-
-cat <<EOF >> $HGRCPATH
-[extensions]
-transplant=
-EOF
-
-hg init t
-cd t
-echo r1 > r1
-hg ci -Amr1 -d'0 0'
-echo r2 > r2
-hg ci -Amr2 -d'1 0'
-hg up 0
-
-echo b1 > b1
-hg ci -Amb1 -d '0 0'
-echo b2 > b2
-hg ci -Amb2 -d '1 0'
-echo b3 > b3
-hg ci -Amb3 -d '2 0'
-
-hg log --template '{rev} {parents} {desc}\n'
-
-hg clone . ../rebase
-cd ../rebase
-
-hg up -C 1
-echo '% rebase b onto r1'
-hg transplant -a -b tip
-hg log --template '{rev} {parents} {desc}\n'
-
-hg clone ../t ../prune
-cd ../prune
-
-hg up -C 1
-echo '% rebase b onto r1, skipping b2'
-hg transplant -a -b tip -p 3
-hg log --template '{rev} {parents} {desc}\n'
-
-echo '% remote transplant'
-hg clone -r 1 ../t ../remote
-cd ../remote
-hg transplant --log -s ../t 2 4
-hg log --template '{rev} {parents} {desc}\n'
-
-echo '% skip previous transplants'
-hg transplant -s ../t -a -b 4
-hg log --template '{rev} {parents} {desc}\n'
-
-echo '% skip local changes transplanted to the source'
-echo b4 > b4
-hg ci -Amb4 -d '3 0'
-hg clone ../t ../pullback
-cd ../pullback
-hg transplant -s ../remote -a -b tip
-
-echo '% remote transplant with pull'
-hg -R ../t serve -p $HGPORT -d --pid-file=../t.pid
-cat ../t.pid >> $DAEMON_PIDS
-
-hg clone -r 0 ../t ../rp
-cd ../rp
-hg transplant -s http://localhost:$HGPORT/ 2 4
-hg log --template '{rev} {parents} {desc}\n'
-
-echo '% transplant --continue'
-hg init ../tc
-cd ../tc
-cat <<EOF > foo
-foo
-bar
-baz
-EOF
-echo toremove > toremove
-hg ci -Amfoo
-cat <<EOF > foo
-foo2
-bar2
-baz2
-EOF
-rm toremove
-echo added > added
-hg ci -Amfoo2
-echo bar > bar
-hg ci -Ambar
-echo bar2 >> bar
-hg ci -mbar2
-hg up 0
-echo foobar > foo
-hg ci -mfoobar
-hg transplant 1:3
-# transplant -c shouldn't use an old changeset
-hg up -C
-rm added
-hg transplant 1
-hg transplant --continue
-hg transplant 1:3
-hg locate
-cd ..
-
-# Test transplant --merge (issue 1111)
-echo % test transplant merge
-hg init t1111
-cd t1111
-echo a > a
-hg ci -Am adda
-echo b >> a
-hg ci -m appendb
-echo c >> a
-hg ci -m appendc
-hg up -C 0
-echo d >> a
-hg ci -m appendd
-echo % tranplant
-hg transplant -m 1
-cd ..
-
-echo '% test transplant into empty repository'
-hg init empty
-cd empty
-hg transplant -s ../t -b tip -a
-cd ..
-
-echo '% test filter'
-hg init filter
-cd filter
-cat <<'EOF' >test-filter
-#!/bin/sh
-sed 's/r1/r2/' $1 > $1.new
-mv $1.new $1
-EOF
-chmod +x test-filter
-hg transplant -s ../t -b tip -a --filter ./test-filter |\
-    sed 's/filtering.*/filtering/g'
-hg log --template '{rev} {parents} {desc}\n'
-cd ..
-
-echo '% test filter with failed patch'
-cd filter
-hg up 0
-echo foo > b1
-hg ci -d '0 0' -Am foo
-hg transplant 1 --filter ./test-filter |\
-    sed 's/filtering.*/filtering/g'
-cd ..
-
-echo '% test with a win32ext like setup (differing EOLs)'
-hg init twin1
-cd twin1
-echo a > a
-echo b > b
-echo b >> b
-hg ci -Am t
-echo a > b
-echo b >> b
-hg ci -m changeb
-cd ..
-
-hg init twin2
-cd twin2
-echo '[patch]' >> .hg/hgrc
-echo 'eol = crlf' >> .hg/hgrc
-python -c "file('b', 'wb').write('b\r\nb\r\n')"
-hg ci -m addb
-hg transplant -s ../twin1 tip
-python -c "print repr(file('b', 'rb').read())"
-cd ..
--- a/tests/test-transplant.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,179 +0,0 @@
-adding r1
-adding r2
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-adding b1
-created new head
-adding b2
-adding b3
-4  b3
-3  b2
-2 0:17ab29e464c6  b1
-1  r2
-0  r1
-updating to branch default
-4 files updated, 0 files merged, 0 files removed, 0 files unresolved
-1 files updated, 0 files merged, 3 files removed, 0 files unresolved
-% rebase b onto r1
-applying 37a1297eb21b
-37a1297eb21b transplanted to e234d668f844
-applying 722f4667af76
-722f4667af76 transplanted to 539f377d78df
-applying a53251cdf717
-a53251cdf717 transplanted to ffd6818a3975
-7  b3
-6  b2
-5 1:d11e3596cc1a  b1
-4  b3
-3  b2
-2 0:17ab29e464c6  b1
-1  r2
-0  r1
-updating to branch default
-4 files updated, 0 files merged, 0 files removed, 0 files unresolved
-1 files updated, 0 files merged, 3 files removed, 0 files unresolved
-% rebase b onto r1, skipping b2
-applying 37a1297eb21b
-37a1297eb21b transplanted to e234d668f844
-applying a53251cdf717
-a53251cdf717 transplanted to 7275fda4d04f
-6  b3
-5 1:d11e3596cc1a  b1
-4  b3
-3  b2
-2 0:17ab29e464c6  b1
-1  r2
-0  r1
-% remote transplant
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 2 changes to 2 files
-updating to branch default
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-searching for changes
-applying 37a1297eb21b
-37a1297eb21b transplanted to c19cf0ccb069
-applying a53251cdf717
-a53251cdf717 transplanted to f7fe5bf98525
-3  b3
-(transplanted from a53251cdf717679d1907b289f991534be05c997a)
-2  b1
-(transplanted from 37a1297eb21b3ef5c5d2ffac22121a0988ed9f21)
-1  r2
-0  r1
-% skip previous transplants
-searching for changes
-applying 722f4667af76
-722f4667af76 transplanted to 47156cd86c0b
-4  b2
-3  b3
-(transplanted from a53251cdf717679d1907b289f991534be05c997a)
-2  b1
-(transplanted from 37a1297eb21b3ef5c5d2ffac22121a0988ed9f21)
-1  r2
-0  r1
-% skip local changes transplanted to the source
-adding b4
-updating to branch default
-4 files updated, 0 files merged, 0 files removed, 0 files unresolved
-searching for changes
-applying 4333daefcb15
-4333daefcb15 transplanted to 5f42c04e07cc
-% remote transplant with pull
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-searching for changes
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-applying a53251cdf717
-a53251cdf717 transplanted to 8d9279348abb
-2  b3
-1  b1
-0  r1
-% transplant --continue
-adding foo
-adding toremove
-adding added
-removing toremove
-adding bar
-2 files updated, 0 files merged, 2 files removed, 0 files unresolved
-created new head
-applying a1e30dd1b8e7
-patching file foo
-Hunk #1 FAILED at 0
-1 out of 1 hunks FAILED -- saving rejects to file foo.rej
-patch failed to apply
-abort: fix up the merge and run hg transplant --continue
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-applying a1e30dd1b8e7
-patching file foo
-Hunk #1 FAILED at 0
-1 out of 1 hunks FAILED -- saving rejects to file foo.rej
-patch failed to apply
-abort: fix up the merge and run hg transplant --continue
-a1e30dd1b8e7 transplanted as f1563cf27039
-skipping already applied revision 1:a1e30dd1b8e7
-applying 1739ac5f6139
-1739ac5f6139 transplanted to d649c221319f
-applying 0282d5fbbe02
-0282d5fbbe02 transplanted to 77418277ccb3
-added
-bar
-foo
-% test transplant merge
-adding a
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-% tranplant
-applying 42dc4432fd35
-1:42dc4432fd35 merged at a9f4acbac129
-% test transplant into empty repository
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 4 changesets with 4 changes to 4 files
-% test filter
-filtering
-applying 17ab29e464c6
-17ab29e464c6 transplanted to e9ffc54ea104
-filtering
-applying 37a1297eb21b
-37a1297eb21b transplanted to 348b36d0b6a5
-filtering
-applying 722f4667af76
-722f4667af76 transplanted to 0aa6979afb95
-filtering
-applying a53251cdf717
-a53251cdf717 transplanted to 14f8512272b5
-3  b3
-2  b2
-1  b1
-0  r2
-% test filter with failed patch
-0 files updated, 0 files merged, 3 files removed, 0 files unresolved
-adding b1
-adding test-filter
-created new head
-file b1 already exists
-1 out of 1 hunks FAILED -- saving rejects to file b1.rej
-abort: fix up the merge and run hg transplant --continue
-filtering
-applying 348b36d0b6a5
-patch failed to apply
-% test with a win32ext like setup (differing EOLs)
-adding a
-adding b
-nothing changed
-applying 2e849d776c17
-2e849d776c17 transplanted to 589cea8ba85b
-'a\r\nb\r\n'
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-transplant.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,357 @@
+  $ cat <<EOF >> $HGRCPATH
+  > [extensions]
+  > transplant=
+  > EOF
+
+  $ hg init t
+  $ cd t
+  $ echo r1 > r1
+  $ hg ci -Amr1 -d'0 0'
+  adding r1
+  $ echo r2 > r2
+  $ hg ci -Amr2 -d'1 0'
+  adding r2
+  $ hg up 0
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+  $ echo b1 > b1
+  $ hg ci -Amb1 -d '0 0'
+  adding b1
+  created new head
+  $ echo b2 > b2
+  $ hg ci -Amb2 -d '1 0'
+  adding b2
+  $ echo b3 > b3
+  $ hg ci -Amb3 -d '2 0'
+  adding b3
+
+  $ hg log --template '{rev} {parents} {desc}\n'
+  4  b3
+  3  b2
+  2 0:17ab29e464c6  b1
+  1  r2
+  0  r1
+
+  $ hg clone . ../rebase
+  updating to branch default
+  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd ../rebase
+
+  $ hg up -C 1
+  1 files updated, 0 files merged, 3 files removed, 0 files unresolved
+
+rebase b onto r1
+
+  $ hg transplant -a -b tip
+  applying 37a1297eb21b
+  37a1297eb21b transplanted to e234d668f844
+  applying 722f4667af76
+  722f4667af76 transplanted to 539f377d78df
+  applying a53251cdf717
+  a53251cdf717 transplanted to ffd6818a3975
+  $ hg log --template '{rev} {parents} {desc}\n'
+  7  b3
+  6  b2
+  5 1:d11e3596cc1a  b1
+  4  b3
+  3  b2
+  2 0:17ab29e464c6  b1
+  1  r2
+  0  r1
+
+  $ hg clone ../t ../prune
+  updating to branch default
+  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd ../prune
+
+  $ hg up -C 1
+  1 files updated, 0 files merged, 3 files removed, 0 files unresolved
+
+rebase b onto r1, skipping b2
+
+  $ hg transplant -a -b tip -p 3
+  applying 37a1297eb21b
+  37a1297eb21b transplanted to e234d668f844
+  applying a53251cdf717
+  a53251cdf717 transplanted to 7275fda4d04f
+  $ hg log --template '{rev} {parents} {desc}\n'
+  6  b3
+  5 1:d11e3596cc1a  b1
+  4  b3
+  3  b2
+  2 0:17ab29e464c6  b1
+  1  r2
+  0  r1
+
+
+remote transplant
+
+  $ hg clone -r 1 ../t ../remote
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 2 files
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd ../remote
+  $ hg transplant --log -s ../t 2 4
+  searching for changes
+  applying 37a1297eb21b
+  37a1297eb21b transplanted to c19cf0ccb069
+  applying a53251cdf717
+  a53251cdf717 transplanted to f7fe5bf98525
+  $ hg log --template '{rev} {parents} {desc}\n'
+  3  b3
+  (transplanted from a53251cdf717679d1907b289f991534be05c997a)
+  2  b1
+  (transplanted from 37a1297eb21b3ef5c5d2ffac22121a0988ed9f21)
+  1  r2
+  0  r1
+
+skip previous transplants
+
+  $ hg transplant -s ../t -a -b 4
+  searching for changes
+  applying 722f4667af76
+  722f4667af76 transplanted to 47156cd86c0b
+  $ hg log --template '{rev} {parents} {desc}\n'
+  4  b2
+  3  b3
+  (transplanted from a53251cdf717679d1907b289f991534be05c997a)
+  2  b1
+  (transplanted from 37a1297eb21b3ef5c5d2ffac22121a0988ed9f21)
+  1  r2
+  0  r1
+
+skip local changes transplanted to the source
+
+  $ echo b4 > b4
+  $ hg ci -Amb4 -d '3 0'
+  adding b4
+  $ hg clone ../t ../pullback
+  updating to branch default
+  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd ../pullback
+  $ hg transplant -s ../remote -a -b tip
+  searching for changes
+  applying 4333daefcb15
+  4333daefcb15 transplanted to 5f42c04e07cc
+
+
+remote transplant with pull
+
+  $ hg -R ../t serve -p $HGPORT -d --pid-file=../t.pid
+  $ cat ../t.pid >> $DAEMON_PIDS
+
+  $ hg clone -r 0 ../t ../rp
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd ../rp
+  $ hg transplant -s http://localhost:$HGPORT/ 2 4
+  searching for changes
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  applying a53251cdf717
+  a53251cdf717 transplanted to 8d9279348abb
+  $ hg log --template '{rev} {parents} {desc}\n'
+  2  b3
+  1  b1
+  0  r1
+
+transplant --continue
+
+  $ hg init ../tc
+  $ cd ../tc
+  $ cat <<EOF > foo
+  > foo
+  > bar
+  > baz
+  > EOF
+  $ echo toremove > toremove
+  $ hg ci -Amfoo
+  adding foo
+  adding toremove
+  $ cat <<EOF > foo
+  > foo2
+  > bar2
+  > baz2
+  > EOF
+  $ rm toremove
+  $ echo added > added
+  $ hg ci -Amfoo2
+  adding added
+  removing toremove
+  $ echo bar > bar
+  $ hg ci -Ambar
+  adding bar
+  $ echo bar2 >> bar
+  $ hg ci -mbar2
+  $ hg up 0
+  2 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  $ echo foobar > foo
+  $ hg ci -mfoobar
+  created new head
+  $ hg transplant 1:3
+  applying a1e30dd1b8e7
+  patching file foo
+  Hunk #1 FAILED at 0
+  1 out of 1 hunks FAILED -- saving rejects to file foo.rej
+  patch failed to apply
+  abort: fix up the merge and run hg transplant --continue
+  [255]
+
+transplant -c shouldn't use an old changeset
+
+  $ hg up -C
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm added
+  $ hg transplant 1
+  applying a1e30dd1b8e7
+  patching file foo
+  Hunk #1 FAILED at 0
+  1 out of 1 hunks FAILED -- saving rejects to file foo.rej
+  patch failed to apply
+  abort: fix up the merge and run hg transplant --continue
+  [255]
+  $ hg transplant --continue
+  a1e30dd1b8e7 transplanted as f1563cf27039
+  $ hg transplant 1:3
+  skipping already applied revision 1:a1e30dd1b8e7
+  applying 1739ac5f6139
+  1739ac5f6139 transplanted to d649c221319f
+  applying 0282d5fbbe02
+  0282d5fbbe02 transplanted to 77418277ccb3
+  $ hg locate
+  added
+  bar
+  foo
+  $ cd ..
+
+Test transplant --merge (issue 1111)
+test transplant merge
+
+  $ hg init t1111
+  $ cd t1111
+  $ echo a > a
+  $ hg ci -Am adda
+  adding a
+  $ echo b >> a
+  $ hg ci -m appendb
+  $ echo c >> a
+  $ hg ci -m appendc
+  $ hg up -C 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo d >> a
+  $ hg ci -m appendd
+  created new head
+
+tranplant
+
+  $ hg transplant -m 1
+  applying 42dc4432fd35
+  1:42dc4432fd35 merged at a9f4acbac129
+  $ cd ..
+
+test transplant into empty repository
+
+  $ hg init empty
+  $ cd empty
+  $ hg transplant -s ../t -b tip -a
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 4 changesets with 4 changes to 4 files
+  $ cd ..
+
+
+test filter
+
+  $ hg init filter
+  $ cd filter
+  $ cat <<'EOF' >test-filter
+  > #!/bin/sh
+  > sed 's/r1/r2/' $1 > $1.new
+  > mv $1.new $1
+  > EOF
+  $ chmod +x test-filter
+  $ hg transplant -s ../t -b tip -a --filter ./test-filter
+  filtering * (glob)
+  applying 17ab29e464c6
+  17ab29e464c6 transplanted to e9ffc54ea104
+  filtering * (glob)
+  applying 37a1297eb21b
+  37a1297eb21b transplanted to 348b36d0b6a5
+  filtering * (glob)
+  applying 722f4667af76
+  722f4667af76 transplanted to 0aa6979afb95
+  filtering * (glob)
+  applying a53251cdf717
+  a53251cdf717 transplanted to 14f8512272b5
+  $ hg log --template '{rev} {parents} {desc}\n'
+  3  b3
+  2  b2
+  1  b1
+  0  r2
+  $ cd ..
+
+
+test filter with failed patch
+
+  $ cd filter
+  $ hg up 0
+  0 files updated, 0 files merged, 3 files removed, 0 files unresolved
+  $ echo foo > b1
+  $ hg ci -Am foo
+  adding b1
+  adding test-filter
+  created new head
+  $ hg transplant 1 --filter ./test-filter
+  filtering * (glob)
+  applying 348b36d0b6a5
+  file b1 already exists
+  1 out of 1 hunks FAILED -- saving rejects to file b1.rej
+  patch failed to apply
+  abort: fix up the merge and run hg transplant --continue
+  [255]
+  $ cd ..
+
+
+test with a win32ext like setup (differing EOLs)
+
+  $ hg init twin1
+  $ cd twin1
+  $ echo a > a
+  $ echo b > b
+  $ echo b >> b
+  $ hg ci -Am t
+  adding a
+  adding b
+  $ echo a > b
+  $ echo b >> b
+  $ hg ci -m changeb
+  $ cd ..
+
+  $ hg init twin2
+  $ cd twin2
+  $ echo '[patch]' >> .hg/hgrc
+  $ echo 'eol = crlf' >> .hg/hgrc
+  $ python -c "file('b', 'wb').write('b\r\nb\r\n')"
+  $ hg ci -m addb
+  nothing changed
+  [1]
+  $ hg transplant -s ../twin1 tip
+  applying 2e849d776c17
+  2e849d776c17 transplanted to 589cea8ba85b
+  $ python -c "print repr(file('b', 'rb').read())"
+  'a\r\nb\r\n'
+  $ cd ..
--- a/tests/test-unrelated-pull	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-#!/bin/sh
-
-mkdir a
-cd a
-hg init
-echo 123 > a
-hg add a
-hg commit -m "a" -u a -d "1000000 0"
-
-cd ..
-mkdir b
-cd b
-hg init
-echo 321 > b
-hg add b
-hg commit -m "b" -u b -d "1000000 0"
-
-hg pull ../a
-hg pull -f ../a
-hg heads
--- a/tests/test-unrelated-pull.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-pulling from ../a
-searching for changes
-abort: repository is unrelated
-pulling from ../a
-searching for changes
-warning: repository is unrelated
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files (+1 heads)
-(run 'hg heads' to see heads, 'hg merge' to merge)
-changeset:   1:bdcee5d51fa6
-tag:         tip
-parent:      -1:000000000000
-user:        a
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     a
-
-changeset:   0:f155ba1aa5ba
-user:        b
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     b
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-unrelated-pull.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,44 @@
+  $ mkdir a
+  $ cd a
+  $ hg init
+  $ echo 123 > a
+  $ hg add a
+  $ hg commit -m "a" -u a
+
+  $ cd ..
+  $ mkdir b
+  $ cd b
+  $ hg init
+  $ echo 321 > b
+  $ hg add b
+  $ hg commit -m "b" -u b
+
+  $ hg pull ../a
+  pulling from ../a
+  searching for changes
+  abort: repository is unrelated
+  [255]
+
+  $ hg pull -f ../a
+  pulling from ../a
+  searching for changes
+  warning: repository is unrelated
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files (+1 heads)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+
+  $ hg heads
+  changeset:   1:9a79c33a9db3
+  tag:         tip
+  parent:      -1:000000000000
+  user:        a
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     a
+  
+  changeset:   0:01f8062b2de5
+  user:        b
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     b
+  
--- a/tests/test-up-issue1456	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-#!/bin/sh
-
-rm -rf a
-hg init a
-cd a
-
-echo foo > foo
-hg ci -qAm0
-chmod +x foo
-hg ci -m1
-hg co -q 0
-echo dirty > foo
-hg up -c
-hg up -q
-cat foo
-hg st -A
-
-echo '% validate update of standalone execute bit change'
-hg up -C 0
-chmod -x foo
-hg ci -m removeexec
-hg up -C 0
-hg up
-hg st
--- a/tests/test-up-issue1456.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-abort: uncommitted local changes
-dirty
-M foo
-% validate update of standalone execute bit change
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-nothing changed
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
--- a/tests/test-up-local-change	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-#!/bin/sh
-
-HGMERGE=true; export HGMERGE
-
-set -e
-mkdir r1
-cd r1
-hg init
-echo a > a
-hg addremove
-hg commit -m "1" -d "1000000 0"
-
-hg clone . ../r2
-cd ../r2
-hg up
-echo abc > a
-hg diff --nodates
-
-cd ../r1
-echo b > b
-echo a2 > a
-hg addremove
-hg commit -m "2" -d "1000000 0"
-
-cd ../r2
-hg -q pull ../r1
-hg status
-hg parents
-hg --debug up
-hg parents
-hg --debug up 0
-hg parents
-hg --debug merge || echo failed
-hg parents
-hg --debug up
-hg parents
-hg -v history
-hg diff --nodates
-
-# create a second head
-cd ../r1
-hg up 0
-echo b2 > b
-echo a3 > a
-hg addremove
-hg commit -m "3" -d "1000000 0"
-
-cd ../r2
-hg -q pull ../r1
-hg status
-hg parents
-hg --debug up || echo failed
-hg --debug merge || echo failed
-hg --debug merge -f
-hg parents
-hg diff --nodates
-
-# test a local add
-cd ..
-hg init a
-hg init b
-echo a > a/a
-echo a > b/a
-hg --cwd a commit -A -m a
-cd b
-hg add a
-hg pull -u ../a
-hg st
--- a/tests/test-up-local-change.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,166 +0,0 @@
-adding a
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-diff -r 33aaa84a386b a
---- a/a
-+++ b/a
-@@ -1,1 +1,1 @@
--a
-+abc
-adding b
-M a
-changeset:   0:33aaa84a386b
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     1
-
-  searching for copies back to rev 1
-  unmatched files in other:
-   b
-resolving manifests
- overwrite False partial False
- ancestor 33aaa84a386b local 33aaa84a386b+ remote 802f095af299
- a: versions differ -> m
- b: remote created -> g
-preserving a for resolve of a
-updating: a 1/2 files (50.00%)
-picked tool 'true' for a (binary False symlink False)
-merging a
-my a@33aaa84a386b+ other a@802f095af299 ancestor a@33aaa84a386b
-updating: b 2/2 files (100.00%)
-getting b
-1 files updated, 1 files merged, 0 files removed, 0 files unresolved
-changeset:   1:802f095af299
-tag:         tip
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     2
-
-resolving manifests
- overwrite False partial False
- ancestor 802f095af299 local 802f095af299+ remote 33aaa84a386b
- a: versions differ -> m
- b: other deleted -> r
-preserving a for resolve of a
-updating: b 1/2 files (50.00%)
-removing b
-updating: a 2/2 files (100.00%)
-picked tool 'true' for a (binary False symlink False)
-merging a
-my a@802f095af299+ other a@33aaa84a386b ancestor a@802f095af299
-0 files updated, 1 files merged, 1 files removed, 0 files unresolved
-changeset:   0:33aaa84a386b
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     1
-
-abort: there is nothing to merge - use "hg update" instead
-failed
-changeset:   0:33aaa84a386b
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     1
-
-  searching for copies back to rev 1
-  unmatched files in other:
-   b
-resolving manifests
- overwrite False partial False
- ancestor 33aaa84a386b local 33aaa84a386b+ remote 802f095af299
- a: versions differ -> m
- b: remote created -> g
-preserving a for resolve of a
-updating: a 1/2 files (50.00%)
-picked tool 'true' for a (binary False symlink False)
-merging a
-my a@33aaa84a386b+ other a@802f095af299 ancestor a@33aaa84a386b
-updating: b 2/2 files (100.00%)
-getting b
-1 files updated, 1 files merged, 0 files removed, 0 files unresolved
-changeset:   1:802f095af299
-tag:         tip
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     2
-
-changeset:   1:802f095af299
-tag:         tip
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-files:       a b
-description:
-2
-
-
-changeset:   0:33aaa84a386b
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-files:       a
-description:
-1
-
-
-diff -r 802f095af299 a
---- a/a
-+++ b/a
-@@ -1,1 +1,1 @@
--a2
-+abc
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-adding b
-created new head
-M a
-changeset:   1:802f095af299
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     2
-
-abort: crosses branches (use 'hg merge' to merge or use 'hg update -C' to discard changes)
-failed
-abort: outstanding uncommitted changes (use 'hg status' to list changes)
-failed
-  searching for copies back to rev 1
-resolving manifests
- overwrite False partial False
- ancestor 33aaa84a386b local 802f095af299+ remote 030602aee63d
- a: versions differ -> m
- b: versions differ -> m
-preserving a for resolve of a
-preserving b for resolve of b
-updating: a 1/2 files (50.00%)
-picked tool 'true' for a (binary False symlink False)
-merging a
-my a@802f095af299+ other a@030602aee63d ancestor a@33aaa84a386b
-updating: b 2/2 files (100.00%)
-picked tool 'true' for b (binary False symlink False)
-merging b
-my b@802f095af299+ other b@030602aee63d ancestor b@000000000000
-0 files updated, 2 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-changeset:   1:802f095af299
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     2
-
-changeset:   2:030602aee63d
-tag:         tip
-parent:      0:33aaa84a386b
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     3
-
-diff -r 802f095af299 a
---- a/a
-+++ b/a
-@@ -1,1 +1,1 @@
--a2
-+abc
-adding a
-pulling from ../a
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-up-local-change.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,235 @@
+  $ HGMERGE=true; export HGMERGE
+
+  $ mkdir r1
+  $ cd r1
+  $ hg init
+  $ echo a > a
+  $ hg addremove
+  adding a
+  $ hg commit -m "1"
+
+  $ hg clone . ../r2
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd ../r2
+  $ hg up
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo abc > a
+  $ hg diff --nodates
+  diff -r c19d34741b0a a
+  --- a/a
+  +++ b/a
+  @@ -1,1 +1,1 @@
+  -a
+  +abc
+
+  $ cd ../r1
+  $ echo b > b
+  $ echo a2 > a
+  $ hg addremove
+  adding b
+  $ hg commit -m "2"
+
+  $ cd ../r2
+  $ hg -q pull ../r1
+  $ hg status
+  M a
+  $ hg parents
+  changeset:   0:c19d34741b0a
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     1
+  
+  $ hg --debug up
+    searching for copies back to rev 1
+    unmatched files in other:
+     b
+  resolving manifests
+   overwrite False partial False
+   ancestor c19d34741b0a local c19d34741b0a+ remote 1e71731e6fbb
+   a: versions differ -> m
+   b: remote created -> g
+  preserving a for resolve of a
+  updating: a 1/2 files (50.00%)
+  picked tool 'true' for a (binary False symlink False)
+  merging a
+  my a@c19d34741b0a+ other a@1e71731e6fbb ancestor a@c19d34741b0a
+  updating: b 2/2 files (100.00%)
+  getting b
+  1 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  $ hg parents
+  changeset:   1:1e71731e6fbb
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     2
+  
+  $ hg --debug up 0
+  resolving manifests
+   overwrite False partial False
+   ancestor 1e71731e6fbb local 1e71731e6fbb+ remote c19d34741b0a
+   a: versions differ -> m
+   b: other deleted -> r
+  preserving a for resolve of a
+  updating: b 1/2 files (50.00%)
+  removing b
+  updating: a 2/2 files (100.00%)
+  picked tool 'true' for a (binary False symlink False)
+  merging a
+  my a@1e71731e6fbb+ other a@c19d34741b0a ancestor a@1e71731e6fbb
+  0 files updated, 1 files merged, 1 files removed, 0 files unresolved
+  $ hg parents
+  changeset:   0:c19d34741b0a
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     1
+  
+  $ hg --debug merge
+  abort: there is nothing to merge - use "hg update" instead
+  [255]
+  $ hg parents
+  changeset:   0:c19d34741b0a
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     1
+  
+  $ hg --debug up
+    searching for copies back to rev 1
+    unmatched files in other:
+     b
+  resolving manifests
+   overwrite False partial False
+   ancestor c19d34741b0a local c19d34741b0a+ remote 1e71731e6fbb
+   a: versions differ -> m
+   b: remote created -> g
+  preserving a for resolve of a
+  updating: a 1/2 files (50.00%)
+  picked tool 'true' for a (binary False symlink False)
+  merging a
+  my a@c19d34741b0a+ other a@1e71731e6fbb ancestor a@c19d34741b0a
+  updating: b 2/2 files (100.00%)
+  getting b
+  1 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  $ hg parents
+  changeset:   1:1e71731e6fbb
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     2
+  
+  $ hg -v history
+  changeset:   1:1e71731e6fbb
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files:       a b
+  description:
+  2
+  
+  
+  changeset:   0:c19d34741b0a
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files:       a
+  description:
+  1
+  
+  
+  $ hg diff --nodates
+  diff -r 1e71731e6fbb a
+  --- a/a
+  +++ b/a
+  @@ -1,1 +1,1 @@
+  -a2
+  +abc
+
+
+create a second head
+
+  $ cd ../r1
+  $ hg up 0
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo b2 > b
+  $ echo a3 > a
+  $ hg addremove
+  adding b
+  $ hg commit -m "3"
+  created new head
+
+  $ cd ../r2
+  $ hg -q pull ../r1
+  $ hg status
+  M a
+  $ hg parents
+  changeset:   1:1e71731e6fbb
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     2
+  
+  $ hg --debug up
+  abort: crosses branches (use 'hg merge' to merge or use 'hg update -C' to discard changes)
+  [255]
+  $ hg --debug merge
+  abort: outstanding uncommitted changes (use 'hg status' to list changes)
+  [255]
+  $ hg --debug merge -f
+    searching for copies back to rev 1
+  resolving manifests
+   overwrite False partial False
+   ancestor c19d34741b0a local 1e71731e6fbb+ remote 83c51d0caff4
+   a: versions differ -> m
+   b: versions differ -> m
+  preserving a for resolve of a
+  preserving b for resolve of b
+  updating: a 1/2 files (50.00%)
+  picked tool 'true' for a (binary False symlink False)
+  merging a
+  my a@1e71731e6fbb+ other a@83c51d0caff4 ancestor a@c19d34741b0a
+  updating: b 2/2 files (100.00%)
+  picked tool 'true' for b (binary False symlink False)
+  merging b
+  my b@1e71731e6fbb+ other b@83c51d0caff4 ancestor b@000000000000
+  0 files updated, 2 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg parents
+  changeset:   1:1e71731e6fbb
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     2
+  
+  changeset:   2:83c51d0caff4
+  tag:         tip
+  parent:      0:c19d34741b0a
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     3
+  
+  $ hg diff --nodates
+  diff -r 1e71731e6fbb a
+  --- a/a
+  +++ b/a
+  @@ -1,1 +1,1 @@
+  -a2
+  +abc
+
+
+test a local add
+
+  $ cd ..
+  $ hg init a
+  $ hg init b
+  $ echo a > a/a
+  $ echo a > b/a
+  $ hg --cwd a commit -A -m a
+  adding a
+  $ cd b
+  $ hg add a
+  $ hg pull -u ../a
+  pulling from ../a
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg st
--- a/tests/test-update-branches	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-#!/bin/sh
-
-# Construct the following history tree:
-#
-# @  5:e1bb631146ca  b1
-# |
-# o  4:a4fdb3b883c4 0:b608b9236435  b1
-# |
-# | o  3:4b57d2520816 1:44592833ba9f
-# | |
-# | | o  2:063f31070f65
-# | |/
-# | o  1:44592833ba9f
-# |/
-# o  0:b608b9236435
-
-hg init
-echo foo > foo
-echo zero > a
-hg ci -qAm0
-echo one > a ; hg ci -m1
-echo two > a ; hg ci -m2
-hg up -q 1
-echo three > a ; hg ci -qm3
-hg up -q 0
-hg branch -q b1
-echo four > a ; hg ci -qm4
-echo five > a ; hg ci -qm5
-
-echo % initial repo state
-echo
-hg --config 'extensions.graphlog=' \
-    glog --template '{rev}:{node|short} {parents} {branches}\n'
-
-# Test helper functions.
-
-revtest () {
-    msg=$1
-    dirtyflag=$2   # 'clean' or 'dirty'
-    startrev=$3
-    targetrev=$4
-    opt=$5
-    echo % revtest $msg $startrev $targetrev
-    hg up -qC $startrev
-    test $dirtyflag = dirty && echo dirty > foo
-    hg up $opt $targetrev
-    hg parent --template 'parent={rev}\n'
-    hg stat
-}    
-
-norevtest () {
-    msg=$1
-    dirtyflag=$2   # 'clean' or 'dirty'
-    startrev=$3
-    opt=$4
-    echo % norevtest $msg $startrev
-    hg up -qC $startrev
-    test $dirtyflag = dirty && echo dirty > foo
-    hg up $opt
-    hg parent --template 'parent={rev}\n'
-    hg stat
-}    
-
-# Test cases are documented in a table in the update function of merge.py.
-# Cases are run as shown in that table, row by row.
-
-norevtest 'none clean linear' clean 4
-norevtest 'none clean same'   clean 2
-
-revtest 'none clean linear' clean 1 2
-revtest 'none clean same'   clean 2 3
-revtest 'none clean cross'  clean 3 4
-
-revtest 'none dirty linear' dirty 1 2
-revtest 'none dirty same'   dirty 2 3
-revtest 'none dirty cross'  dirty 3 4
-
-revtest '-C dirty linear'   dirty 1 2 -C
-revtest '-c dirty linear'   dirty 1 2 -c
-norevtest '-c clean same'   clean 2 -c
-revtest '-cC dirty linear'  dirty 1 2 -cC
--- a/tests/test-update-branches.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-% initial repo state
-
-@  5:e1bb631146ca  b1
-|
-o  4:a4fdb3b883c4 0:b608b9236435  b1
-|
-| o  3:4b57d2520816 1:44592833ba9f
-| |
-| | o  2:063f31070f65
-| |/
-| o  1:44592833ba9f
-|/
-o  0:b608b9236435
-
-% norevtest none clean linear 4
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-parent=5
-% norevtest none clean same 2
-abort: crosses branches (use 'hg merge' or use 'hg update -c')
-parent=2
-% revtest none clean linear 1 2
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-parent=2
-% revtest none clean same 2 3
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-parent=3
-% revtest none clean cross 3 4
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-parent=4
-% revtest none dirty linear 1 2
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-parent=2
-M foo
-% revtest none dirty same 2 3
-abort: crosses branches (use 'hg merge' to merge or use 'hg update -C' to discard changes)
-parent=2
-M foo
-% revtest none dirty cross 3 4
-abort: crosses branches (use 'hg merge' to merge or use 'hg update -C' to discard changes)
-parent=3
-M foo
-% revtest -C dirty linear 1 2
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-parent=2
-% revtest -c dirty linear 1 2
-abort: uncommitted local changes
-parent=1
-M foo
-% norevtest -c clean same 2
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-parent=3
-% revtest -cC dirty linear 1 2
-abort: cannot specify both -c/--check and -C/--clean
-parent=1
-M foo
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-update-branches.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,130 @@
+# Construct the following history tree:
+#
+# @  5:e1bb631146ca  b1
+# |
+# o  4:a4fdb3b883c4 0:b608b9236435  b1
+# |
+# | o  3:4b57d2520816 1:44592833ba9f
+# | |
+# | | o  2:063f31070f65
+# | |/
+# | o  1:44592833ba9f
+# |/
+# o  0:b608b9236435
+
+  $ hg init
+  $ echo foo > foo
+  $ echo zero > a
+  $ hg ci -qAm0
+  $ echo one > a ; hg ci -m1
+  $ echo two > a ; hg ci -m2
+  $ hg up -q 1
+  $ echo three > a ; hg ci -qm3
+  $ hg up -q 0
+  $ hg branch -q b1
+  $ echo four > a ; hg ci -qm4
+  $ echo five > a ; hg ci -qm5
+
+Initial repo state:
+
+  $ hg --config 'extensions.graphlog=' \
+  >    glog --template '{rev}:{node|short} {parents} {branches}\n'
+  @  5:e1bb631146ca  b1
+  |
+  o  4:a4fdb3b883c4 0:b608b9236435  b1
+  |
+  | o  3:4b57d2520816 1:44592833ba9f
+  | |
+  | | o  2:063f31070f65
+  | |/
+  | o  1:44592833ba9f
+  |/
+  o  0:b608b9236435
+  
+
+Test helper functions:
+
+  $ revtest () {
+  >     msg=$1
+  >     dirtyflag=$2   # 'clean' or 'dirty'
+  >     startrev=$3
+  >     targetrev=$4
+  >     opt=$5
+  >     hg up -qC $startrev
+  >     test $dirtyflag = dirty && echo dirty > foo
+  >     hg up $opt $targetrev
+  >     hg parent --template 'parent={rev}\n'
+  >     hg stat
+  > }    
+
+  $ norevtest () {
+  >     msg=$1
+  >     dirtyflag=$2   # 'clean' or 'dirty'
+  >     startrev=$3
+  >     opt=$4
+  >     hg up -qC $startrev
+  >     test $dirtyflag = dirty && echo dirty > foo
+  >     hg up $opt
+  >     hg parent --template 'parent={rev}\n'
+  >     hg stat
+  > }    
+
+Test cases are documented in a table in the update function of merge.py.
+Cases are run as shown in that table, row by row.
+
+  $ norevtest 'none clean linear' clean 4
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  parent=5
+
+  $ norevtest 'none clean same'   clean 2
+  abort: crosses branches (use 'hg merge' or use 'hg update -c')
+  parent=2
+
+
+  $ revtest 'none clean linear' clean 1 2
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  parent=2
+
+  $ revtest 'none clean same'   clean 2 3
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  parent=3
+
+  $ revtest 'none clean cross'  clean 3 4
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  parent=4
+
+
+  $ revtest 'none dirty linear' dirty 1 2
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  parent=2
+  M foo
+
+  $ revtest 'none dirty same'   dirty 2 3
+  abort: crosses branches (use 'hg merge' to merge or use 'hg update -C' to discard changes)
+  parent=2
+  M foo
+
+  $ revtest 'none dirty cross'  dirty 3 4
+  abort: crosses branches (use 'hg merge' to merge or use 'hg update -C' to discard changes)
+  parent=3
+  M foo
+
+
+  $ revtest '-C dirty linear'   dirty 1 2 -C
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  parent=2
+
+  $ revtest '-c dirty linear'   dirty 1 2 -c
+  abort: uncommitted local changes
+  parent=1
+  M foo
+
+  $ norevtest '-c clean same'   clean 2 -c
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  parent=3
+
+  $ revtest '-cC dirty linear'  dirty 1 2 -cC
+  abort: cannot specify both -c/--check and -C/--clean
+  parent=1
+  M foo
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-update-issue1456.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,33 @@
+  $ rm -rf a
+  $ hg init a
+  $ cd a
+
+  $ echo foo > foo
+  $ hg ci -qAm0
+  $ chmod +x foo
+  $ hg ci -m1
+  $ hg co -q 0
+  $ echo dirty > foo
+  $ hg up -c
+  abort: uncommitted local changes
+  [255]
+  $ hg up -q
+  $ cat foo
+  dirty
+  $ hg st -A
+  M foo
+
+Validate update of standalone execute bit change:
+
+  $ hg up -C 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ chmod -x foo
+  $ hg ci -m removeexec
+  nothing changed
+  [1]
+  $ hg up -C 0
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg up
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg st
+
--- a/tests/test-update-renames	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-#!/bin/sh
-
-# test update logic when there are renames
-
-
-# update with local changes across a file rename
-hg init a
-cd a
-echo a > a
-hg add a
-hg ci -m a
-hg mv a b
-hg ci -m rename
-echo b > b
-hg ci -m change
-hg up -q 0
-echo c > a
-hg up
-cd ..
--- a/tests/test-update-renames.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-merging a and b to b
-warning: conflicts during merge.
-merging b failed!
-0 files updated, 0 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-update-renames.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,30 @@
+Test update logic when there are renames
+
+Update with local changes across a file rename
+
+  $ hg init
+
+  $ echo a > a
+  $ hg add a
+  $ hg ci -m a
+
+  $ hg mv a b
+  $ hg ci -m rename
+
+  $ echo b > b
+  $ hg ci -m change
+
+  $ hg up -q 0
+
+  $ echo c > a
+
+  $ hg up
+  merging a and b to b
+  warning: conflicts during merge.
+  merging b failed!
+  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges
+  [1]
+
+  $ cd ..
+
--- a/tests/test-update-reverse	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-#!/bin/sh
-
-hg init
-touch a
-hg add a
-hg commit -m "Added a" -d "1000000 0"
-
-touch main
-hg add main
-hg commit -m "Added main" -d "1000000 0"
-hg checkout 0
-
-echo Main should be gone
-ls
-
-touch side1
-hg add side1
-hg commit -m "Added side1" -d "1000000 0"
-touch side2
-hg add side2
-hg commit -m "Added side2" -d "1000000 0"
-
-hg log
-
-echo Should have two heads, side2 and main
-hg heads
-
-echo Should show "a side1 side2"
-ls
-
-hg update --debug -C 1
-echo Should only show "a main"
-ls
-
--- a/tests/test-update-reverse.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-Main should be gone
-a
-created new head
-changeset:   3:ded32b0db104
-tag:         tip
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     Added side2
-
-changeset:   2:92a816cea698
-parent:      0:537353581d3d
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     Added side1
-
-changeset:   1:221226fb2bd8
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     Added main
-
-changeset:   0:537353581d3d
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     Added a
-
-Should have two heads, side2 and main
-changeset:   3:ded32b0db104
-tag:         tip
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     Added side2
-
-changeset:   1:221226fb2bd8
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     Added main
-
-Should show a side1 side2
-a
-side1
-side2
-resolving manifests
- overwrite True partial False
- ancestor ded32b0db104+ local ded32b0db104+ remote 221226fb2bd8
- side2: other deleted -> r
- side1: other deleted -> r
- main: remote created -> g
-updating: side1 1/3 files (33.33%)
-removing side1
-updating: side2 2/3 files (66.67%)
-removing side2
-updating: main 3/3 files (100.00%)
-getting main
-1 files updated, 0 files merged, 2 files removed, 0 files unresolved
-Should only show a main
-a
-main
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-update-reverse.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,85 @@
+  $ hg init
+
+  $ touch a
+  $ hg add a
+  $ hg commit -m "Added a"
+
+  $ touch main
+  $ hg add main
+  $ hg commit -m "Added main"
+  $ hg checkout 0
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+'main' should be gone:
+
+  $ ls
+  a
+
+  $ touch side1
+  $ hg add side1
+  $ hg commit -m "Added side1"
+  created new head
+  $ touch side2
+  $ hg add side2
+  $ hg commit -m "Added side2"
+
+  $ hg log
+  changeset:   3:91ebc10ed028
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     Added side2
+  
+  changeset:   2:b932d7dbb1e1
+  parent:      0:c2eda428b523
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     Added side1
+  
+  changeset:   1:71a760306caf
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     Added main
+  
+  changeset:   0:c2eda428b523
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     Added a
+  
+
+  $ hg heads
+  changeset:   3:91ebc10ed028
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     Added side2
+  
+  changeset:   1:71a760306caf
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     Added main
+  
+  $ ls
+  a
+  side1
+  side2
+
+  $ hg update --debug -C 1
+  resolving manifests
+   overwrite True partial False
+   ancestor 91ebc10ed028+ local 91ebc10ed028+ remote 71a760306caf
+   side2: other deleted -> r
+   side1: other deleted -> r
+   main: remote created -> g
+  updating: side1 1/3 files (33.33%)
+  removing side1
+  updating: side2 2/3 files (66.67%)
+  removing side2
+  updating: main 3/3 files (100.00%)
+  getting main
+  1 files updated, 0 files merged, 2 files removed, 0 files unresolved
+
+  $ ls
+  a
+  main
+
--- a/tests/test-url-rev	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-#!/bin/sh
-# test basic functionality of url#rev syntax
-
-hg init repo
-cd repo
-echo a > a
-hg ci -qAm 'add a'
-hg branch foo
-echo >> a
-hg ci -m 'change a'
-cd ..
-
-echo '% clone repo#foo'
-hg clone 'repo#foo' clone
-echo '% heads'
-hg --cwd clone heads
-echo '% parents'
-hg --cwd clone parents
-sed -e 's/default.*#/default = #/' clone/.hg/hgrc
-echo
-
-echo '% changing original repo'
-cd repo
-echo >> a
-hg ci -m 'new head of branch foo'
-hg up -qC default
-echo bar > bar
-hg ci -qAm 'add bar'
-hg log
-echo
-
-echo '% outgoing'
-hg -q outgoing '../clone#foo'
-echo
-
-echo '% push'
-hg -q push '../clone#foo'
-hg --cwd ../clone heads
-cd ..
-echo
-
-echo '% rolling back'
-cd clone
-hg rollback
-
-echo '% incoming'
-hg -q incoming
-
-echo '% pull'
-hg -q pull
-hg heads
-echo
-
-echo '% pull should not have updated'
-hg parents -q
-echo '% going back to the default branch'
-hg up -C 0
-hg parents
-echo '% no new revs, no update'
-hg pull -qu
-hg parents -q
-echo '% rollback'
-hg rollback
-hg up -C 0
-hg parents -q
-echo '% pull -u takes us back to branch foo'
-hg pull -qu
-hg parents
-
-echo '% rollback'
-hg rollback
-hg up -C 0
-echo '% parents'
-hg parents -q
-echo '% heads'
-hg heads -q
-echo '% pull -u -r otherrev url#rev updates to rev'
-hg pull -qur default default
-echo '% parents'
-hg parents
-echo '% heads'
-hg heads
-
--- a/tests/test-url-rev.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,148 +0,0 @@
-marked working directory as branch foo
-% clone repo#foo
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 2 changes to 1 files
-updating to branch foo
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% heads
-changeset:   1:cd2a86ecc814
-branch:      foo
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     change a
-
-changeset:   0:1f0dee641bb7
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     add a
-
-% parents
-changeset:   1:cd2a86ecc814
-branch:      foo
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     change a
-
-[paths]
-default = #foo
-
-% changing original repo
-changeset:   3:4cd725637392
-tag:         tip
-parent:      0:1f0dee641bb7
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     add bar
-
-changeset:   2:faba9097cad4
-branch:      foo
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     new head of branch foo
-
-changeset:   1:cd2a86ecc814
-branch:      foo
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     change a
-
-changeset:   0:1f0dee641bb7
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     add a
-
-
-% outgoing
-2:faba9097cad4
-
-% push
-changeset:   2:faba9097cad4
-branch:      foo
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     new head of branch foo
-
-changeset:   0:1f0dee641bb7
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     add a
-
-
-% rolling back
-rolling back to revision 1 (undo push)
-% incoming
-2:faba9097cad4
-% pull
-changeset:   2:faba9097cad4
-branch:      foo
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     new head of branch foo
-
-changeset:   0:1f0dee641bb7
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     add a
-
-
-% pull should not have updated
-1:cd2a86ecc814
-% going back to the default branch
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-changeset:   0:1f0dee641bb7
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     add a
-
-% no new revs, no update
-0:1f0dee641bb7
-% rollback
-rolling back to revision 1 (undo pull)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-0:1f0dee641bb7
-% pull -u takes us back to branch foo
-changeset:   2:faba9097cad4
-branch:      foo
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     new head of branch foo
-
-% rollback
-rolling back to revision 1 (undo pull)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% parents
-0:1f0dee641bb7
-% heads
-1:cd2a86ecc814
-0:1f0dee641bb7
-% pull -u -r otherrev url#rev updates to rev
-% parents
-changeset:   3:4cd725637392
-tag:         tip
-parent:      0:1f0dee641bb7
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     add bar
-
-% heads
-changeset:   3:4cd725637392
-tag:         tip
-parent:      0:1f0dee641bb7
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     add bar
-
-changeset:   2:faba9097cad4
-branch:      foo
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     new head of branch foo
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-url-rev.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,206 @@
+Test basic functionality of url#rev syntax
+
+  $ hg init repo
+  $ cd repo
+  $ echo a > a
+  $ hg ci -qAm 'add a'
+  $ hg branch foo
+  marked working directory as branch foo
+  $ echo >> a
+  $ hg ci -m 'change a'
+  $ cd ..
+
+  $ hg clone 'repo#foo' clone
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 1 files
+  updating to branch foo
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ hg --cwd clone heads
+  changeset:   1:cd2a86ecc814
+  branch:      foo
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     change a
+  
+  changeset:   0:1f0dee641bb7
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add a
+  
+  $ hg --cwd clone parents
+  changeset:   1:cd2a86ecc814
+  branch:      foo
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     change a
+  
+  $ cat clone/.hg/hgrc
+  [paths]
+  default = */repo#foo (glob)
+
+Changing original repo:
+
+  $ cd repo
+
+  $ echo >> a
+  $ hg ci -m 'new head of branch foo'
+
+  $ hg up -qC default
+  $ echo bar > bar
+  $ hg ci -qAm 'add bar'
+
+  $ hg log
+  changeset:   3:4cd725637392
+  tag:         tip
+  parent:      0:1f0dee641bb7
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add bar
+  
+  changeset:   2:faba9097cad4
+  branch:      foo
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     new head of branch foo
+  
+  changeset:   1:cd2a86ecc814
+  branch:      foo
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     change a
+  
+  changeset:   0:1f0dee641bb7
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add a
+  
+  $ hg -q outgoing '../clone#foo'
+  2:faba9097cad4
+
+  $ hg -q push '../clone#foo'
+
+  $ hg --cwd ../clone heads
+  changeset:   2:faba9097cad4
+  branch:      foo
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     new head of branch foo
+  
+  changeset:   0:1f0dee641bb7
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add a
+  
+  $ cd ..
+
+  $ cd clone
+  $ hg rollback
+  rolling back to revision 1 (undo push)
+
+  $ hg -q incoming
+  2:faba9097cad4
+
+  $ hg -q pull
+
+  $ hg heads
+  changeset:   2:faba9097cad4
+  branch:      foo
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     new head of branch foo
+  
+  changeset:   0:1f0dee641bb7
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add a
+  
+Pull should not have updated:
+
+  $ hg parents -q
+  1:cd2a86ecc814
+
+Going back to the default branch:
+
+  $ hg up -C 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ hg parents
+  changeset:   0:1f0dee641bb7
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add a
+  
+No new revs, no update:
+
+  $ hg pull -qu
+
+  $ hg parents -q
+  0:1f0dee641bb7
+
+  $ hg rollback
+  rolling back to revision 1 (undo pull)
+
+  $ hg up -C 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ hg parents -q
+  0:1f0dee641bb7
+
+Pull -u takes us back to branch foo:
+
+  $ hg pull -qu
+
+  $ hg parents
+  changeset:   2:faba9097cad4
+  branch:      foo
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     new head of branch foo
+  
+  $ hg rollback
+  rolling back to revision 1 (undo pull)
+
+  $ hg up -C 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ hg parents -q
+  0:1f0dee641bb7
+
+  $ hg heads -q
+  1:cd2a86ecc814
+  0:1f0dee641bb7
+
+  $ hg pull -qur default default
+
+  $ hg parents
+  changeset:   3:4cd725637392
+  tag:         tip
+  parent:      0:1f0dee641bb7
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add bar
+  
+  $ hg heads
+  changeset:   3:4cd725637392
+  tag:         tip
+  parent:      0:1f0dee641bb7
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add bar
+  
+  changeset:   2:faba9097cad4
+  branch:      foo
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     new head of branch foo
+  
+
--- a/tests/test-username-newline	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-#!/bin/sh
-#
-
-hg init foo
-cd foo
-touch a
-
-
-unset HGUSER
-echo "[ui]" >> .hg/hgrc
-echo "username= foo" >> .hg/hgrc
-echo "          bar1" >> .hg/hgrc
-
-hg ci -Am m
-
-rm .hg/hgrc
-
-HGUSER=`(echo foo; echo bar2)` hg ci -Am m
-
-hg ci -Am m -u "`(echo foo; echo bar3)`"
-
-true
--- a/tests/test-username-newline.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-adding a
-abort: username 'foo\nbar1' contains a newline
-
-abort: username 'foo\nbar2' contains a newline
-
-transaction abort!
-rollback completed
-abort: username 'foo\nbar3' contains a newline!
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-username-newline.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,25 @@
+  $ hg init
+  $ touch a
+
+  $ unset HGUSER
+  $ echo "[ui]" >> .hg/hgrc
+  $ echo "username= foo" >> .hg/hgrc
+  $ echo "          bar1" >> .hg/hgrc
+
+  $ hg ci -Am m
+  adding a
+  abort: username 'foo\nbar1' contains a newline
+  
+  [255]
+  $ rm .hg/hgrc
+
+  $ HGUSER=`(echo foo; echo bar2)` hg ci -Am m
+  abort: username 'foo\nbar2' contains a newline
+  
+  [255]
+  $ hg ci -Am m -u "`(echo foo; echo bar3)`"
+  transaction abort!
+  rollback completed
+  abort: username 'foo\nbar3' contains a newline!
+  [255]
+
--- a/tests/test-verify	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-#!/bin/sh
-
-echo % prepare repo
-hg init a
-cd a
-echo "some text" > FOO.txt
-echo "another text" > bar.txt
-echo "more text" > QUICK.txt
-hg add
-hg ci -mtest1
-
-echo
-echo % verify
-hg verify
-
-echo
-echo % verify with journal
-touch .hg/store/journal
-hg verify
-rm .hg/store/journal
-
-echo
-echo % introduce some bugs in repo
-cd .hg/store/data
-mv _f_o_o.txt.i X_f_o_o.txt.i
-mv bar.txt.i xbar.txt.i
-rm _q_u_i_c_k.txt.i
-
-echo
-echo % verify
-hg verify
-
-cd ..
-
-echo % test revlog corruption
-hg init b
-cd b
-
-touch a
-hg add a
-hg ci -m a
-
-echo 'corrupted' > b
-dd if=.hg/store/data/a.i of=start bs=1 count=20 2>/dev/null
-cat start b > .hg/store/data/a.i
-
-echo
-echo % verify
-hg verify
-
-cd ..
-
-echo % test revlog format 0
-
-"$TESTDIR/revlog-formatv0.py"
-cd formatv0
-hg verify
-
-exit 0
--- a/tests/test-verify.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-% prepare repo
-adding FOO.txt
-adding QUICK.txt
-adding bar.txt
-
-% verify
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-3 files, 1 changesets, 3 total revisions
-
-% verify with journal
-abandoned transaction found - run hg recover
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-3 files, 1 changesets, 3 total revisions
-
-% introduce some bugs in repo
-
-% verify
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
- data/FOO.txt.i@0: missing revlog!
- 0: empty or missing FOO.txt
- FOO.txt@0: f62022d3d590 in manifests not found
- data/QUICK.txt.i@0: missing revlog!
- 0: empty or missing QUICK.txt
- QUICK.txt@0: 88b857db8eba in manifests not found
- data/bar.txt.i@0: missing revlog!
- 0: empty or missing bar.txt
- bar.txt@0: 256559129457 in manifests not found
-3 files, 1 changesets, 0 total revisions
-9 integrity errors encountered!
-(first damaged changeset appears to be 0)
-% test revlog corruption
-
-% verify
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
- a@0: broken revlog! (index data/a.i is corrupted)
-warning: orphan revlog 'data/a.i'
-1 files, 1 changesets, 0 total revisions
-1 warnings encountered!
-1 integrity errors encountered!
-(first damaged changeset appears to be 0)
-% test revlog format 0
-repository uses revlog format 0
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 1 changesets, 1 total revisions
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-verify.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,101 @@
+prepare repo
+
+  $ hg init a
+  $ cd a
+  $ echo "some text" > FOO.txt
+  $ echo "another text" > bar.txt
+  $ echo "more text" > QUICK.txt
+  $ hg add
+  adding FOO.txt
+  adding QUICK.txt
+  adding bar.txt
+  $ hg ci -mtest1
+
+verify
+
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  3 files, 1 changesets, 3 total revisions
+
+verify with journal
+
+  $ touch .hg/store/journal
+  $ hg verify
+  abandoned transaction found - run hg recover
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  3 files, 1 changesets, 3 total revisions
+  $ rm .hg/store/journal
+
+introduce some bugs in repo
+
+  $ cd .hg/store/data
+  $ mv _f_o_o.txt.i X_f_o_o.txt.i
+  $ mv bar.txt.i xbar.txt.i
+  $ rm _q_u_i_c_k.txt.i
+
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+   data/FOO.txt.i@0: missing revlog!
+   0: empty or missing FOO.txt
+   FOO.txt@0: f62022d3d590 in manifests not found
+   data/QUICK.txt.i@0: missing revlog!
+   0: empty or missing QUICK.txt
+   QUICK.txt@0: 88b857db8eba in manifests not found
+   data/bar.txt.i@0: missing revlog!
+   0: empty or missing bar.txt
+   bar.txt@0: 256559129457 in manifests not found
+  3 files, 1 changesets, 0 total revisions
+  9 integrity errors encountered!
+  (first damaged changeset appears to be 0)
+  [1]
+
+  $ cd ..
+
+test revlog corruption
+
+  $ hg init b
+  $ cd b
+
+  $ touch a
+  $ hg add a
+  $ hg ci -m a
+
+  $ echo 'corrupted' > b
+  $ dd if=.hg/store/data/a.i of=start bs=1 count=20 2>/dev/null
+  $ cat start b > .hg/store/data/a.i
+
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+   a@0: broken revlog! (index data/a.i is corrupted)
+  warning: orphan revlog 'data/a.i'
+  1 files, 1 changesets, 0 total revisions
+  1 warnings encountered!
+  1 integrity errors encountered!
+  (first damaged changeset appears to be 0)
+  [1]
+
+  $ cd ..
+
+test revlog format 0
+
+  $ "$TESTDIR/revlog-formatv0.py"
+  $ cd formatv0
+  $ hg verify
+  repository uses revlog format 0
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 1 changesets, 1 total revisions
--- a/tests/test-walk	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,108 +0,0 @@
-#!/bin/sh
-
-debugwalk()
-{
-    echo "hg debugwalk $@"
-    hg debugwalk "$@"
-    echo
-}
-
-chdir()
-{
-    echo "cd $@"
-    cd "$@"
-    echo
-}
-
-mkdir t
-cd t
-hg init
-mkdir -p beans
-for b in kidney navy turtle borlotti black pinto; do
-    echo $b > beans/$b
-done
-mkdir -p mammals/Procyonidae
-for m in cacomistle coatimundi raccoon; do
-    echo $m > mammals/Procyonidae/$m
-done
-echo skunk > mammals/skunk
-echo fennel > fennel
-echo fenugreek > fenugreek
-echo fiddlehead > fiddlehead
-echo glob:glob > glob:glob
-hg addremove
-hg commit -m "commit #0" -d "1000000 0"
-debugwalk
-debugwalk -I.
-chdir mammals
-debugwalk
-debugwalk -X ../beans
-debugwalk -I '*k'
-debugwalk -I 'glob:*k'
-debugwalk -I 'relglob:*k'
-debugwalk -I 'relglob:*k' .
-debugwalk -I 're:.*k$'
-debugwalk -I 'relre:.*k$'
-debugwalk -I 'path:beans'
-debugwalk -I 'relpath:../beans'
-debugwalk .
-debugwalk -I.
-debugwalk Procyonidae
-chdir Procyonidae
-debugwalk .
-debugwalk ..
-chdir ..
-debugwalk ../beans
-debugwalk .
-debugwalk .hg
-debugwalk ../.hg
-chdir ..
-debugwalk -Ibeans
-debugwalk -I '{*,{b,m}*/*}k'
-debugwalk 'glob:mammals/../beans/b*'
-debugwalk '-X*/Procyonidae' mammals
-debugwalk path:mammals
-debugwalk ..
-debugwalk beans/../..
-debugwalk .hg
-debugwalk beans/../.hg
-debugwalk beans/../.hg/data
-debugwalk beans/.hg
-# Don't know how to test absolute paths without always getting a false
-# error.
-#debugwalk `pwd`/beans
-#debugwalk `pwd`/..
-debugwalk glob:\*
-debugwalk 'glob:**e'
-debugwalk 're:.*[kb]$'
-debugwalk path:beans/black
-debugwalk path:beans//black
-debugwalk relglob:Procyonidae
-debugwalk 'relglob:Procyonidae/**'
-debugwalk 'relglob:Procyonidae/**' fennel
-debugwalk beans 'glob:beans/*'
-debugwalk 'glob:mamm**'
-debugwalk 'glob:mamm**' fennel
-debugwalk 'glob:j*'
-debugwalk NOEXIST
-mkfifo fifo
-debugwalk fifo
-rm fenugreek
-debugwalk fenugreek
-hg rm fenugreek
-debugwalk fenugreek
-touch new
-debugwalk new
-
-mkdir ignored
-touch ignored/file
-echo '^ignored$' > .hgignore
-debugwalk ignored
-debugwalk ignored/file
-
-chdir ..
-debugwalk -R t t/mammals/skunk
-mkdir t2
-chdir t2
-debugwalk -R ../t ../t/mammals/skunk
-debugwalk --cwd ../t mammals/skunk
--- a/tests/test-walk.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,303 +0,0 @@
-adding beans/black
-adding beans/borlotti
-adding beans/kidney
-adding beans/navy
-adding beans/pinto
-adding beans/turtle
-adding fennel
-adding fenugreek
-adding fiddlehead
-adding glob:glob
-adding mammals/Procyonidae/cacomistle
-adding mammals/Procyonidae/coatimundi
-adding mammals/Procyonidae/raccoon
-adding mammals/skunk
-hg debugwalk 
-f  beans/black                     beans/black
-f  beans/borlotti                  beans/borlotti
-f  beans/kidney                    beans/kidney
-f  beans/navy                      beans/navy
-f  beans/pinto                     beans/pinto
-f  beans/turtle                    beans/turtle
-f  fennel                          fennel
-f  fenugreek                       fenugreek
-f  fiddlehead                      fiddlehead
-f  glob:glob                       glob:glob
-f  mammals/Procyonidae/cacomistle  mammals/Procyonidae/cacomistle
-f  mammals/Procyonidae/coatimundi  mammals/Procyonidae/coatimundi
-f  mammals/Procyonidae/raccoon     mammals/Procyonidae/raccoon
-f  mammals/skunk                   mammals/skunk
-
-hg debugwalk -I.
-f  beans/black                     beans/black
-f  beans/borlotti                  beans/borlotti
-f  beans/kidney                    beans/kidney
-f  beans/navy                      beans/navy
-f  beans/pinto                     beans/pinto
-f  beans/turtle                    beans/turtle
-f  fennel                          fennel
-f  fenugreek                       fenugreek
-f  fiddlehead                      fiddlehead
-f  glob:glob                       glob:glob
-f  mammals/Procyonidae/cacomistle  mammals/Procyonidae/cacomistle
-f  mammals/Procyonidae/coatimundi  mammals/Procyonidae/coatimundi
-f  mammals/Procyonidae/raccoon     mammals/Procyonidae/raccoon
-f  mammals/skunk                   mammals/skunk
-
-cd mammals
-
-hg debugwalk 
-f  beans/black                     ../beans/black
-f  beans/borlotti                  ../beans/borlotti
-f  beans/kidney                    ../beans/kidney
-f  beans/navy                      ../beans/navy
-f  beans/pinto                     ../beans/pinto
-f  beans/turtle                    ../beans/turtle
-f  fennel                          ../fennel
-f  fenugreek                       ../fenugreek
-f  fiddlehead                      ../fiddlehead
-f  glob:glob                       ../glob:glob
-f  mammals/Procyonidae/cacomistle  Procyonidae/cacomistle
-f  mammals/Procyonidae/coatimundi  Procyonidae/coatimundi
-f  mammals/Procyonidae/raccoon     Procyonidae/raccoon
-f  mammals/skunk                   skunk
-
-hg debugwalk -X ../beans
-f  fennel                          ../fennel
-f  fenugreek                       ../fenugreek
-f  fiddlehead                      ../fiddlehead
-f  glob:glob                       ../glob:glob
-f  mammals/Procyonidae/cacomistle  Procyonidae/cacomistle
-f  mammals/Procyonidae/coatimundi  Procyonidae/coatimundi
-f  mammals/Procyonidae/raccoon     Procyonidae/raccoon
-f  mammals/skunk                   skunk
-
-hg debugwalk -I *k
-f  mammals/skunk  skunk
-
-hg debugwalk -I glob:*k
-f  mammals/skunk  skunk
-
-hg debugwalk -I relglob:*k
-f  beans/black    ../beans/black
-f  fenugreek      ../fenugreek
-f  mammals/skunk  skunk
-
-hg debugwalk -I relglob:*k .
-f  mammals/skunk  skunk
-
-hg debugwalk -I re:.*k$
-f  beans/black    ../beans/black
-f  fenugreek      ../fenugreek
-f  mammals/skunk  skunk
-
-hg debugwalk -I relre:.*k$
-f  beans/black    ../beans/black
-f  fenugreek      ../fenugreek
-f  mammals/skunk  skunk
-
-hg debugwalk -I path:beans
-f  beans/black     ../beans/black
-f  beans/borlotti  ../beans/borlotti
-f  beans/kidney    ../beans/kidney
-f  beans/navy      ../beans/navy
-f  beans/pinto     ../beans/pinto
-f  beans/turtle    ../beans/turtle
-
-hg debugwalk -I relpath:../beans
-f  beans/black     ../beans/black
-f  beans/borlotti  ../beans/borlotti
-f  beans/kidney    ../beans/kidney
-f  beans/navy      ../beans/navy
-f  beans/pinto     ../beans/pinto
-f  beans/turtle    ../beans/turtle
-
-hg debugwalk .
-f  mammals/Procyonidae/cacomistle  Procyonidae/cacomistle
-f  mammals/Procyonidae/coatimundi  Procyonidae/coatimundi
-f  mammals/Procyonidae/raccoon     Procyonidae/raccoon
-f  mammals/skunk                   skunk
-
-hg debugwalk -I.
-f  mammals/Procyonidae/cacomistle  Procyonidae/cacomistle
-f  mammals/Procyonidae/coatimundi  Procyonidae/coatimundi
-f  mammals/Procyonidae/raccoon     Procyonidae/raccoon
-f  mammals/skunk                   skunk
-
-hg debugwalk Procyonidae
-f  mammals/Procyonidae/cacomistle  Procyonidae/cacomistle
-f  mammals/Procyonidae/coatimundi  Procyonidae/coatimundi
-f  mammals/Procyonidae/raccoon     Procyonidae/raccoon
-
-cd Procyonidae
-
-hg debugwalk .
-f  mammals/Procyonidae/cacomistle  cacomistle
-f  mammals/Procyonidae/coatimundi  coatimundi
-f  mammals/Procyonidae/raccoon     raccoon
-
-hg debugwalk ..
-f  mammals/Procyonidae/cacomistle  cacomistle
-f  mammals/Procyonidae/coatimundi  coatimundi
-f  mammals/Procyonidae/raccoon     raccoon
-f  mammals/skunk                   ../skunk
-
-cd ..
-
-hg debugwalk ../beans
-f  beans/black     ../beans/black
-f  beans/borlotti  ../beans/borlotti
-f  beans/kidney    ../beans/kidney
-f  beans/navy      ../beans/navy
-f  beans/pinto     ../beans/pinto
-f  beans/turtle    ../beans/turtle
-
-hg debugwalk .
-f  mammals/Procyonidae/cacomistle  Procyonidae/cacomistle
-f  mammals/Procyonidae/coatimundi  Procyonidae/coatimundi
-f  mammals/Procyonidae/raccoon     Procyonidae/raccoon
-f  mammals/skunk                   skunk
-
-hg debugwalk .hg
-abort: path 'mammals/.hg' is inside repo 'mammals'
-
-hg debugwalk ../.hg
-abort: path contains illegal component: .hg
-
-cd ..
-
-hg debugwalk -Ibeans
-f  beans/black     beans/black
-f  beans/borlotti  beans/borlotti
-f  beans/kidney    beans/kidney
-f  beans/navy      beans/navy
-f  beans/pinto     beans/pinto
-f  beans/turtle    beans/turtle
-
-hg debugwalk -I {*,{b,m}*/*}k
-f  beans/black    beans/black
-f  fenugreek      fenugreek
-f  mammals/skunk  mammals/skunk
-
-hg debugwalk glob:mammals/../beans/b*
-f  beans/black     beans/black
-f  beans/borlotti  beans/borlotti
-
-hg debugwalk -X*/Procyonidae mammals
-f  mammals/skunk  mammals/skunk
-
-hg debugwalk path:mammals
-f  mammals/Procyonidae/cacomistle  mammals/Procyonidae/cacomistle
-f  mammals/Procyonidae/coatimundi  mammals/Procyonidae/coatimundi
-f  mammals/Procyonidae/raccoon     mammals/Procyonidae/raccoon
-f  mammals/skunk                   mammals/skunk
-
-hg debugwalk ..
-abort: .. not under root
-
-hg debugwalk beans/../..
-abort: beans/../.. not under root
-
-hg debugwalk .hg
-abort: path contains illegal component: .hg
-
-hg debugwalk beans/../.hg
-abort: path contains illegal component: .hg
-
-hg debugwalk beans/../.hg/data
-abort: path contains illegal component: .hg/data
-
-hg debugwalk beans/.hg
-abort: path 'beans/.hg' is inside repo 'beans'
-
-hg debugwalk glob:*
-f  fennel      fennel
-f  fenugreek   fenugreek
-f  fiddlehead  fiddlehead
-f  glob:glob   glob:glob
-
-hg debugwalk glob:**e
-f  beans/turtle                    beans/turtle
-f  mammals/Procyonidae/cacomistle  mammals/Procyonidae/cacomistle
-
-hg debugwalk re:.*[kb]$
-f  beans/black    beans/black
-f  fenugreek      fenugreek
-f  glob:glob      glob:glob
-f  mammals/skunk  mammals/skunk
-
-hg debugwalk path:beans/black
-f  beans/black  beans/black  exact
-
-hg debugwalk path:beans//black
-f  beans/black  beans/black  exact
-
-hg debugwalk relglob:Procyonidae
-
-hg debugwalk relglob:Procyonidae/**
-f  mammals/Procyonidae/cacomistle  mammals/Procyonidae/cacomistle
-f  mammals/Procyonidae/coatimundi  mammals/Procyonidae/coatimundi
-f  mammals/Procyonidae/raccoon     mammals/Procyonidae/raccoon
-
-hg debugwalk relglob:Procyonidae/** fennel
-f  fennel                          fennel                          exact
-f  mammals/Procyonidae/cacomistle  mammals/Procyonidae/cacomistle
-f  mammals/Procyonidae/coatimundi  mammals/Procyonidae/coatimundi
-f  mammals/Procyonidae/raccoon     mammals/Procyonidae/raccoon
-
-hg debugwalk beans glob:beans/*
-f  beans/black     beans/black
-f  beans/borlotti  beans/borlotti
-f  beans/kidney    beans/kidney
-f  beans/navy      beans/navy
-f  beans/pinto     beans/pinto
-f  beans/turtle    beans/turtle
-
-hg debugwalk glob:mamm**
-f  mammals/Procyonidae/cacomistle  mammals/Procyonidae/cacomistle
-f  mammals/Procyonidae/coatimundi  mammals/Procyonidae/coatimundi
-f  mammals/Procyonidae/raccoon     mammals/Procyonidae/raccoon
-f  mammals/skunk                   mammals/skunk
-
-hg debugwalk glob:mamm** fennel
-f  fennel                          fennel                          exact
-f  mammals/Procyonidae/cacomistle  mammals/Procyonidae/cacomistle
-f  mammals/Procyonidae/coatimundi  mammals/Procyonidae/coatimundi
-f  mammals/Procyonidae/raccoon     mammals/Procyonidae/raccoon
-f  mammals/skunk                   mammals/skunk
-
-hg debugwalk glob:j*
-
-hg debugwalk NOEXIST
-NOEXIST: No such file or directory
-
-hg debugwalk fifo
-fifo: unsupported file type (type is fifo)
-
-hg debugwalk fenugreek
-f  fenugreek  fenugreek  exact
-
-hg debugwalk fenugreek
-f  fenugreek  fenugreek  exact
-
-hg debugwalk new
-f  new  new  exact
-
-hg debugwalk ignored
-
-hg debugwalk ignored/file
-f  ignored/file  ignored/file  exact
-
-cd ..
-
-hg debugwalk -R t t/mammals/skunk
-f  mammals/skunk  t/mammals/skunk  exact
-
-cd t2
-
-hg debugwalk -R ../t ../t/mammals/skunk
-f  mammals/skunk  ../t/mammals/skunk  exact
-
-hg debugwalk --cwd ../t mammals/skunk
-f  mammals/skunk  mammals/skunk  exact
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-walk.t	Wed Sep 22 18:29:41 2010 -0500
@@ -0,0 +1,306 @@
+  $ mkdir t
+  $ cd t
+  $ hg init
+  $ mkdir -p beans
+  $ for b in kidney navy turtle borlotti black pinto; do
+  >     echo $b > beans/$b
+  $ done
+  $ mkdir -p mammals/Procyonidae
+  $ for m in cacomistle coatimundi raccoon; do
+  >     echo $m > mammals/Procyonidae/$m
+  $ done
+  $ echo skunk > mammals/skunk
+  $ echo fennel > fennel
+  $ echo fenugreek > fenugreek
+  $ echo fiddlehead > fiddlehead
+  $ echo glob:glob > glob:glob
+  $ hg addremove
+  adding beans/black
+  adding beans/borlotti
+  adding beans/kidney
+  adding beans/navy
+  adding beans/pinto
+  adding beans/turtle
+  adding fennel
+  adding fenugreek
+  adding fiddlehead
+  adding glob:glob
+  adding mammals/Procyonidae/cacomistle
+  adding mammals/Procyonidae/coatimundi
+  adding mammals/Procyonidae/raccoon
+  adding mammals/skunk
+  $ hg commit -m "commit #0"
+
+  $ hg debugwalk
+  f  beans/black                     beans/black
+  f  beans/borlotti                  beans/borlotti
+  f  beans/kidney                    beans/kidney
+  f  beans/navy                      beans/navy
+  f  beans/pinto                     beans/pinto
+  f  beans/turtle                    beans/turtle
+  f  fennel                          fennel
+  f  fenugreek                       fenugreek
+  f  fiddlehead                      fiddlehead
+  f  glob:glob                       glob:glob
+  f  mammals/Procyonidae/cacomistle  mammals/Procyonidae/cacomistle
+  f  mammals/Procyonidae/coatimundi  mammals/Procyonidae/coatimundi
+  f  mammals/Procyonidae/raccoon     mammals/Procyonidae/raccoon
+  f  mammals/skunk                   mammals/skunk
+  $ hg debugwalk -I.
+  f  beans/black                     beans/black
+  f  beans/borlotti                  beans/borlotti
+  f  beans/kidney                    beans/kidney
+  f  beans/navy                      beans/navy
+  f  beans/pinto                     beans/pinto
+  f  beans/turtle                    beans/turtle
+  f  fennel                          fennel
+  f  fenugreek                       fenugreek
+  f  fiddlehead                      fiddlehead
+  f  glob:glob                       glob:glob
+  f  mammals/Procyonidae/cacomistle  mammals/Procyonidae/cacomistle
+  f  mammals/Procyonidae/coatimundi  mammals/Procyonidae/coatimundi
+  f  mammals/Procyonidae/raccoon     mammals/Procyonidae/raccoon
+  f  mammals/skunk                   mammals/skunk
+
+  $ cd mammals
+  $ hg debugwalk
+  f  beans/black                     ../beans/black
+  f  beans/borlotti                  ../beans/borlotti
+  f  beans/kidney                    ../beans/kidney
+  f  beans/navy                      ../beans/navy
+  f  beans/pinto                     ../beans/pinto
+  f  beans/turtle                    ../beans/turtle
+  f  fennel                          ../fennel
+  f  fenugreek                       ../fenugreek
+  f  fiddlehead                      ../fiddlehead
+  f  glob:glob                       ../glob:glob
+  f  mammals/Procyonidae/cacomistle  Procyonidae/cacomistle
+  f  mammals/Procyonidae/coatimundi  Procyonidae/coatimundi
+  f  mammals/Procyonidae/raccoon     Procyonidae/raccoon
+  f  mammals/skunk                   skunk
+  $ hg debugwalk -X ../beans
+  f  fennel                          ../fennel
+  f  fenugreek                       ../fenugreek
+  f  fiddlehead                      ../fiddlehead
+  f  glob:glob                       ../glob:glob
+  f  mammals/Procyonidae/cacomistle  Procyonidae/cacomistle
+  f  mammals/Procyonidae/coatimundi  Procyonidae/coatimundi
+  f  mammals/Procyonidae/raccoon     Procyonidae/raccoon
+  f  mammals/skunk                   skunk
+  $ hg debugwalk -I '*k'
+  f  mammals/skunk  skunk
+  $ hg debugwalk -I 'glob:*k'
+  f  mammals/skunk  skunk
+  $ hg debugwalk -I 'relglob:*k'
+  f  beans/black    ../beans/black
+  f  fenugreek      ../fenugreek
+  f  mammals/skunk  skunk
+  $ hg debugwalk -I 'relglob:*k' .
+  f  mammals/skunk  skunk
+  $ hg debugwalk -I 're:.*k$'
+  f  beans/black    ../beans/black
+  f  fenugreek      ../fenugreek
+  f  mammals/skunk  skunk
+  $ hg debugwalk -I 'relre:.*k$'
+  f  beans/black    ../beans/black
+  f  fenugreek      ../fenugreek
+  f  mammals/skunk  skunk
+  $ hg debugwalk -I 'path:beans'
+  f  beans/black     ../beans/black
+  f  beans/borlotti  ../beans/borlotti
+  f  beans/kidney    ../beans/kidney
+  f  beans/navy      ../beans/navy
+  f  beans/pinto     ../beans/pinto
+  f  beans/turtle    ../beans/turtle
+  $ hg debugwalk -I 'relpath:../beans'
+  f  beans/black     ../beans/black
+  f  beans/borlotti  ../beans/borlotti
+  f  beans/kidney    ../beans/kidney
+  f  beans/navy      ../beans/navy
+  f  beans/pinto     ../beans/pinto
+  f  beans/turtle    ../beans/turtle
+  $ hg debugwalk .
+  f  mammals/Procyonidae/cacomistle  Procyonidae/cacomistle
+  f  mammals/Procyonidae/coatimundi  Procyonidae/coatimundi
+  f  mammals/Procyonidae/raccoon     Procyonidae/raccoon
+  f  mammals/skunk                   skunk
+  $ hg debugwalk -I.
+  f  mammals/Procyonidae/cacomistle  Procyonidae/cacomistle
+  f  mammals/Procyonidae/coatimundi  Procyonidae/coatimundi
+  f  mammals/Procyonidae/raccoon     Procyonidae/raccoon
+  f  mammals/skunk                   skunk
+  $ hg debugwalk Procyonidae
+  f  mammals/Procyonidae/cacomistle  Procyonidae/cacomistle
+  f  mammals/Procyonidae/coatimundi  Procyonidae/coatimundi
+  f  mammals/Procyonidae/raccoon     Procyonidae/raccoon
+
+  $ cd Procyonidae
+  $ hg debugwalk .
+  f  mammals/Procyonidae/cacomistle  cacomistle
+  f  mammals/Procyonidae/coatimundi  coatimundi
+  f  mammals/Procyonidae/raccoon     raccoon
+  $ hg debugwalk ..
+  f  mammals/Procyonidae/cacomistle  cacomistle
+  f  mammals/Procyonidae/coatimundi  coatimundi
+  f  mammals/Procyonidae/raccoon     raccoon
+  f  mammals/skunk                   ../skunk
+  $ cd ..
+
+  $ hg debugwalk ../beans
+  f  beans/black     ../beans/black
+  f  beans/borlotti  ../beans/borlotti
+  f  beans/kidney    ../beans/kidney
+  f  beans/navy      ../beans/navy
+  f  beans/pinto     ../beans/pinto
+  f  beans/turtle    ../beans/turtle
+  $ hg debugwalk .
+  f  mammals/Procyonidae/cacomistle  Procyonidae/cacomistle
+  f  mammals/Procyonidae/coatimundi  Procyonidae/coatimundi
+  f  mammals/Procyonidae/raccoon     Procyonidae/raccoon
+  f  mammals/skunk                   skunk
+  $ hg debugwalk .hg
+  abort: path 'mammals/.hg' is inside repo 'mammals'
+  [255]
+  $ hg debugwalk ../.hg
+  abort: path contains illegal component: .hg
+  [255]
+  $ cd ..
+
+  $ hg debugwalk -Ibeans
+  f  beans/black     beans/black
+  f  beans/borlotti  beans/borlotti
+  f  beans/kidney    beans/kidney
+  f  beans/navy      beans/navy
+  f  beans/pinto     beans/pinto
+  f  beans/turtle    beans/turtle
+  $ hg debugwalk -I '{*,{b,m}*/*}k'
+  f  beans/black    beans/black
+  f  fenugreek      fenugreek
+  f  mammals/skunk  mammals/skunk
+  $ hg debugwalk 'glob:mammals/../beans/b*'
+  f  beans/black     beans/black
+  f  beans/borlotti  beans/borlotti
+  $ hg debugwalk '-X*/Procyonidae' mammals
+  f  mammals/skunk  mammals/skunk
+  $ hg debugwalk path:mammals
+  f  mammals/Procyonidae/cacomistle  mammals/Procyonidae/cacomistle
+  f  mammals/Procyonidae/coatimundi  mammals/Procyonidae/coatimundi
+  f  mammals/Procyonidae/raccoon     mammals/Procyonidae/raccoon
+  f  mammals/skunk                   mammals/skunk
+  $ hg debugwalk ..
+  abort: .. not under root
+  [255]
+  $ hg debugwalk beans/../..
+  abort: beans/../.. not under root
+  [255]
+  $ hg debugwalk .hg
+  abort: path contains illegal component: .hg
+  [255]
+  $ hg debugwalk beans/../.hg
+  abort: path contains illegal component: .hg
+  [255]
+  $ hg debugwalk beans/../.hg/data
+  abort: path contains illegal component: .hg/data
+  [255]
+  $ hg debugwalk beans/.hg
+  abort: path 'beans/.hg' is inside repo 'beans'
+  [255]
+
+Test absolute paths:
+
+  $ hg debugwalk `pwd`/beans
+  f  beans/black     beans/black
+  f  beans/borlotti  beans/borlotti
+  f  beans/kidney    beans/kidney
+  f  beans/navy      beans/navy
+  f  beans/pinto     beans/pinto
+  f  beans/turtle    beans/turtle
+  $ hg debugwalk `pwd`/..
+  abort: */.. not under root (glob)
+  [255]
+
+Test patterns:
+
+  $ hg debugwalk glob:\*
+  f  fennel      fennel
+  f  fenugreek   fenugreek
+  f  fiddlehead  fiddlehead
+  f  glob:glob   glob:glob
+
+  $ hg debugwalk 'glob:**e'
+  f  beans/turtle                    beans/turtle
+  f  mammals/Procyonidae/cacomistle  mammals/Procyonidae/cacomistle
+
+  $ hg debugwalk 're:.*[kb]$'
+  f  beans/black    beans/black
+  f  fenugreek      fenugreek
+  f  glob:glob      glob:glob
+  f  mammals/skunk  mammals/skunk
+
+  $ hg debugwalk path:beans/black
+  f  beans/black  beans/black  exact
+  $ hg debugwalk path:beans//black
+  f  beans/black  beans/black  exact
+
+  $ hg debugwalk relglob:Procyonidae
+  $ hg debugwalk 'relglob:Procyonidae/**'
+  f  mammals/Procyonidae/cacomistle  mammals/Procyonidae/cacomistle
+  f  mammals/Procyonidae/coatimundi  mammals/Procyonidae/coatimundi
+  f  mammals/Procyonidae/raccoon     mammals/Procyonidae/raccoon
+  $ hg debugwalk 'relglob:Procyonidae/**' fennel
+  f  fennel                          fennel                          exact
+  f  mammals/Procyonidae/cacomistle  mammals/Procyonidae/cacomistle
+  f  mammals/Procyonidae/coatimundi  mammals/Procyonidae/coatimundi
+  f  mammals/Procyonidae/raccoon     mammals/Procyonidae/raccoon
+  $ hg debugwalk beans 'glob:beans/*'
+  f  beans/black     beans/black
+  f  beans/borlotti  beans/borlotti
+  f  beans/kidney    beans/kidney
+  f  beans/navy      beans/navy
+  f  beans/pinto     beans/pinto
+  f  beans/turtle    beans/turtle
+  $ hg debugwalk 'glob:mamm**'
+  f  mammals/Procyonidae/cacomistle  mammals/Procyonidae/cacomistle
+  f  mammals/Procyonidae/coatimundi  mammals/Procyonidae/coatimundi
+  f  mammals/Procyonidae/raccoon     mammals/Procyonidae/raccoon
+  f  mammals/skunk                   mammals/skunk
+  $ hg debugwalk 'glob:mamm**' fennel
+  f  fennel                          fennel                          exact
+  f  mammals/Procyonidae/cacomistle  mammals/Procyonidae/cacomistle
+  f  mammals/Procyonidae/coatimundi  mammals/Procyonidae/coatimundi
+  f  mammals/Procyonidae/raccoon     mammals/Procyonidae/raccoon
+  f  mammals/skunk                   mammals/skunk
+  $ hg debugwalk 'glob:j*'
+  $ hg debugwalk NOEXIST
+  NOEXIST: No such file or directory
+
+  $ mkfifo fifo
+  $ hg debugwalk fifo
+  fifo: unsupported file type (type is fifo)
+
+  $ rm fenugreek
+  $ hg debugwalk fenugreek
+  f  fenugreek  fenugreek  exact
+  $ hg rm fenugreek
+  $ hg debugwalk fenugreek
+  f  fenugreek  fenugreek  exact
+  $ touch new
+  $ hg debugwalk new
+  f  new  new  exact
+
+  $ mkdir ignored
+  $ touch ignored/file
+  $ echo '^ignored$' > .hgignore
+  $ hg debugwalk ignored
+  $ hg debugwalk ignored/file
+  f  ignored/file  ignored/file  exact
+
+  $ cd ..
+  $ hg debugwalk -R t t/mammals/skunk
+  f  mammals/skunk  t/mammals/skunk  exact
+  $ mkdir t2
+  $ cd t2
+  $ hg debugwalk -R ../t ../t/mammals/skunk
+  f  mammals/skunk  ../t/mammals/skunk  exact
+  $ hg debugwalk --cwd ../t mammals/skunk
+  f  mammals/skunk  mammals/skunk  exact
--- a/tests/test-webraw	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-#!/bin/sh
-
-hg init test
-cd test
-mkdir sub
-cat >'sub/some "text".txt' <<ENDSOME
-This is just some random text
-that will go inside the file and take a few lines.
-It is very boring to read, but computers don't
-care about things like that.
-ENDSOME
-hg add 'sub/some "text".txt'
-hg commit -d "1 0" -m "Just some text"
-hg serve -p $HGPORT -A access.log -E error.log -d --pid-file=hg.pid
-cat hg.pid >> $DAEMON_PIDS
-("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/?f=a23bf1310f6e;file=sub/some%20%22text%22.txt;style=raw' content-type content-length content-disposition) >getoutput.txt &
-
-sleep 5
-kill `cat hg.pid`
-sleep 1 # wait for server to scream and die
-cat getoutput.txt
-cat access.log error.log | \
-  sed 's/^[^ ]*\( [^[]*\[\)[^]]*\(\].*\)$/host\1date\2/'
--- a/tests/test-webraw.out	Wed Sep 22 17:13:49 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-200 Script output follows
-content-type: text/plain; charset="ascii"
-content-length: 157
-content-disposition: inline; filename="some \"text\".txt"
-
-This is just some random text
-that will go inside the file and take a few lines.
-It is very boring to read, but computers don't
-care about things like that.
-host - - [date] "GET /?f=a23bf1310f6e;file=sub/some%20%22text%22.txt;style=raw HTTP/1.1" 200 -