Patchwork [5,of,6] vfs: add dirname

login
register
mail settings
Submitter Katsunori FUJIWARA
Date July 9, 2015, 4:03 p.m.
Message ID <819896ff7ffd53404f41.1436457782@juju>
Download mbox | patch
Permalink /patch/9939/
State Accepted
Headers show

Comments

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

Patch

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))