comparison mercurial/debugcommands.py @ 44352:6c07480d6659

nodemap: add a function to read the data from disk This changeset is small and mostly an excuse to introduce an API function reading the data from disk. Differential Revision: https://phab.mercurial-scm.org/D7836
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 15 Jan 2020 15:47:31 +0100
parents c577bb4a04d4
children 20e125cdd719
comparison
equal deleted inserted replaced
44351:5962fd0d1045 44352:6c07480d6659
2084 ui.write(b'\n') 2084 ui.write(b'\n')
2085 2085
2086 2086
2087 @command( 2087 @command(
2088 b'debugnodemap', 2088 b'debugnodemap',
2089 [(b'', b'dump', False, _(b'write persistent binary nodemap on stdin'))], 2089 [
2090 (
2091 b'',
2092 b'dump-new',
2093 False,
2094 _(b'write a (new) persistent binary nodemap on stdin'),
2095 ),
2096 (b'', b'dump-disk', False, _(b'dump on-disk data on stdin')),
2097 ],
2090 ) 2098 )
2091 def debugnodemap(ui, repo, **opts): 2099 def debugnodemap(ui, repo, **opts):
2092 """write and inspect on disk nodemap 2100 """write and inspect on disk nodemap
2093 """ 2101 """
2094 if opts['dump']: 2102 if opts['dump_new']:
2095 unfi = repo.unfiltered() 2103 unfi = repo.unfiltered()
2096 cl = unfi.changelog 2104 cl = unfi.changelog
2097 data = nodemap.persistent_data(cl.index) 2105 data = nodemap.persistent_data(cl.index)
2106 ui.write(data)
2107 elif opts['dump_disk']:
2108 unfi = repo.unfiltered()
2109 cl = unfi.changelog
2110 data = nodemap.persisted_data(cl)
2098 ui.write(data) 2111 ui.write(data)
2099 2112
2100 2113
2101 @command( 2114 @command(
2102 b'debugobsolete', 2115 b'debugobsolete',