view tests/failfilemerge.py @ 32269:ed2c44741190

scmutil: add simplekeyvaluefile reading test Before this patch, mockvfs did not emulate readlines correctly and there was no test for simplekeyvaluefile reading.
author Kostia Balytskyi <ikostia@fb.com>
date Thu, 11 May 2017 08:39:44 -0700
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)