tests/failfilemerge.py
author Yuya Nishihara <yuya@tcha.org>
Sat, 19 Dec 2020 12:01:58 +0900
changeset 46176 300f6e23882a
parent 45681 a736ab681b78
child 48471 de8181c5414d
permissions -rw-r--r--
test-check-interface: do not expect bare "python" executable exists The test would crash if python executable had version suffix.

# extension to emulate interrupting filemerge._filemerge

from __future__ import absolute_import

from mercurial import (
    error,
    extensions,
    filemerge,
)


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


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