[PATCH 2 of 3 V2] vfs: add a `_auditpath` to abstract vfs

Boris Feld boris.feld at octobus.net
Mon Dec 31 12:37:29 EST 2018


# HG changeset patch
# User Boris Feld <boris.feld at octobus.net>
# Date 1545828263 -3600
#      Wed Dec 26 13:44:23 2018 +0100
# Node ID 6528ebfbd28f8fc3669257404eaa4b0aa2c2a2c8
# Parent  5479d748f59531f6669290e092a12920cbcc8349
# EXP-Topic vfs.audit-rename
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 6528ebfbd28f
vfs: add a `_auditpath` to abstract vfs

We are about to make `rename` audit path. Since rename lives in the
`abstractvfs` layer, we need it to be aware of auditing to some extent.

The default implementation is no-op because multiple existing vfs are not using
auditing at all right now (eg: fncachevfs).

diff --git a/mercurial/vfs.py b/mercurial/vfs.py
--- a/mercurial/vfs.py
+++ b/mercurial/vfs.py
@@ -46,6 +46,9 @@ class abstractvfs(object):
         '''Prevent instantiation; don't call this from subclasses.'''
         raise NotImplementedError('attempted instantiating ' + str(type(self)))
 
+    def _auditpath(self, path, mode):
+        pass
+
     def tryread(self, path):
         '''gracefully return an empty string for missing files'''
         try:


More information about the Mercurial-devel mailing list