changeset 22617:1625770c2ce1

push: use `exchange.push` in `commands.push` To gain access to all results from the push, we need to have access to the `pushoperation` object. We call `exchange.push` to do so. It is impossible to just change the `localrepo.push` signature because the change may be too subtle to be caught by external extension wrapping `localrepo.push`. This mean we'll have to kill `localrepo.push` because just using `exchange.push` in `commands.py` would silently disable all wrapping around `localrepo.push` by third-party extensions. So we'll remove it in a later changeset to get such extensions to fail noisily.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 25 Sep 2014 01:39:39 -0700
parents cda85cfc8252
children ce95c15f680b
files mercurial/commands.py
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Thu Sep 25 02:21:59 2014 -0700
+++ b/mercurial/commands.py	Thu Sep 25 01:39:39 2014 -0700
@@ -5068,10 +5068,10 @@
                 return not result
     finally:
         del repo._subtoppath
-    result = repo.push(other, opts.get('force'), revs=revs,
-                       newbranch=opts.get('new_branch'))
-
-    result = not result
+    pushop = exchange.push(repo, other, opts.get('force'), revs=revs,
+                           newbranch=opts.get('new_branch'))
+
+    result = not pushop.cgresult
 
     if opts.get('bookmark'):
         bresult = bookmarks.pushtoremote(ui, repo, other, opts['bookmark'])