<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Mar 16, 2019 at 1:46 PM Pierre-Yves David <<a href="mailto:pierre-yves.david@ens-lyon.org">pierre-yves.david@ens-lyon.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"># HG changeset patch<br>
# User Pierre-Yves David <<a href="mailto:pierre-yves.david@octobus.net" target="_blank">pierre-yves.david@octobus.net</a>><br>
# Date 1552657976 0<br>
#      Fri Mar 15 13:52:56 2019 +0000<br>
# Node ID 85fa9d19ba227cb04a6c4209a71b1a2f858c6ede<br>
# Parent  b74ef67573e58294771487c5e39f003a9512d11a<br>
# EXP-Topic manifestcache<br>
# Available At <a href="https://bitbucket.org/octobus/mercurial-devel/" rel="noreferrer" target="_blank">https://bitbucket.org/octobus/mercurial-devel/</a><br>
#              hg pull <a href="https://bitbucket.org/octobus/mercurial-devel/" rel="noreferrer" target="_blank">https://bitbucket.org/octobus/mercurial-devel/</a> -r 85fa9d19ba22<br>
manifestcache: support multiple cache addition in one debug command run<br>
<br>
This is more practical.<br></blockquote><div><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Queued the series, many thanks!</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py<br>
--- a/mercurial/debugcommands.py<br>
+++ b/mercurial/debugcommands.py<br>
@@ -1460,10 +1460,10 @@ def debuglocks(ui, repo, **opts):<br>
<br>
 @command('debugmanifestfulltextcache', [<br>
         ('', 'clear', False, _('clear the cache')),<br>
-        ('a', 'add', '', _('add the given manifest node to the cache'),<br>
+        ('a', 'add', [], _('add the given manifest nodes to the cache'),<br>
          _('NODE'))<br>
     ], '')<br>
-def debugmanifestfulltextcache(ui, repo, add=None, **opts):<br>
+def debugmanifestfulltextcache(ui, repo, add=(), **opts):<br>
     """show, clear or amend the contents of the manifest fulltext cache"""<br>
<br>
     def getcache():<br>
@@ -1483,12 +1483,14 @@ def debugmanifestfulltextcache(ui, repo,<br>
<br>
     if add:<br>
         with repo.lock():<br>
-            try:<br>
-                m = repo.manifestlog<br>
-                manifest = m[m.getstorage(b'').lookup(add)]<br>
-            except error.LookupError as e:<br>
-                raise error.Abort(e, hint="Check your manifest node id")<br>
-            manifest.read()  # stores revisision in cache too<br>
+            m = repo.manifestlog<br>
+            store = m.getstorage(b'')<br>
+            for n in add:<br>
+                try:<br>
+                    manifest = m[store.lookup(n)]<br>
+                except error.LookupError as e:<br>
+                    raise error.Abort(e, hint="Check your manifest node id")<br></blockquote><div><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Since the command can accept multiple nodeids now, it will be nice to mention the node id in error output.</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+                manifest.read()  # stores revisision in cache too<br>
             return<br>
<br>
     cache = getcache()<br>
diff --git a/tests/test-manifest.t b/tests/test-manifest.t<br>
--- a/tests/test-manifest.t<br>
+++ b/tests/test-manifest.t<br>
@@ -148,3 +148,13 @@ Check cache clearing<br>
   $ hg debugmanifestfulltextcache --clear<br>
   $ hg debugmanifestfulltextcache<br>
   cache empty<br>
+<br>
+Check adding multiple entry in one go:<br>
+<br>
+  $ hg debugmanifestfulltextcache --add fce2a30dedad1eef4da95ca1dc0004157aa527cf  --add 1e01206b1d2f72bd55f2a33fa8ccad74144825b7<br>
+  $ hg debugmanifestfulltextcache<br>
+  cache contains 2 manifest entries, in order of most to least recent:<br>
+  id: 1e01206b1d2f72bd55f2a33fa8ccad74144825b7, size 133 bytes<br>
+  id: fce2a30dedad1eef4da95ca1dc0004157aa527cf, size 87 bytes<br>
+  total cache data size 268 bytes, on-disk 268 bytes<br>
+  $ hg debugmanifestfulltextcache --clear<br>
_______________________________________________<br>
Mercurial-devel mailing list<br>
<a href="mailto:Mercurial-devel@mercurial-scm.org" target="_blank">Mercurial-devel@mercurial-scm.org</a><br>
<a href="https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel" rel="noreferrer" target="_blank">https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel</a><br>
</blockquote></div></div>