1. David Carr
  2. hg-git-queue

Commits

David Carr  committed ce49d8e

remove accepted patches, snapshot latest submissions

  • Participants
  • Parent commits 6fe4b9f
  • Branches default

Comments (0)

Files changed (26)

File dont-pull-tags-as-bookmarks.diff

-# HG changeset patch
-# Parent 64479303803bd85a91e5aa38fa7dd391f225dd66
-pull: don't pull tags as bookmarks
-
-This should fix a bug introduced by 4f4ab2d which caused all tags to be
-duplicated as bookmarks on pull.
-
-Test coverage has been added for pull to allow verifying the fix.
-
-diff -r 64479303803b hggit/gitrepo.py
---- a/hggit/gitrepo.py	Fri Oct 26 22:06:57 2012 -0400
-+++ b/hggit/gitrepo.py	Fri Oct 26 22:46:02 2012 -0400
-@@ -62,9 +62,9 @@
-                 newcommits = [bin(c) for c in commits]
-                 b = overlayrepo(handler, newcommits, refs)
-                 stripped_refs = dict([
--                    (ref[ref.find('/', ref.find('/')+1)+1:], b.node(refs[ref]))
-+                    (ref[ref.find('refs/heads/')+11:], b.node(refs[ref]))
-                         for ref in refs.keys()
--                            if ref.find('/') != -1])
-+                            if ref.startswith('refs/heads/')])
-                 return stripped_refs
-         return {}
- 
-diff -r 64479303803b tests/test-pull.t
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/tests/test-pull.t	Fri Oct 26 22:46:02 2012 -0400
-@@ -0,0 +1,163 @@
-+# Fails for some reason, need to investigate
-+#   $ "$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
-+  $ GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; export GIT_COMMITTER_NAME
-+  $ GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"; export GIT_COMMITTER_EMAIL
-+  $ GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"; export GIT_COMMITTER_DATE
-+
-+  $ count=10
-+  $ commit()
-+  > {
-+  >     GIT_AUTHOR_DATE="2007-01-01 00:00:$count +0000"
-+  >     GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"
-+  >     git commit "$@" >/dev/null 2>/dev/null || echo "git commit error"
-+  >     count=`expr $count + 1`
-+  > }
-+
-+set up a git repo with some commits, branches and a tag
-+  $ git init -q gitrepo
-+  $ cd gitrepo
-+  $ echo alpha > alpha
-+  $ git add alpha
-+  $ commit -m 'add alpha'
-+  $ git tag t_alpha
-+  $ git checkout -qb beta
-+  $ echo beta > beta
-+  $ git add beta
-+  $ commit -m 'add beta'
-+  $ cd ..
-+
-+clone a tag (ideally we'd want to pull it, but that seems broken for now)
-+#  $ hg init hgrepo
-+#  $ echo "[paths]" >> hgrepo/.hg/hgrc
-+#  $ echo "default=$TESTTMP/gitrepo" >> hgrepo/.hg/hgrc
-+#  $ hg -R hgrepo pull -r t_alpha
-+  $ hg clone -r t_alpha gitrepo hgrepo
-+  importing git objects into hg
-+  updating to branch default
-+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-+  $ hg -R hgrepo log --graph
-+  @  changeset:   0:3442585be8a6
-+     bookmark:    master
-+     tag:         default/master
-+     tag:         t_alpha
-+     tag:         tip
-+     user:        test <test@example.org>
-+     date:        Mon Jan 01 00:00:10 2007 +0000
-+     summary:     add alpha
-+  
-+pull a branch
-+  $ hg -R hgrepo pull -r beta
-+  pulling from $TESTTMP/gitrepo
-+  importing git objects into hg
-+  (run 'hg update' to get a working copy)
-+  $ hg -R hgrepo log --graph
-+  o  changeset:   1:7bcd915dc873
-+  |  bookmark:    beta
-+  |  tag:         default/beta
-+  |  tag:         tip
-+  |  user:        test <test@example.org>
-+  |  date:        Mon Jan 01 00:00:11 2007 +0000
-+  |  summary:     add beta
-+  |
-+  @  changeset:   0:3442585be8a6
-+     bookmark:    master
-+     tag:         default/master
-+     tag:         t_alpha
-+     user:        test <test@example.org>
-+     date:        Mon Jan 01 00:00:10 2007 +0000
-+     summary:     add alpha
-+  
-+add another commit and tag to the git repo
-+  $ cd gitrepo
-+  $ git tag t_beta
-+  $ git checkout -q master
-+  $ echo gamma > gamma
-+  $ git add gamma
-+  $ commit -m 'add gamma'
-+  $ cd ..
-+
-+pull everything else
-+  $ hg -R hgrepo pull
-+  pulling from $TESTTMP/gitrepo
-+  importing git objects into hg
-+  (run 'hg update' to get a working copy)
-+  $ hg -R hgrepo log --graph
-+  o  changeset:   2:37c124f2d0a0
-+  |  bookmark:    master
-+  |  tag:         default/master
-+  |  tag:         tip
-+  |  parent:      0:3442585be8a6
-+  |  user:        test <test@example.org>
-+  |  date:        Mon Jan 01 00:00:12 2007 +0000
-+  |  summary:     add gamma
-+  |
-+  | o  changeset:   1:7bcd915dc873
-+  |/   bookmark:    beta
-+  |    tag:         default/beta
-+  |    tag:         t_beta
-+  |    user:        test <test@example.org>
-+  |    date:        Mon Jan 01 00:00:11 2007 +0000
-+  |    summary:     add beta
-+  |
-+  @  changeset:   0:3442585be8a6
-+     tag:         t_alpha
-+     user:        test <test@example.org>
-+     date:        Mon Jan 01 00:00:10 2007 +0000
-+     summary:     add alpha
-+  
-+add a merge to the git repo
-+  $ cd gitrepo
-+  $ git merge beta
-+  Merge made by the 'recursive' strategy.
-+   beta |    1 +
-+   1 file changed, 1 insertion(+)
-+   create mode 100644 beta
-+  $ cd ..
-+
-+pull the merge
-+  $ hg -R hgrepo pull
-+  pulling from $TESTTMP/gitrepo
-+  importing git objects into hg
-+  (run 'hg update' to get a working copy)
-+  $ hg -R hgrepo log --graph
-+  o    changeset:   3:b8668fddf56c
-+  |\   bookmark:    master
-+  | |  tag:         default/master
-+  | |  tag:         tip
-+  | |  parent:      2:37c124f2d0a0
-+  | |  parent:      1:7bcd915dc873
-+  | |  user:        test <test@example.org>
-+  | |  date:        Mon Jan 01 00:00:12 2007 +0000
-+  | |  summary:     Merge branch 'beta'
-+  | |
-+  | o  changeset:   2:37c124f2d0a0
-+  | |  parent:      0:3442585be8a6
-+  | |  user:        test <test@example.org>
-+  | |  date:        Mon Jan 01 00:00:12 2007 +0000
-+  | |  summary:     add gamma
-+  | |
-+  o |  changeset:   1:7bcd915dc873
-+  |/   bookmark:    beta
-+  |    tag:         default/beta
-+  |    tag:         t_beta
-+  |    user:        test <test@example.org>
-+  |    date:        Mon Jan 01 00:00:11 2007 +0000
-+  |    summary:     add beta
-+  |
-+  @  changeset:   0:3442585be8a6
-+     tag:         t_alpha
-+     user:        test <test@example.org>
-+     date:        Mon Jan 01 00:00:10 2007 +0000
-+     summary:     add alpha
-+  

File 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

File fix-empty-push.diff

-# HG changeset patch
-# Parent cac070a4b5219b86d4999722bbe1ca7f34e55697
-push: fix traceback when pushing empty hg repo to empty git repo (issue #58)
-
-In the logic that was attempting to handle the case where the local repo doesn't
-have any bookmarks, the assumption was being made that tip resolved to a
-non-null revision.  In the case of a totally empty local repo, however, that
-isn't a valid assumption, and resulted in attempting to set the master ref
-to None, which broke dulwich.
-
-The "fix", which avoids the traceback and allows the push to complete (though
-still do nothing, since in this case there aren't any changes to push), is to
-not tweak the refs at all if tip is nullid.  Leaving the special capabilities
-ref and not adding a master ref appears to be fine in this case.
-
-diff -r cac070a4b521 hggit/git_handler.py
---- a/hggit/git_handler.py	Thu Oct 18 12:25:04 2012 -0400
-+++ b/hggit/git_handler.py	Thu Oct 25 00:40:35 2012 -0400
-@@ -887,15 +887,17 @@
- 
-         #The remote repo is empty and the local one doesn't have bookmarks/tags
-         if refs.keys()[0] == 'capabilities^{}':
--            del new_refs['capabilities^{}']
-             if not self.local_heads():
--                tip = hex(self.repo.lookup('tip'))
--                try:
--                    commands.bookmark(self.ui, self.repo, 'master', tip, force=True)
--                except NameError:
--                    bookmarks.bookmark(self.ui, self.repo, 'master', tip, force=True)
--                bookmarks.setcurrent(self.repo, 'master')
--                new_refs['refs/heads/master'] = self.map_git_get(tip)
-+                tip = self.repo.lookup('tip')
-+                if tip != nullid:
-+                    del new_refs['capabilities^{}']
-+                    tip = hex(tip)
-+                    try:
-+                        commands.bookmark(self.ui, self.repo, 'master', tip, force=True)
-+                    except NameError:
-+                        bookmarks.bookmark(self.ui, self.repo, 'master', tip, force=True)
-+                    bookmarks.setcurrent(self.repo, 'master')
-+                    new_refs['refs/heads/master'] = self.map_git_get(tip)
- 
-         for rev in revs:
-             ctx = self.repo[rev]
-diff -r cac070a4b521 tests/test-push.t
---- a/tests/test-push.t	Thu Oct 18 12:25:04 2012 -0400
-+++ b/tests/test-push.t	Thu Oct 25 00:40:35 2012 -0400
-@@ -153,3 +153,15 @@
-   [1]
- 
-   $ cd ..
-+
-+Push empty Hg repo to empty Git repo (issue #58)
-+Since there aren't any changes, exit code 1 is expected in modern Mercurial.
-+However, since it varies between supported Mercurial versions, we need to
-+force it to consistency for now. (see issue3228, fixed in Mercurial 2.1)
-+  $ hg init hgrepo2
-+  $ git init -q --bare gitrepo2
-+  $ hg -R hgrepo2 push gitrepo2 && false
-+  pushing to gitrepo2
-+  searching for changes
-+  no changes found
-+  [1]

File fix-hghave.diff

-# 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"),
-+}

File fix-push-output.diff

-# HG changeset patch
-# Parent 300dba3412542e06751244d558aff49bb4056004
-push: suppress ref output by default
-
-When communicating with the user on push, Mercurial doesn't show much on
-success.  Currently, Hg-Git shows every changed ref.  After this change,
-the default output will more closely match Mercurial's regular behavior (no
-per-ref output), while changed refs will be shown if --verbose is specified,
-and all refs will be shown if --debug is specified.
-
-diff -r 300dba341254 hggit/git_handler.py
---- a/hggit/git_handler.py	Thu Oct 25 20:49:26 2012 -0400
-+++ b/hggit/git_handler.py	Thu Oct 25 21:47:36 2012 -0400
-@@ -279,7 +279,10 @@
-         if remote_name and new_refs:
-             for ref, new_sha in new_refs.iteritems():
-                 if new_sha != old_refs.get(ref):
--                    self.ui.status("    %s::%s => GIT:%s\n" %
-+                    self.ui.note("    %s::%s => GIT:%s\n" %
-+                                   (remote_name, ref, new_sha[0:8]))
-+                else:
-+                    self.ui.debug("    %s::%s => GIT:%s\n" %
-                                    (remote_name, ref, new_sha[0:8]))
- 
-             self.update_remote_branches(remote_name, new_refs)
-diff -r 300dba341254 tests/test-git-tags.t
---- a/tests/test-git-tags.t	Thu Oct 25 20:49:26 2012 -0400
-+++ b/tests/test-git-tags.t	Thu Oct 25 21:47:36 2012 -0400
-@@ -73,6 +73,5 @@
-   pushing to $TESTTMP/gitrepo
-   exporting hg objects to git
-   searching for changes
--      default::refs/heads/master => GIT:3b7fd1b3
- 
-   $ cd ..
-diff -r 300dba341254 tests/test-hg-author.t
---- a/tests/test-hg-author.t	Thu Oct 25 20:49:26 2012 -0400
-+++ b/tests/test-hg-author.t	Thu Oct 25 21:47:36 2012 -0400
-@@ -56,7 +56,6 @@
-   pushing to $TESTTMP/gitrepo
-   exporting hg objects to git
-   searching for changes
--      default::refs/heads/master => GIT:cffa0e8d
- 
-   $ echo gamma >> beta
-   $ hgcommit -u "test <test@example.com> (comment)" -m 'modify beta'
-@@ -64,7 +63,6 @@
-   pushing to $TESTTMP/gitrepo
-   exporting hg objects to git
-   searching for changes
--      default::refs/heads/master => GIT:2b9ec6a4
- 
-   $ echo gamma > gamma
-   $ hg add gamma
-@@ -73,7 +71,6 @@
-   pushing to $TESTTMP/gitrepo
-   exporting hg objects to git
-   searching for changes
--      default::refs/heads/master => GIT:fee30180
- 
-   $ echo delta > delta
-   $ hg add delta
-@@ -82,7 +79,6 @@
-   pushing to $TESTTMP/gitrepo
-   exporting hg objects to git
-   searching for changes
--      default::refs/heads/master => GIT:d1659250
- 
-   $ echo epsilon > epsilon
-   $ hg add epsilon
-@@ -91,7 +87,6 @@
-   pushing to $TESTTMP/gitrepo
-   exporting hg objects to git
-   searching for changes
--      default::refs/heads/master => GIT:ee985f12
- 
-   $ echo zeta > zeta
-   $ hg add zeta
-@@ -100,7 +95,6 @@
-   pushing to $TESTTMP/gitrepo
-   exporting hg objects to git
-   searching for changes
--      default::refs/heads/master => GIT:d21e26b4
- 
-   $ echo eta > eta
-   $ hg add eta
-@@ -109,7 +103,6 @@
-   pushing to $TESTTMP/gitrepo
-   exporting hg objects to git
-   searching for changes
--      default::refs/heads/master => GIT:8c878c97
- 
-   $ echo theta > theta
-   $ hg add theta
-@@ -118,7 +111,6 @@
-   pushing to $TESTTMP/gitrepo
-   exporting hg objects to git
-   searching for changes
--      default::refs/heads/master => GIT:1e03e913
- 
-   $ hg log --graph | egrep -v ': *(not-master|master)'
-   @  changeset:   8:d3c51ce68cfd
-diff -r 300dba341254 tests/test-hg-branch.t
---- a/tests/test-hg-branch.t	Thu Oct 25 20:49:26 2012 -0400
-+++ b/tests/test-hg-branch.t	Thu Oct 25 21:47:36 2012 -0400
-@@ -59,7 +59,6 @@
-   pushing to $TESTTMP/gitrepo
-   exporting hg objects to git
-   searching for changes
--      default::refs/heads/master => GIT:05c2bcbe
- 
-   $ hg branch gamma | grep -v 'permanent and global'
-   marked working directory as branch gamma
-@@ -68,7 +67,6 @@
-   pushing to $TESTTMP/gitrepo
-   exporting hg objects to git
-   searching for changes
--      default::refs/heads/master => GIT:296802ef
- 
-   $ hg log --graph | $filterhash | egrep -v ': *(not-master|master)'
-   @  changeset:   2:05aed681ccb3
-diff -r 300dba341254 tests/test-hg-tags.t
---- a/tests/test-hg-tags.t	Thu Oct 25 20:49:26 2012 -0400
-+++ b/tests/test-hg-tags.t	Thu Oct 25 21:47:36 2012 -0400
-@@ -54,8 +54,6 @@
-   pushing to $TESTTMP/gitrepo
-   exporting hg objects to git
-   searching for changes
--      default::refs/tags/alpha => GIT:7eeab2ea
--      default::refs/heads/master => GIT:9a2616b9
- 
-   $ hg log --graph | egrep -v ': *(not-master|master)'
-   @  changeset:   1:d529e9229f6d
-diff -r 300dba341254 tests/test-push.t
---- a/tests/test-push.t	Thu Oct 25 20:49:26 2012 -0400
-+++ b/tests/test-push.t	Thu Oct 25 21:47:36 2012 -0400
-@@ -61,7 +61,6 @@
-   pushing to $TESTTMP/gitrepo
-   exporting hg objects to git
-   searching for changes
--      default::refs/heads/beta => GIT:cffa0e8d
- 
-   $ cd ..
- 
-@@ -140,7 +139,6 @@
-   $ hg push -fr master
-   pushing to $TESTTMP/gitrepo
-   searching for changes
--      default::refs/heads/master => GIT:cc119202
- 
-   $ echo % this should fail, no changes to push
-   % this should fail, no changes to push
-diff -r 300dba341254 tests/test-subrepos.t
---- a/tests/test-subrepos.t	Thu Oct 25 20:49:26 2012 -0400
-+++ b/tests/test-subrepos.t	Thu Oct 25 21:47:36 2012 -0400
-@@ -117,7 +117,6 @@
-   pushing to $TESTTMP/gitrepo1
-   exporting hg objects to git
-   searching for changes
--      default::refs/heads/master => GIT:4663c492
-   $ cd ..
-   $ cd gitrepo1
-   $ echo % there shall be two gitlink entries, with values matching that in .hgsubstate

File 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

File gitrepo-support-listkeys.diff

-# HG changeset patch
-# Parent e31954248ffdfa088c8765bac3625e732a27f96b
-gitrepo: initial support for listkeys
-
-This changeset adds test coverage for comparing "hg outgoing -B" in normal
-Mercurial usage with Hg-Git usage.  This didn't match, since previously, gitrepo
-didn't provide a meaningful listkeys implementation.  Now, it does.
-
-gitrepo now has access to a GitHandler when a localrepo is available.  This
-handler is used to access the information needed to implement listkeys for
-namespaces (currently, only bookmarks) and bookmarks.
-
-A couple of other tests were testing "divergent bookmark" scenarios.  These
-tests have been updated to filter out the divergent bookmark output, as it isn't
-consistent across the supported Mercurial versions.
-
-diff --git a/hggit/git_handler.py b/hggit/git_handler.py
---- a/hggit/git_handler.py
-+++ b/hggit/git_handler.py
-@@ -966,7 +966,7 @@
-         return new_refs
- 
- 
--    def fetch_pack(self, remote_name, heads):
-+    def fetch_pack(self, remote_name, heads=None):
-         client, path = self.get_transport_and_path(remote_name)
-         graphwalker = self.git.get_graph_walker()
-         def determine_wants(refs):
-diff --git a/hggit/gitrepo.py b/hggit/gitrepo.py
---- a/hggit/gitrepo.py
-+++ b/hggit/gitrepo.py
-@@ -1,3 +1,4 @@
-+import os
- from mercurial import util
- try:
-     from mercurial.error import RepoError
-@@ -11,6 +12,10 @@
- 
- from git_handler import GitHandler
- 
-+from overlay import overlayrepo
-+
-+from mercurial.node import bin
-+
- class gitrepo(peerrepository):
-     capabilities = ['lookup']
- 
-@@ -23,6 +28,12 @@
-         self.ui = ui
-         self.path = path
-         self.localrepo = None
-+        self.handler = None
-+
-+    def _initializehandler(self):
-+        if self.handler is None and self.localrepo is not None:
-+            self.handler = GitHandler(self.localrepo, self.localrepo.ui)
-+        return self.handler
- 
-     def url(self):
-         return self.path
-@@ -39,6 +50,22 @@
-         return []
- 
-     def listkeys(self, namespace):
-+        if namespace == 'namespaces':
-+            return {'bookmarks':''}
-+        elif namespace == 'bookmarks':
-+            handler = self._initializehandler()
-+            if handler:
-+                handler.export_commits()
-+                refs = handler.fetch_pack(self.path)
-+                reqrefs = refs
-+                convertlist, commits = handler.getnewgitcommits(reqrefs)
-+                newcommits = [bin(c) for c in commits]
-+                b = overlayrepo(handler, newcommits, refs)
-+                stripped_refs = dict([
-+                    (ref[ref.find('/', ref.find('/')+1)+1:], b.node(refs[ref]))
-+                        for ref in refs.keys()
-+                            if ref.find('/') != -1])
-+                return stripped_refs
-         return {}
- 
-     def pushkey(self, namespace, key, old, new):
-diff --git a/hggit/overlay.py b/hggit/overlay.py
---- a/hggit/overlay.py
-+++ b/hggit/overlay.py
-@@ -227,6 +227,12 @@
-             return self.handler.repo[n]
-         return overlaychangectx(self, n)
- 
-+    def node(self, n):
-+        """Returns an Hg or Git hash for the specified Git hash"""
-+        if bin(n) in self.revmap:
-+            return n
-+        return self.handler.map_hg_get(n)
-+
-     def nodebookmarks(self, n):
-         return self.refmap.get(n, [])
- 
-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
-@@ -109,6 +109,11 @@
-   searching for changes
-   no changes found
-   [1]
-+  $ hg outgoing -B
-+  comparing with $TESTTMP/hgremoterepo
-+  searching for changed bookmarks
-+  no changed bookmarks found
-+  [1]
-   $ hg push
-   pushing to $TESTTMP/hgremoterepo
-   searching for changes
-@@ -121,6 +126,11 @@
-   searching for changes
-   no changes found
-   [1]
-+  $ hg outgoing -B
-+  comparing with $TESTTMP/gitremoterepo
-+  searching for changed bookmarks
-+  no changed bookmarks found
-+  [1]
-   $ hg push
-   pushing to $TESTTMP/gitremoterepo
-   searching for changes
-diff --git a/tests/test-incoming.t b/tests/test-incoming.t
-old mode 100755
-new mode 100644
---- a/tests/test-incoming.t
-+++ b/tests/test-incoming.t
-@@ -152,7 +152,8 @@
- 
-   $ echo % nothing incoming after pull
-   % nothing incoming after pull
--  $ hg pull
-+"adding remote bookmark" message was added in Mercurial 2.3
-+  $ hg pull | grep -v "adding remote bookmark"
-   pulling from $TESTTMP/gitrepo
-   importing git objects into hg
-   (run 'hg heads' to see heads, 'hg merge' to merge)
-diff --git a/tests/test-outgoing.t b/tests/test-outgoing.t
---- a/tests/test-outgoing.t
-+++ b/tests/test-outgoing.t
-@@ -126,7 +126,7 @@
-   [255]
-   $ echo % let\'s pull and try again
-   % let's pull and try again
--  $ hg pull
-+  $ hg pull 2>&1 | grep -v 'divergent bookmark'
-   pulling from */gitrepo (glob)
-   importing git objects into hg
-   (run 'hg update' to get a working copy)
-diff --git a/tests/test-pull-after-strip.t b/tests/test-pull-after-strip.t
-old mode 100755
-new mode 100644
---- a/tests/test-pull-after-strip.t
-+++ b/tests/test-pull-after-strip.t
-@@ -114,11 +114,12 @@
-   git commit map cleaned
-   $ echo % pull works after \'hg git-cleanup\'
-   % pull works after 'hg git-cleanup'
--  $ hg pull -r beta
-+"adding remote bookmark" message was added in Mercurial 2.3
-+  $ hg pull -r beta | grep -v "adding remote bookmark"
-   pulling from $TESTTMP/gitrepo
-   importing git objects into hg
-   (run 'hg update' to get a working copy)
--  $ hg log --graph | egrep -v ': *(beta|master)'
-+  $ hg log --graph | egrep -v 'bookmark: *(alpha|beta|master)'
-   o  changeset:   2:611948b1ec6a
-   |  tag:         default/beta
-   |  tag:         tip
-diff --git a/tests/test-push.t b/tests/test-push.t
---- a/tests/test-push.t
-+++ b/tests/test-push.t
-@@ -102,7 +102,7 @@
-   abort: refs/heads/master changed on the server, please pull and merge before pushing
-   [255]
- 
--  $ hg pull
-+  $ hg pull 2>&1 | grep -v 'divergent bookmark'
-   pulling from $TESTTMP/gitrepo
-   importing git objects into hg
-   (run 'hg update' to get a working copy)
-@@ -117,7 +117,7 @@
-   date:        Mon Jan 01 00:00:12 2007 +0000
-   summary:     add gamma
-   
--  $ hg log -r default/master
-+  $ hg log -r default/master | grep -v 'master@default'
-   changeset:   3:1436150b86c2
-   tag:         default/master
-   tag:         tip

File loosen-test-incoming.diff

View file
 # HG changeset patch
-# Parent b03e2de3e608bb57c6145e056bad09501abac56f
+# Parent 819e46cffc8417bb521eaf355c1757ec1728d995
 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 @@
+diff -r 819e46cffc84 tests/test-incoming.t
+--- a/tests/test-incoming.t	Sat Nov 03 19:20:39 2012 -0400
++++ b/tests/test-incoming.t	Sat Nov 03 19:20:52 2012 -0400
+@@ -1,10 +1,6 @@
+ Load commonly used test logic
    $ . "$TESTDIR/testutil"
-   $ fn_require git dulwich
  
 -This test only works on hg 1.7 and later
 -  $ python -c 'from mercurial import util ; assert \

File loosen-test-pull-after-strip.diff

View file
 # HG changeset patch
-# Parent e8ddc63df4546e63f7330ab2ce78c4eeb243d2a5
+# Parent 52461f71a7829a50ad63ff2cca3351f54375a490
 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 @@
+diff -r 52461f71a782 tests/test-pull-after-strip.t
+--- a/tests/test-pull-after-strip.t	Sat Nov 03 19:14:17 2012 -0400
++++ b/tests/test-pull-after-strip.t	Sat Nov 03 19:20:29 2012 -0400
+@@ -1,17 +1,6 @@
+ Load commonly used test logic
    $ . "$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

File 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()

File populate-gitrepo-localrepo.diff

-# HG changeset patch
-# Parent 3f4c9921466a4f312a0f0583d530e1dca611c77a
-peer: pass localrepo to new gitrepo instances
-
-This change wraps hg.peer to allow for capturing the repo object.  It is then
-passed in to new gitrepo instanceds.  This will be needed to implement later
-functionality, such as richer bookmark support using pushkeys.
-
-diff -r 3f4c9921466a -r 8b1b1c8f9781 hggit/__init__.py
---- a/hggit/__init__.py	Fri Sep 28 19:15:14 2012 -0400
-+++ b/hggit/__init__.py	Fri Sep 28 19:23:42 2012 -0400
-@@ -184,6 +184,14 @@
-     # 1.7+
-     pass
- 
-+def peer(orig, uiorrepo, *args, **opts):
-+    newpeer = orig(uiorrepo, *args, **opts)
-+    if isinstance(newpeer, gitrepo.gitrepo):
-+        if isinstance(uiorrepo, localrepo.localrepository):
-+            newpeer.localrepo = uiorrepo
-+    return newpeer
-+extensions.wrapfunction(hg, 'peer', peer)
-+
- def revset_fromgit(repo, subset, x):
-     '''``fromgit()``
-     Select changesets that originate from Git.
-diff -r 3f4c9921466a -r 8b1b1c8f9781 hggit/gitrepo.py
---- a/hggit/gitrepo.py	Fri Sep 28 19:15:14 2012 -0400
-+++ b/hggit/gitrepo.py	Fri Sep 28 19:23:42 2012 -0400
-@@ -22,6 +22,7 @@
-             raise util.Abort('Cannot create a git repository.')
-         self.ui = ui
-         self.path = path
-+        self.localrepo = None
- 
-     def url(self):
-         return self.path

File remove-filter-test-incoming.diff

View file
 # HG changeset patch
-# Parent c84cabbe7c15e6274804d9840329a45ec2375d7d
+# Parent d92439a508370b9f428d70e22cdc0d5e1536754b
 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 @@
+diff -r d92439a50837 tests/test-hg-branch.t
+--- a/tests/test-hg-branch.t	Sat Nov 03 19:20:52 2012 -0400
++++ b/tests/test-hg-branch.t	Sat Nov 03 19:25:13 2012 -0400
+@@ -1,10 +1,6 @@
+ Load commonly used test logic
    $ . "$TESTDIR/testutil"
-   $ fn_require git dulwich
  
 -TODO stop using this when we're 1.5 only
 -  $ filterhash="sed s/71414c4e3c6f/a31e374801c9/;s/698615204564/d93a72262a83/"
    $ git init gitrepo
    Initialized empty Git repository in $TESTTMP/gitrepo/.git/
    $ cd gitrepo
-@@ -36,7 +32,7 @@
+@@ -35,7 +31,7 @@
    pushing to $TESTTMP/gitrepo
    searching for changes
  
    @  changeset:   2:05aed681ccb3
    |  branch:      gamma
    |  tag:         default/master
-@@ -61,7 +57,7 @@
+@@ -60,7 +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

File rename-test-pull.diff

-# HG changeset patch
-# Parent 9f919924bf8184ea2ba6822d34001b0b8488a64a
-tests: rename test-pull.t to test-clone.t
-
-This test wasn't actually testing anything to do with pulling.
-
-diff --git a/tests/test-pull.t b/tests/test-clone.t
-rename from tests/test-pull.t
-rename to tests/test-clone.t

File series

View file
-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 #+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
+tests-extract-requirements.diff #+sub20121103
+test-avoid-cd.diff #+sub20121103
+test-echo-to-comment.diff #+sub20121103
+loosen-test-pull-after-strip.diff #+sub20121103
+loosen-test-incoming.diff #+sub20121103
+remove-filter-test-incoming.diff #+sub20121103
+test-encoding-git1.8.0.diff #+sub20121103
+test-encoding-util-extract.diff #+sub20121103
 limit-push-scope.diff
 test-bookmark-workflow.diff
 bookmark-delete.diff

File 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

File suppress-export-message.diff

-# HG changeset patch
-# Parent cc0bf357e7eae6b7057aa2d7cb879c00c2a5422b
-push: suppress "exporting hg objects to git" message
-
-When communicating with the user on push/outgoing, Mercurial doesn't show a
-"exporting hg objects to git" message, so we shouldn't.  The message has been
-changed to be shown if --verbose is specified.
-
-diff --git a/hggit/git_handler.py b/hggit/git_handler.py
---- a/hggit/git_handler.py
-+++ b/hggit/git_handler.py
-@@ -339,7 +339,7 @@
-         export = [node for node in nodes if not hex(node) in self._map_hg]
-         total = len(export)
-         if total:
--            self.ui.status(_("exporting hg objects to git\n"))
-+            self.ui.note(_("exporting hg objects to git\n"))
-         for i, rev in enumerate(export):
-             util.progress(self.ui, 'exporting', i, total=total)
-             ctx = self.repo.changectx(rev)
-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
-@@ -60,7 +60,6 @@
-   $ hg bookmark -r tip master
-   $ hg push -r master ../gitrepo
-   pushing to ../gitrepo
--  exporting hg objects to git
-   searching for changes
-   $ cd ..
- 
-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
-@@ -60,7 +60,6 @@
-   $ hg bookmark -r tip master
-   $ hg push -r master ../gitrepo
-   pushing to ../gitrepo
--  exporting hg objects to git
-   searching for changes
-   $ cd ..
- 
-diff --git a/tests/test-convergedmerge.t b/tests/test-convergedmerge.t
---- a/tests/test-convergedmerge.t
-+++ b/tests/test-convergedmerge.t
-@@ -61,7 +61,6 @@
-   $ hg bookmark -r4 master
-   $ hg push -r master ../gitrepo
-   pushing to ../gitrepo
--  exporting hg objects to git
-   searching for changes
-   $ cd ..
- 
-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
-@@ -39,7 +39,6 @@
-   clearing out the git cache data
-   $ hg push ../gitrepo2
-   pushing to ../gitrepo2
--  exporting hg objects to git
-   searching for changes
- 
-   $ cd ../gitrepo2
-diff --git a/tests/test-encoding.t b/tests/test-encoding.t
---- a/tests/test-encoding.t
-+++ b/tests/test-encoding.t
-@@ -121,7 +121,6 @@
-   clearing out the git cache data
-   $ hg push ../gitrepo2
-   pushing to ../gitrepo2
--  exporting hg objects to git
-   searching for changes
- 
-   $ cd ../gitrepo2
-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
-@@ -108,7 +108,6 @@
-   clearing out the git cache data
-   $ hg push ../gitrepo2
-   pushing to ../gitrepo2
--  exporting hg objects to git
-   searching for changes
- 
-   $ cd ../gitrepo2
-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
-@@ -71,7 +71,6 @@
-   $ hg commit -m 'fix for beta'
-   $ hg push
-   pushing to $TESTTMP/gitrepo
--  exporting hg objects to git
-   searching for changes
- 
-   $ cd ..
-diff --git a/tests/test-git-workflow.t b/tests/test-git-workflow.t
-old mode 100755
-new mode 100644
---- a/tests/test-git-workflow.t
-+++ b/tests/test-git-workflow.t
-@@ -66,7 +66,6 @@
-   $ echo "[git]" >> .hg/hgrc
-   $ echo "intree = True" >> .hg/hgrc
-   $ hg gexport
--  exporting hg objects to git
- 
-   $ echo % do some work
-   % do some work
-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
-@@ -54,14 +54,12 @@
-   $ hgcommit -u "test" -m 'add beta'
-   $ hg push
-   pushing to $TESTTMP/gitrepo
--  exporting hg objects to git
-   searching for changes
- 
-   $ echo gamma >> beta
-   $ hgcommit -u "test <test@example.com> (comment)" -m 'modify beta'
-   $ hg push
-   pushing to $TESTTMP/gitrepo
--  exporting hg objects to git
-   searching for changes
- 
-   $ echo gamma > gamma
-@@ -69,7 +67,6 @@
-   $ hgcommit -u "<test@example.com>" -m 'add gamma'
-   $ hg push
-   pushing to $TESTTMP/gitrepo
--  exporting hg objects to git
-   searching for changes
- 
-   $ echo delta > delta
-@@ -77,7 +74,6 @@
-   $ hgcommit -u "name<test@example.com>" -m 'add delta'
-   $ hg push
-   pushing to $TESTTMP/gitrepo
--  exporting hg objects to git
-   searching for changes
- 
-   $ echo epsilon > epsilon
-@@ -85,7 +81,6 @@
-   $ hgcommit -u "name <test@example.com" -m 'add epsilon'
-   $ hg push
-   pushing to $TESTTMP/gitrepo
--  exporting hg objects to git
-   searching for changes
- 
-   $ echo zeta > zeta
-@@ -93,7 +88,6 @@
-   $ hgcommit -u " test " -m 'add zeta'
-   $ hg push
-   pushing to $TESTTMP/gitrepo
--  exporting hg objects to git
-   searching for changes
- 
-   $ echo eta > eta
-@@ -101,7 +95,6 @@
-   $ hgcommit -u "test < test@example.com >" -m 'add eta'
-   $ hg push
-   pushing to $TESTTMP/gitrepo
--  exporting hg objects to git
-   searching for changes
- 
-   $ echo theta > theta
-@@ -109,7 +102,6 @@
-   $ hgcommit -u "test >test@example.com>" -m 'add theta'
-   $ hg push
-   pushing to $TESTTMP/gitrepo
--  exporting hg objects to git
-   searching for changes
- 
-   $ hg log --graph | egrep -v ': *(not-master|master)'
-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
-@@ -57,7 +57,6 @@
-   $ hgcommit -m 'rename alpha to beta'
-   $ hg push
-   pushing to $TESTTMP/gitrepo
--  exporting hg objects to git
-   searching for changes
- 
-   $ hg branch gamma | grep -v 'permanent and global'
-@@ -65,7 +64,6 @@
-   $ hgcommit -m 'started branch gamma'
-   $ hg push
-   pushing to $TESTTMP/gitrepo
--  exporting hg objects to git
-   searching for changes
- 
-   $ hg log --graph | $filterhash | egrep -v ': *(not-master|master)'
-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
-@@ -52,7 +52,6 @@
-   $ hgtag alpha
-   $ hg push
-   pushing to $TESTTMP/gitrepo
--  exporting hg objects to git
-   searching for changes
- 
-   $ hg log --graph | egrep -v ': *(not-master|master)'
-diff --git a/tests/test-merge.t b/tests/test-merge.t
---- a/tests/test-merge.t
-+++ b/tests/test-merge.t
-@@ -69,7 +69,6 @@
-   clearing out the git cache data
-   $ hg push ../gitrepo2
-   pushing to ../gitrepo2
--  exporting hg objects to git
-   searching for changes
- 
-   $ cd ..
-diff --git a/tests/test-octopus.t b/tests/test-octopus.t
---- a/tests/test-octopus.t
-+++ b/tests/test-octopus.t
-@@ -96,7 +96,6 @@
-   clearing out the git cache data
-   $ hg push ../gitrepo2
-   pushing to ../gitrepo2
--  exporting hg objects to git
-   searching for changes
- 
-   $ cd ../gitrepo2
-diff --git a/tests/test-outgoing.t b/tests/test-outgoing.t
-old mode 100755
-new mode 100644
---- a/tests/test-outgoing.t
-+++ b/tests/test-outgoing.t
-@@ -60,7 +60,6 @@
- 
-   $ hg outgoing | sed 's/bookmark:    /tag:         /' | grep -v 'searching for changes'
-   comparing with */gitrepo (glob)
--  exporting hg objects to git
-   changeset:   1:0564f526fb0f
-   tag:         beta
-   user:        test
-diff --git a/tests/test-push.t b/tests/test-push.t
---- a/tests/test-push.t
-+++ b/tests/test-push.t
-@@ -59,7 +59,6 @@
-   $ hg book -r 1 beta
-   $ hg push -r beta
-   pushing to $TESTTMP/gitrepo
--  exporting hg objects to git
-   searching for changes
- 
-   $ cd ..
-diff --git a/tests/test-subrepos.t b/tests/test-subrepos.t
---- a/tests/test-subrepos.t
-+++ b/tests/test-subrepos.t
-@@ -115,7 +115,6 @@
-   $ hg commit -m 'Update subrepo2 from hg' | grep -v "committing subrepository" || true
-   $ hg push
-   pushing to $TESTTMP/gitrepo1
--  exporting hg objects to git
-   searching for changes
-   $ cd ..
-   $ cd gitrepo1
-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
-@@ -67,7 +67,6 @@
-   clearing out the git cache data
-   $ hg push ../gitrepo2
-   pushing to ../gitrepo2
--  exporting hg objects to git
-   searching for changes
- 
-   $ cd ../gitrepo2

File test-changes-bookmarks-outgoing.diff

-# HG changeset patch
-# Parent e0344f1832507ec67f8024c256fa722e1c0a9c3b
-tests: add coverage for outgoing with bookmark changes only
-
-diff -r e0344f183250 -r abdff9438c66 tests/test-bookmark-workflow.t
---- a/tests/test-bookmark-workflow.t	Fri Sep 28 20:45:58 2012 -0400
-+++ b/tests/test-bookmark-workflow.t	Fri Sep 28 20:51:13 2012 -0400
-@@ -137,3 +137,45 @@
-   no changes found
-   [1]
-   $ cd ..
-+
-+Changed bookmarks, but not revs
-+  $ cd purehglocalrepo
-+  $ hg bookmark -fr 2 b1
-+  $ hg bookmark -r 0 b2
-+  $ hgstate
-+    3 fc2664cac217 "add delta" bookmarks: [master]
-+    2 d85ced7ae9d6 "add gamma" bookmarks: [b1]
-+    1 7bcd915dc873 "add beta" bookmarks: []
-+    0 3442585be8a6 "add alpha" bookmarks: [b2]
-+  $ hg outgoing
-+  comparing with $TESTTMP/hgremoterepo
-+  searching for changes
-+  no changes found
-+  [1]
-+As of 2.3, Mercurial's outgoing -B doesn't actually show changed bookmarks
-+It only shows "new" bookmarks.  Thus, b1 doesn't show up.
-+  $ hg outgoing -B
-+  comparing with $TESTTMP/hgremoterepo
-+  searching for changed bookmarks
-+     b2                        3442585be8a6
-+  $ cd ..
-+  $ cd hggitlocalrepo
-+  $ hg bookmark -fr 2 b1
-+  $ hg bookmark -r 0 b2
-+  $ hgstate
-+    3 fc2664cac217 "add delta" bookmarks: [master]
-+    2 d85ced7ae9d6 "add gamma" bookmarks: [b1]
-+    1 7bcd915dc873 "add beta" bookmarks: []
-+    0 3442585be8a6 "add alpha" bookmarks: [b2]
-+  $ hg outgoing
-+  comparing with $TESTTMP/gitremoterepo
-+  searching for changes
-+  no changes found
-+  [1]
-+As of 2.3, Mercurial's outgoing -B doesn't actually show changed bookmarks
-+It only shows "new" bookmarks.  Thus, b1 doesn't show up.
-+  $ hg outgoing -B
-+  comparing with $TESTTMP/gitremoterepo
-+  searching for changed bookmarks
-+     b2                        3442585be8a6
-+  $ cd ..

File test-encoding-git1.8.0.diff

View file
+# HG changeset patch
+# Parent 8e8d06e75e742358910274fc30605ccb39473482
+tests: make test-encoding.t compatible with git 1.8.0
+
+It looks like Git 1.8.0 started silently converting latin1 commit messages to
+utf-8.  That changed the result of this test.  This changeset alters the test
+to make it accept both the pre-1.8.0 and post-1.8.0 behaviors.
+
+https://raw.github.com/git/git/master/Documentation/RelNotes/1.8.0.txt
+
+diff -r 8e8d06e75e74 -r fbbdbc8a8785 tests/test-encoding.t
+--- a/tests/test-encoding.t	Sat Nov 03 19:25:13 2012 -0400
++++ b/tests/test-encoding.t	Sat Nov 03 22:22:43 2012 -0400
+@@ -28,11 +28,13 @@
+   $ git add alpha
+   $ commit -m 'add älphà'
+ 
++Create some commits using latin1 encoding
++The warning message changed in Git 1.8.0
+   $ . $TESTDIR/latin-1-encoding
+-  Warning: commit message does not conform to UTF-8.
++  Warning: commit message (did|does) not conform to UTF-8. (re)
+   You may want to amend it after fixing the message, or set the config
+   variable i18n.commitencoding to the encoding your project uses.
+-  Warning: commit message does not conform to UTF-8.
++  Warning: commit message (did|does) not conform to UTF-8. (re)
+   You may want to amend it after fixing the message, or set the config
+   variable i18n.commitencoding to the encoding your project uses.
+ 
+@@ -45,48 +47,45 @@
+   4 files updated, 0 files merged, 0 files removed, 0 files unresolved
+   $ cd hgrepo
+ 
+-  $ HGENCODING=utf-8 hg log --graph --debug | grep -v ': *master' | grep -v phase:
+-  @  changeset:   3:8549ee7fe0801b2dafc06047ca6f66d36da709f5
++Latin1 commit messages started being automatically converted to UTF-8 in
++Git 1.8.0, so we accept the output of either version.
++  $ HGENCODING=utf-8 hg log --graph --debug | grep -v ': *master' | grep -v 'phase:' | grep -v ': *author=' | grep -v ': *message='
++  @  changeset:   3:(8549ee7fe0801b2dafc06047ca6f66d36da709f5|c3d3e39fc04f7e2e8cdb95f090415ec1ddc1be70) (re)
+   |  tag:         default/master
+   |  tag:         tip
+-  |  parent:      2:0422fbb4ec39fb69e87b94a3874ac890333de11a
++  |  parent:      2:(0422fbb4ec39fb69e87b94a3874ac890333de11a|f8aa41895a3a771a72520ca205a4685b76649fdd) (re)
+   |  parent:      -1:0000000000000000000000000000000000000000
+   |  manifest:    3:ea49f93388380ead5601c8fcbfa187516e7c2ed8
+   |  user:        tést èncödîng <test@example.org>
+   |  date:        Mon Jan 01 00:00:13 2007 +0000
+   |  files+:      delta
+-  |  extra:       author=$ \x90\x01\x01\xe9\x91\x03\x03\x01\xe8\x91\x08\x02\x01\xf6\x91\x0c\x01\x01\xee\x91\x0f\x15
+   |  extra:       branch=default
+   |  extra:       committer=test <test@example.org> 1167609613 0
+   |  extra:       encoding=latin-1
+-  |  extra:       message=\x0c\n\x90\x05\x01\xe9\x91\x07\x02\x01\xe0\x91\x0b\x01
+   |  description:
+   |  add déltà
+   |
+   |
+-  o  changeset:   2:0422fbb4ec39fb69e87b94a3874ac890333de11a
+-  |  parent:      1:9f6268bfc9eb3956c5ab8752d7b983b0ffe57115
++  o  changeset:   2:(0422fbb4ec39fb69e87b94a3874ac890333de11a|f8aa41895a3a771a72520ca205a4685b76649fdd) (re)
++  |  parent:      1:(9f6268bfc9eb3956c5ab8752d7b983b0ffe57115|955b24cf6f8f293741d3f39110c6fe554c292533) (re)
+   |  parent:      -1:0000000000000000000000000000000000000000
+   |  manifest:    2:f580e7da3673c137370da2b931a1dee83590d7b4
+   |  user:        tést èncödîng <test@example.org>
+   |  date:        Mon Jan 01 00:00:12 2007 +0000
+   |  files+:      gamma
+-  |  extra:       author=$ \x90\x01\x01\xe9\x91\x03\x03\x01\xe8\x91\x08\x02\x01\xf6\x91\x0c\x01\x01\xee\x91\x0f\x15
+   |  extra:       branch=default
+   |  extra:       committer=test <test@example.org> 1167609612 0
+-  |  extra:       message=\x0c\n\x90\x05\x01\xe4\x91\x07\x02\x01\xe2\x91\x0b\x01
+   |  description:
+   |  add gämmâ
+   |
+   |
+-  o  changeset:   1:9f6268bfc9eb3956c5ab8752d7b983b0ffe57115
++  o  changeset:   1:(9f6268bfc9eb3956c5ab8752d7b983b0ffe57115|955b24cf6f8f293741d3f39110c6fe554c292533) (re)
+   |  parent:      0:bb7d36568d6188ce0de2392246c43f6f213df954
+   |  parent:      -1:0000000000000000000000000000000000000000
+   |  manifest:    1:f0bd6fbafbaebe4bb59c35108428f6fce152431d
+   |  user:        tést èncödîng <test@example.org>
+   |  date:        Mon Jan 01 00:00:11 2007 +0000
+   |  files+:      beta
+-  |  extra:       author=$ \x90\x01\x01\xe9\x91\x03\x03\x01\xe8\x91\x08\x02\x01\xf6\x91\x0c\x01\x01\xee\x91\x0f\x15
+   |  extra:       branch=default
+   |  extra:       committer=test <test@example.org> 1167609611 0
+   |  description:
+@@ -113,21 +112,23 @@
+   searching for changes
+ 
+   $ cd ..
++Latin1 commit messages started being automatically converted to UTF-8 in
++Git 1.8.0, so we accept the output of either version.
+   $ git --git-dir=gitrepo2 log --pretty=medium
+-  commit da0edb01d4f3d1abf08b1be298379b0b2960e680
++  commit (da0edb01d4f3d1abf08b1be298379b0b2960e680|51c509c1c7eeb8f0a5b20aa3e894e8823f39171f) (re)
+   Author: t\xe9st \xe8nc\xf6d\xeeng <test@example.org> (esc)
+   Date:   Mon Jan 1 00:00:13 2007 +0000
+   
+       add d\xe9lt\xe0 (esc)
+   
+-  commit 2372b6c8f1b91f2db8ae5eb0f9e0427c318b449c
+-  Author: t\xe9st \xe8nc\xf6d\xeeng <test@example.org> (esc)
++  commit (2372b6c8f1b91f2db8ae5eb0f9e0427c318b449c|bd576458238cbda49ffcfbafef5242e103f1bc24) (re)
++  Author: * <test@example.org> (glob)
+   Date:   Mon Jan 1 00:00:12 2007 +0000
+   
+-      add g\xe4mm\xe2 (esc)
++      add g*mm* (glob)
+   
+-  commit 9ef7f6dcffe643b89ba63f3323621b9a923e4802
+-  Author: t\xe9st \xe8nc\xf6d\xeeng <test@example.org> (esc)
++  commit (9ef7f6dcffe643b89ba63f3323621b9a923e4802|7a7e86fc1b24db03109c9fe5da28b352de59ce90) (re)
++  Author: * <test@example.org> (glob)
+   Date:   Mon Jan 1 00:00:11 2007 +0000
+   
+       add beta

File test-encoding-util-extract.diff

View file
+# HG changeset patch
+# Parent fbbdbc8a87853b4bf2f179257f7268371ac73bec
+tests: use fn_git_commit in test-encoding.t
+
+In c4849b2dab87, the "commit" function was extracted into a testutil for re-use.
+However, test-encoding.t was skipped over in that changeset, as I was seeing
+unexplained test failures.  Since those test failures have now been explained
+(and fixed), this changeset performs the same extraction on test-encoding.t as
+was done on all the other tests.
+
+The version of fn_git_commit that was used in testutil redirected all output
+(including errors) to /dev/null, which didn't match the expectations of this
+test.  The test utility functions for commit/tag now no longer throw away error
+output, instead leaving it to individual tests to decide if error output should
+be ignored.
+
+diff -r fbbdbc8a8785 tests/latin-1-encoding
+--- a/tests/latin-1-encoding	Sat Nov 03 22:22:43 2012 -0400
++++ b/tests/latin-1-encoding	Sat Nov 03 22:36:13 2012 -0400
+@@ -5,14 +5,14 @@
+ GIT_AUTHOR_NAME='t�st �nc�d�ng'; export GIT_AUTHOR_NAME
+ echo beta > beta
+ git add beta
+-commit -m 'add beta'
++fn_git_commit -m 'add beta'
+ 
+ echo gamma > gamma
+ git add gamma
+-commit -m 'add g�mm�'
++fn_git_commit -m 'add g�mm�'
+ 
+ # test the commit encoding field
+ git config i18n.commitencoding latin-1
+ echo delta > delta
+ git add delta
+-commit -m 'add d�lt�'
++fn_git_commit -m 'add d�lt�'
+diff -r fbbdbc8a8785 tests/test-encoding.t
+--- a/tests/test-encoding.t	Sat Nov 03 22:22:43 2012 -0400
++++ b/tests/test-encoding.t	Sat Nov 03 22:36:13 2012 -0400
+@@ -3,22 +3,6 @@
+ Load commonly used test logic
+   $ . "$TESTDIR/testutil"
+ 
+-  $ 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
+-  $ GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; export GIT_COMMITTER_NAME
+-  $ GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"; export GIT_COMMITTER_EMAIL
+-  $ GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"; export GIT_COMMITTER_DATE
+-
+-  $ count=10
+-  $ commit()
+-  > {
+-  >     GIT_AUTHOR_DATE="2007-01-01 00:00:$count +0000"
+-  >     GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"
+-  >     git commit "$@" >/dev/null || echo "git commit error"
+-  >     count=`expr $count + 1`
+-  > }
+-
+   $ git init gitrepo
+   Initialized empty Git repository in $TESTTMP/gitrepo/.git/
+   $ cd gitrepo
+@@ -26,7 +10,7 @@
+ utf-8 encoded commit message
+   $ echo alpha > alpha
+   $ git add alpha
+-  $ commit -m 'add älphà'
++  $ fn_git_commit -m 'add älphà'
+ 
+ Create some commits using latin1 encoding
+ The warning message changed in Git 1.8.0
+diff -r fbbdbc8a8785 tests/testutil
+--- a/tests/testutil	Sat Nov 03 22:22:43 2012 -0400
++++ b/tests/testutil	Sat Nov 03 22:36:13 2012 -0400
+@@ -33,25 +33,25 @@
+ fn_git_commit() {
+     GIT_AUTHOR_DATE="2007-01-01 00:00:$count +0000"
+     GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"
+-    git commit "$@" >/dev/null 2>/dev/null || echo "git commit error"
++    git commit "$@" >/dev/null || echo "git commit error"
+     count=`expr $count + 1`
+ }
+ 
+ fn_hg_commit() {
+     HGDATE="2007-01-01 00:00:$count +0000"
+-    hg commit -d "$HGDATE" "$@" >/dev/null 2>/dev/null || echo "hg commit error"
++    hg commit -d "$HGDATE" "$@" >/dev/null || echo "hg commit error"
+     count=`expr $count + 1`
+ }
+ 
+ fn_git_tag() {
+     GIT_AUTHOR_DATE="2007-01-01 00:00:$count +0000"
+     GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"
+-    git tag "$@" >/dev/null 2>/dev/null || echo "git tag error"
++    git tag "$@" >/dev/null || echo "git tag error"
+     count=`expr $count + 1`
+ }
+ 
+ fn_hg_tag() {
+     HGDATE="2007-01-01 00:00:$count +0000"
+-    hg tag -d "$HGDATE" "$@" >/dev/null 2>/dev/null || echo "hg tag error"
++    hg tag -d "$HGDATE" "$@" >/dev/null || echo "hg tag error"
+     count=`expr $count + 1`
+ }

File 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
-