Mercurial > hg-stable
changeset 32750:b8ff7d0ff361
localrepo: move filtername to __init__
This is obviously an instance attribute, not a type attribute. The
modern Python style is to use __init__ for defining these.
This exposes statichttprepo as inheriting from localrepository
without calling its __init__. As a result, its __init__ defines
a lot of variables that methods on localrepository's methods need.
But factoring the common bits into a separate class is for another
day.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Thu, 08 Jun 2017 23:23:37 -0700 |
parents | c8177792fef6 |
children | 6f791ca70640 |
files | mercurial/localrepo.py mercurial/statichttprepo.py |
diffstat | 2 files changed, 2 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/localrepo.py Thu Jun 08 21:54:30 2017 -0700 +++ b/mercurial/localrepo.py Thu Jun 08 23:23:37 2017 -0700 @@ -270,7 +270,6 @@ 'treemanifest', 'manifestv2', } - filtername = None # a list of (ui, featureset) functions. # only functions defined in module of enabled extensions are invoked @@ -278,6 +277,7 @@ def __init__(self, baseui, path, create=False): self.requirements = set() + self.filtername = None # wvfs: rooted at the repository root, used to access the working copy self.wvfs = vfsmod.vfs(path, expandpath=True, realpath=True) # vfs: rooted at .hg, used to access repo files outside of .hg/store
--- a/mercurial/statichttprepo.py Thu Jun 08 21:54:30 2017 -0700 +++ b/mercurial/statichttprepo.py Thu Jun 08 23:23:37 2017 -0700 @@ -127,6 +127,7 @@ self._phasedefaults = [] self.names = namespaces.namespaces() + self.filtername = None try: requirements = scmutil.readrequires(self.vfs, self.supported)