# HG changeset patch # User FUJIWARA Katsunori # Date 2012-10-08 16:41:55 # Node ID 004bd533880dc33b2aa8e41816a1eb59b47d9045 # Parent 6492b39a44d593cf4dfaac65856de0b77f73095b 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 --git a/mercurial/store.py b/mercurial/store.py --- a/mercurial/store.py +++ b/mercurial/store.py @@ -295,6 +295,7 @@ class basicstore(object): 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 @@ class basicstore(object): 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 @@ class encodedstore(basicstore): 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