diff -r 78721bbdb2ab -r 20e125cdd719 mercurial/debugcommands.py --- a/mercurial/debugcommands.py Wed Jan 15 15:48:47 2020 +0100 +++ b/mercurial/debugcommands.py Wed Jan 15 15:48:57 2020 +0100 @@ -2094,6 +2094,12 @@ _(b'write a (new) persistent binary nodemap on stdin'), ), (b'', b'dump-disk', False, _(b'dump on-disk data on stdin')), + ( + b'', + b'check', + False, + _(b'check that the data on disk data are correct.'), + ), ], ) def debugnodemap(ui, repo, **opts): @@ -2109,6 +2115,11 @@ cl = unfi.changelog data = nodemap.persisted_data(cl) ui.write(data) + elif opts['check']: + unfi = repo.unfiltered() + cl = unfi.changelog + data = nodemap.persisted_data(cl) + return nodemap.check_data(ui, cl.index, data) @command(