view tests/failfilemerge.py @ 32313:a580b2d65ded

rebase: make sure merge state is cleaned up for no-op rebases (issue5494) If a rebase ends up doing a no-op commit, make sure the merge state is still cleaned up.
author Jeremy Fitzhardinge <jsgf@fb.com>
date Thu, 18 May 2017 13:18:05 -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)