Patchwork [7,of,8] cachevfs: add a devel warning for cache access though 'vfs'

login
register
mail settings
Submitter Boris Feld
Date July 16, 2017, 8:47 a.m.
Message ID <ade3b656f808205bbe66.1500194872@FB>
Download mbox | patch
Permalink /patch/22431/
State Accepted
Headers show

Comments

Boris Feld - July 16, 2017, 8:47 a.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1500152715 -7200
#      Sat Jul 15 23:05:15 2017 +0200
# Node ID ade3b656f808205bbe66f8a18bef34d545ad03f3
# Parent  6de7b0ec19f57b99fd48093a7f5ae41d1d48347c
# EXP-Topic cachevfs
cachevfs: add a devel warning for cache access though 'vfs'

This will help third party extensions to migrate to the new 'cachevfs'.

Patch

diff -r 6de7b0ec19f5 -r ade3b656f808 mercurial/localrepo.py
--- a/mercurial/localrepo.py	Sat Jul 15 23:30:25 2017 +0200
+++ b/mercurial/localrepo.py	Sat Jul 15 23:05:15 2017 +0200
@@ -487,6 +487,9 @@ 
             if path.startswith(repo.path):
                 # truncate name relative to the repository (.hg)
                 path = path[len(repo.path) + 1:]
+            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.'):
                 # journal is covered by 'lock'
                 if repo._currentlock(repo._lockref) is None: