[PATCH 1 of 6] vfs: treat 'undo.' file the same as 'journal.' file

Boris Feld boris.feld at octobus.net
Mon Nov 26 18:22:43 UTC 2018


# HG changeset patch
# User Boris Feld <boris.feld at octobus.net>
# Date 1542908647 -3600
#      Thu Nov 22 18:44:07 2018 +0100
# Node ID 5bcdd426a817c333ca30dac9a02ec100f962155e
# Parent  dba590f27c7abacbd7e9b27f3e06822bb0b339cb
# EXP-Topic vfs.audit-rename
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 5bcdd426a817
vfs: treat 'undo.' file the same as 'journal.' file

They are the same kind of file, they are protected by the store lock, but
directly lives inside the '.hg' directory.

No warnings were ever raised about them because `vfs.rename` is not audited.
Something we are trying to change.

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1030,7 +1030,7 @@ class localrepository(object):
             if path.startswith('cache/'):
                 msg = 'accessing cache with vfs instead of cachevfs: "%s"'
                 repo.ui.develwarn(msg % path, stacklevel=2, config="cache-vfs")
-            if path.startswith('journal.'):
+            if path.startswith('journal.') or path.startswith('undo.'):
                 # journal is covered by 'lock'
                 if repo._currentlock(repo._lockref) is None:
                     repo.ui.develwarn('write with no lock: "%s"' % path,


More information about the Mercurial-devel mailing list