489 if output is not None: |
489 if output is not None: |
490 output = op.ui.popbuffer() |
490 output = op.ui.popbuffer() |
491 if output: |
491 if output: |
492 outpart = op.reply.newpart('output', data=output, |
492 outpart = op.reply.newpart('output', data=output, |
493 mandatory=False) |
493 mandatory=False) |
494 outpart.addparam('in-reply-to', str(part.id), mandatory=False) |
494 outpart.addparam( |
|
495 'in-reply-to', pycompat.bytestr(part.id), mandatory=False) |
495 # If exiting or interrupted, do not attempt to seek the stream in the |
496 # If exiting or interrupted, do not attempt to seek the stream in the |
496 # finally block below. This makes abort faster. |
497 # finally block below. This makes abort faster. |
497 except (SystemExit, KeyboardInterrupt): |
498 except (SystemExit, KeyboardInterrupt): |
498 hardabort = True |
499 hardabort = True |
499 raise |
500 raise |
1576 expectedtotal=nbchangesets, **extrakwargs) |
1577 expectedtotal=nbchangesets, **extrakwargs) |
1577 if op.reply is not None: |
1578 if op.reply is not None: |
1578 # This is definitely not the final form of this |
1579 # This is definitely not the final form of this |
1579 # return. But one need to start somewhere. |
1580 # return. But one need to start somewhere. |
1580 part = op.reply.newpart('reply:changegroup', mandatory=False) |
1581 part = op.reply.newpart('reply:changegroup', mandatory=False) |
1581 part.addparam('in-reply-to', str(inpart.id), mandatory=False) |
1582 part.addparam( |
|
1583 'in-reply-to', pycompat.bytestr(inpart.id), mandatory=False) |
1582 part.addparam('return', '%i' % ret, mandatory=False) |
1584 part.addparam('return', '%i' % ret, mandatory=False) |
1583 assert not inpart.read() |
1585 assert not inpart.read() |
1584 |
1586 |
1585 _remotechangegroupparams = tuple(['url', 'size', 'digests'] + |
1587 _remotechangegroupparams = tuple(['url', 'size', 'digests'] + |
1586 ['digest:%s' % k for k in util.DIGESTS.keys()]) |
1588 ['digest:%s' % k for k in util.DIGESTS.keys()]) |
1639 ret = _processchangegroup(op, cg, tr, 'bundle2', 'bundle2') |
1641 ret = _processchangegroup(op, cg, tr, 'bundle2', 'bundle2') |
1640 if op.reply is not None: |
1642 if op.reply is not None: |
1641 # This is definitely not the final form of this |
1643 # This is definitely not the final form of this |
1642 # return. But one need to start somewhere. |
1644 # return. But one need to start somewhere. |
1643 part = op.reply.newpart('reply:changegroup') |
1645 part = op.reply.newpart('reply:changegroup') |
1644 part.addparam('in-reply-to', str(inpart.id), mandatory=False) |
1646 part.addparam( |
|
1647 'in-reply-to', pycompat.bytestr(inpart.id), mandatory=False) |
1645 part.addparam('return', '%i' % ret, mandatory=False) |
1648 part.addparam('return', '%i' % ret, mandatory=False) |
1646 try: |
1649 try: |
1647 real_part.validate() |
1650 real_part.validate() |
1648 except error.Abort as e: |
1651 except error.Abort as e: |
1649 raise error.Abort(_('bundle at %s is corrupted:\n%s') % |
1652 raise error.Abort(_('bundle at %s is corrupted:\n%s') % |
1782 'old': old, |
1785 'old': old, |
1783 'new': new} |
1786 'new': new} |
1784 op.records.add('pushkey', record) |
1787 op.records.add('pushkey', record) |
1785 if op.reply is not None: |
1788 if op.reply is not None: |
1786 rpart = op.reply.newpart('reply:pushkey') |
1789 rpart = op.reply.newpart('reply:pushkey') |
1787 rpart.addparam('in-reply-to', str(inpart.id), mandatory=False) |
1790 rpart.addparam( |
|
1791 'in-reply-to', pycompat.bytestr(inpart.id), mandatory=False) |
1788 rpart.addparam('return', '%i' % ret, mandatory=False) |
1792 rpart.addparam('return', '%i' % ret, mandatory=False) |
1789 if inpart.mandatory and not ret: |
1793 if inpart.mandatory and not ret: |
1790 kwargs = {} |
1794 kwargs = {} |
1791 for key in ('namespace', 'key', 'new', 'old', 'ret'): |
1795 for key in ('namespace', 'key', 'new', 'old', 'ret'): |
1792 if key in inpart.params: |
1796 if key in inpart.params: |
1837 if new: |
1841 if new: |
1838 op.repo.ui.status(_('%i new obsolescence markers\n') % new) |
1842 op.repo.ui.status(_('%i new obsolescence markers\n') % new) |
1839 op.records.add('obsmarkers', {'new': new}) |
1843 op.records.add('obsmarkers', {'new': new}) |
1840 if op.reply is not None: |
1844 if op.reply is not None: |
1841 rpart = op.reply.newpart('reply:obsmarkers') |
1845 rpart = op.reply.newpart('reply:obsmarkers') |
1842 rpart.addparam('in-reply-to', str(inpart.id), mandatory=False) |
1846 rpart.addparam( |
|
1847 'in-reply-to', pycompat.bytestr(inpart.id), mandatory=False) |
1843 rpart.addparam('new', '%i' % new, mandatory=False) |
1848 rpart.addparam('new', '%i' % new, mandatory=False) |
1844 |
1849 |
1845 |
1850 |
1846 @parthandler('reply:obsmarkers', ('new', 'in-reply-to')) |
1851 @parthandler('reply:obsmarkers', ('new', 'in-reply-to')) |
1847 def handleobsmarkerreply(op, inpart): |
1852 def handleobsmarkerreply(op, inpart): |