mercurial/scmutil.py
changeset 17161 be016e96117a
parent 17157 87e8440964a0
child 17201 afd75476939e
--- a/mercurial/scmutil.py	Fri Jul 06 18:45:27 2012 +0900
+++ b/mercurial/scmutil.py	Fri Jul 06 18:45:27 2012 +0900
@@ -190,6 +190,21 @@
         finally:
             fp.close()
 
+    def mkdir(self, path=None):
+        return os.mkdir(self.join(path))
+
+    def exists(self, path=None):
+        return os.path.exists(self.join(path))
+
+    def isdir(self, path=None):
+        return os.path.isdir(self.join(path))
+
+    def makedir(self, path=None, notindexed=True):
+        return util.makedir(self.join(path), notindexed)
+
+    def makedirs(self, path=None, mode=None):
+        return util.makedirs(self.join(path), mode)
+
 class opener(abstractopener):
     '''Open files relative to a base directory
 
@@ -293,7 +308,10 @@
         self.auditor(path)
 
     def join(self, path):
-        return os.path.join(self.base, path)
+        if path:
+            return os.path.join(self.base, path)
+        else:
+            return self.base
 
 class filteropener(abstractopener):
     '''Wrapper opener for filtering filenames with a function.'''