[PATCH 1 of 3 V2] vfs: makes all audited path relative

Boris Feld boris.feld at octobus.net
Mon Dec 31 17:37:28 UTC 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 5479d748f59531f6669290e092a12920cbcc8349
# Parent  9bfbb9fc58711308708003846f8beb63ac21b9d0
# EXP-Topic vfs.audit-rename
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 5479d748f595
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