mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 08:47:12 +03:00
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.
This commit is contained in:
parent
890facca02
commit
d499a8fc67
@ -129,13 +129,13 @@ try:
|
||||
if getattr(discovery, 'findcommonoutgoing', None):
|
||||
kwname = 'onlyheads'
|
||||
def findoutgoing(orig, local, remote, *args, **kwargs):
|
||||
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
|
||||
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)
|
||||
newkw = {'base': base, kwname: heads}
|
||||
@ -147,6 +147,7 @@ try:
|
||||
if kwname == 'onlyheads':
|
||||
del kw['base']
|
||||
return orig(local, remote, **kw)
|
||||
return orig(local, remote, *args, **kwargs)
|
||||
if getattr(discovery, 'findoutgoing', None):
|
||||
extensions.wrapfunction(discovery, 'findoutgoing', findoutgoing)
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user