tests/failfilemerge.py
author Phil Cohen <phillco@fb.com>
Mon, 11 Sep 2017 13:03:27 -0700
changeset 34122 c0ce60459d84
parent 30332 318a24b52eeb
child 43076 2372284d9457
permissions -rw-r--r--
merge: pass wctx to premerge, filemerge In the in-memory merge branch. we'll need to call a function (``flushall``) on the wctx inside of _xmerge. This prepares the way so it can be done without hacks like ``fcd.ctx()``. Differential Revision: https://phab.mercurial-scm.org/D449

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