tests/failfilemerge.py
author Simon Sapin <simon.sapin@octobus.net>
Tue, 06 Apr 2021 14:35:39 +0200
changeset 47099 3da19db33cbc
parent 45681 a736ab681b78
child 48426 de8181c5414d
permissions -rw-r--r--
dirstate-tree: Add map `get` and `contains_key` methods Differential Revision: https://phab.mercurial-scm.org/D10369

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