##// END OF EJS Templates
with: use context manager for transaction in mercurial_sink
Bryan O'Sullivan -
r27863:ed59ae8b default
parent child Browse files
Show More
@@ -323,9 +323,7 b' class mercurial_sink(converter_sink):'
323 self.repo.ui.setconfig('phases', 'new-commit',
323 self.repo.ui.setconfig('phases', 'new-commit',
324 phases.phasenames[commit.phase], 'convert')
324 phases.phasenames[commit.phase], 'convert')
325
325
326 tr = self.repo.transaction("convert")
326 with self.repo.transaction("convert") as tr:
327
328 try:
329 node = hex(self.repo.commitctx(ctx))
327 node = hex(self.repo.commitctx(ctx))
330
328
331 # If the node value has changed, but the phase is lower than
329 # If the node value has changed, but the phase is lower than
@@ -336,9 +334,6 b' class mercurial_sink(converter_sink):'
336 if ctx.phase() < phases.draft:
334 if ctx.phase() < phases.draft:
337 phases.retractboundary(self.repo, tr, phases.draft,
335 phases.retractboundary(self.repo, tr, phases.draft,
338 [ctx.node()])
336 [ctx.node()])
339 tr.close()
340 finally:
341 tr.release()
342
337
343 text = "(octopus merge fixup)\n"
338 text = "(octopus merge fixup)\n"
344 p2 = node
339 p2 = node
General Comments 0
You need to be logged in to leave comments. Login now