Commit 6614b301ea5 by Pierre-Yves David

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
parent 50ad851efd9
...@@ -2100,6 +2100,12 @@ def debugnamecomplete(ui, repo, *args): ...@@ -2100,6 +2100,12 @@ def debugnamecomplete(ui, repo, *args):
False, False,
_(b'check that the data on disk data are correct.'), _(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): def debugnodemap(ui, repo, **opts):
...@@ -2124,6 +2130,13 @@ def debugnodemap(ui, repo, **opts): ...@@ -2124,6 +2130,13 @@ def debugnodemap(ui, repo, **opts):
if nm_data is not None: if nm_data is not None:
docket, data = nm_data docket, data = nm_data
return nodemap.check_data(ui, cl.index, 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( @command(
......
...@@ -291,7 +291,7 @@ Show all commands + options ...@@ -291,7 +291,7 @@ Show all commands + options
debugmanifestfulltextcache: clear, add debugmanifestfulltextcache: clear, add
debugmergestate: debugmergestate:
debugnamecomplete: 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 debugobsolete: flags, record-parents, rev, exclusive, index, delete, date, user, template
debugp1copies: rev debugp1copies: rev
debugp2copies: rev debugp2copies: rev
......
...@@ -12,6 +12,8 @@ Test the persistent on-disk nodemap ...@@ -12,6 +12,8 @@ Test the persistent on-disk nodemap
> persistent-nodemap=yes > persistent-nodemap=yes
> EOF > EOF
$ hg debugbuilddag .+5000 $ hg debugbuilddag .+5000
$ hg debugnodemap --metadata
uid: ???????????????? (glob)
$ f --size .hg/store/00changelog.n $ f --size .hg/store/00changelog.n
.hg/store/00changelog.n: size=18 .hg/store/00changelog.n: size=18
$ f --sha256 .hg/store/00changelog-*.nd $ f --sha256 .hg/store/00changelog-*.nd
...@@ -47,6 +49,8 @@ add a new commit ...@@ -47,6 +49,8 @@ add a new commit
$ echo foo > foo $ echo foo > foo
$ hg add foo $ hg add foo
$ hg ci -m 'foo' $ hg ci -m 'foo'
$ hg debugnodemap --metadata
uid: ???????????????? (glob)
$ f --size .hg/store/00changelog.n $ f --size .hg/store/00changelog.n
.hg/store/00changelog.n: size=18 .hg/store/00changelog.n: size=18
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment