tests/failfilemerge.py
author Mateusz Kwapich <mitrandir@fb.com>
Tue, 24 May 2016 13:29:53 -0700
changeset 29270 48b38b16a8f8
parent 28772 424c1632fffb
child 29774 a7f8939641aa
permissions -rw-r--r--
shelve: use backup functions instead of manually copying dirstate This increases encapsulation of dirstate: the dirstate file is private to the dirstate module and shouldn't be touched by extensions directly.

# extension to emulate interupting filemerge._filemerge

from __future__ import absolute_import

from mercurial import (
    error,
    extensions,
    filemerge,
)

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)