changeset 943:d278f6d82a06

push: fix exchangepush wrapping Upstream added opargs to exchange.push and uses it as kwargs to the pushoperation constructor (16e69e6b357b). There was an attempt to fix this in hggit (c85c28fbc8a5) but it passes the exchange.push kwargs directly to pushoperation(), where we actually need to pull out the opargs and pass them as kwargs.
author Durham Goode <durham@fb.com>
date Mon, 26 Oct 2015 16:00:55 -0700
parents d1546c673c65
children e1d343fdeba4
files hggit/__init__.py
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hggit/__init__.py
+++ b/hggit/__init__.py
@@ -347,15 +347,17 @@
 # TODO figure out something useful to do with the newbranch param
 @util.transform_notgit
 def exchangepush(orig, repo, remote, force=False, revs=None, newbranch=False,
-                 bookmarks=(), **kwargs):
+                 bookmarks=(), opargs=None, **kwargs):
     if isinstance(remote, gitrepo.gitrepo):
+        if opargs is None:
+            opargs = {}
         pushop = exchange.pushoperation(repo, remote, force, revs, newbranch,
-                                        bookmarks, **kwargs)
+                                        bookmarks, **opargs)
         pushop.cgresult = repo.githandler.push(remote.path, revs, force)
         return pushop
     else:
         return orig(repo, remote, force, revs, newbranch, bookmarks=bookmarks,
-                    **kwargs)
+                    opargs=opargs, **kwargs)
 if not hgutil.safehasattr(localrepo.localrepository, 'push'):
     # Mercurial >= 3.2
     extensions.wrapfunction(exchange, 'push', exchangepush)