changeset 17728:004bd533880d

store: invoke "os.path.isdir()" via vfs This patch invokes "os.path.isdir()" via "rawvfs" object to avoid filename encoding, because the path passed to "os.path.isdir()" shouldn't be encoded. This patch newly adds "self.rawvfs" field only to "basicstore" and "encodedstore", because "fncachestore" has "self.rawvfs" already.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Tue, 09 Oct 2012 01:41:55 +0900
parents 6492b39a44d5
children 9a3cb3ce011e
files mercurial/store.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/store.py	Tue Oct 09 01:41:55 2012 +0900
+++ b/mercurial/store.py	Tue Oct 09 01:41:55 2012 +0900
@@ -295,6 +295,7 @@
         self.path = vfs.base
         self.createmode = _calcmode(vfs)
         vfs.createmode = self.createmode
+        self.rawvfs = vfs
         self.vfs = scmutil.filtervfs(vfs, encodedir)
         self.opener = self.vfs
 
@@ -308,7 +309,7 @@
             path += '/' + relpath
         striplen = len(self.path) + 1
         l = []
-        if os.path.isdir(path):
+        if self.rawvfs.isdir(path):
             visit = [path]
             while visit:
                 p = visit.pop()
@@ -346,6 +347,7 @@
         self.path = vfs.base
         self.createmode = _calcmode(vfs)
         vfs.createmode = self.createmode
+        self.rawvfs = vfs
         self.vfs = scmutil.filtervfs(vfs, encodefilename)
         self.opener = self.vfs