Mercurial > hg
comparison mercurial/localrepo.py @ 24913:e3a928bd1cd4
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.
author | Drew Gottlieb <drgott@google.com> |
---|---|
date | Tue, 21 Apr 2015 16:55:30 -0700 |
parents | 21b33f0460e0 |
children | cb144bfc61ea |
comparison
equal
deleted
inserted
replaced
24912:e285b98c65cc | 24913:e3a928bd1cd4 |
---|---|
194 | 194 |
195 supportedformats = set(('revlogv1', 'generaldelta', 'manifestv2')) | 195 supportedformats = set(('revlogv1', 'generaldelta', 'manifestv2')) |
196 _basesupported = supportedformats | set(('store', 'fncache', 'shared', | 196 _basesupported = supportedformats | set(('store', 'fncache', 'shared', |
197 'dotencode')) | 197 'dotencode')) |
198 openerreqs = set(('revlogv1', 'generaldelta', 'manifestv2')) | 198 openerreqs = set(('revlogv1', 'generaldelta', 'manifestv2')) |
199 requirements = ['revlogv1'] | |
200 filtername = None | 199 filtername = None |
201 | 200 |
202 # a list of (ui, featureset) functions. | 201 # a list of (ui, featureset) functions. |
203 # only functions defined in module of enabled extensions are invoked | 202 # only functions defined in module of enabled extensions are invoked |
204 featuresetupfuncs = set() | 203 featuresetupfuncs = set() |
205 | 204 |
206 def _baserequirements(self, create): | 205 def _baserequirements(self, create): |
207 return self.requirements[:] | 206 return ['revlogv1'] |
208 | 207 |
209 def __init__(self, baseui, path=None, create=False): | 208 def __init__(self, baseui, path=None, create=False): |
210 self.wvfs = scmutil.vfs(path, expandpath=True, realpath=True) | 209 self.wvfs = scmutil.vfs(path, expandpath=True, realpath=True) |
211 self.wopener = self.wvfs | 210 self.wopener = self.wvfs |
212 self.root = self.wvfs.base | 211 self.root = self.wvfs.base |