mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 09:17:30 +03:00
4d72067cbd
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
24 lines
643 B
Python
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)
|