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

login
register
mail settings
Submitter Pierre-Yves David
Date Sept. 25, 2014, 6:46 p.m.
Message ID <e91c1379d9de4abb6d4b.1411670803@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/5981/
State Accepted
Commit cda85cfc82528af4320362b7e8a42a4a9c277afc
Headers show

Comments

Pierre-Yves David - Sept. 25, 2014, 6:46 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@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.

Patch

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