tests/failfilemerge.py
author Matt Mackall <mpm@selenic.com>
Wed, 16 Mar 2016 17:29:29 -0700
branchstable
changeset 28656 b6ed2505d6cf
parent 27988 61f4d59e9a0b
child 28772 424c1632fffb
permissions -rw-r--r--
parsers: fix list sizing rounding error (SEC) CVE-2016-3630 (1/2) This addresses part of a vulnerability in application of binary deltas.

# extension to emulate interupting filemerge._filemerge

from __future__ import absolute_import

from mercurial import (
    filemerge,
    extensions,
    error,
)

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)