tests/failfilemerge.py
author Pulkit Goyal <7895pulkit@gmail.com>
Sat, 19 May 2018 18:41:02 +0530
changeset 38111 549e970397b2
parent 34137 c0ce60459d84
child 43076 2372284d9457
permissions -rw-r--r--
py3: use print as a function in tests/test-pull.t Differential Revision: https://phab.mercurial-scm.org/D3602

# 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("^C")
    return filemergefn(premerge, repo, mynode, orig, fcd, fco, fca, labels)

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