tests/failfilemerge.py
author Martin von Zweigbergk <martinvonz@google.com>
Thu, 08 Oct 2020 15:35:44 -0700
changeset 45681 a736ab681b78
parent 43076 2372284d9457
child 48426 de8181c5414d
permissions -rw-r--r--
errors: stop passing non-strings to Abort's constructor The next patch will change `Abort`'s constructor and `__bytes__` functions and they will start assuming that the first argument is the messages as `bytes`. Differential Revision: https://phab.mercurial-scm.org/D9178

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