scmutil: reorder newly added functions for vfs support in dictionary order
authorFUJIWARA Katsunori <foozy@lares.dti.ne.jp>
Tue, 09 Oct 2012 01:41:55 +0900
changeset 17723 ab23768746fd
parent 17722 3b976051034d
child 17724 bf4b72d8dd4d
scmutil: reorder newly added functions for vfs support in dictionary order Definition functions for vfs support in dictionary order increases readability/maintainability, because there are functions which invoke file API: - with same name: "os.listdir" and "osutil.listdir", for example - with ambiguous names: "os.mkdir" and "util.makedirs", for example
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
@@ -204,9 +204,6 @@
         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))
 
@@ -219,6 +216,9 @@
     def makedirs(self, path=None, mode=None):
         return util.makedirs(self.join(path), mode)
 
+    def mkdir(self, path=None):
+        return os.mkdir(self.join(path))
+
 class vfs(abstractvfs):
     '''Operate files relative to a base directory