# HG changeset patch # User Anton Shestakov # Date 1617192811 -28800 # Node ID 97f5b5b25299602ba6171eee02ef9578fdd4a607 # Parent 34c7661bd5e221d45fa773552bef5077c6762de9 evolve: add debugfirstmergecache command to simply dump the contents It also recreates the cache if needed (and it will be). diff -r 34c7661bd5e2 -r 97f5b5b25299 hgext3rd/evolve/firstmergecache.py --- 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): diff -r 34c7661bd5e2 -r 97f5b5b25299 tests/test-discovery-obshashrange-cache.t --- 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