Comments
Patch
@@ -78,10 +78,15 @@ class pushoperation(object):
# testable as a boolean indicating if any nodes are missing locally.
self.incoming = None
# set of all heads common after changeset bundle push
self.commonheads = None
+ @util.propertycache
+ def futureheads(self):
+ """future remote heads if the changeset push succeed"""
+ 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:
- None means nothing to push
- 0 means HTTP error
@@ -308,12 +313,11 @@ def _pushchangeset(pushop):
pushop.ret = pushop.remote.addchangegroup(cg, 'push', pushop.repo.url())
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
else:
# I want cheads = heads(::missingheads and ::commonheads)