localrepo: eliminate requirements class variable (API)
authorDrew Gottlieb <drgott@google.com>
Tue, 21 Apr 2015 16:55:30 -0700
changeset 24913 e3a928bd1cd4
parent 24912 e285b98c65cc
child 24914 cb144bfc61ea
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.
mercurial/localrepo.py
--- a/mercurial/localrepo.py	Wed Apr 29 10:30:58 2015 -0700
+++ b/mercurial/localrepo.py	Tue Apr 21 16:55:30 2015 -0700
@@ -196,7 +196,6 @@
     _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 @@
     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)