comparison contrib/undumprevlog @ 47150:8d3c2f9d4af7

revlog: use a "radix" to address revlog Instead of pointing to the index directly and to derive the other file from that, we directly provide the radix and let the revlog determine the associated file path internally. This is more robust and will give us more flexibility for picking this file name in the future. Differential Revision: https://phab.mercurial-scm.org/D10576
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 03 May 2021 12:22:36 +0200
parents 4c041c71ec01
children 6000f5b25c9b
comparison
equal deleted inserted replaced
47149:396442cd7e6a 47150:8d3c2f9d4af7
30 l = sys.stdin.readline() 30 l = sys.stdin.readline()
31 if not l: 31 if not l:
32 break 32 break
33 if l.startswith("file:"): 33 if l.startswith("file:"):
34 f = encoding.strtolocal(l[6:-1]) 34 f = encoding.strtolocal(l[6:-1])
35 assert f.endswith(b'.i')
35 r = revlog.revlog( 36 r = revlog.revlog(
36 opener, 37 opener,
37 target=(revlog_constants.KIND_OTHER, b'undump-revlog'), 38 target=(revlog_constants.KIND_OTHER, b'undump-revlog'),
38 indexfile=f, 39 radix=f[:-2],
39 ) 40 )
40 procutil.stdout.write(b'%s\n' % f) 41 procutil.stdout.write(b'%s\n' % f)
41 elif l.startswith("node:"): 42 elif l.startswith("node:"):
42 n = bin(l[6:-1]) 43 n = bin(l[6:-1])
43 elif l.startswith("linkrev:"): 44 elif l.startswith("linkrev:"):