comparison mercurial/debugcommands.py @ 44318:20e125cdd719

nodemap: add basic checking of the on disk nodemap content The simplest check it so verify we have all the revision we needs, and nothing more. Differential Revision: https://phab.mercurial-scm.org/D7845
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 15 Jan 2020 15:48:57 +0100
parents 6c07480d6659
children 76a96e3a2bbb
comparison
equal deleted inserted replaced
44317:78721bbdb2ab 44318:20e125cdd719
2092 b'dump-new', 2092 b'dump-new',
2093 False, 2093 False,
2094 _(b'write a (new) persistent binary nodemap on stdin'), 2094 _(b'write a (new) persistent binary nodemap on stdin'),
2095 ), 2095 ),
2096 (b'', b'dump-disk', False, _(b'dump on-disk data on stdin')), 2096 (b'', b'dump-disk', False, _(b'dump on-disk data on stdin')),
2097 (
2098 b'',
2099 b'check',
2100 False,
2101 _(b'check that the data on disk data are correct.'),
2102 ),
2097 ], 2103 ],
2098 ) 2104 )
2099 def debugnodemap(ui, repo, **opts): 2105 def debugnodemap(ui, repo, **opts):
2100 """write and inspect on disk nodemap 2106 """write and inspect on disk nodemap
2101 """ 2107 """
2107 elif opts['dump_disk']: 2113 elif opts['dump_disk']:
2108 unfi = repo.unfiltered() 2114 unfi = repo.unfiltered()
2109 cl = unfi.changelog 2115 cl = unfi.changelog
2110 data = nodemap.persisted_data(cl) 2116 data = nodemap.persisted_data(cl)
2111 ui.write(data) 2117 ui.write(data)
2118 elif opts['check']:
2119 unfi = repo.unfiltered()
2120 cl = unfi.changelog
2121 data = nodemap.persisted_data(cl)
2122 return nodemap.check_data(ui, cl.index, data)
2112 2123
2113 2124
2114 @command( 2125 @command(
2115 b'debugobsolete', 2126 b'debugobsolete',
2116 [ 2127 [