##// END OF EJS Templates
push: rename `pushop.ret` to `pushop.cgresult`...
Pierre-Yves David -
r22615:4f14303e default
parent child Browse files
Show More
@@ -78,13 +78,13 b' class pushoperation(object):'
78 78 # step already performed
79 79 # (used to check what steps have been already performed through bundle2)
80 80 self.stepsdone = set()
81 # Integer version of the push result
81 # Integer version of the changegroup push result
82 82 # - None means nothing to push
83 83 # - 0 means HTTP error
84 84 # - 1 means we pushed and remote head count is unchanged *or*
85 85 # we have outgoing changesets but refused to push
86 86 # - other values as described by addchangegroup()
87 self.ret = None
87 self.cgresult = None
88 88 # discover.outgoing object (contains common and outgoing data)
89 89 self.outgoing = None
90 90 # all remote heads before the push
@@ -140,7 +140,7 b' class pushoperation(object):'
140 140 @property
141 141 def commonheads(self):
142 142 """set of all common heads after changeset bundle push"""
143 if self.ret:
143 if self.cgresult:
144 144 return self.futureheads
145 145 else:
146 146 return self.fallbackheads
@@ -211,7 +211,7 b' def push(repo, remote, force=False, revs'
211 211 if locallock is not None:
212 212 locallock.release()
213 213
214 return pushop.ret
214 return pushop.cgresult
215 215
216 216 # list of steps to perform discovery before push
217 217 pushdiscoveryorder = []
@@ -388,7 +388,7 b' def b2partsgenerator(stepname):'
388 388 def _pushb2ctx(pushop, bundler):
389 389 """handle changegroup push through bundle2
390 390
391 addchangegroup result is stored in the ``pushop.ret`` attribute.
391 addchangegroup result is stored in the ``pushop.cgresult`` attribute.
392 392 """
393 393 if 'changesets' in pushop.stepsdone:
394 394 return
@@ -407,7 +407,7 b' def _pushb2ctx(pushop, bundler):'
407 407 """extract addchangroup returns from server reply"""
408 408 cgreplies = op.records.getreplies(cgpart.id)
409 409 assert len(cgreplies['changegroup']) == 1
410 pushop.ret = cgreplies['changegroup'][0]['return']
410 pushop.cgresult = cgreplies['changegroup'][0]['return']
411 411 return handlereply
412 412
413 413 @b2partsgenerator('phase')
@@ -558,12 +558,13 b' def _pushchangeset(pushop):'
558 558 remoteheads = pushop.remoteheads
559 559 # ssh: return remote's addchangegroup()
560 560 # http: return remote's addchangegroup() or 0 for error
561 pushop.ret = pushop.remote.unbundle(cg, remoteheads,
561 pushop.cgresult = pushop.remote.unbundle(cg, remoteheads,
562 562 pushop.repo.url())
563 563 else:
564 564 # we return an integer indicating remote head count
565 565 # change
566 pushop.ret = pushop.remote.addchangegroup(cg, 'push', pushop.repo.url())
566 pushop.cgresult = pushop.remote.addchangegroup(cg, 'push',
567 pushop.repo.url())
567 568
568 569 def _pushsyncphase(pushop):
569 570 """synchronise phase information locally and remotely"""
@@ -572,7 +573,7 b' def _pushsyncphase(pushop):'
572 573 remotephases = pushop.remote.listkeys('phases')
573 574 if (pushop.ui.configbool('ui', '_usedassubrepo', False)
574 575 and remotephases # server supports phases
575 and pushop.ret is None # nothing was pushed
576 and pushop.cgresult is None # nothing was pushed
576 577 and remotephases.get('publishing', False)):
577 578 # When:
578 579 # - this is a subrepo push
@@ -599,7 +600,7 b' def _pushsyncphase(pushop):'
599 600 _localphasemove(pushop, cheads, phases.draft)
600 601 ### Apply local phase on remote
601 602
602 if pushop.ret:
603 if pushop.cgresult:
603 604 if 'phases' in pushop.stepsdone:
604 605 # phases already pushed though bundle2
605 606 return
@@ -697,7 +698,7 b' def _pushobsolete(pushop):'
697 698
698 699 def _pushbookmark(pushop):
699 700 """Update bookmark position on remote"""
700 if pushop.ret == 0 or 'bookmarks' in pushop.stepsdone:
701 if pushop.cgresult == 0 or 'bookmarks' in pushop.stepsdone:
701 702 return
702 703 pushop.stepsdone.add('bookmarks')
703 704 ui = pushop.ui
General Comments 0
You need to be logged in to leave comments. Login now