# HG changeset patch # User FUJIWARA Katsunori # Date 2012-07-06 09:45:26 # Node ID 7034365089bfa53605290dc455f9ee59aa6f64f3 # Parent 88ff28bcd98014170909101adc410a8447704fd0 localrepo: add "vfs" fields to "localrepository" for migration from "opener" As a part of migration to vfs, this patch adds "vfs" fields to "localrepository" class. This allows new codes to access current "opener" objects related to repositories via "vfs" fields, so patches referring to "vfs" will replace referring to "opener" in time. This patch also adds initializations for "vfs" fields to "statichttprepository" class derived from it, because its constructor doesn't invoke the constructor of "localrepository", so "vfs" fields should be initialized explicitly as same as "opener" fields: it has no working directory, so "wvfs" field is not added. diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -42,7 +42,9 @@ class localrepository(repo.repository): self.origroot = path self.auditor = scmutil.pathauditor(self.root, self._checknested) self.opener = scmutil.opener(self.path) + self.vfs = self.opener self.wopener = scmutil.opener(self.root) + self.wvfs = self.wopener self.baseui = baseui self.ui = baseui.copy() # A list of callback to shape the phase if no data were found. @@ -104,6 +106,7 @@ class localrepository(repo.repository): self.store = store.store(requirements, self.sharedpath, scmutil.opener) self.spath = self.store.path self.sopener = self.store.opener + self.svfs = self.sopener self.sjoin = self.store.join self.opener.createmode = self.store.createmode self._applyrequirements(requirements) diff --git a/mercurial/statichttprepo.py b/mercurial/statichttprepo.py --- a/mercurial/statichttprepo.py +++ b/mercurial/statichttprepo.py @@ -87,6 +87,7 @@ class statichttprepository(localrepo.loc opener = build_opener(ui, authinfo) self.opener = opener(self.path) + self.vfs = self.opener self._phasedefaults = [] try: @@ -112,6 +113,7 @@ class statichttprepository(localrepo.loc self.store = store.store(requirements, self.path, opener) self.spath = self.store.path self.sopener = self.store.opener + self.svfs = self.sopener self.sjoin = self.store.join self._filecache = {}