[PATCH 2 of 6] push: `exchange.push` now returns the `pushoperation` object

Pierre-Yves David pierre-yves.david at ens-lyon.org
Thu Sep 25 13:46:43 CDT 2014


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1411636919 25200
#      Thu Sep 25 02:21:59 2014 -0700
# Node ID e91c1379d9de4abb6d4b44eda75386f857c77ca6
# Parent  e2e5ccac8e31e05e427d935e0e96a54785f7e31e
push: `exchange.push` now returns the `pushoperation` object

Returning the pushop object gives access to more information (coming bookmark
push result for example). `localrepo.push` currently extract the `cgresult` for
callers.

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -209,11 +209,11 @@ def push(repo, remote, force=False, revs
                 lock.release()
     finally:
         if locallock is not None:
             locallock.release()
 
-    return pushop.cgresult
+    return pushop
 
 # list of steps to perform discovery before push
 pushdiscoveryorder = []
 
 # Mapping between step name and function
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1590,11 +1590,11 @@ class localrepository(object):
         functions, which are called before pushing changesets.
         """
         return util.hooks()
 
     def push(self, remote, force=False, revs=None, newbranch=False):
-        return exchange.push(self, remote, force, revs, newbranch)
+        return exchange.push(self, remote, force, revs, newbranch).cgresult
 
     def stream_in(self, remote, requirements):
         lock = self.lock()
         try:
             # Save remote branchmap. We will use it later


More information about the Mercurial-devel mailing list