[PATCH 5 of 9] vfs: define "join()" in each classes derived from "abstractvfs"
FUJIWARA Katsunori
foozy at lares.dti.ne.jp
Mon Oct 8 12:06:15 CDT 2012
# HG changeset patch
# User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
# Date 1349714515 -32400
# Node ID 4956dd12c3b003bb566fd29ba44a91e707626cc3
# Parent 6874c01dafdb6ea259b9f4649f522cb5fb005cd4
vfs: define "join()" in each classes derived from "abstractvfs"
This patch defines "join()" in each classes derived from "abstractvfs"
except "vfs", which already defines it.
This allows all vfs instances to be used for indirect file API
invocation.
diff -r 6874c01dafdb -r 4956dd12c3b0 mercurial/scmutil.py
--- a/mercurial/scmutil.py Tue Oct 09 01:41:55 2012 +0900
+++ b/mercurial/scmutil.py Tue Oct 09 01:41:55 2012 +0900
@@ -347,6 +347,12 @@
def __call__(self, path, *args, **kwargs):
return self._orig(self._filter(path), *args, **kwargs)
+ def join(self, path):
+ if path:
+ return self._orig.join(self._filter(path))
+ else:
+ return self._orig.join(path)
+
filteropener = filtervfs
def canonpath(root, cwd, myname, auditor=None):
diff -r 6874c01dafdb -r 4956dd12c3b0 mercurial/statichttprepo.py
--- a/mercurial/statichttprepo.py Tue Oct 09 01:41:55 2012 +0900
+++ b/mercurial/statichttprepo.py Tue Oct 09 01:41:55 2012 +0900
@@ -74,6 +74,12 @@
f = "/".join((self.base, urllib.quote(path)))
return httprangereader(f, urlopener)
+ def join(self, path):
+ if path:
+ return os.path.join(self.base, path)
+ else:
+ return self.base
+
return statichttpvfs
class statichttppeer(localrepo.localpeer):
diff -r 6874c01dafdb -r 4956dd12c3b0 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
@@ -441,6 +441,12 @@
self.fncache.add(path)
return self.vfs(self.encode(path), mode, *args, **kw)
+ def join(self, path):
+ if path:
+ return self.vfs.join(self.encode(path))
+ else:
+ return self.vfs.join(path)
+
class fncachestore(basicstore):
def __init__(self, path, vfstype, dotencode):
if dotencode:
More information about the Mercurial-devel
mailing list