# HG changeset patch # User Drew Gottlieb # Date 2015-04-21 23:55:30 # Node ID e3a928bd1cd41246b23b355f4538f7446fe3d4fd # Parent e285b98c65ccf55314b729ed6f1b46ac75b44bab localrepo: eliminate requirements class variable (API) Localrepo's requirements class variable was introduced in b090601a80d1 to make requirements modifiable by extensions. A main access point, _baserequirements, still exists, but this change undoes making the class variable to begin with. Without this simplification, there is a class variable with a default value that is only copied, but never directly used. This behavior is moved directly into the _baserequirements function. diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -196,7 +196,6 @@ class localrepository(object): _basesupported = supportedformats | set(('store', 'fncache', 'shared', 'dotencode')) openerreqs = set(('revlogv1', 'generaldelta', 'manifestv2')) - requirements = ['revlogv1'] filtername = None # a list of (ui, featureset) functions. @@ -204,7 +203,7 @@ class localrepository(object): featuresetupfuncs = set() def _baserequirements(self, create): - return self.requirements[:] + return ['revlogv1'] def __init__(self, baseui, path=None, create=False): self.wvfs = scmutil.vfs(path, expandpath=True, realpath=True)