changeset 41964:e3307243d188

manifestcache: stop altering the lru cache order while displaying it Accessing value with `.get` alter the iteration order and make the output of the debug command misbehave, showing multiple entry twice. We need more than 2 entry to see the bug, so there are not test change. Later test will introduce a third entry and would fail without this fix.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 15 Mar 2019 13:52:36 +0000
parents 1fe278aa4ad5
children 7d417ab1eda9
files mercurial/debugcommands.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/debugcommands.py	Fri Mar 15 13:52:56 2019 +0000
+++ b/mercurial/debugcommands.py	Fri Mar 15 13:52:36 2019 +0000
@@ -1503,7 +1503,7 @@
         totalsize = 0
         for nodeid in cache:
             # Use cache.get to not update the LRU order
-            data = cache.get(nodeid)
+            data = cache.peek(nodeid)
             size = len(data)
             totalsize += size + 24   # 20 bytes nodeid, 4 bytes size
             ui.write(_('id: %s, size %s\n') % (