mercurial/exchange.py
branchstable
changeset 24850 6b81309d15a7
parent 24849 aff2aca3420e
child 24851 df0ce98c882f
--- 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)