# HG changeset patch # User Pierre-Yves David # Date 2014-08-06 07:54:15 # Node ID e894de232f359e80b8c81df51258b4d0976c05d6 # Parent 56ccd95b49c6a494d915183ce348c22bcfe42703 push: wrap local phase movement in a transaction Phases are not yet inside the transaction, but we need to prepare for it. So we wrap the phase movement inside a transaction. diff --git a/mercurial/exchange.py b/mercurial/exchange.py --- a/mercurial/exchange.py +++ b/mercurial/exchange.py @@ -577,7 +577,12 @@ def _pushsyncphase(pushop): def _localphasemove(pushop, nodes, phase=phases.public): """move to in the local source repo""" if pushop.locallocked: - phases.advanceboundary(pushop.repo, phase, nodes) + tr = pushop.repo.transaction('push-phase-sync') + try: + phases.advanceboundary(pushop.repo, phase, nodes) + tr.close() + finally: + tr.release() else: # repo is not locked, do not change any phases! # Informs the user that phases should have been moved when