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