[PATCH 1 of 6] localrepo: eliminate requirements class variable

Drew Gottlieb drgott at google.com
Fri May 1 18:19:07 CDT 2015


# HG changeset patch
# User Drew Gottlieb <drgott at google.com>
# Date 1429660530 25200
#      Tue Apr 21 16:55:30 2015 -0700
# Node ID 07d39152e3f49c717296ebbe0e543319404f1447
# Parent  e9edd53770fb77a9787a3e6592a3bf0a29c1bd80
localrepo: eliminate requirements class variable

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 @@
     _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)


More information about the Mercurial-devel mailing list