tests/crashgetbundler.py
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
Mon, 20 Feb 2017 12:42:23 +0100
changeset 31111 0c003943134f
parent 30876 f3807a135e43
child 43076 2372284d9457
permissions -rw-r--r--
color: move 'write-err' logic to the core ui class This is similar to what we needed for 'write', we move the logic from the extension to the core class. Beside the dispatch to 'win32print', we just apply label to the argument.

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)