115 self.outobsmarkers = set() |
115 self.outobsmarkers = set() |
116 # outgoing bookmarks |
116 # outgoing bookmarks |
117 self.outbookmarks = [] |
117 self.outbookmarks = [] |
118 # transaction manager |
118 # transaction manager |
119 self.trmanager = None |
119 self.trmanager = None |
|
120 # map { pushkey partid -> callback handling failure} |
|
121 # used to handle exception from mandatory pushkey part failure |
|
122 self.pkfailcb = {} |
120 |
123 |
121 @util.propertycache |
124 @util.propertycache |
122 def futureheads(self): |
125 def futureheads(self): |
123 """future remote heads if the changeset push succeeds""" |
126 """future remote heads if the changeset push succeeds""" |
124 return self.outgoing.missingheads |
127 return self.outgoing.missingheads |
621 # do not push if nothing to push |
624 # do not push if nothing to push |
622 if bundler.nbparts <= 1: |
625 if bundler.nbparts <= 1: |
623 return |
626 return |
624 stream = util.chunkbuffer(bundler.getchunks()) |
627 stream = util.chunkbuffer(bundler.getchunks()) |
625 try: |
628 try: |
626 reply = pushop.remote.unbundle(stream, ['force'], 'push') |
629 try: |
627 except error.BundleValueError, exc: |
630 reply = pushop.remote.unbundle(stream, ['force'], 'push') |
628 raise util.Abort('missing support for %s' % exc) |
631 except error.BundleValueError, exc: |
629 try: |
632 raise util.Abort('missing support for %s' % exc) |
630 trgetter = None |
633 try: |
631 if pushback: |
634 trgetter = None |
632 trgetter = pushop.trmanager.transaction |
635 if pushback: |
633 op = bundle2.processbundle(pushop.repo, reply, trgetter) |
636 trgetter = pushop.trmanager.transaction |
634 except error.BundleValueError, exc: |
637 op = bundle2.processbundle(pushop.repo, reply, trgetter) |
635 raise util.Abort('missing support for %s' % exc) |
638 except error.BundleValueError, exc: |
|
639 raise util.Abort('missing support for %s' % exc) |
|
640 except error.PushkeyFailed, exc: |
|
641 partid = int(exc.partid) |
|
642 if partid not in pushop.pkfailcb: |
|
643 raise |
|
644 pushop.pkfailcb[partid](pushop, exc) |
636 for rephand in replyhandlers: |
645 for rephand in replyhandlers: |
637 rephand(op) |
646 rephand(op) |
638 |
647 |
639 def _pushchangeset(pushop): |
648 def _pushchangeset(pushop): |
640 """Make the actual push of changeset bundle to remote repo""" |
649 """Make the actual push of changeset bundle to remote repo""" |