Update for newer dulwich and hg versions.

This commit is contained in:
Augie Fackler 2012-01-27 11:06:27 -06:00
parent 05e4d83f4b
commit 2d280d3dfb
10 changed files with 16 additions and 30 deletions

View File

@ -131,27 +131,8 @@ try:
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)

View File

@ -209,7 +209,7 @@ class GitHandler(object):
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)]

View File

@ -27,7 +27,7 @@ hg up -r0
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

View File

@ -27,7 +27,7 @@ hg up -r0
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

View File

@ -60,7 +60,7 @@ git daemon --base-path="$(pwd)"\
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

View File

@ -43,7 +43,7 @@ hg init
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 @@ commit -m 'add beta'
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

View File

@ -71,7 +71,7 @@ hg mv alpha beta
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

View File

@ -48,7 +48,7 @@ git add gamma
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

View File

@ -53,7 +53,7 @@ echo delta > delta
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

View File

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