view tests/failfilemerge.py @ 32338:ec84db232fc2

registrar: switch @command decorator to class It overrides _funcregistrarbase._doregister() since the structure of the command table is quite different.
author Yuya Nishihara <yuya@tcha.org>
date Mon, 08 May 2017 22:08:40 +0900
parents 318a24b52eeb
children c0ce60459d84
line wrap: on
line source

# extension to emulate interrupting 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)