[PATCH 5 of 6] vfs: makes all audited path relative
Boris Feld
boris.feld at octobus.net
Mon Nov 26 13:22:47 EST 2018
# HG changeset patch
# User Boris Feld <boris.feld at octobus.net>
# Date 1498963863 -7200
# Sun Jul 02 04:51:03 2017 +0200
# Node ID cc7d970d99eb242dbe2d8e792a9212aabd06911f
# Parent 7f04e7e8eea72eb588d9460df7c0f2b72941b760
# EXP-Topic vfs.audit-rename
# Available At https://bitbucket.org/octobus/mercurial-devel/
# hg pull https://bitbucket.org/octobus/mercurial-devel/ -r cc7d970d99eb
vfs: makes all audited path relative
Only auditing relative path helps the vfs warning logic.
diff --git a/mercurial/vfs.py b/mercurial/vfs.py
--- a/mercurial/vfs.py
+++ b/mercurial/vfs.py
@@ -339,6 +339,8 @@ class vfs(abstractvfs):
def _auditpath(self, path, mode):
if self._audit:
+ if os.path.isabs(path) and path.startswith(self.base):
+ path = os.path.relpath(path, self.base)
r = util.checkosfilename(path)
if r:
raise error.Abort("%s: %r" % (r, path))
More information about the Mercurial-devel
mailing list