changeset 24628:a0b47885a1c5

vfs: make it possible to pass multiple path elements to join os.path.join(), localrepo.join() and localrepo.wjoin() allow passing multiple path elements; vfs.join() should be as convenient.
author Matt Harbison <matt_harbison@yahoo.com>
date Sat, 04 Apr 2015 17:19:16 -0400
parents f33236c9b025
children 8dc2533f03ef
files mercurial/scmutil.py
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/scmutil.py	Sat Apr 04 15:43:00 2015 -0400
+++ b/mercurial/scmutil.py	Sat Apr 04 17:19:16 2015 -0400
@@ -445,9 +445,9 @@
         else:
             self.write(dst, src)
 
-    def join(self, path):
+    def join(self, path, *insidef):
         if path:
-            return os.path.join(self.base, path)
+            return os.path.join(self.base, path, *insidef)
         else:
             return self.base
 
@@ -475,9 +475,9 @@
     def __call__(self, path, *args, **kwargs):
         return self.vfs(self._filter(path), *args, **kwargs)
 
-    def join(self, path):
+    def join(self, path, *insidef):
         if path:
-            return self.vfs.join(self._filter(path))
+            return self.vfs.join(self._filter(self.vfs.reljoin(path, *insidef)))
         else:
             return self.vfs.join(path)