tests/failfilemerge.py
author Raphaël Gomès <rgomes@octobus.net>
Mon, 28 Feb 2022 18:34:23 +0100
branchstable
changeset 48805 d4486810a179
parent 48432 f45a4a47f6a8
child 48875 6000f5b25c9b
permissions -rw-r--r--
merge: remove direct rustmod reference We shouldn't rely on this member being present in `dirstate.py`, this creates unnecessary coupling. This also can trigger certain issues in edge-cases where the policy is changed at runtime or multiple Python environments fight, which is an added bonus. Differential Revision: https://phab.mercurial-scm.org/D12217

# extension to emulate interrupting filemerge._filemerge

from __future__ import absolute_import

from mercurial import (
    error,
    extensions,
    filemerge,
)


def failfilemerge(*args, **kwargs):
    raise error.Abort(b"^C")


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