Comments
Patch
@@ -24,10 +24,12 @@ class pushoperation(object):
self.newbranch = newbranch
self._outgoing = None # discovery.outgoing object
self._remoteheads = None # know remote head before the push
+ self._ret = None # push operation return
+
def perform(self):
'''Push outgoing changesets (limited by revs) from the current
repository to remote. Return an integer:
- None means nothing to push
- 0 means HTTP error
@@ -59,15 +61,14 @@ class pushoperation(object):
if not self._outgoing.missing:
# nothing to push
scmutil.nochangesfound(unfi.ui, unfi,
self._outgoing.excluded)
- ret = None
else:
- ret = self._pushbundle()
+ self._ret = self._pushbundle()
- if ret:
+ if self._ret:
# push succeed, synchronize target of the push
cheads = self._outgoing.missingheads
elif self.revs is None:
# All out push fails. synchronize all common
cheads = self._outgoing.commonheads
@@ -96,11 +97,11 @@ class pushoperation(object):
cheads.extend(c.node() for c in revset)
# even when we don't push, exchanging phase data is useful
remotephases = remote.listkeys('phases')
if (repo.ui.configbool('ui', '_usedassubrepo', False)
and remotephases # server supports phases
- and ret is None # nothing was pushed
+ and self._ret is None # nothing was pushed
and remotephases.get('publishing', False)):
# When:
# - this is a subrepo push
# - and remote support phase
# - and no changeset was pushed
@@ -142,11 +143,11 @@ class pushoperation(object):
if lock is not None:
lock.release()
finally:
locallock.release()
self._pushbookmarks()
- return ret
+ return self._ret
def _processoutgoing(self):
"""call discovery to find outgoing changeset and validate it content
"""
unfi = self.repo.unfiltered()