vfs: makes all audited path relative
authorBoris Feld <boris.feld@octobus.net>
Sun, 02 Jul 2017 04:51:03 +0200
changeset 41090 c8006a25b845
parent 41089 a59a74721c76
child 41091 d9b6b9ed96d8
vfs: makes all audited path relative Only auditing relative path helps the vfs warning logic.
mercurial/vfs.py
--- a/mercurial/vfs.py	Fri Dec 21 13:17:58 2018 +0100
+++ b/mercurial/vfs.py	Sun Jul 02 04:51:03 2017 +0200
@@ -339,6 +339,8 @@
 
     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))