comparison 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
comparison
equal deleted inserted replaced
24849:aff2aca3420e 24850:6b81309d15a7
1296 tr = repo.transaction(source) 1296 tr = repo.transaction(source)
1297 tr.hookargs['source'] = source 1297 tr.hookargs['source'] = source
1298 tr.hookargs['url'] = url 1298 tr.hookargs['url'] = url
1299 tr.hookargs['bundle2'] = '1' 1299 tr.hookargs['bundle2'] = '1'
1300 r = bundle2.processbundle(repo, cg, lambda: tr).reply 1300 r = bundle2.processbundle(repo, cg, lambda: tr).reply
1301 if r is not None:
1302 repo.ui.pushbuffer(error=True, subproc=True)
1303 def recordout(output):
1304 r.newpart('output', data=output, mandatory=False)
1301 tr.close() 1305 tr.close()
1302 except Exception, exc: 1306 except Exception, exc:
1303 exc.duringunbundle2 = True 1307 exc.duringunbundle2 = True
1304 if r is not None: 1308 if r is not None:
1305 parts = exc._bundle2salvagedoutput = r.salvageoutput() 1309 parts = exc._bundle2salvagedoutput = r.salvageoutput()
1306 repo.ui.pushbuffer(error=True, subproc=True)
1307 def recordout(output): 1310 def recordout(output):
1308 part = bundle2.bundlepart('output', data=output, 1311 part = bundle2.bundlepart('output', data=output,
1309 mandatory=False) 1312 mandatory=False)
1310 parts.append(part) 1313 parts.append(part)
1311 raise 1314 raise