tests/crashgetbundler.py
author Yuya Nishihara <yuya@tcha.org>
Wed, 21 Feb 2018 21:14:05 +0900
branchstable
changeset 35831 0a7c59a4c835
parent 30876 f3807a135e43
child 43076 2372284d9457
permissions -rw-r--r--
annotate: do not poorly split lines at CR (issue5798) mdiff and lines(text) take only LF as a line separator, but str.splitlines() breaks our assumption. Use mdiff.splitnewlines() consistently. It's hard to read \r in tests, so \r is replaced with [CR]. I had to wrap sed by a shell function to silence check-code warning.

from __future__ import absolute_import

from mercurial.i18n import _
from mercurial import (
        changegroup,
        error,
        extensions
    )

def abort(orig, *args, **kwargs):
    raise error.Abort(_('this is an exercise'))

def uisetup(ui):
    extensions.wrapfunction(changegroup, 'getbundler', abort)