comparison mercurial/debugcommands.py @ 44334:6614b301ea58

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
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 15 Jan 2020 15:50:04 +0100
parents 76a96e3a2bbb
children e41a164db7a9
comparison
equal deleted inserted replaced
44333:50ad851efd9b 44334:6614b301ea58
2098 b'', 2098 b'',
2099 b'check', 2099 b'check',
2100 False, 2100 False,
2101 _(b'check that the data on disk data are correct.'), 2101 _(b'check that the data on disk data are correct.'),
2102 ), 2102 ),
2103 (
2104 b'',
2105 b'metadata',
2106 False,
2107 _(b'display the on disk meta data for the nodemap'),
2108 ),
2103 ], 2109 ],
2104 ) 2110 )
2105 def debugnodemap(ui, repo, **opts): 2111 def debugnodemap(ui, repo, **opts):
2106 """write and inspect on disk nodemap 2112 """write and inspect on disk nodemap
2107 """ 2113 """
2122 cl = unfi.changelog 2128 cl = unfi.changelog
2123 nm_data = nodemap.persisted_data(cl) 2129 nm_data = nodemap.persisted_data(cl)
2124 if nm_data is not None: 2130 if nm_data is not None:
2125 docket, data = nm_data 2131 docket, data = nm_data
2126 return nodemap.check_data(ui, cl.index, data) 2132 return nodemap.check_data(ui, cl.index, data)
2133 elif opts['metadata']:
2134 unfi = repo.unfiltered()
2135 cl = unfi.changelog
2136 nm_data = nodemap.persisted_data(cl)
2137 if nm_data is not None:
2138 docket, data = nm_data
2139 ui.write((b"uid: %s\n") % docket.uid)
2127 2140
2128 2141
2129 @command( 2142 @command(
2130 b'debugobsolete', 2143 b'debugobsolete',
2131 [ 2144 [