exchange: add oparg to push so that extensions can wrap pushop
authorSean Farley <sean@farley.io>
Tue, 13 Oct 2015 23:04:53 -0700
changeset 26729 16e69e6b357b
parent 26728 e8f1b7285917
child 26730 a1e43e85d294
exchange: add oparg to push so that extensions can wrap pushop
mercurial/exchange.py
--- a/mercurial/exchange.py	Thu Oct 15 03:15:54 2015 +0100
+++ b/mercurial/exchange.py	Tue Oct 13 23:04:53 2015 -0700
@@ -260,7 +260,8 @@
               }
 
 
-def push(repo, remote, force=False, revs=None, newbranch=False, bookmarks=()):
+def push(repo, remote, force=False, revs=None, newbranch=False, bookmarks=(),
+         opargs=None):
     '''Push outgoing changesets (limited by revs) from a local
     repository to remote. Return an integer:
       - None means nothing to push
@@ -269,7 +270,10 @@
         we have outgoing changesets but refused to push
       - other values as described by addchangegroup()
     '''
-    pushop = pushoperation(repo, remote, force, revs, newbranch, bookmarks)
+    if opargs is None:
+        opargs = {}
+    pushop = pushoperation(repo, remote, force, revs, newbranch, bookmarks,
+                           **opargs)
     if pushop.remote.local():
         missing = (set(pushop.repo.requirements)
                    - pushop.remote.local().supported)