comparison mercurial/debugcommands.py @ 44307:c577bb4a04d4

nodemap: have some python code writing a nodemap in persistent binary form This python code aims to be as "simple" as possible. It is a reference implementation of the data we are going to write on disk (and possibly, later a way for pure python install to make sure the on disk data are up to date). It is not optimized for performance and rebuild the full data structure from the index every time. This is a stepping stone toward a persistent nodemap on disk. Differential Revision: https://phab.mercurial-scm.org/D7834
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 15 Jan 2020 15:47:12 +0100
parents a0ec05d93c8e
children 6c07480d6659
comparison
equal deleted inserted replaced
44306:a0ec05d93c8e 44307:c577bb4a04d4
93 dateutil, 93 dateutil,
94 procutil, 94 procutil,
95 stringutil, 95 stringutil,
96 ) 96 )
97 97
98 from .revlogutils import deltas as deltautil 98 from .revlogutils import (
99 deltas as deltautil,
100 nodemap,
101 )
99 102
100 release = lockmod.release 103 release = lockmod.release
101 104
102 command = registrar.command() 105 command = registrar.command()
103 106
2077 args = [b''] 2080 args = [b'']
2078 for a in args: 2081 for a in args:
2079 completions.update(n for n in names if n.startswith(a)) 2082 completions.update(n for n in names if n.startswith(a))
2080 ui.write(b'\n'.join(sorted(completions))) 2083 ui.write(b'\n'.join(sorted(completions)))
2081 ui.write(b'\n') 2084 ui.write(b'\n')
2085
2086
2087 @command(
2088 b'debugnodemap',
2089 [(b'', b'dump', False, _(b'write persistent binary nodemap on stdin'))],
2090 )
2091 def debugnodemap(ui, repo, **opts):
2092 """write and inspect on disk nodemap
2093 """
2094 if opts['dump']:
2095 unfi = repo.unfiltered()
2096 cl = unfi.changelog
2097 data = nodemap.persistent_data(cl.index)
2098 ui.write(data)
2082 2099
2083 2100
2084 @command( 2101 @command(
2085 b'debugobsolete', 2102 b'debugobsolete',
2086 [ 2103 [