[PATCH 8 of 9] store: invoke "os.path.isdir()" via vfs

FUJIWARA Katsunori foozy at lares.dti.ne.jp
Mon Oct 8 12:06:18 CDT 2012


# HG changeset patch
# User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
# Date 1349714515 -32400
# Node ID e821f4ebf5a1082e750b07964e0ee291272bb458
# Parent  6353632376a81896afadcef810da1cf1c3c6d56f
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.

diff -r 6353632376a8 -r e821f4ebf5a1 mercurial/store.py
--- 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
 


More information about the Mercurial-devel mailing list