tests/crashgetbundler.py
author Kyle Lippincott <spectral@google.com>
Wed, 02 Dec 2020 11:05:53 -0800
changeset 46026 b9588ff9b66a
parent 43076 2372284d9457
child 48966 6000f5b25c9b
permissions -rw-r--r--
copies: avoid materializing a full directory map during copy tracing Materializing a full copy of every directory in a treemanifest repo can be quite expensive, even with a narrow matcher. For flat manifest repos, this should be equivalent - it will still materialize (and cache) a dict of all of the dirs inside of the manifest object, we just don't get a copy of it. In a repo I have here, this brings the time for a simple rebase from 11.197s to 4.609s. Differential Revision: https://phab.mercurial-scm.org/D9503

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)