changeset 5864:97f5b5b25299 stable

evolve: add debugfirstmergecache command to simply dump the contents It also recreates the cache if needed (and it will be).
author Anton Shestakov <av6@dwimlabs.net>
date Wed, 31 Mar 2021 20:13:31 +0800
parents 34c7661bd5e2
children d7ed88810457
files hgext3rd/evolve/firstmergecache.py tests/test-discovery-obshashrange-cache.t
diffstat 2 files changed, 19 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/firstmergecache.py	Tue Mar 30 19:18:08 2021 +0800
+++ b/hgext3rd/evolve/firstmergecache.py	Wed Mar 31 20:13:31 2021 +0800
@@ -31,6 +31,15 @@
 
 eh = exthelper.exthelper()
 
+@eh.command(b'debugfirstmergecache', [])
+def debugfirstmergecache(ui, repo, **opts):
+    """display the contents of firstmergecache"""
+    cache = repo.firstmergecache
+    cache.save(repo)
+    for r in repo:
+        ctx = repo[r]
+        ui.write(b'%s %d\n' % (ctx, cache.get(r)))
+
 @eh.reposetup
 def setupcache(ui, repo):
 
--- a/tests/test-discovery-obshashrange-cache.t	Tue Mar 30 19:18:08 2021 +0800
+++ b/tests/test-discovery-obshashrange-cache.t	Wed Mar 31 20:13:31 2021 +0800
@@ -282,6 +282,16 @@
   f69452c5b1af 7
   4de32a90b66c 8
 
+  $ hg -R main debugfirstmergecache --debug
+  1ea73414a91b -1
+  66f7d451a68b -1
+  01241442b3c2 -1
+  2dc09a01254d -1
+  bebd167eb94d -1
+  c8d03c1b5e94 -1
+  f69452c5b1af -1
+  4de32a90b66c -1
+
   $ hg -R main debugstablesortcache --debug
   number of revisions:            8
   number of merge:                0