[PATCH 5 of 6] vfs: add dirname

FUJIWARA Katsunori foozy at lares.dti.ne.jp
Thu Jul 9 11:03:02 CDT 2015


# HG changeset patch
# User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
# Date 1436457591 -32400
#      Fri Jul 10 00:59:51 2015 +0900
# Node ID 819896ff7ffd53404f41832f890f1c3603cf5a49
# Parent  2de1993548dae3768341ae0815684a0b94eff332
vfs: add dirname

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -291,6 +291,12 @@ class abstractvfs(object):
     def chmod(self, path, mode):
         return os.chmod(self.join(path), mode)
 
+    def dirname(self, path):
+        """return dirname element of a path (as os.path.dirname would do)
+
+        This exists to allow handling of strange encoding if needed."""
+        return os.path.dirname(path)
+
     def exists(self, path=None):
         return os.path.exists(self.join(path))
 


More information about the Mercurial-devel mailing list