tests/failfilemerge.py
author Martin von Zweigbergk <martinvonz@google.com>
Mon, 14 Feb 2022 22:16:29 -0800
changeset 48787 69000dc0dced
parent 48477 f45a4a47f6a8
child 48966 6000f5b25c9b
permissions -rw-r--r--
filemerge: reduce some duplication in `_maketempfiles()` The two callers of the local `maketempfrompath()` function used the returned file object in the same way. We can reduce duplication by moving that code into the function. Differential Revision: https://phab.mercurial-scm.org/D12192

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