changeset 17156:7034365089bf

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.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Fri, 06 Jul 2012 18:45:26 +0900
parents 88ff28bcd980
children 87e8440964a0
files mercurial/localrepo.py mercurial/statichttprepo.py
diffstat 2 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py	Fri Jul 13 14:49:16 2012 +0200
+++ b/mercurial/localrepo.py	Fri Jul 06 18:45:26 2012 +0900
@@ -42,7 +42,9 @@
         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 @@
         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)
--- a/mercurial/statichttprepo.py	Fri Jul 13 14:49:16 2012 +0200
+++ b/mercurial/statichttprepo.py	Fri Jul 06 18:45:26 2012 +0900
@@ -87,6 +87,7 @@
 
         opener = build_opener(ui, authinfo)
         self.opener = opener(self.path)
+        self.vfs = self.opener
         self._phasedefaults = []
 
         try:
@@ -112,6 +113,7 @@
         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 = {}