##// END OF EJS Templates
vfs: use 'vfs' module directly in 'mercurial.localrepo'...
Pierre-Yves David -
r31231:0a38a313 default
parent child Browse files
Show More
@@ -59,6 +59,7 b' from . import ('
59 transaction,
59 transaction,
60 txnutil,
60 txnutil,
61 util,
61 util,
62 vfs as vfsmod,
62 )
63 )
63
64
64 release = lockmod.release
65 release = lockmod.release
@@ -255,7 +256,7 b' class localrepository(object):'
255 def __init__(self, baseui, path, create=False):
256 def __init__(self, baseui, path, create=False):
256 self.requirements = set()
257 self.requirements = set()
257 # vfs to access the working copy
258 # vfs to access the working copy
258 self.wvfs = scmutil.vfs(path, expandpath=True, realpath=True)
259 self.wvfs = vfsmod.vfs(path, expandpath=True, realpath=True)
259 # vfs to access the content of the repository
260 # vfs to access the content of the repository
260 self.vfs = None
261 self.vfs = None
261 # vfs to access the store part of the repository
262 # vfs to access the store part of the repository
@@ -266,7 +267,7 b' class localrepository(object):'
266 self.auditor = pathutil.pathauditor(self.root, self._checknested)
267 self.auditor = pathutil.pathauditor(self.root, self._checknested)
267 self.nofsauditor = pathutil.pathauditor(self.root, self._checknested,
268 self.nofsauditor = pathutil.pathauditor(self.root, self._checknested,
268 realfs=False)
269 realfs=False)
269 self.vfs = scmutil.vfs(self.path)
270 self.vfs = vfsmod.vfs(self.path)
270 self.baseui = baseui
271 self.baseui = baseui
271 self.ui = baseui.copy()
272 self.ui = baseui.copy()
272 self.ui.copy = baseui.copy # prevent copying repo configuration
273 self.ui.copy = baseui.copy # prevent copying repo configuration
@@ -331,8 +332,7 b' class localrepository(object):'
331 sharedpath = self.vfs.read("sharedpath").rstrip('\n')
332 sharedpath = self.vfs.read("sharedpath").rstrip('\n')
332 if 'relshared' in self.requirements:
333 if 'relshared' in self.requirements:
333 sharedpath = self.vfs.join(sharedpath)
334 sharedpath = self.vfs.join(sharedpath)
334 vfs = scmutil.vfs(sharedpath, realpath=True)
335 vfs = vfsmod.vfs(sharedpath, realpath=True)
335
336 s = vfs.base
336 s = vfs.base
337 if not vfs.exists():
337 if not vfs.exists():
338 raise error.RepoError(
338 raise error.RepoError(
@@ -343,7 +343,7 b' class localrepository(object):'
343 raise
343 raise
344
344
345 self.store = store.store(
345 self.store = store.store(
346 self.requirements, self.sharedpath, scmutil.vfs)
346 self.requirements, self.sharedpath, vfsmod.vfs)
347 self.spath = self.store.path
347 self.spath = self.store.path
348 self.svfs = self.store.vfs
348 self.svfs = self.store.vfs
349 self.sjoin = self.store.join
349 self.sjoin = self.store.join
General Comments 0
You need to be logged in to leave comments. Login now