Skip to content
Snippets Groups Projects
Commit 6867b01d authored by Brendan Cully's avatar Brendan Cully
Browse files

Unbreak outgoing to non-git repos with hg pre-1.9

The wrapped version of findoutgoing unconditionally mangled the
keyword arguments, but doesn't do version fixups unless the
remote is a git repository. This change only mangles the argument
list when the remote is a git repository.
parent b8eeabb6
No related branches found
No related tags found
No related merge requests found
......@@ -129,10 +129,6 @@
if getattr(discovery, 'findcommonoutgoing', None):
kwname = 'onlyheads'
def findoutgoing(orig, local, remote, *args, **kwargs):
kw = {}
kw.update(kwargs)
for val, k in zip(args, ('base', kwname, 'force')):
kw[k] = val
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.
......@@ -136,6 +132,10 @@
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.
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}
......@@ -146,7 +146,8 @@
return [x[0] for x in r]
if kwname == 'onlyheads':
del kw['base']
return orig(local, remote, **kw)
return orig(local, remote, **kw)
return orig(local, remote, *args, **kwargs)
if getattr(discovery, 'findoutgoing', None):
extensions.wrapfunction(discovery, 'findoutgoing', findoutgoing)
else:
......
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