tests/failfilemerge.py
author Pulkit Goyal <7895pulkit@gmail.com>
Fri, 07 Oct 2016 15:29:57 +0200
changeset 30052 eaaedad68011
parent 29774 a7f8939641aa
child 30332 318a24b52eeb
permissions -rw-r--r--
py3: switch to .items() using transformer .iteritems() don't exist in Python 3 world. Used the transformer to replace .iteritems() to .items()

# extension to emulate interupting filemerge._filemerge

from __future__ import absolute_import

from mercurial import (
    error,
    extensions,
    filemerge,
)

def failfilemerge(filemergefn,
                  premerge, repo, mynode, orig, fcd, fco, fca, labels=None):
    raise error.Abort("^C")
    return filemergefn(premerge, repo, mynode, orig, fcd, fco, fca, labels)

def extsetup(ui):
    extensions.wrapfunction(filemerge, '_filemerge',
                            failfilemerge)