sapling/perftweaks.py
Durham Goode 4d72067cbd Add option to disable reading from the tag cache
Summary:
The tag cache can be pretty expensive to populate, and in many of our repos we
do not even allow tags, so let's allo disable it entirely.

Test Plan: Added a test

Reviewers: #sourcecontrol, rmcelroy

Reviewed By: #sourcecontrol, rmcelroy

Subscribers: rmcelroy

Differential Revision: https://phabricator.fb.com/D2481606
2015-09-25 13:45:08 -07:00

24 lines
643 B
Python

# perftweaks.py
#
# Copyright 2015 Facebook, Inc.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
"""extension for tweaking Mercurial features to improve performance."""
from mercurial import tags
from mercurial.extensions import wrapcommand, wrapfunction
from mercurial.i18n import _
import os
testedwith = 'internal'
def extsetup(ui):
wrapfunction(tags, '_readtagcache', _readtagcache)
def _readtagcache(orig, ui, repo):
if ui.configbool('perftweaks', 'disabletags'):
return (None, None, None, {}, False)
return orig(ui, repo)