Mercurial > hg > hg-git
changeset 442:553dd7078058
Update for newer dulwich and hg versions.
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Fri, 27 Jan 2012 11:06:27 -0600 |
parents | 35e2813f58a5 |
children | a9c0b93488d4 |
files | hggit/__init__.py hggit/git_handler.py tests/test-conflict-1 tests/test-conflict-2 tests/test-encoding tests/test-git-workflow tests/test-hg-branch tests/test-merge tests/test-octopus tests/test-outgoing |
diffstat | 10 files changed, 16 insertions(+), 30 deletions(-) [+] |
line wrap: on
line diff
--- a/hggit/__init__.py +++ b/hggit/__init__.py @@ -131,27 +131,8 @@ kwname = 'onlyheads' def findoutgoing(orig, local, remote, *args, **kwargs): if isinstance(remote, gitrepo.gitrepo): - hgver = hg.util.version() - if hgver >= '1.8.9' or (hgver > '1.8' and '+' in hgver): - raise hgutil.Abort( - 'hg-git outgoing support is broken on hg 1.9.x') - # clean up this cruft when we're 1.7-only, remoteheads and - # the return value change happened between 1.6 and 1.7. - kw = {} - kw.update(kwargs) - for val, k in zip(args, ('base', kwname, 'force')): - kw[k] = val - git = GitHandler(local, local.ui) - base, heads = git.get_refs(remote.path) - newkw = {'base': base, kwname: heads} - newkw.update(kw) - kw = newkw - if kwname == 'heads': - r = orig(local, remote, **kw) - return [x[0] for x in r] - if kwname == 'onlyheads': - del kw['base'] - return orig(local, remote, **kw) + raise hgutil.Abort( + 'hg-git outgoing support is broken') return orig(local, remote, *args, **kwargs) if getattr(discovery, 'findoutgoing', None): extensions.wrapfunction(discovery, 'findoutgoing', findoutgoing)
--- a/hggit/git_handler.py +++ b/hggit/git_handler.py @@ -209,7 +209,7 @@ return {} try: - client.send_pack(path, changed, None) + client.send_pack(path, changed, lambda have, want: []) changed_refs = [ref for ref, sha in new_refs.iteritems() if sha != old_refs.get(ref)]
--- a/tests/test-conflict-1 +++ b/tests/test-conflict-1 @@ -27,7 +27,7 @@ echo C > afile hg ci -m "A->C" -hg merge -r1 | sed 's/-C ./-C/' | grep -v 'merging afile' +hg merge -r1 2>&1 | sed 's/-C ./-C/' | egrep -v '^merging afile$' | sed 's/incomplete.*/failed!/' # resolve using first parent echo C > afile hg resolve -m afile
--- a/tests/test-conflict-2 +++ b/tests/test-conflict-2 @@ -27,7 +27,7 @@ echo C > afile hg ci -m "A->C" -hg merge -r1 | sed 's/-C ./-C/' | grep -v 'merging afile' +hg merge -r1 2>&1 | sed 's/-C ./-C/' | egrep -v '^merging afile$' | sed 's/incomplete.*/failed!/' # resolve using second parent echo B > afile hg resolve -m afile
--- a/tests/test-encoding +++ b/tests/test-encoding @@ -60,7 +60,7 @@ hg clone git://localhost/gitrepo hgrepo | grep -v '^updating' cd hgrepo -HGENCODING=utf-8 hg log --graph --debug | grep -v ': *master' +HGENCODING=utf-8 hg log --graph --debug | grep -v ': *master' | grep -v phase: hg gclear hg push git://localhost/gitrepo2
--- a/tests/test-git-workflow +++ b/tests/test-git-workflow @@ -43,7 +43,7 @@ echo alpha > alpha hg add alpha hgcommit -m "add alpha" -hg log --graph --debug +hg log --graph --debug | grep -v phase: cd .. @@ -65,6 +65,6 @@ echo % get things back to hg hg gimport -hg log --graph --debug | grep -v ': *master' +hg log --graph --debug | grep -v ': *master' | grep -v phase: echo % gimport should have updated the bookmarks as well hg bookmarks
--- a/tests/test-hg-branch +++ b/tests/test-hg-branch @@ -71,7 +71,7 @@ hgcommit -m 'rename alpha to beta' hg push -hg branch gamma +hg branch gamma | grep -v 'permanent and global' hgcommit -m 'started branch gamma' hg push
--- a/tests/test-merge +++ b/tests/test-merge @@ -48,7 +48,7 @@ commit -m 'add gamma' # clean merge -git merge beta | sed 's/^Merge.*recursive.*$/Merge successful/' +git merge beta | sed "s/the '//;s/' strategy//" | sed 's/^Merge.*recursive.*$/Merge successful/' cd .. mkdir gitrepo2
--- a/tests/test-octopus +++ b/tests/test-octopus @@ -53,7 +53,7 @@ git add delta commit -m 'add delta' -git merge branch1 branch2 | sed 's/^Merge.*octopus.*$/Merge successful/' +git merge branch1 branch2 | sed "s/the '//;s/' strategy//" | sed 's/^Merge.*octopus.*$/Merge successful/' cd .. mkdir gitrepo2
--- a/tests/test-outgoing +++ b/tests/test-outgoing @@ -1,5 +1,10 @@ #!/bin/sh +# This feature is currently completely broken due to changes in +# dulwich, but since it was already broken on hg 1.9 and later, it's +# not a blocker. +exit 80 + # Fails for some reason, need to investigate # "$TESTDIR/hghave" git || exit 80 python -c 'from mercurial import util ; assert util.version() < "1.8"' || exit 80