# HG changeset patch # User Pierre-Yves David # Date 1579099804 -3600 # Node ID 6614b301ea5887acc30a694344188b0ad826a613 # Parent 50ad851efd9b2ded7d278be6aab03f4572bccd32 nodemap: add a flag to dump the details of the docket We are about to add more information to the docket. We first introduce a way to debug its content. Differential Revision: https://phab.mercurial-scm.org/D7887 diff -r 50ad851efd9b -r 6614b301ea58 mercurial/debugcommands.py --- a/mercurial/debugcommands.py Wed Jan 15 15:49:54 2020 +0100 +++ b/mercurial/debugcommands.py Wed Jan 15 15:50:04 2020 +0100 @@ -2100,6 +2100,12 @@ False, _(b'check that the data on disk data are correct.'), ), + ( + b'', + b'metadata', + False, + _(b'display the on disk meta data for the nodemap'), + ), ], ) def debugnodemap(ui, repo, **opts): @@ -2124,6 +2130,13 @@ if nm_data is not None: docket, data = nm_data return nodemap.check_data(ui, cl.index, data) + elif opts['metadata']: + unfi = repo.unfiltered() + cl = unfi.changelog + nm_data = nodemap.persisted_data(cl) + if nm_data is not None: + docket, data = nm_data + ui.write((b"uid: %s\n") % docket.uid) @command( diff -r 50ad851efd9b -r 6614b301ea58 tests/test-completion.t --- a/tests/test-completion.t Wed Jan 15 15:49:54 2020 +0100 +++ b/tests/test-completion.t Wed Jan 15 15:50:04 2020 +0100 @@ -291,7 +291,7 @@ debugmanifestfulltextcache: clear, add debugmergestate: debugnamecomplete: - debugnodemap: dump-new, dump-disk, check + debugnodemap: dump-new, dump-disk, check, metadata debugobsolete: flags, record-parents, rev, exclusive, index, delete, date, user, template debugp1copies: rev debugp2copies: rev diff -r 50ad851efd9b -r 6614b301ea58 tests/test-persistent-nodemap.t --- a/tests/test-persistent-nodemap.t Wed Jan 15 15:49:54 2020 +0100 +++ b/tests/test-persistent-nodemap.t Wed Jan 15 15:50:04 2020 +0100 @@ -12,6 +12,8 @@ > persistent-nodemap=yes > EOF $ hg debugbuilddag .+5000 + $ hg debugnodemap --metadata + uid: ???????????????? (glob) $ f --size .hg/store/00changelog.n .hg/store/00changelog.n: size=18 $ f --sha256 .hg/store/00changelog-*.nd @@ -47,6 +49,8 @@ $ echo foo > foo $ hg add foo $ hg ci -m 'foo' + $ hg debugnodemap --metadata + uid: ???????????????? (glob) $ f --size .hg/store/00changelog.n .hg/store/00changelog.n: size=18