Commits

David Carr committed 6fe4b9f

snapshot latest submissions

Comments (0)

Files changed (18)

fake-overlay.diff

+# HG changeset patch
+# Parent bff92a208c3f336edb3b0666150d87f988023aa6
+overlaychangectx: fix compatibility with mercurial 2.4-rc (no attribute _repo)
+
+This isn't a real implementation of phases support.  Rather, it's just enough
+to avoid the traceback.
+
+Traceback (most recent call last):
+  File "/usr/local/share/python/hg", line 38, in <module>
+    mercurial.dispatch.run()
+  File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line 28, in run
+    sys.exit((dispatch(request(sys.argv[1:])) or 0) & 255)
+  File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line 65, in dispatch
+    return _runcatch(req)
+  File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line 88, in _runcatch
+    return _dispatch(req)
+  File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line 741, in _dispatch
+    cmdpats, cmdoptions)
+  File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line 514, in runcommand
+    ret = _runcommand(ui, options, cmd, d)
+  File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line 831, in _runcommand
+    return checkargs()
+  File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line 802, in checkargs
+    return cmdfunc()
+  File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line 738, in <lambda>
+    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
+  File "/usr/local/lib/python2.7/site-packages/mercurial/util.py", line 472, in check
+    return func(*args, **kwargs)
+  File "/usr/local/lib/python2.7/site-packages/mercurial/commands.py", line 3942, in incoming
+    return hg.incoming(ui, repo, source, opts)
+  File "/usr/local/lib/python2.7/site-packages/mercurial/hg.py", line 525, in incoming
+    return _incoming(display, subreporecurse, ui, repo, source, opts)
+  File "/usr/local/lib/python2.7/site-packages/mercurial/hg.py", line 494, in _incoming
+    displaychlist(other, chlist, displayer)
+  File "/usr/local/lib/python2.7/site-packages/mercurial/hg.py", line 524, in display
+    displayer.show(other[n])
+  File "/usr/local/lib/python2.7/site-packages/mercurial/cmdutil.py", line 670, in show
+    self._show(ctx, copies, matchfn, props)
+  File "/usr/local/lib/python2.7/site-packages/mercurial/cmdutil.py", line 691, in _show
+    label='log.changeset changeset.%s' % ctx.phasestr())
+  File "/usr/local/lib/python2.7/site-packages/mercurial/context.py", line 203, in phasestr
+    return phases.phasenames[self.phase()]
+  File "/usr/local/lib/python2.7/site-packages/mercurial/context.py", line 201, in phase
+    return self._repo._phasecache.phase(self._repo, self._rev)
+AttributeError: 'overlaychangectx' object has no attribute '_repo'
+
+diff -r bff92a208c3f hggit/overlay.py
+--- a/hggit/overlay.py	Wed Oct 17 10:50:55 2012 -0500
++++ b/hggit/overlay.py	Mon Oct 29 20:16:00 2012 -0400
+@@ -151,6 +151,13 @@
+     def __nonzero__(self):
+         return True
+ 
++    def phase(self):
++        try:
++            from mercurial import phases
++            return phases.draft
++        except ImportError:
++            return 1
++
+ class overlayrevlog(object):
+     def __init__(self, repo, base):
+         self.repo = repo
+# HG changeset patch
+# Parent b3881fda3ce9c106f1affdf1c683485640aeec83
+tests: pull in hghave
+
+Previously, the hghave checks that were commented out in the tests were broken
+if uncommented.  One cause was that it was expecting hghave in the testdir,
+while our testdir didn't contain hghave.  Now it does.
+
+The hghave was pulled unmodified from Mercurial 2.3, to match the version of
+run-tests.py in use.
+
+diff --git a/tests/hghave b/tests/hghave
+new file mode 100755
+--- /dev/null
++++ b/tests/hghave
+@@ -0,0 +1,77 @@
++#!/usr/bin/env python
++"""Test the running system for features availability. Exit with zero
++if all features are there, non-zero otherwise. If a feature name is
++prefixed with "no-", the absence of feature is tested.
++"""
++import optparse
++import sys
++import hghave
++
++checks = hghave.checks
++
++def list_features():
++    for name, feature in checks.iteritems():
++        desc = feature[1]
++        print name + ':', desc
++
++def test_features():
++    failed = 0
++    for name, feature in checks.iteritems():
++        check, _ = feature
++        try:
++            check()
++        except Exception, e:
++            print "feature %s failed:  %s" % (name, e)
++            failed += 1
++    return failed
++
++parser = optparse.OptionParser("%prog [options] [features]")
++parser.add_option("--test-features", action="store_true",
++                  help="test available features")
++parser.add_option("--list-features", action="store_true",
++                  help="list available features")
++parser.add_option("-q", "--quiet", action="store_true",
++                  help="check features silently")
++
++if __name__ == '__main__':
++    options, args = parser.parse_args()
++    if options.list_features:
++        list_features()
++        sys.exit(0)
++
++    if options.test_features:
++        sys.exit(test_features())
++
++    quiet = options.quiet
++
++    failures = 0
++
++    def error(msg):
++        global failures
++        if not quiet:
++            sys.stderr.write(msg + '\n')
++        failures += 1
++
++    for feature in args:
++        negate = feature.startswith('no-')
++        if negate:
++            feature = feature[3:]
++
++        if feature not in checks:
++            error('skipped: unknown feature: ' + feature)
++            continue
++
++        check, desc = checks[feature]
++        try:
++            available = check()
++        except Exception, e:
++            error('hghave check failed: ' + feature)
++            continue
++
++        if not negate and not available:
++            error('skipped: missing feature: ' + desc)
++        elif negate and available:
++            error('skipped: system supports %s' % desc)
++
++    if failures != 0:
++        sys.exit(1)
+diff --git a/tests/hghave.py b/tests/hghave.py
+new file mode 100755
+--- /dev/null
++++ b/tests/hghave.py
+@@ -0,0 +1,308 @@
++import os, stat, socket
++import re
++import sys
++import tempfile
++
++tempprefix = 'hg-hghave-'
++
++def matchoutput(cmd, regexp, ignorestatus=False):
++    """Return True if cmd executes successfully and its output
++    is matched by the supplied regular expression.
++    """
++    r = re.compile(regexp)
++    fh = os.popen(cmd)
++    s = fh.read()
++    try:
++        ret = fh.close()
++    except IOError:
++        # Happen in Windows test environment
++        ret = 1
++    return (ignorestatus or ret is None) and r.search(s)
++
++def has_baz():
++    return matchoutput('baz --version 2>&1', r'baz Bazaar version')
++
++def has_bzr():
++    try:
++        import bzrlib
++        return bzrlib.__doc__ is not None
++    except ImportError:
++        return False
++
++def has_bzr114():
++    try:
++        import bzrlib
++        return (bzrlib.__doc__ is not None
++                and bzrlib.version_info[:2] >= (1, 14))
++    except ImportError:
++        return False
++
++def has_cvs():
++    re = r'Concurrent Versions System.*?server'
++    return matchoutput('cvs --version 2>&1', re) and not has_msys()
++
++def has_darcs():
++    return matchoutput('darcs --version', r'2\.[2-9]', True)
++
++def has_mtn():
++    return matchoutput('mtn --version', r'monotone', True) and not matchoutput(
++        'mtn --version', r'monotone 0\.', True)
++
++def has_eol_in_paths():
++    try:
++        fd, path = tempfile.mkstemp(dir='.', prefix=tempprefix, suffix='\n\r')
++        os.close(fd)
++        os.remove(path)
++        return True
++    except (IOError, OSError):
++        return False
++
++def has_executablebit():
++    try:
++        EXECFLAGS = stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH
++        fh, fn = tempfile.mkstemp(dir='.', prefix=tempprefix)
++        try:
++            os.close(fh)
++            m = os.stat(fn).st_mode & 0777
++            new_file_has_exec = m & EXECFLAGS
++            os.chmod(fn, m ^ EXECFLAGS)
++            exec_flags_cannot_flip = ((os.stat(fn).st_mode & 0777) == m)
++        finally:
++            os.unlink(fn)
++    except (IOError, OSError):
++        # we don't care, the user probably won't be able to commit anyway
++        return False
++    return not (new_file_has_exec or exec_flags_cannot_flip)
++
++def has_icasefs():
++    # Stolen from mercurial.util
++    fd, path = tempfile.mkstemp(dir='.', prefix=tempprefix)
++    os.close(fd)
++    try:
++        s1 = os.stat(path)
++        d, b = os.path.split(path)
++        p2 = os.path.join(d, b.upper())
++        if path == p2:
++            p2 = os.path.join(d, b.lower())
++        try:
++            s2 = os.stat(p2)
++            return s2 == s1
++        except OSError:
++            return False
++    finally:
++        os.remove(path)
++
++def has_inotify():
++    try:
++        import hgext.inotify.linux.watcher
++    except ImportError:
++        return False
++    name = tempfile.mktemp(dir='.', prefix=tempprefix)
++    sock = socket.socket(socket.AF_UNIX)
++    try:
++        sock.bind(name)
++    except socket.error, err:
++        return False
++    sock.close()
++    os.unlink(name)
++    return True
++
++def has_fifo():
++    if getattr(os, "mkfifo", None) is None:
++        return False
++    name = tempfile.mktemp(dir='.', prefix=tempprefix)
++    try:
++        os.mkfifo(name)
++        os.unlink(name)
++        return True
++    except OSError:
++        return False
++
++def has_cacheable_fs():
++    from mercurial import util
++
++    fd, path = tempfile.mkstemp(dir='.', prefix=tempprefix)
++    os.close(fd)
++    try:
++        return util.cachestat(path).cacheable()
++    finally:
++        os.remove(path)
++
++def has_lsprof():
++    try:
++        import _lsprof
++        return True
++    except ImportError:
++        return False
++
++def has_gettext():
++    return matchoutput('msgfmt --version', 'GNU gettext-tools')
++
++def has_git():
++    return matchoutput('git --version 2>&1', r'^git version')
++
++def has_docutils():
++    try:
++        from docutils.core import publish_cmdline
++        return True
++    except ImportError:
++        return False
++
++def getsvnversion():
++    m = matchoutput('svn --version 2>&1', r'^svn,\s+version\s+(\d+)\.(\d+)')
++    if not m:
++        return (0, 0)
++    return (int(m.group(1)), int(m.group(2)))
++
++def has_svn15():
++    return getsvnversion() >= (1, 5)
++
++def has_svn13():
++    return getsvnversion() >= (1, 3)
++
++def has_svn():
++    return matchoutput('svn --version 2>&1', r'^svn, version') and \
++        matchoutput('svnadmin --version 2>&1', r'^svnadmin, version')
++
++def has_svn_bindings():
++    try:
++        import svn.core
++        version = svn.core.SVN_VER_MAJOR, svn.core.SVN_VER_MINOR
++        if version < (1, 4):
++            return False
++        return True
++    except ImportError:
++        return False
++
++def has_p4():
++    return (matchoutput('p4 -V', r'Rev\. P4/') and
++            matchoutput('p4d -V', r'Rev\. P4D/'))
++
++def has_symlink():
++    if getattr(os, "symlink", None) is None:
++        return False
++    name = tempfile.mktemp(dir='.', prefix=tempprefix)
++    try:
++        os.symlink(".", name)
++        os.unlink(name)
++        return True
++    except (OSError, AttributeError):
++        return False
++
++def has_hardlink():
++    from mercurial import util
++    fh, fn = tempfile.mkstemp(dir='.', prefix=tempprefix)
++    os.close(fh)
++    name = tempfile.mktemp(dir='.', prefix=tempprefix)
++    try:
++        try:
++            util.oslink(fn, name)
++            os.unlink(name)
++            return True
++        except OSError:
++            return False
++    finally:
++        os.unlink(fn)
++
++def has_tla():
++    return matchoutput('tla --version 2>&1', r'The GNU Arch Revision')
++
++def has_gpg():
++    return matchoutput('gpg --version 2>&1', r'GnuPG')
++
++def has_unix_permissions():
++    d = tempfile.mkdtemp(dir='.', prefix=tempprefix)
++    try:
++        fname = os.path.join(d, 'foo')
++        for umask in (077, 007, 022):
++            os.umask(umask)
++            f = open(fname, 'w')
++            f.close()
++            mode = os.stat(fname).st_mode
++            os.unlink(fname)
++            if mode & 0777 != ~umask & 0666:
++                return False
++        return True
++    finally:
++        os.rmdir(d)
++
++def has_pyflakes():
++    return matchoutput("sh -c \"echo 'import re' 2>&1 | pyflakes\"",
++                       r"<stdin>:1: 're' imported but unused",
++                       True)
++
++def has_pygments():
++    try:
++        import pygments
++        return True
++    except ImportError:
++        return False
++
++def has_outer_repo():
++    # failing for other reasons than 'no repo' imply that there is a repo
++    return not matchoutput('hg root 2>&1',
++                           r'abort: no repository found', True)
++
++def has_ssl():
++    try:
++        import ssl
++        import OpenSSL
++        OpenSSL.SSL.Context
++        return True
++    except ImportError:
++        return False
++
++def has_windows():
++    return os.name == 'nt'
++
++def has_system_sh():
++    return os.name != 'nt'
++
++def has_serve():
++    return os.name != 'nt' # gross approximation
++
++def has_tic():
++    return matchoutput('test -x "`which tic`"', '')
++
++def has_msys():
++    return os.getenv('MSYSTEM')
++
++checks = {
++    "true": (lambda: True, "yak shaving"),
++    "false": (lambda: False, "nail clipper"),
++    "baz": (has_baz, "GNU Arch baz client"),
++    "bzr": (has_bzr, "Canonical's Bazaar client"),
++    "bzr114": (has_bzr114, "Canonical's Bazaar client >= 1.14"),
++    "cacheable": (has_cacheable_fs, "cacheable filesystem"),
++    "cvs": (has_cvs, "cvs client/server"),
++    "darcs": (has_darcs, "darcs client"),
++    "docutils": (has_docutils, "Docutils text processing library"),
++    "eol-in-paths": (has_eol_in_paths, "end-of-lines in paths"),
++    "execbit": (has_executablebit, "executable bit"),
++    "fifo": (has_fifo, "named pipes"),
++    "gettext": (has_gettext, "GNU Gettext (msgfmt)"),
++    "git": (has_git, "git command line client"),
++    "gpg": (has_gpg, "gpg client"),
++    "hardlink": (has_hardlink, "hardlinks"),
++    "icasefs": (has_icasefs, "case insensitive file system"),
++    "inotify": (has_inotify, "inotify extension support"),
++    "lsprof": (has_lsprof, "python lsprof module"),
++    "mtn": (has_mtn, "monotone client (>= 1.0)"),
++    "outer-repo": (has_outer_repo, "outer repo"),
++    "p4": (has_p4, "Perforce server and client"),
++    "pyflakes": (has_pyflakes, "Pyflakes python linter"),
++    "pygments": (has_pygments, "Pygments source highlighting library"),
++    "serve": (has_serve, "platform and python can manage 'hg serve -d'"),
++    "ssl": (has_ssl, "python >= 2.6 ssl module and python OpenSSL"),
++    "svn": (has_svn, "subversion client and admin tools"),
++    "svn13": (has_svn13, "subversion client and admin tools >= 1.3"),
++    "svn15": (has_svn15, "subversion client and admin tools >= 1.5"),
++    "svn-bindings": (has_svn_bindings, "subversion python bindings"),
++    "symlink": (has_symlink, "symbolic links"),
++    "system-sh": (has_system_sh, "system() uses sh"),
++    "tic": (has_tic, "terminfo compiler"),
++    "tla": (has_tla, "GNU Arch tla client"),
++    "unix-permissions": (has_unix_permissions, "unix-style permissions"),
++    "windows": (has_windows, "Windows"),
++    "msys": (has_msys, "Windows with MSYS"),
++}

fix-test-subrepos.diff

+# HG changeset patch
+# Parent 81832807d193c244022409571ba70ec36bbe6667
+tests: fix check for dulwich in test-subrepos.t
+
+In converting this test to the unified format, it looks like we missed this
+line.  It was accidentally being treated as a comment rather than executable.
+
+diff -r 81832807d193 -r b933b2b06b87 tests/test-subrepos.t
+--- a/tests/test-subrepos.t	Mon Oct 29 00:17:55 2012 -0400
++++ b/tests/test-subrepos.t	Mon Oct 29 00:19:44 2012 -0400
+@@ -2,7 +2,7 @@
+   $ "$TESTDIR/hghave" git || exit 80
+ 
+ bail if the user does not have dulwich
+-python -c 'import dulwich, dulwich.repo' || exit 80
++  $ python -c 'import dulwich, dulwich.repo' || exit 80
+ 
+ bail early if the user is already running git-daemon
+   $ ! (echo hi | nc localhost 9418 2>/dev/null) || exit 80

loosen-test-incoming.diff

+# HG changeset patch
+# Parent b03e2de3e608bb57c6145e056bad09501abac56f
+tests: remove mercurial version check from test-incoming.t
+
+This test was only running on Mercurial 1.7 or later.  Since now we only
+support versions that are 1.7 or later, there isn't a need to perform this
+check any more.
+
+diff -r b03e2de3e608 tests/test-incoming.t
+--- a/tests/test-incoming.t	Wed Oct 31 00:47:49 2012 -0400
++++ b/tests/test-incoming.t	Wed Oct 31 00:49:08 2012 -0400
+@@ -2,10 +2,6 @@
+   $ . "$TESTDIR/testutil"
+   $ fn_require git dulwich
+ 
+-This test only works on hg 1.7 and later
+-  $ python -c 'from mercurial import util ; assert \
+-  >  util.version() != "unknown" and util.version() > "1.7"' || exit 80
+-
+   $ git init gitrepo
+   Initialized empty Git repository in $TESTTMP/gitrepo/.git/
+   $ cd gitrepo

loosen-test-pull-after-strip.diff

+# HG changeset patch
+# Parent e8ddc63df4546e63f7330ab2ce78c4eeb243d2a5
+tests: remove mercurial version check from test-pull-after-strip.t
+
+This test was being skipped in Mercurial < 1.5.  We don't support Mercurial
+that old any more, so there isn't a need to worry about it in the tests.
+
+diff -r e8ddc63df454 tests/test-pull-after-strip.t
+--- a/tests/test-pull-after-strip.t	Wed Oct 31 00:42:18 2012 -0400
++++ b/tests/test-pull-after-strip.t	Wed Oct 31 00:47:49 2012 -0400
+@@ -2,17 +2,6 @@
+   $ . "$TESTDIR/testutil"
+   $ fn_require git dulwich
+ 
+-this test is busted on hg < 1.5. I'm not sure how to fix it.
+-  $ cat > tmp.py <<EOF
+-  > import sys
+-  > v = sys.stdin.read().strip()[:-1]
+-  > if v[1] == '.' and ((int(v[0]) == 1 and int(v[2]) > 4) or int(v[0]) > 1):
+-  >   sys.exit(0)
+-  > sys.exit(1)
+-  > EOF
+-
+-  $ hg version | grep version | sed 's/.*(version //' | python tmp.py || exit 80
+-
+   $ git init gitrepo
+   Initialized empty Git repository in $TESTTMP/gitrepo/.git/
+   $ cd gitrepo

no_atrribute_repo.diff

+# HG changeset patch
+# Parent b933b2b06b8702da4b0626fc7e73fd8b5137ca76
+overlay: fix "no attribute '_repo'" incompatibility with mercurial 2.4-rc
+
+...
+  File "/private/var/folders/ft/7htx18192nn9pgtf00k94hrm0000gn/T/hgtests.J4xBFT/install/lib/python/mercurial/context.py", line 201, in phase
+    return self._repo._phasecache.phase(self._repo, self._rev)
+AttributeError: 'overlaychangectx' object has no attribute '_repo'
+
+diff -r b933b2b06b87 hggit/overlay.py
+--- a/hggit/overlay.py	Mon Oct 29 00:19:44 2012 -0400
++++ b/hggit/overlay.py	Mon Oct 29 01:18:30 2012 -0400
+@@ -95,14 +95,15 @@
+ 
+ class overlaychangectx(context.changectx):
+     def __init__(self, repo, sha):
+-        self.repo = repo
++        super(overlaychangectx, self).__init__(repo, sha)
++        self._repo = repo
+         self.commit = repo.handler.git.get_object(sha)
+ 
+     def node(self):
+         return bin(self.commit.id)
+ 
+     def rev(self):
+-        return self.repo.rev(bin(self.commit.id))
++        return self._repo.rev(bin(self.commit.id))
+ 
+     def date(self):
+         return self.commit.author_time, self.commit.author_timezone
+@@ -123,7 +124,7 @@
+         return self.commit.message
+ 
+     def parents(self):
+-        return [overlaychangectx(self.repo, sha) for sha in self.commit.parents]
++        return [overlaychangectx(self._repo, sha) for sha in self.commit.parents]
+ 
+     def manifestnode(self):
+         return bin(self.commit.tree)
+@@ -138,11 +139,11 @@
+         return []
+ 
+     def manifest(self):
+-        return overlaymanifest(self.repo, self.commit.tree)
++        return overlaymanifest(self._repo, self.commit.tree)
+ 
+     def filectx(self, path, filelog=None):
+         mf = self.manifest()
+-        return overlayfilectx(self.repo, path, mf[path])
++        return overlayfilectx(self._repo, path, mf[path])
+ 
+     def flags(self, path):
+         mf = self.manifest()

remove-filter-test-incoming.diff

+# HG changeset patch
+# Parent c84cabbe7c15e6274804d9840329a45ec2375d7d
+tests: remove filterhash from test-incoming.t
+
+This test had some form of legacy hash filtering, marked with a TODO to remove
+it when we're only supporting Mercurial 1.5 or later.  Well, that time has
+come, so I removed it.
+
+diff -r c84cabbe7c15 -r 41042bc48075 tests/test-hg-branch.t
+--- a/tests/test-hg-branch.t	Wed Oct 31 00:49:08 2012 -0400
++++ b/tests/test-hg-branch.t	Wed Oct 31 00:51:23 2012 -0400
+@@ -2,10 +2,6 @@
+   $ . "$TESTDIR/testutil"
+   $ fn_require git dulwich
+ 
+-TODO stop using this when we're 1.5 only
+-  $ filterhash="sed s/71414c4e3c6f/a31e374801c9/;s/698615204564/d93a72262a83/"
+-  $ filterhash="$filterhash;s/d93a72262a83/05aed681ccb3/"
+-
+   $ git init gitrepo
+   Initialized empty Git repository in $TESTTMP/gitrepo/.git/
+   $ cd gitrepo
+@@ -36,7 +32,7 @@
+   pushing to $TESTTMP/gitrepo
+   searching for changes
+ 
+-  $ hg log --graph | $filterhash | egrep -v ': *(not-master|master)'
++  $ hg log --graph | egrep -v ': *(not-master|master)'
+   @  changeset:   2:05aed681ccb3
+   |  branch:      gamma
+   |  tag:         default/master
+@@ -61,7 +57,7 @@
+   $ hg clone gitrepo hgrepo2 | grep -v '^updating'
+   importing git objects into hg
+   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+-  $ hg -R hgrepo2 log --graph | $filterhash | egrep -v ': *(not-master|master)'
++  $ hg -R hgrepo2 log --graph | egrep -v ': *(not-master|master)'
+   o  changeset:   2:05aed681ccb3
+   |  branch:      gamma
+   |  tag:         default/master
-rename-test-pull.diff
+test-extract-extension-config.diff #+sub20121030
+tests-extract-commit-tag.diff #+sub20121030
+tests-extract-requirements.diff #+sub20121030
+test-url-parsing-check-dulwich.diff #+sub20121030
+test-git-init-collapse.diff #+sub20121030
+test-avoid-cd.diff #+sub20121030
+test-echo-to-comment.diff #+sub20121030
+loosen-test-pull-after-strip.diff #+sub20121030
+loosen-test-incoming.diff #+sub20121030
+remove-filter-test-incoming.diff #+sub20121030
+test-gitdaemon-subrepo.diff #+sub20121029
+fake-overlay.diff #+sub20121029
+rename-test-pull.diff #+sub20121026
 fix-empty-push.diff #+sub20121025
 populate-gitrepo-localrepo.diff #+sub20121025
 gitrepo-support-listkeys.diff #+sub20121025
-dont-pull-tags-as-bookmarks.diff
+dont-pull-tags-as-bookmarks.diff #+sub20121026
+simplify_listkeys.diff #+sub20121028
+fix-hghave.diff #+sub20121028
+uncomment-hghave.diff #+sub20121028
+fix-test-subrepos.diff #+sub20121028
+no_atrribute_repo.diff
 test-changes-bookmarks-outgoing.diff #+sub20121025
 fix-push-output.diff #+sub20121025
 suppress-export-message.diff #+sub20121025

simplify_listkeys.diff

+# HG changeset patch
+# Parent af4d66e2bc6e1b7f2d87f761625bcc925ad80c63
+listkeys: simplify ref stripping expression
+
+Eliminate a find that would always return 0, based on an example in git_handler
+update_hg_bookmarks.
+
+diff -r af4d66e2bc6e -r b8532cb3cd43 hggit/gitrepo.py
+--- a/hggit/gitrepo.py	Fri Oct 26 22:46:02 2012 -0400
++++ b/hggit/gitrepo.py	Sat Oct 27 00:32:09 2012 -0400
+@@ -62,7 +62,7 @@
+                 newcommits = [bin(c) for c in commits]
+                 b = overlayrepo(handler, newcommits, refs)
+                 stripped_refs = dict([
+-                    (ref[ref.find('refs/heads/')+11:], b.node(refs[ref]))
++                    (ref[11:], b.node(refs[ref]))
+                         for ref in refs.keys()
+                             if ref.startswith('refs/heads/')])
+                 return stripped_refs

test-avoid-cd.diff

+# HG changeset patch
+# Parent d4571f242ddf75205d49e9014c67493557fd94a2
+tests: avoid changing the current directory
+
+Mercurial allows specifying which repository to use via the -R/--repository
+option.  Git allows a similar function using the --git-dir option.  By using
+these options, in many cases we can avoid checking the current directory.
+This makes tests easier to understand, as you don't need to remember which
+directory you're in to understand what's going on.  It also makes tests easier
+to write, as you don't need to remember to cd out of a directory when you're
+done doing things there.
+
+Thanks to Felipe Contreras for the patch which this was based on.
+
+diff -r d4571f242ddf tests/test-clone.t
+--- a/tests/test-clone.t	Wed Oct 31 00:01:03 2012 -0400
++++ b/tests/test-clone.t	Wed Oct 31 00:24:09 2012 -0400
+@@ -24,8 +24,7 @@
+   $ hg clone -r alpha gitrepo hgrepo-a | grep -v '^updating'
+   importing git objects into hg
+   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+-  $ cd hgrepo-a
+-  $ hg log --graph | egrep -v ': *(beta|master)'
++  $ hg -R hgrepo-a log --graph | egrep -v ': *(beta|master)'
+   @  changeset:   0:3442585be8a6
+      tag:         alpha
+      tag:         default/master
+@@ -34,15 +33,12 @@
+      date:        Mon Jan 01 00:00:10 2007 +0000
+      summary:     add alpha
+   
+-
+-  $ cd ..
+   $ echo % clone a branch
+   % clone a branch
+   $ hg clone -r beta gitrepo hgrepo-b | grep -v '^updating'
+   importing git objects into hg
+   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+-  $ cd hgrepo-b
+-  $ hg log --graph | egrep -v ': *(beta|master)'
++  $ hg -R hgrepo-b log --graph | egrep -v ': *(beta|master)'
+   @  changeset:   1:7bcd915dc873
+   |  tag:         default/beta
+   |  tag:         tip
+@@ -57,6 +53,3 @@
+      date:        Mon Jan 01 00:00:10 2007 +0000
+      summary:     add alpha
+   
+-
+-
+-  $ cd ..
+diff -r d4571f242ddf tests/test-conflict-1.t
+--- a/tests/test-conflict-1.t	Wed Oct 31 00:01:03 2012 -0400
++++ b/tests/test-conflict-1.t	Wed Oct 31 00:24:09 2012 -0400
+@@ -56,10 +56,9 @@
+   $ hg clone gitrepo hgrepo2 | grep -v '^updating'
+   importing git objects into hg
+   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+-  $ cd hgrepo2
+   $ echo % expect the same revision ids as above
+   % expect the same revision ids as above
+-  $ hg log --graph --style compact | sed 's/\[.*\]//g'
++  $ hg -R hgrepo2 log --graph --style compact | sed 's/\[.*\]//g'
+   @    3:1,2   6c53bc0f062f   1970-01-01 00:00 +0000   test
+   |\     merge to C
+   | |
+@@ -72,5 +71,3 @@
+   o  0   5d1a6b64f9d0   1970-01-01 00:00 +0000   test
+        origin
+   
+-
+-  $ cd ..
+diff -r d4571f242ddf tests/test-conflict-2.t
+--- a/tests/test-conflict-2.t	Wed Oct 31 00:01:03 2012 -0400
++++ b/tests/test-conflict-2.t	Wed Oct 31 00:24:09 2012 -0400
+@@ -56,10 +56,9 @@
+   $ hg clone gitrepo hgrepo2 | grep -v '^updating'
+   importing git objects into hg
+   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+-  $ cd hgrepo2
+   $ echo % expect the same revision ids as above
+   % expect the same revision ids as above
+-  $ hg log --graph --style compact | sed 's/\[.*\]//g'
++  $ hg -R hgrepo2 log --graph --style compact | sed 's/\[.*\]//g'
+   @    3:1,2   120385945d08   1970-01-01 00:00 +0000   test
+   |\     merge to B
+   | |
+@@ -72,5 +71,3 @@
+   o  0   5d1a6b64f9d0   1970-01-01 00:00 +0000   test
+        origin
+   
+-
+-  $ cd ..
+diff -r d4571f242ddf tests/test-convergedmerge.t
+--- a/tests/test-convergedmerge.t	Wed Oct 31 00:01:03 2012 -0400
++++ b/tests/test-convergedmerge.t	Wed Oct 31 00:24:09 2012 -0400
+@@ -57,10 +57,9 @@
+   $ hg clone gitrepo hgrepo2 | grep -v '^updating'
+   importing git objects into hg
+   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+-  $ cd hgrepo2
+   $ echo % expect the same revision ids as above
+   % expect the same revision ids as above
+-  $ hg log --graph --style compact | sed 's/\[.*\]//g'
++  $ hg -R hgrepo2 log --graph --style compact | sed 's/\[.*\]//g'
+   @    4:1,3   eaa21d002113   1970-01-01 00:00 +0000   test
+   |\     merge
+   | |
+@@ -76,5 +75,3 @@
+   o  0   5d1a6b64f9d0   1970-01-01 00:00 +0000   test
+        origin
+   
+-
+-  $ cd ..
+diff -r d4571f242ddf tests/test-empty-working-tree.t
+--- a/tests/test-empty-working-tree.t	Wed Oct 31 00:01:03 2012 -0400
++++ b/tests/test-empty-working-tree.t	Wed Oct 31 00:24:09 2012 -0400
+@@ -23,13 +23,10 @@
+   $ hg push ../gitrepo2
+   pushing to ../gitrepo2
+   searching for changes
+-
+-  $ cd ../gitrepo2
+-  $ git log --pretty=medium
++  $ cd ..
++  $ git --git-dir=gitrepo2 log --pretty=medium
+   commit 678256865a8c85ae925bf834369264193c88f8de
+   Author: test <test@example.org>
+   Date:   Mon Jan 1 00:00:00 2007 +0000
+   
+       empty
+-
+-  $ cd ..
+diff -r d4571f242ddf tests/test-encoding.t
+--- a/tests/test-encoding.t	Wed Oct 31 00:01:03 2012 -0400
++++ b/tests/test-encoding.t	Wed Oct 31 00:24:09 2012 -0400
+@@ -113,8 +113,8 @@
+   pushing to ../gitrepo2
+   searching for changes
+ 
+-  $ cd ../gitrepo2
+-  $ git log --pretty=medium
++  $ cd ..
++  $ git --git-dir=gitrepo2 log --pretty=medium
+   commit da0edb01d4f3d1abf08b1be298379b0b2960e680
+   Author: t\xe9st \xe8nc\xf6d\xeeng <test@example.org> (esc)
+   Date:   Mon Jan 1 00:00:13 2007 +0000
+@@ -138,5 +138,3 @@
+   Date:   Mon Jan 1 00:00:10 2007 +0000
+   
+       add älphà
+-
+-  $ cd ..
+diff -r d4571f242ddf tests/test-file-removal.t
+--- a/tests/test-file-removal.t	Wed Oct 31 00:01:03 2012 -0400
++++ b/tests/test-file-removal.t	Wed Oct 31 00:24:09 2012 -0400
+@@ -84,8 +84,8 @@
+   pushing to ../gitrepo2
+   searching for changes
+ 
+-  $ cd ../gitrepo2
+-  $ git log --pretty=medium
++  $ cd ..
++  $ git --git-dir=gitrepo2 log --pretty=medium
+   commit b991de8952c482a7cd51162674ffff8474862218
+   Author: test <test@example.org>
+   Date:   Mon Jan 1 00:00:14 2007 +0000
+@@ -115,5 +115,3 @@
+   Date:   Mon Jan 1 00:00:10 2007 +0000
+   
+       add alpha
+-
+-  $ cd ..
+diff -r d4571f242ddf tests/test-git-clone.t
+--- a/tests/test-git-clone.t	Wed Oct 31 00:01:03 2012 -0400
++++ b/tests/test-git-clone.t	Wed Oct 31 00:24:09 2012 -0400
+@@ -17,8 +17,7 @@
+   $ hg clone gitrepo hgrepo | grep -v '^updating'
+   importing git objects into hg
+   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+-  $ cd hgrepo
+-  $ hg log --graph  | grep -v ': *master'
++  $ hg -R hgrepo log --graph  | grep -v ': *master'
+   @  changeset:   1:7bcd915dc873
+   |  tag:         default/master
+   |  tag:         tip
+@@ -34,5 +33,5 @@
+ 
+   $ echo % we should have some bookmarks
+   % we should have some bookmarks
+-  $ hg book
++  $ hg -R hgrepo book
+    * master                    1:7bcd915dc873
+diff -r d4571f242ddf tests/test-git-submodules.t
+--- a/tests/test-git-submodules.t	Wed Oct 31 00:01:03 2012 -0400
++++ b/tests/test-git-submodules.t	Wed Oct 31 00:24:09 2012 -0400
+@@ -53,8 +53,7 @@
+   $ hg clone gitrepo2 hgrepo | grep -v '^updating'
+   importing git objects into hg
+   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+-  $ cd hgrepo
+-  $ hg log --graph  | grep -v ': *master'
++  $ hg -R hgrepo log --graph  | grep -v ': *master'
+   @  changeset:   2:76fda365fbbb
+   |  tag:         default/master
+   |  tag:         tip
+@@ -75,5 +74,5 @@
+ 
+   $ echo % we should have some bookmarks
+   % we should have some bookmarks
+-  $ hg book
++  $ hg -R hgrepo book
+    * master                    2:76fda365fbbb
+diff -r d4571f242ddf tests/test-hg-author.t
+--- a/tests/test-hg-author.t	Wed Oct 31 00:01:03 2012 -0400
++++ b/tests/test-hg-author.t	Wed Oct 31 00:24:09 2012 -0400
+@@ -128,8 +128,7 @@
+   $ hg clone gitrepo hgrepo2 | grep -v '^updating'
+   importing git objects into hg
+   8 files updated, 0 files merged, 0 files removed, 0 files unresolved
+-  $ cd hgrepo2
+-  $ hg log --graph | egrep -v ': *(not-master|master)'
++  $ hg -R hgrepo2 log --graph | egrep -v ': *(not-master|master)'
+   @  changeset:   8:efec0270e295
+   |  tag:         default/master
+   |  tag:         tip
+@@ -178,10 +177,7 @@
+      date:        Mon Jan 01 00:00:10 2007 +0000
+      summary:     add alpha
+   
+-
+-  $ cd ..
+-  $ cd gitrepo
+-  $ git log --pretty=medium master
++  $ git --git-dir=gitrepo/.git log --pretty=medium master
+   commit 1e03e913eca571b86ee06d3c1ddd795dde9ca917
+   Author: test ?test@example.com <test ?test@example.com>
+   Date:   Mon Jan 1 00:00:18 2007 +0000
+@@ -235,5 +231,3 @@
+   Date:   Mon Jan 1 00:00:10 2007 +0000
+   
+       add alpha
+-
+-  $ cd ..
+diff -r d4571f242ddf tests/test-hg-branch.t
+--- a/tests/test-hg-branch.t	Wed Oct 31 00:01:03 2012 -0400
++++ b/tests/test-hg-branch.t	Wed Oct 31 00:24:09 2012 -0400
+@@ -61,8 +61,7 @@
+   $ hg clone gitrepo hgrepo2 | grep -v '^updating'
+   importing git objects into hg
+   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+-  $ cd hgrepo2
+-  $ hg log --graph | $filterhash | egrep -v ': *(not-master|master)'
++  $ hg -R hgrepo2 log --graph | $filterhash | egrep -v ': *(not-master|master)'
+   o  changeset:   2:05aed681ccb3
+   |  branch:      gamma
+   |  tag:         default/master
+@@ -82,5 +81,3 @@
+      date:        Mon Jan 01 00:00:10 2007 +0000
+      summary:     add alpha
+   
+-
+-  $ cd ..
+diff -r d4571f242ddf tests/test-hg-tags.t
+--- a/tests/test-hg-tags.t	Wed Oct 31 00:01:03 2012 -0400
++++ b/tests/test-hg-tags.t	Wed Oct 31 00:24:09 2012 -0400
+@@ -51,8 +51,7 @@
+   $ hg clone gitrepo hgrepo2 | grep -v '^updating'
+   importing git objects into hg
+   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+-  $ cd hgrepo2
+-  $ hg log --graph | egrep -v ': *(not-master|master)'
++  $ hg -R hgrepo2 log --graph | egrep -v ': *(not-master|master)'
+   @  changeset:   1:d529e9229f6d
+   |  tag:         default/master
+   |  tag:         tip
+@@ -70,7 +69,5 @@
+ 
+   $ echo % the tag should be in .hgtags
+   % the tag should be in .hgtags
+-  $ cat .hgtags
++  $ cat hgrepo2/.hgtags
+   3442585be8a60c6cd476bbc4e45755339f2a23ef alpha
+-
+-  $ cd ..
+diff -r d4571f242ddf tests/test-incoming.t
+--- a/tests/test-incoming.t	Wed Oct 31 00:01:03 2012 -0400
++++ b/tests/test-incoming.t	Wed Oct 31 00:24:09 2012 -0400
+@@ -18,17 +18,16 @@
+   importing git objects into hg
+   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ 
+-  $ cd hgrepo
+-  $ hg incoming | grep -v 'no changes found' | grep -v 'bookmark:'
++  $ hg -R hgrepo incoming | grep -v 'no changes found' | grep -v 'bookmark:'
+   comparing with $TESTTMP/gitrepo
+ 
+-  $ cd ../gitrepo
++  $ cd gitrepo
+   $ echo beta > beta
+   $ git add beta
+   $ fn_git_commit -m 'add beta'
++  $ cd ..
+ 
+-  $ cd ../hgrepo
+-  $ hg incoming | grep -v 'no changes found' | grep -v 'bookmark:'
++  $ hg -R hgrepo incoming | grep -v 'no changes found' | grep -v 'bookmark:'
+   comparing with $TESTTMP/gitrepo
+   changeset:   1:9497a4ee62e1
+   user:        test <test@example.org>
+@@ -36,7 +35,7 @@
+   summary:     add beta
+   
+ 
+-  $ cd ../gitrepo
++  $ cd gitrepo
+   $ git checkout -b b1 HEAD^
+   Switched to a new branch 'b1'
+   $ mkdir d
+@@ -48,7 +47,6 @@
+   $ echo gamma 2 >> d/gamma
+   $ git add d/gamma
+   $ fn_git_commit -m'add d/gamma line 2'
+-
+   $ cd ../hgrepo
+   $ hg incoming -p | grep -v 'no changes found' | grep -v 'bookmark:'
+   comparing with $TESTTMP/gitrepo
+diff -r d4571f242ddf tests/test-merge.t
+--- a/tests/test-merge.t	Wed Oct 31 00:01:03 2012 -0400
++++ b/tests/test-merge.t	Wed Oct 31 00:24:09 2012 -0400
+@@ -46,10 +46,9 @@
+   searching for changes
+ 
+   $ cd ..
+-  $ cd gitrepo2
+   $ echo % git log in repo pushed from hg
+   % git log in repo pushed from hg
+-  $ git log --pretty=medium master | sed 's/\.\.\.//g'
++  $ git --git-dir=gitrepo2 log --pretty=medium master | sed 's/\.\.\.//g'
+   commit 5806851511aaf3bfe813ae3a86c5027165fa9b96
+   Merge: e5023f9 9497a4e
+   Author: test <test@example.org>
+@@ -74,7 +73,7 @@
+   Date:   Mon Jan 1 00:00:10 2007 +0000
+   
+       add alpha
+-  $ git log --pretty=medium beta | sed 's/\.\.\.//g'
++  $ git --git-dir=gitrepo2 log --pretty=medium beta | sed 's/\.\.\.//g'
+   commit 9497a4ee62e16ee641860d7677cdb2589ea15554
+   Author: test <test@example.org>
+   Date:   Mon Jan 1 00:00:11 2007 +0000
+@@ -86,5 +85,3 @@
+   Date:   Mon Jan 1 00:00:10 2007 +0000
+   
+       add alpha
+-
+-  $ cd ..
+diff -r d4571f242ddf tests/test-octopus.t
+--- a/tests/test-octopus.t	Wed Oct 31 00:01:03 2012 -0400
++++ b/tests/test-octopus.t	Wed Oct 31 00:24:09 2012 -0400
+@@ -70,9 +70,9 @@
+   $ hg push ../gitrepo2
+   pushing to ../gitrepo2
+   searching for changes
++  $ cd ..
+ 
+-  $ cd ../gitrepo2
+-  $ git log --pretty=medium | sed s/\\.\\.\\.//g
++  $ git --git-dir=gitrepo2 log --pretty=medium | sed s/\\.\\.\\.//g
+   commit f0c7ec180419a130636d0c333fc34c1462cab4b5
+   Merge: d8e22dd 9497a4e e5023f9
+   Author: test <test@example.org>
+@@ -103,5 +103,3 @@
+   Date:   Mon Jan 1 00:00:10 2007 +0000
+   
+       add alpha
+-
+-  $ cd ..
+diff -r d4571f242ddf tests/test-pull-after-strip.t
+--- a/tests/test-pull-after-strip.t	Wed Oct 31 00:01:03 2012 -0400
++++ b/tests/test-pull-after-strip.t	Wed Oct 31 00:24:09 2012 -0400
+@@ -35,8 +35,7 @@
+   $ hg clone -r alpha gitrepo hgrepo-a | grep -v '^updating'
+   importing git objects into hg
+   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+-  $ cd hgrepo-a
+-  $ hg log --graph | egrep -v ': *(beta|master)'
++  $ hg -R hgrepo-a log --graph | egrep -v ': *(beta|master)'
+   @  changeset:   0:3442585be8a6
+      tag:         alpha
+      tag:         default/master
+@@ -45,15 +44,12 @@
+      date:        Mon Jan 01 00:00:10 2007 +0000
+      summary:     add alpha
+   
+-
+-  $ cd ..
+   $ echo % clone a branch
+   % clone a branch
+   $ hg clone -r beta gitrepo hgrepo-b | grep -v '^updating'
+   importing git objects into hg
+   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+-  $ cd hgrepo-b
+-  $ hg log --graph | egrep -v ': *(beta|master)'
++  $ hg -R hgrepo-b log --graph | egrep -v ': *(beta|master)'
+   @  changeset:   1:7bcd915dc873
+   |  tag:         default/beta
+   |  tag:         tip
+@@ -68,8 +64,6 @@
+      date:        Mon Jan 01 00:00:10 2007 +0000
+      summary:     add alpha
+   
+-  $ cd ..
+-
+   $ cd gitrepo
+   $ echo beta line 2 >> beta
+   $ git add beta
+diff -r d4571f242ddf tests/test-tree-decomposition.t
+--- a/tests/test-tree-decomposition.t	Wed Oct 31 00:01:03 2012 -0400
++++ b/tests/test-tree-decomposition.t	Wed Oct 31 00:24:09 2012 -0400
+@@ -42,9 +42,9 @@
+   $ hg push ../gitrepo2
+   pushing to ../gitrepo2
+   searching for changes
++  $ cd ..
+ 
+-  $ cd ../gitrepo2
+-  $ git log --pretty=medium
++  $ git --git-dir=gitrepo2 log --pretty=medium
+   commit 6e0dbd8cd92ed4823c69cb48d8a2b81f904e6e69
+   Author: test <test@example.org>
+   Date:   Mon Jan 1 00:00:12 2007 +0000
+@@ -62,5 +62,3 @@
+   Date:   Mon Jan 1 00:00:10 2007 +0000
+   
+       initial
+-
+-  $ cd ..

test-echo-to-comment.diff

+# HG changeset patch
+# Parent a5571df60aa1e2fe34b51537f1f701bce8ce23db
+tests: convert echos to comments
+
+Now that we're in the unified test format, there isn't a need to use echo
+to provide context to command output.  This technique actually ends up resulting
+in redundant output.  To preserve the original context, but eliminate the
+redundancy, such echo statements have been converted into comment lines.
+
+diff -r a5571df60aa1 tests/test-clone.t
+--- a/tests/test-clone.t	Wed Oct 31 00:24:09 2012 -0400
++++ b/tests/test-clone.t	Wed Oct 31 00:42:18 2012 -0400
+@@ -19,8 +19,7 @@
+ 
+ 
+   $ cd ..
+-  $ echo % clone a tag
+-  % clone a tag
++clone a tag
+   $ hg clone -r alpha gitrepo hgrepo-a | grep -v '^updating'
+   importing git objects into hg
+   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+@@ -33,8 +32,7 @@
+      date:        Mon Jan 01 00:00:10 2007 +0000
+      summary:     add alpha
+   
+-  $ echo % clone a branch
+-  % clone a branch
++clone a branch
+   $ hg clone -r beta gitrepo hgrepo-b | grep -v '^updating'
+   importing git objects into hg
+   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+diff -r a5571df60aa1 tests/test-conflict-1.t
+--- a/tests/test-conflict-1.t	Wed Oct 31 00:24:09 2012 -0400
++++ b/tests/test-conflict-1.t	Wed Oct 31 00:42:18 2012 -0400
+@@ -56,8 +56,7 @@
+   $ hg clone gitrepo hgrepo2 | grep -v '^updating'
+   importing git objects into hg
+   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+-  $ echo % expect the same revision ids as above
+-  % expect the same revision ids as above
++expect the same revision ids as above
+   $ hg -R hgrepo2 log --graph --style compact | sed 's/\[.*\]//g'
+   @    3:1,2   6c53bc0f062f   1970-01-01 00:00 +0000   test
+   |\     merge to C
+diff -r a5571df60aa1 tests/test-conflict-2.t
+--- a/tests/test-conflict-2.t	Wed Oct 31 00:24:09 2012 -0400
++++ b/tests/test-conflict-2.t	Wed Oct 31 00:42:18 2012 -0400
+@@ -56,8 +56,7 @@
+   $ hg clone gitrepo hgrepo2 | grep -v '^updating'
+   importing git objects into hg
+   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+-  $ echo % expect the same revision ids as above
+-  % expect the same revision ids as above
++expect the same revision ids as above
+   $ hg -R hgrepo2 log --graph --style compact | sed 's/\[.*\]//g'
+   @    3:1,2   120385945d08   1970-01-01 00:00 +0000   test
+   |\     merge to B
+diff -r a5571df60aa1 tests/test-convergedmerge.t
+--- a/tests/test-convergedmerge.t	Wed Oct 31 00:24:09 2012 -0400
++++ b/tests/test-convergedmerge.t	Wed Oct 31 00:42:18 2012 -0400
+@@ -57,8 +57,7 @@
+   $ hg clone gitrepo hgrepo2 | grep -v '^updating'
+   importing git objects into hg
+   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+-  $ echo % expect the same revision ids as above
+-  % expect the same revision ids as above
++expect the same revision ids as above
+   $ hg -R hgrepo2 log --graph --style compact | sed 's/\[.*\]//g'
+   @    4:1,3   eaa21d002113   1970-01-01 00:00 +0000   test
+   |\     merge
+diff -r a5571df60aa1 tests/test-file-removal.t
+--- a/tests/test-file-removal.t	Wed Oct 31 00:24:09 2012 -0400
++++ b/tests/test-file-removal.t	Wed Oct 31 00:42:18 2012 -0400
+@@ -21,8 +21,7 @@
+   $ git rm foo/bar
+   rm 'foo/bar'
+   $ fn_git_commit -m 'remove foo/bar'
+-  $ echo % final manifest in git is just beta
+-  % final manifest in git is just beta
++final manifest in git is just beta
+   $ git ls-files
+   beta
+ 
+@@ -63,18 +62,12 @@
+      summary:     add alpha
+   
+ 
+-  $ echo
+-  
+-  $ echo % make sure alpha is not in this manifest
+-  % make sure alpha is not in this manifest
++make sure alpha is not in this manifest
+   $ hg manifest -r 3
+   beta
+   foo/bar
+ 
+-  $ echo
+-  
+-  $ echo % make sure that only beta is in the manifest
+-  % make sure that only beta is in the manifest
++make sure that only beta is in the manifest
+   $ hg manifest
+   beta
+ 
+diff -r a5571df60aa1 tests/test-git-clone.t
+--- a/tests/test-git-clone.t	Wed Oct 31 00:24:09 2012 -0400
++++ b/tests/test-git-clone.t	Wed Oct 31 00:42:18 2012 -0400
+@@ -31,7 +31,6 @@
+      summary:     add alpha
+   
+ 
+-  $ echo % we should have some bookmarks
+-  % we should have some bookmarks
++we should have some bookmarks
+   $ hg -R hgrepo book
+    * master                    1:7bcd915dc873
+diff -r a5571df60aa1 tests/test-git-submodules.t
+--- a/tests/test-git-submodules.t	Wed Oct 31 00:24:09 2012 -0400
++++ b/tests/test-git-submodules.t	Wed Oct 31 00:42:18 2012 -0400
+@@ -72,7 +72,6 @@
+      summary:     add alpha
+   
+ 
+-  $ echo % we should have some bookmarks
+-  % we should have some bookmarks
++we should have some bookmarks
+   $ hg -R hgrepo book
+    * master                    2:76fda365fbbb
+diff -r a5571df60aa1 tests/test-git-workflow.t
+--- a/tests/test-git-workflow.t	Wed Oct 31 00:24:09 2012 -0400
++++ b/tests/test-git-workflow.t	Wed Oct 31 00:42:18 2012 -0400
+@@ -24,8 +24,7 @@
+ 
+   $ cd ..
+ 
+-  $ echo % configure for use from git
+-  % configure for use from git
++configure for use from git
+   $ hg clone hgrepo gitrepo
+   updating to branch default
+   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+@@ -37,8 +36,7 @@
+   $ echo "intree = True" >> .hg/hgrc
+   $ hg gexport
+ 
+-  $ echo % do some work
+-  % do some work
++do some work
+   $ git config core.bare false
+   $ git checkout master 2>&1 | sed s/\'/\"/g
+   Already on "master"
+@@ -46,8 +44,7 @@
+   $ git add beta
+   $ fn_git_commit -m 'add beta'
+ 
+-  $ echo % get things back to hg
+-  % get things back to hg
++get things back to hg
+   $ hg gimport
+   importing git objects into hg
+   $ hg log --graph --debug | grep -v ': *master' | grep -v phase:
+@@ -76,7 +73,6 @@
+      add alpha
+   
+   
+-  $ echo % gimport should have updated the bookmarks as well
+-  % gimport should have updated the bookmarks as well
++gimport should have updated the bookmarks as well
+   $ hg bookmarks
+      master                    1:7108ae7bd184
+diff -r a5571df60aa1 tests/test-hg-tags.t
+--- a/tests/test-hg-tags.t	Wed Oct 31 00:24:09 2012 -0400
++++ b/tests/test-hg-tags.t	Wed Oct 31 00:42:18 2012 -0400
+@@ -42,8 +42,7 @@
+ 
+   $ cd ..
+   $ cd gitrepo
+-  $ echo % git should have the tag alpha
+-  % git should have the tag alpha
++git should have the tag alpha
+   $ git tag -l
+   alpha
+ 
+@@ -67,7 +66,6 @@
+      summary:     add alpha
+   
+ 
+-  $ echo % the tag should be in .hgtags
+-  % the tag should be in .hgtags
++the tag should be in .hgtags
+   $ cat hgrepo2/.hgtags
+   3442585be8a60c6cd476bbc4e45755339f2a23ef alpha
+diff -r a5571df60aa1 tests/test-incoming.t
+--- a/tests/test-incoming.t	Wed Oct 31 00:24:09 2012 -0400
++++ b/tests/test-incoming.t	Wed Oct 31 00:42:18 2012 -0400
+@@ -87,8 +87,7 @@
+   +gamma 2
+   
+ 
+-  $ echo % incoming -r
+-  % incoming -r
++incoming -r
+   $ hg incoming -r master | grep -v 'no changes found' | grep -v 'bookmark:'
+   comparing with $TESTTMP/gitrepo
+   changeset:   1:9497a4ee62e1
+@@ -118,8 +117,7 @@
+   summary:     add d/gamma
+   
+ 
+-  $ echo % nothing incoming after pull
+-  % nothing incoming after pull
++nothing incoming after pull
+ "adding remote bookmark" message was added in Mercurial 2.3
+   $ hg pull | grep -v "adding remote bookmark"
+   pulling from $TESTTMP/gitrepo
+@@ -127,6 +125,3 @@
+   (run 'hg heads' to see heads, 'hg merge' to merge)
+   $ hg incoming | grep -v 'no changes found' | grep -v 'bookmark:'
+   comparing with $TESTTMP/gitrepo
+-
+-  $ echo 'done'
+-  done
+diff -r a5571df60aa1 tests/test-merge.t
+--- a/tests/test-merge.t	Wed Oct 31 00:24:09 2012 -0400
++++ b/tests/test-merge.t	Wed Oct 31 00:42:18 2012 -0400
+@@ -37,8 +37,7 @@
+   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+   $ cd hgrepo
+ 
+-  $ echo % clear the cache to be sure it is regenerated correctly
+-  % clear the cache to be sure it is regenerated correctly
++clear the cache to be sure it is regenerated correctly
+   $ hg gclear
+   clearing out the git cache data
+   $ hg push ../gitrepo2
+@@ -46,8 +45,7 @@
+   searching for changes
+ 
+   $ cd ..
+-  $ echo % git log in repo pushed from hg
+-  % git log in repo pushed from hg
++git log in repo pushed from hg
+   $ git --git-dir=gitrepo2 log --pretty=medium master | sed 's/\.\.\.//g'
+   commit 5806851511aaf3bfe813ae3a86c5027165fa9b96
+   Merge: e5023f9 9497a4e
+diff -r a5571df60aa1 tests/test-outgoing.t
+--- a/tests/test-outgoing.t	Wed Oct 31 00:24:09 2012 -0400
++++ b/tests/test-outgoing.t	Wed Oct 31 00:42:18 2012 -0400
+@@ -72,8 +72,7 @@
+ 
+   $ cd ..
+ 
+-  $ echo % some more work on master from git
+-  % some more work on master from git
++some more work on master from git
+   $ cd gitrepo
+ 
+ Check state of refs after outgoing
+@@ -90,14 +89,12 @@
+   $ cd ..
+ 
+   $ cd hgrepo
+-  $ echo % this will fail # maybe we should try to make it work
+-  % this will fail
++this will fail # maybe we should try to make it work
+   $ hg outgoing
+   comparing with */gitrepo (glob)
+   abort: refs/heads/master changed on the server, please pull and merge before pushing
+   [255]
+-  $ echo % let\'s pull and try again
+-  % let's pull and try again
++let's pull and try again
+   $ hg pull 2>&1 | grep -v 'divergent bookmark'
+   pulling from */gitrepo (glob)
+   importing git objects into hg
+diff -r a5571df60aa1 tests/test-pull-after-strip.t
+--- a/tests/test-pull-after-strip.t	Wed Oct 31 00:24:09 2012 -0400
++++ b/tests/test-pull-after-strip.t	Wed Oct 31 00:42:18 2012 -0400
+@@ -30,8 +30,7 @@
+ 
+ 
+   $ cd ..
+-  $ echo % clone a tag
+-  % clone a tag
++clone a tag
+   $ hg clone -r alpha gitrepo hgrepo-a | grep -v '^updating'
+   importing git objects into hg
+   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+@@ -44,8 +43,7 @@
+      date:        Mon Jan 01 00:00:10 2007 +0000
+      summary:     add alpha
+   
+-  $ echo % clone a branch
+-  % clone a branch
++clone a branch
+   $ hg clone -r beta gitrepo hgrepo-b | grep -v '^updating'
+   importing git objects into hg
+   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+@@ -80,8 +78,7 @@
+   [255]
+   $ hg git-cleanup
+   git commit map cleaned
+-  $ echo % pull works after \'hg git-cleanup\'
+-  % pull works after 'hg git-cleanup'
++pull works after 'hg git-cleanup'
+ "adding remote bookmark" message was added in Mercurial 2.3
+   $ hg pull -r beta | grep -v "adding remote bookmark"
+   pulling from $TESTTMP/gitrepo
+diff -r a5571df60aa1 tests/test-push.t
+--- a/tests/test-push.t	Wed Oct 31 00:24:09 2012 -0400
++++ b/tests/test-push.t	Wed Oct 31 00:42:18 2012 -0400
+@@ -33,16 +33,14 @@
+ 
+   $ cd ..
+ 
+-  $ echo % should have two different branches
+-  % should have two different branches
++should have two different branches
+   $ cd gitrepo
+   $ git branch -v
+     beta       cffa0e8 add beta
+     master     7eeab2e add alpha
+   * not-master 7eeab2e add alpha
+ 
+-  $ echo % some more work on master from git
+-  % some more work on master from git
++some more work on master from git
+   $ git checkout master 2>&1 | sed s/\'/\"/g
+   Switched to branch "master"
+   $ echo delta > delta
+@@ -54,16 +52,14 @@
+   $ cd ..
+ 
+   $ cd hgrepo
+-  $ echo % this should fail
+-  % this should fail
++this should fail
+   $ hg push -r master
+   pushing to $TESTTMP/gitrepo
+   searching for changes
+   abort: refs/heads/master changed on the server, please pull and merge before pushing
+   [255]
+ 
+-  $ echo % ... even with -f
+-  % ... even with -f
++... even with -f
+   $ hg push -fr master
+   pushing to $TESTTMP/gitrepo
+   searching for changes
+@@ -77,8 +73,7 @@
+ TODO shouldn't need to do this since we're (in theory) pushing master explicitly,
+ which should not implicitly also push the not-master ref.
+   $ hg book not-master -r default/not-master --force
+-  $ echo % master and default/master should be diferent
+-  % master and default/master should be diferent
++master and default/master should be diferent
+   $ hg log -r master | grep -v ': *master'
+   changeset:   2:72f56395749d
+   user:        test
+@@ -95,22 +90,19 @@
+   summary:     add delta
+   
+ 
+-  $ echo % this should also fail
+-  % this should also fail
++this should also fail
+   $ hg push -r master
+   pushing to $TESTTMP/gitrepo
+   searching for changes
+   abort: pushing refs/heads/master overwrites 72f56395749d
+   [255]
+ 
+-  $ echo % ... but succeed with -f
+-  % ... but succeed with -f
++... but succeed with -f
+   $ hg push -fr master
+   pushing to $TESTTMP/gitrepo
+   searching for changes
+ 
+-  $ echo % this should fail, no changes to push
+-  % this should fail, no changes to push
++this should fail, no changes to push
+ The exit code for this was broken in Mercurial (incorrectly returning 0) until
+ issue3228 was fixed in 2.1
+   $ hg push -r master && false
+diff -r a5571df60aa1 tests/test-subrepos.t
+--- a/tests/test-subrepos.t	Wed Oct 31 00:24:09 2012 -0400
++++ b/tests/test-subrepos.t	Wed Oct 31 00:42:18 2012 -0400
+@@ -28,10 +28,7 @@
+ allow commits despite working copy presense
+   $ git config receive.denyCurrentBranch ignore
+   $ cd ..
+-  $ echo
+-  
+-  $ echo % Ensure gitlinks are transformed to .hgsubstate on hg pull from git
+-  % Ensure gitlinks are transformed to .hgsubstate on hg pull from git
++Ensure gitlinks are transformed to .hgsubstate on hg pull from git
+   $ hg clone gitrepo1 hgrepo
+   importing git objects into hg
+   updating to branch default
+@@ -41,27 +38,20 @@
+   $ cd hgrepo
+   $ hg bookmarks -f -r default master
+ 1. Ensure gitlinks are transformed to .hgsubstate on hg <- git pull
+-  $ echo % .hgsub shall list two [git] subrepos
+-  % .hgsub shall list two [git] subrepos
++.hgsub shall list two [git] subrepos
+   $ cat .hgsub
+   subrepo1 = [git]../gitsubrepo
+   xyz/subrepo2 = [git]../gitsubrepo
+-  $ echo % .hgsubstate shall list two idenitcal revisions
+-  % .hgsubstate shall list two idenitcal revisions
++.hgsubstate shall list two idenitcal revisions
+   $ cat .hgsubstate
+   56f0304c5250308f14cfbafdc27bd12d40154d17 subrepo1
+   56f0304c5250308f14cfbafdc27bd12d40154d17 xyz/subrepo2
+-  $ echo % hg status shall NOT report .hgsub and .hgsubstate as untracked - either ignored or unmodified
+-  % hg status shall NOT report .hgsub and .hgsubstate as untracked - either ignored or unmodified
++hg status shall NOT report .hgsub and .hgsubstate as untracked - either ignored or unmodified
+   $ hg status --unknown .hgsub .hgsubstate
+   $ hg status --modified .hgsub .hgsubstate
+   $ cd ..
+-  $ echo
+-  
+ 
+ 2. Check gitmodules are preserved during hg -> git push
+-  $ echo % Check gitmodules are preserved during hg push to git
+-  % Check gitmodules are preserved during hg push to git
+   $ cd gitsubrepo
+   $ echo gamma > gamma
+   $ git add gamma
+@@ -85,8 +75,7 @@
+   searching for changes
+   $ cd ..
+   $ cd gitrepo1
+-  $ echo % there shall be two gitlink entries, with values matching that in .hgsubstate
+-  % there shall be two gitlink entries, with values matching that in .hgsubstate
++there shall be two gitlink entries, with values matching that in .hgsubstate
+   $ git ls-tree -r HEAD^{tree} | grep 'commit'
+   160000 commit 56f0304c5250308f14cfbafdc27bd12d40154d17	subrepo1
+   160000 commit aabf7cd015089aff0b84596e69aa37b24a3d090a	xyz/subrepo2
+@@ -94,12 +83,8 @@
+   $ git reset --hard
+   HEAD is now at 4663c49 Update subrepo2 from hg
+   $ cd ..
+-  $ echo
+-  
+ 
+ 3. Check .hgsub and .hgsubstate from git repository are merged, not overwritten
+-  $ echo Check .hgsub and .hgsubstate from git repository are merged, not overwritten
+-  Check .hgsub and .hgsubstate from git repository are merged, not overwritten
+   $ hg init hgsub
+   $ cd hgsub
+   $ echo delta > delta
+@@ -119,14 +104,12 @@
+   cloning subrepo hgsub from $TESTTMP/hgsub
+   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+   $ cd ..
+-  $ echo % pull shall bring .hgsub entry which was added to the git repo
+-  % pull shall bring .hgsub entry which was added to the git repo
++pull shall bring .hgsub entry which was added to the git repo
+   $ cat hgrepo/.hgsub
+   hgsub = $TESTTMP/hgsub
+   subrepo1 = [git]../gitsubrepo
+   xyz/subrepo2 = [git]../gitsubrepo
+-  $ echo % .hgsubstate shall list revision of the subrepo added through git repo
+-  % .hgsubstate shall list revision of the subrepo added through git repo
++.hgsubstate shall list revision of the subrepo added through git repo
+   $ cat hgrepo/.hgsubstate
+   481ec30d580f333ae3a77f94c973ce37b69d5bda hgsub
+   56f0304c5250308f14cfbafdc27bd12d40154d17 subrepo1

test-extract-extension-config.diff

+# HG changeset patch
+# Parent a9165a7d8082a6d31539de0d97685614818efcd2
+tests: extract extension configuration into a testutil library
+
+Thanks to Felipe Contreras for the patch which this was based on.
+
+Even though the MQ extension was only used in a single test
+(test-pull-after-strip.t), I included it in the testutil.  It shouldn't hurt
+anything to have it enabled and not used, and saves us from having to deal
+with enabling extensions in individual tests at all.
+
+Similarly, this changeset results in the graphlog extension being enabled
+for all tests, even though there were some that didn't use it before.  This is
+even less significant in Mercurial 2.3+, since in those versions, graphlog is
+part of core, and is available even when the extension is disabled.
+
+diff --git a/tests/test-bookmark-workflow.t b/tests/test-bookmark-workflow.t
+--- a/tests/test-bookmark-workflow.t
++++ b/tests/test-bookmark-workflow.t
+@@ -9,6 +9,9 @@
+ of bookmarks should be considered "under test", and mutation of bookmarks
+ locally is only to provide a test fixture.
+ 
++Load commonly used test logic
++  $ . "$TESTDIR/testutil"
++
+ bail if the user does not have git command-line client
+   $ "$TESTDIR/hghave" git || exit 80
+ 
+@@ -19,9 +22,6 @@
+   $ python -c 'from mercurial import util ; assert \
+   >  util.version() != "unknown" and util.version() >= "2.1"' || exit 80
+ 
+-  $ echo "[extensions]" >> $HGRCPATH
+-  $ echo "hggit=$(echo $(dirname $TESTDIR))/hggit" >> $HGRCPATH
+-
+   $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
+   $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL
+   $ GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE
+diff --git a/tests/test-clone.t b/tests/test-clone.t
+--- a/tests/test-clone.t
++++ b/tests/test-clone.t
+@@ -1,13 +1,12 @@
++Load commonly used test logic
++  $ . "$TESTDIR/testutil"
++
+ bail if the user does not have git command-line client
+   $ "$TESTDIR/hghave" git || exit 80
+ 
+ bail if the user does not have dulwich
+   $ python -c 'import dulwich, dulwich.repo' || exit 80
+ 
+-  $ echo "[extensions]" >> $HGRCPATH
+-  $ echo "hggit=$(echo $(dirname $TESTDIR))/hggit" >> $HGRCPATH
+-  $ echo 'hgext.graphlog =' >> $HGRCPATH
+-
+   $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
+   $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL
+   $ GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE
+diff --git a/tests/test-conflict-1.t b/tests/test-conflict-1.t
+--- a/tests/test-conflict-1.t
++++ b/tests/test-conflict-1.t
+@@ -1,13 +1,12 @@
++Load commonly used test logic
++  $ . "$TESTDIR/testutil"
++
+ bail if the user does not have git command-line client
+   $ "$TESTDIR/hghave" git || exit 80
+ 
+ bail if the user does not have dulwich
+   $ python -c 'import dulwich, dulwich.repo' || exit 80
+ 
+-  $ echo "[extensions]" >> $HGRCPATH
+-  $ echo "hggit=$(echo $(dirname $TESTDIR))/hggit" >> $HGRCPATH
+-  $ echo 'hgext.graphlog =' >> $HGRCPATH
+-
+   $ hg init hgrepo1
+   $ cd hgrepo1
+   $ echo A > afile
+diff --git a/tests/test-conflict-2.t b/tests/test-conflict-2.t
+--- a/tests/test-conflict-2.t
++++ b/tests/test-conflict-2.t
+@@ -1,13 +1,12 @@
++Load commonly used test logic
++  $ . "$TESTDIR/testutil"
++
+ bail if the user does not have git command-line client
+   $ "$TESTDIR/hghave" git || exit 80
+ 
+ bail if the user does not have dulwich
+   $ python -c 'import dulwich, dulwich.repo' || exit 80
+ 
+-  $ echo "[extensions]" >> $HGRCPATH
+-  $ echo "hggit=$(echo $(dirname $TESTDIR))/hggit" >> $HGRCPATH
+-  $ echo 'hgext.graphlog =' >> $HGRCPATH
+-
+   $ hg init hgrepo1
+   $ cd hgrepo1
+   $ echo A > afile
+diff --git a/tests/test-convergedmerge.t b/tests/test-convergedmerge.t
+--- a/tests/test-convergedmerge.t
++++ b/tests/test-convergedmerge.t
+@@ -1,13 +1,12 @@
++Load commonly used test logic
++  $ . "$TESTDIR/testutil"
++
+ bail if the user does not have git command-line client
+   $ "$TESTDIR/hghave" git || exit 80
+ 
+ bail if the user does not have dulwich
+   $ python -c 'import dulwich, dulwich.repo' || exit 80
+ 
+-  $ echo "[extensions]" >> $HGRCPATH
+-  $ echo "hggit=$(echo $(dirname $TESTDIR))/hggit" >> $HGRCPATH
+-  $ echo 'hgext.graphlog =' >> $HGRCPATH
+-
+   $ hg init hgrepo1
+   $ cd hgrepo1
+   $ echo A > afile
+diff --git a/tests/test-empty-working-tree.t b/tests/test-empty-working-tree.t
+--- a/tests/test-empty-working-tree.t
++++ b/tests/test-empty-working-tree.t
+@@ -1,12 +1,12 @@
++Load commonly used test logic
++  $ . "$TESTDIR/testutil"
++
+ bail if the user does not have git command-line client
+   $ "$TESTDIR/hghave" git || exit 80
+ 
+ bail if the user does not have dulwich
+   $ python -c 'import dulwich, dulwich.repo' || exit 80
+ 
+-  $ echo "[extensions]" >> $HGRCPATH
+-  $ echo "hggit=$(echo $(dirname $TESTDIR))/hggit" >> $HGRCPATH
+-
+   $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
+   $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL
+   $ GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE
+diff --git a/tests/test-encoding.t b/tests/test-encoding.t
+--- a/tests/test-encoding.t
++++ b/tests/test-encoding.t
+@@ -1,15 +1,14 @@
+ # -*- coding: utf-8 -*-
+ 
++Load commonly used test logic
++  $ . "$TESTDIR/testutil"
++
+ bail if the user does not have git command-line client
+   $ "$TESTDIR/hghave" git || exit 80
+ 
+ bail if the user does not have dulwich
+   $ python -c 'import dulwich, dulwich.repo' || exit 80
+ 
+-  $ echo "[extensions]" >> $HGRCPATH
+-  $ echo "hggit=$(echo $(dirname $TESTDIR))/hggit" >> $HGRCPATH
+-  $ echo 'hgext.graphlog =' >> $HGRCPATH
+-
+   $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
+   $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL
+   $ GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE
+diff --git a/tests/test-file-removal.t b/tests/test-file-removal.t
+--- a/tests/test-file-removal.t
++++ b/tests/test-file-removal.t
+@@ -1,13 +1,12 @@
++Load commonly used test logic
++  $ . "$TESTDIR/testutil"
++
+ bail if the user does not have git command-line client
+   $ "$TESTDIR/hghave" git || exit 80
+ 
+ bail if the user does not have dulwich
+   $ python -c 'import dulwich, dulwich.repo' || exit 80
+ 
+-  $ echo "[extensions]" >> $HGRCPATH
+-  $ echo "hggit=$(echo $(dirname $TESTDIR))/hggit" >> $HGRCPATH
+-  $ echo 'hgext.graphlog =' >> $HGRCPATH
+-
+   $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
+   $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL
+   $ GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE
+diff --git a/tests/test-git-clone.t b/tests/test-git-clone.t
+--- a/tests/test-git-clone.t
++++ b/tests/test-git-clone.t
+@@ -1,13 +1,12 @@
++Load commonly used test logic
++  $ . "$TESTDIR/testutil"
++
+ bail if the user does not have git command-line client
+   $ "$TESTDIR/hghave" git || exit 80
+ 
+ bail if the user does not have dulwich
+   $ python -c 'import dulwich, dulwich.repo' || exit 80
+ 
+-  $ echo "[extensions]" >> $HGRCPATH
+-  $ echo "hggit=$(echo $(dirname $TESTDIR))/hggit" >> $HGRCPATH
+-  $ echo 'hgext.graphlog =' >> $HGRCPATH
+-
+   $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
+   $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL
+   $ GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE
+diff --git a/tests/test-git-submodules.t b/tests/test-git-submodules.t
+--- a/tests/test-git-submodules.t
++++ b/tests/test-git-submodules.t
+@@ -1,13 +1,12 @@
++Load commonly used test logic
++  $ . "$TESTDIR/testutil"
++
+ bail if the user does not have git command-line client
+   $ "$TESTDIR/hghave" git || exit 80
+ 
+ bail if the user does not have dulwich
+   $ python -c 'import dulwich, dulwich.repo' || exit 80
+ 
+-  $ echo "[extensions]" >> $HGRCPATH
+-  $ echo "hggit=$(echo $(dirname $TESTDIR))/hggit" >> $HGRCPATH
+-  $ echo 'hgext.graphlog =' >> $HGRCPATH
+-
+   $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
+   $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL
+   $ GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE
+diff --git a/tests/test-git-tags.t b/tests/test-git-tags.t
+--- a/tests/test-git-tags.t
++++ b/tests/test-git-tags.t
+@@ -1,13 +1,12 @@
++Load commonly used test logic
++  $ . "$TESTDIR/testutil"
++
+ bail if the user does not have git command-line client
+   $ "$TESTDIR/hghave" git || exit 80
+ 
+ bail if the user does not have dulwich
+   $ python -c 'import dulwich, dulwich.repo' || exit 80
+ 
+-  $ echo "[extensions]" >> $HGRCPATH
+-  $ echo "hggit=$(echo $(dirname $TESTDIR))/hggit" >> $HGRCPATH
+-  $ echo 'hgext.graphlog =' >> $HGRCPATH
+-
+   $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
+   $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL
+   $ GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE
+diff --git a/tests/test-git-workflow.t b/tests/test-git-workflow.t
+--- a/tests/test-git-workflow.t
++++ b/tests/test-git-workflow.t
+@@ -1,13 +1,12 @@
++Load commonly used test logic
++  $ . "$TESTDIR/testutil"
++
+ bail if the user does not have git command-line client
+   $ "$TESTDIR/hghave" git || exit 80
+ 
+ bail if the user does not have dulwich
+   $ python -c 'import dulwich, dulwich.repo' || exit 80
+ 
+-  $ echo "[extensions]" >> $HGRCPATH
+-  $ echo "hggit=$(echo $(dirname $TESTDIR))/hggit" >> $HGRCPATH
+-  $ echo 'hgext.graphlog =' >> $HGRCPATH
+-
+   $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
+   $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL
+   $ GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE
+diff --git a/tests/test-help.t b/tests/test-help.t
+--- a/tests/test-help.t
++++ b/tests/test-help.t
+@@ -1,7 +1,7 @@
+ Tests that the various help files are properly registered
+ 
+-  $ echo "[extensions]" >> $HGRCPATH
+-  $ echo "hggit=$(echo $(dirname $TESTDIR))/hggit" >> $HGRCPATH
++Load commonly used test logic
++  $ . "$TESTDIR/testutil"
+ 
+   $ hg help | grep 'git' | sed 's/  */ /g'
+    hggit push and pull from a Git server
+diff --git a/tests/test-hg-author.t b/tests/test-hg-author.t
+--- a/tests/test-hg-author.t
++++ b/tests/test-hg-author.t
+@@ -1,13 +1,12 @@
++Load commonly used test logic
++  $ . "$TESTDIR/testutil"
++
+ bail if the user does not have git command-line client
+   $ "$TESTDIR/hghave" git || exit 80
+ 
+ bail if the user does not have dulwich
+   $ python -c 'import dulwich, dulwich.repo' || exit 80
+ 
+-  $ echo "[extensions]" >> $HGRCPATH
+-  $ echo "hggit=$(echo $(dirname $TESTDIR))/hggit" >> $HGRCPATH
+-  $ echo 'hgext.graphlog =' >> $HGRCPATH
+-
+   $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
+   $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL
+   $ GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE
+diff --git a/tests/test-hg-branch.t b/tests/test-hg-branch.t
+--- a/tests/test-hg-branch.t
++++ b/tests/test-hg-branch.t
+@@ -1,13 +1,12 @@
++Load commonly used test logic
++  $ . "$TESTDIR/testutil"
++
+ bail if the user does not have git command-line client
+   $ "$TESTDIR/hghave" git || exit 80
+ 
+ bail if the user does not have dulwich
+   $ python -c 'import dulwich, dulwich.repo' || exit 80
+ 
+-  $ echo "[extensions]" >> $HGRCPATH
+-  $ echo "hggit=$(echo $(dirname $TESTDIR))/hggit" >> $HGRCPATH
+-  $ echo 'hgext.graphlog =' >> $HGRCPATH
+-
+   $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
+   $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL
+   $ GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE
+diff --git a/tests/test-hg-tags.t b/tests/test-hg-tags.t
+--- a/tests/test-hg-tags.t
++++ b/tests/test-hg-tags.t
+@@ -1,13 +1,12 @@
++Load commonly used test logic
++  $ . "$TESTDIR/testutil"
++
+ bail if the user does not have git command-line client
+   $ "$TESTDIR/hghave" git || exit 80
+ 
+ bail if the user does not have dulwich
+   $ python -c 'import dulwich, dulwich.repo' || exit 80
+ 
+-  $ echo "[extensions]" >> $HGRCPATH
+-  $ echo "hggit=$(echo $(dirname $TESTDIR))/hggit" >> $HGRCPATH
+-  $ echo 'hgext.graphlog =' >> $HGRCPATH
+-
+   $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
+   $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL
+   $ GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE
+diff --git a/tests/test-incoming.t b/tests/test-incoming.t
+--- a/tests/test-incoming.t
++++ b/tests/test-incoming.t
+@@ -1,3 +1,6 @@
++Load commonly used test logic
++  $ . "$TESTDIR/testutil"
++
+ bail if the user does not have git command-line client
+   $ "$TESTDIR/hghave" git || exit 80
+ 
+@@ -8,10 +11,6 @@
+   $ python -c 'from mercurial import util ; assert \
+   >  util.version() != "unknown" and util.version() > "1.7"' || exit 80
+ 
+-  $ echo "[extensions]" >> $HGRCPATH
+-  $ echo "hggit=$(echo $(dirname $TESTDIR))/hggit" >> $HGRCPATH
+-  $ echo 'hgext.graphlog =' >> $HGRCPATH
+-
+   $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
+   $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL
+   $ GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE
+diff --git a/tests/test-keywords.t b/tests/test-keywords.t
+--- a/tests/test-keywords.t
++++ b/tests/test-keywords.t
+@@ -1,12 +1,12 @@
++Load commonly used test logic
++  $ . "$TESTDIR/testutil"
++
+ bail if the user does not have git command-line client
+   $ "$TESTDIR/hghave" git || exit 80
+ 
+ bail if the user does not have dulwich
+   $ python -c 'import dulwich, dulwich.repo' || exit 80
+ 
+-  $ echo "[extensions]" >> $HGRCPATH
+-  $ echo "hggit=$(echo $(dirname $TESTDIR))/hggit" >> $HGRCPATH
+-
+   $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
+   $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL
+   $ GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE
+diff --git a/tests/test-merge.t b/tests/test-merge.t
+--- a/tests/test-merge.t
++++ b/tests/test-merge.t
+@@ -1,13 +1,12 @@
++Load commonly used test logic
++  $ . "$TESTDIR/testutil"
++
+ bail if the user does not have git command-line client
+   $ "$TESTDIR/hghave" git || exit 80
+ 
+ bail if the user does not have dulwich
+   $ python -c 'import dulwich, dulwich.repo' || exit 80
+ 
+-  $ echo "[extensions]" >> $HGRCPATH
+-  $ echo "hggit=$(echo $(dirname $TESTDIR))/hggit" >> $HGRCPATH
+-  $ echo 'hgext.graphlog =' >> $HGRCPATH
+-
+   $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
+   $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL
+   $ GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE
+diff --git a/tests/test-octopus.t b/tests/test-octopus.t
+--- a/tests/test-octopus.t
++++ b/tests/test-octopus.t
+@@ -1,13 +1,12 @@
++Load commonly used test logic
++  $ . "$TESTDIR/testutil"
++
+ bail if the user does not have git command-line client
+   $ "$TESTDIR/hghave" git || exit 80
+ 
+ bail if the user does not have dulwich
+   $ python -c 'import dulwich, dulwich.repo' || exit 80
+ 
+-  $ echo "[extensions]" >> $HGRCPATH
+-  $ echo "hggit=$(echo $(dirname $TESTDIR))/hggit" >> $HGRCPATH
+-  $ echo 'hgext.graphlog =' >> $HGRCPATH
+-
+   $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
+   $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL
+   $ GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE
+diff --git a/tests/test-outgoing.t b/tests/test-outgoing.t
+--- a/tests/test-outgoing.t
++++ b/tests/test-outgoing.t
+@@ -1,13 +1,12 @@
++Load commonly used test logic
++  $ . "$TESTDIR/testutil"
++
+ bail if the user does not have git command-line client
+   $ "$TESTDIR/hghave" git || exit 80
+ 
+ bail if the user does not have dulwich
+   $ python -c 'import dulwich, dulwich.repo' || exit 80
+ 
+-  $ echo "[extensions]" >> $HGRCPATH
+-  $ echo "hggit=$(echo $(dirname $TESTDIR))/hggit" >> $HGRCPATH
+-  $ echo 'hgext.graphlog =' >> $HGRCPATH
+-
+   $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
+   $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL
+   $ GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE
+diff --git a/tests/test-pull-after-strip.t b/tests/test-pull-after-strip.t
+--- a/tests/test-pull-after-strip.t
++++ b/tests/test-pull-after-strip.t
+@@ -1,3 +1,6 @@
++Load commonly used test logic
++  $ . "$TESTDIR/testutil"
++
+ bail if the user does not have git command-line client
+   $ "$TESTDIR/hghave" git || exit 80
+ 
+@@ -15,13 +18,6 @@
+ bail if the user does not have dulwich
+   $ python -c 'import dulwich, dulwich.repo' || exit 80
+ 
+-  $ cat >> $HGRCPATH <<EOF
+-  > [extensions]
+-  > graphlog=
+-  > mq=
+-  > EOF
+-  $ echo "hggit=$(echo $(dirname $TESTDIR))/hggit" >> $HGRCPATH
+-
+   $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
+   $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL
+   $ GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE
+diff --git a/tests/test-pull.t b/tests/test-pull.t
+--- a/tests/test-pull.t
++++ b/tests/test-pull.t
+@@ -1,13 +1,12 @@
++Load commonly used test logic
++  $ . "$TESTDIR/testutil"
++
+ bail if the user does not have git command-line client
+   $ "$TESTDIR/hghave" git || exit 80
+ 
+ bail if the user does not have dulwich
+   $ python -c 'import dulwich, dulwich.repo' || exit 80
+ 
+-  $ echo "[extensions]" >> $HGRCPATH
+-  $ echo "hggit=$(echo $(dirname $TESTDIR))/hggit" >> $HGRCPATH
+-  $ echo 'hgext.graphlog =' >> $HGRCPATH
+-
+   $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
+   $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL
+   $ GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE
+diff --git a/tests/test-push-r.t b/tests/test-push-r.t
+--- a/tests/test-push-r.t
++++ b/tests/test-push-r.t
+@@ -1,10 +1,9 @@
++Load commonly used test logic
++  $ . "$TESTDIR/testutil"
++
+ bail if the user does not have dulwich
+   $ python -c 'import dulwich, dulwich.repo' || exit 80
+ 
+-  $ echo "[extensions]" >> $HGRCPATH
+-  $ echo "hggit=$(echo $(dirname $TESTDIR))/hggit" >> $HGRCPATH
+-  $ echo 'hgext.graphlog =' >> $HGRCPATH
+-
+   $ hg init test
+   $ cd test
+   $ cat >>afile <<EOF
+diff --git a/tests/test-push.t b/tests/test-push.t
+--- a/tests/test-push.t
++++ b/tests/test-push.t
+@@ -1,13 +1,12 @@
++Load commonly used test logic
++  $ . "$TESTDIR/testutil"
++
+ bail if the user does not have git command-line client
+   $ "$TESTDIR/hghave" git || exit 80
+ 
+ bail if the user does not have dulwich
+   $ python -c 'import dulwich, dulwich.repo' || exit 80
+ 
+-  $ echo "[extensions]" >> $HGRCPATH
+-  $ echo "hggit=$(echo $(dirname $TESTDIR))/hggit" >> $HGRCPATH
+-  $ echo 'hgext.graphlog =' >> $HGRCPATH
+-
+   $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
+   $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL
+   $ GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE
+diff --git a/tests/test-subrepos.t b/tests/test-subrepos.t
+--- a/tests/test-subrepos.t
++++ b/tests/test-subrepos.t
+@@ -1,12 +1,12 @@
++Load commonly used test logic
++  $ . "$TESTDIR/testutil"
++
+ bail if the user does not have git command-line client
+   $ "$TESTDIR/hghave" git || exit 80
+ 
+ bail if the user does not have dulwich
+   $ python -c 'import dulwich, dulwich.repo' || exit 80
+ 
+-  $ echo "[extensions]" >> $HGRCPATH
+-  $ echo "hggit=$(echo $(dirname $TESTDIR))/hggit" >> $HGRCPATH
+-
+   $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
+   $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL
+   $ GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE
+diff --git a/tests/test-tree-decomposition.t b/tests/test-tree-decomposition.t
+--- a/tests/test-tree-decomposition.t
++++ b/tests/test-tree-decomposition.t
+@@ -1,12 +1,12 @@
++Load commonly used test logic
++  $ . "$TESTDIR/testutil"
++
+ bail if the user does not have git command-line client
+   $ "$TESTDIR/hghave" git || exit 80
+ 
+ bail if the user does not have dulwich
+   $ python -c 'import dulwich, dulwich.repo' || exit 80
+ 
+-  $ echo "[extensions]" >> $HGRCPATH
+-  $ echo "hggit=$(echo $(dirname $TESTDIR))/hggit" >> $HGRCPATH
+-
+   $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME