diff mercurial/exchange.py @ 24850:6b81309d15a7 stable

bundle2: capture output issue during transaction close We were capturing all output issue during bundle2 processing, and all output issue during transaction rollback in case of failure. However, the output issue during transaction commit was still roaming the land freely. It is now put back in line. This let the user see output from 'pretxnclose' and 'txnclose' (and related) in the right order.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 23 Apr 2015 14:54:45 +0100
parents aff2aca3420e
children df0ce98c882f
line wrap: on
line diff
--- a/mercurial/exchange.py	Thu Apr 23 17:03:58 2015 +0100
+++ b/mercurial/exchange.py	Thu Apr 23 14:54:45 2015 +0100
@@ -1298,12 +1298,15 @@
                 tr.hookargs['url'] = url
                 tr.hookargs['bundle2'] = '1'
                 r = bundle2.processbundle(repo, cg, lambda: tr).reply
+                if r is not None:
+                    repo.ui.pushbuffer(error=True, subproc=True)
+                    def recordout(output):
+                        r.newpart('output', data=output, mandatory=False)
                 tr.close()
             except Exception, exc:
                 exc.duringunbundle2 = True
                 if r is not None:
                     parts = exc._bundle2salvagedoutput = r.salvageoutput()
-                    repo.ui.pushbuffer(error=True, subproc=True)
                     def recordout(output):
                         part = bundle2.bundlepart('output', data=output,
                                                   mandatory=False)