# HG changeset patch # User FUJIWARA Katsunori # Date 2012-10-08 16:41:55 # Node ID bf4b72d8dd4d03e6d27dff228c97b20305b6b5c9 # Parent ab23768746fdca210c6e9f87bd2851ae232bdc6d store: initialize vfs field first to use it for initialization of others This patch initializes "vfs" field in the constructor of each store classes to use it for initialization of others. In this patch, "self.vfs.base" is used to initialize "self.path", because redo join of path components for "self.path" is redundant. diff --git a/mercurial/store.py b/mercurial/store.py --- a/mercurial/store.py +++ b/mercurial/store.py @@ -291,9 +291,9 @@ def _calcmode(path): class basicstore(object): '''base class for local repository stores''' def __init__(self, path, vfstype): - self.path = path + vfs = vfstype(path) + self.path = vfs.base self.createmode = _calcmode(path) - vfs = vfstype(self.path) vfs.createmode = self.createmode self.vfs = scmutil.filtervfs(vfs, encodedir) self.opener = self.vfs @@ -342,9 +342,9 @@ class basicstore(object): class encodedstore(basicstore): def __init__(self, path, vfstype): - self.path = path + '/store' + vfs = vfstype(path + '/store') + self.path = vfs.base self.createmode = _calcmode(self.path) - vfs = vfstype(self.path) vfs.createmode = self.createmode self.vfs = scmutil.filtervfs(vfs, encodefilename) self.opener = self.vfs @@ -448,10 +448,10 @@ class fncachestore(basicstore): else: encode = _plainhybridencode self.encode = encode - self.path = path + '/store' + vfs = vfstype(path + '/store') + self.path = vfs.base self.pathsep = self.path + '/' self.createmode = _calcmode(self.path) - vfs = vfstype(self.path) vfs.createmode = self.createmode fnc = fncache(vfs) self.fncache = fnc