view mercurial/mergeutil.py @ 33100:65cadeea6c22

scmutil: add a cleanupnodes method for developers It's now common that an old node gets replaced by zero or more new nodes, that could happen with amend, rebase, histedit, etc. And it's a common requirement to do bookmark movements, strip or obsolete nodes and even moving working copy parent. Previously, amend, rebase, history have their own logic doing the above. This patch is an attempt to unify them and future code. This enables new developers to be able to do "replace X with Y" thing correctly, without any knowledge about bookmarks, strip or obsstore. The next step will be migrating rebase to the new API, so it works inside a transaction, and its code could be simplified.
author Jun Wu <quark@fb.com>
date Sun, 25 Jun 2017 13:31:56 -0700
parents c1149533676b
children 2372284d9457
line wrap: on
line source

# 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'))