tests/failfilemerge.py
author Pierre-Yves David <pierre-yves.david@octobus.net>
Wed, 14 Apr 2021 18:34:42 +0200
changeset 46951 338ab1d89ddb
parent 45681 a736ab681b78
child 48426 de8181c5414d
permissions -rw-r--r--
clone: use `get_clone_path` "Surprisingly", the new API is well suited for `hg clone` too. Differential Revision: https://phab.mercurial-scm.org/D10417

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