tests/failfilemerge.py
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
Wed, 15 Mar 2017 00:29:09 -0700
changeset 31416 1527ffe65f9f
parent 30332 318a24b52eeb
child 34122 c0ce60459d84
permissions -rw-r--r--
localrepo: use 'wvfs' instead of 'wfile' Method is about to be deprecated and the modern form is shorter.

# extension to emulate interrupting 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)