tests/failfilemerge.py
author Jun Wu <quark@fb.com>
Mon, 14 Mar 2016 15:05:25 +0000
changeset 28555 1435a8e9b5fe
parent 27988 61f4d59e9a0b
child 28772 424c1632fffb
permissions -rw-r--r--
chg: do not redirect stdout to /dev/null Redirecting stdout to /dev/null has unwanted side effects, namely ui.write will stop working. This patch removes the redirection code and helps chg to pass test-bad-extension.t.

# extension to emulate interupting filemerge._filemerge

from __future__ import absolute_import

from mercurial import (
    filemerge,
    extensions,
    error,
)

def failfilemerge(filemergefn,
        premerge, repo, mynode, orig, fcd, fco, fca, labels=None):
    raise error.Abort("^C")
    return filemergefn(premerge, repo, mynode, orig, fcd, fco, fca, labels)

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