# HG changeset patch # User FUJIWARA Katsunori # Date 2015-07-09 15:59:51 # Node ID 39de2e9cc6f41391391112cf7511e83e2272f878 # Parent 2538b87660be4c84b84b0bd89adb565bf81a7c84 vfs: add basename diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py --- a/mercurial/scmutil.py +++ b/mercurial/scmutil.py @@ -282,6 +282,12 @@ class abstractvfs(object): finally: fp.close() + def basename(self, path): + """return base element of a path (as os.path.basename would do) + + This exists to allow handling of strange encoding if needed.""" + return os.path.basename(path) + def chmod(self, path, mode): return os.chmod(self.join(path), mode)