Skip to content
Snippets Groups Projects
Commit dd90394c authored by Augie Fackler's avatar Augie Fackler
Browse files

findoutgoing: update wrapper for hg change 98c874a929f1

parent 4d807216
No related branches found
No related tags found
No related merge requests found
......@@ -15,6 +15,7 @@
Try hg clone git:// or hg clone git+ssh://
'''
import inspect
import os
from mercurial import commands
......@@ -105,5 +106,9 @@
try:
from mercurial import discovery
def findoutgoing(orig, local, remote, base=None, heads=None, force=False):
kwname = 'heads'
if 'remoteheads' in inspect.getargspec(discovery.findoutgoing)[0]:
kwname = 'remoteheads'
def findoutgoing(orig, local, remote, base=None, remoteheads=None, force=False, heads=None):
kw = {'force': force, 'base': base, kwname: locals()[kwname]}
if isinstance(remote, gitrepo.gitrepo):
......@@ -109,3 +114,5 @@
if isinstance(remote, gitrepo.gitrepo):
# clean up this cruft when we're 1.7-only, remoteheads and
# the return value change happened between 1.6 and 1.7.
git = GitHandler(local, local.ui)
base, heads = git.get_refs(remote.path)
......@@ -110,9 +117,12 @@
git = GitHandler(local, local.ui)
base, heads = git.get_refs(remote.path)
r = orig(local, remote, base=base, heads=heads,
force=force)
return [x[0] for x in r]
return orig(local, remote, base=base, heads=heads, force=force)
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]
return orig(local, remote, **kw)
extensions.wrapfunction(discovery, 'findoutgoing', findoutgoing)
except ImportError:
pass
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment