##// END OF EJS Templates
strip: add a delayedstrip method that works in a transaction...
strip: add a delayedstrip method that works in a transaction For long, the fact that strip does not work inside a transaction and some code has to work with both obsstore and fallback to strip lead to duplicated code like: with repo.transaction(): .... if obsstore: obsstore.createmarkers(...) if not obsstore: repair.strip(...) Things get more complex when you want to call something which may call strip under the hood. Like you cannot simply write: with repo.transaction(): .... rebasemod.rebase(...) # may call "strip", so this doesn't work But you do want rebase to run inside a same transaction if possible, so the code may look like: with repo.transaction(): .... if obsstore: rebasemod.rebase(...) obsstore.createmarkers(...) if not obsstore: rebasemod.rebase(...) repair.strip(...) That's ugly and error-prone. Ideally it's possible to just write: with repo.transaction(): rebasemod.rebase(...) saferemovenodes(...) This patch is the first step towards that. It adds a "delayedstrip" method to repair.py which maintains a postclose callback in the transaction object.

File last commit:

r30494:c1149533 default
r33087:fcd1c483 default
Show More
mergeutil.py
22 lines | 701 B | text/x-python | PythonLexer
# mergeutil.py - help for merge processing in mercurial
#
# Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from __future__ import absolute_import
from .i18n import _
from . import (
error,
)
def checkunresolved(ms):
if list(ms.unresolved()):
raise error.Abort(_("unresolved merge conflicts "
"(see 'hg help resolve')"))
if ms.mdstate() != 's' or list(ms.driverresolved()):
raise error.Abort(_('driver-resolved merge conflicts'),
hint=_('run "hg resolve --all" to resolve'))