manifestcache: actually honor --clear
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 14 Mar 2019 09:12:46 +0000
changeset 41947 b74ef67573e5
parent 41946 5b77847bdf09
child 41948 dd1ab72be983
manifestcache: actually honor --clear Before this change, the --clear flag was not clearing the on disk cache. (We also remove the extra verbosity when using --clear. Same as what we did for --add)
mercurial/debugcommands.py
tests/test-manifest.t
--- a/mercurial/debugcommands.py	Thu Mar 14 10:58:53 2019 +0000
+++ b/mercurial/debugcommands.py	Thu Mar 14 09:12:46 2019 +0000
@@ -1478,7 +1478,8 @@
     if opts.get(r'clear'):
         with repo.lock():
             cache = getcache()
-            cache.clear()
+            cache.clear(clear_persisted_data=True)
+            return
 
     if add:
         with repo.lock():
--- a/tests/test-manifest.t	Thu Mar 14 10:58:53 2019 +0000
+++ b/tests/test-manifest.t	Thu Mar 14 09:12:46 2019 +0000
@@ -142,3 +142,9 @@
   id: 1e01206b1d2f72bd55f2a33fa8ccad74144825b7, size 133 bytes
   id: fce2a30dedad1eef4da95ca1dc0004157aa527cf, size 87 bytes
   total cache data size 268 bytes, on-disk 268 bytes
+
+Check cache clearing
+
+  $ hg debugmanifestfulltextcache --clear
+  $ hg debugmanifestfulltextcache
+  cache empty