tests/failfilemerge.py
author Raphaël Gomès <rgomes@octobus.net>
Thu, 18 Jul 2024 12:03:29 +0200
changeset 51702 b0a4de6c14f8
parent 48875 6000f5b25c9b
permissions -rw-r--r--
pytype: work around wrong ImportError flagging As documented in https://github.com/google/pytype/issues/163, newer versions of Pytype do not understand caught `ImportError`, so we temporarily ignore them where applicable.

# extension to emulate interrupting filemerge._filemerge


from mercurial import (
    error,
    extensions,
    filemerge,
)


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


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