From d499a8fc677d7367f3d19f2e2ba7b87bafb1a649 Mon Sep 17 00:00:00 2001 From: Brendan Cully Date: Thu, 23 Jun 2011 11:29:30 -0700 Subject: [PATCH] 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. --- hggit/__init__.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/hggit/__init__.py b/hggit/__init__.py index 409e2f69de..1b430fc60a 100644 --- a/hggit/__init__.py +++ b/hggit/__init__.py @@ -129,13 +129,13 @@ try: 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. + 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 @@ try: 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: