mercurial/exchange.py
changeset 22014 71083b020b4a
parent 21989 bdb6d97f0a04
child 22015 c478031deba2
--- a/mercurial/exchange.py	Sat Aug 02 21:46:27 2014 +0900
+++ b/mercurial/exchange.py	Tue Jul 01 17:20:31 2014 +0200
@@ -80,6 +80,11 @@
         # set of all heads common after changeset bundle push
         self.commonheads = None
 
+    @util.propertycache
+    def futureheads(self):
+        """future remote heads if the changeset push succeeds"""
+        return self.outgoing.missingheads
+
 def push(repo, remote, force=False, revs=None, newbranch=False):
     '''Push outgoing changesets (limited by revs) from a local
     repository to remote. Return an integer:
@@ -310,8 +315,7 @@
 def _pushcomputecommonheads(pushop):
     unfi = pushop.repo.unfiltered()
     if pushop.ret:
-        # push succeed, synchronize target of the push
-        cheads = pushop.outgoing.missingheads
+        cheads = pushop.futureheads
     elif pushop.revs is None:
         # All out push fails. synchronize all common
         cheads = pushop.outgoing.commonheads