Mercurial > hg
comparison mercurial/exchange.py @ 22051:e894de232f35
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.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Wed, 06 Aug 2014 00:54:15 -0700 |
parents | f1528ef123f4 |
children | d5cef58d8ec8 |
comparison
equal
deleted
inserted
replaced
22050:56ccd95b49c6 | 22051:e894de232f35 |
---|---|
575 % newremotehead) | 575 % newremotehead) |
576 | 576 |
577 def _localphasemove(pushop, nodes, phase=phases.public): | 577 def _localphasemove(pushop, nodes, phase=phases.public): |
578 """move <nodes> to <phase> in the local source repo""" | 578 """move <nodes> to <phase> in the local source repo""" |
579 if pushop.locallocked: | 579 if pushop.locallocked: |
580 phases.advanceboundary(pushop.repo, phase, nodes) | 580 tr = pushop.repo.transaction('push-phase-sync') |
581 try: | |
582 phases.advanceboundary(pushop.repo, phase, nodes) | |
583 tr.close() | |
584 finally: | |
585 tr.release() | |
581 else: | 586 else: |
582 # repo is not locked, do not change any phases! | 587 # repo is not locked, do not change any phases! |
583 # Informs the user that phases should have been moved when | 588 # Informs the user that phases should have been moved when |
584 # applicable. | 589 # applicable. |
585 actualmoves = [n for n in nodes if phase < pushop.repo[n].phase()] | 590 actualmoves = [n for n in nodes if phase < pushop.repo[n].phase()] |