Mercurial > hg
comparison mercurial/changelog.py @ 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 | a07d5cb03a85 |
children | 906a7bcaac86 |
comparison
equal
deleted
inserted
replaced
47149:396442cd7e6a | 47150:8d3c2f9d4af7 |
---|---|
394 | 394 |
395 ``concurrencychecker`` will be passed to the revlog init function, see | 395 ``concurrencychecker`` will be passed to the revlog init function, see |
396 the documentation there. | 396 the documentation there. |
397 """ | 397 """ |
398 | 398 |
399 indexfile = b'00changelog.i' | |
400 if trypending and opener.exists(b'00changelog.i.a'): | 399 if trypending and opener.exists(b'00changelog.i.a'): |
401 postfix = b'a' | 400 postfix = b'a' |
402 else: | 401 else: |
403 postfix = None | 402 postfix = None |
404 | 403 |
405 datafile = b'00changelog.d' | |
406 revlog.revlog.__init__( | 404 revlog.revlog.__init__( |
407 self, | 405 self, |
408 opener, | 406 opener, |
409 target=(revlog_constants.KIND_CHANGELOG, None), | 407 target=(revlog_constants.KIND_CHANGELOG, None), |
408 radix=b'00changelog', | |
410 postfix=postfix, | 409 postfix=postfix, |
411 indexfile=indexfile, | |
412 datafile=datafile, | |
413 checkambig=True, | 410 checkambig=True, |
414 mmaplargeindex=True, | 411 mmaplargeindex=True, |
415 persistentnodemap=opener.options.get(b'persistent-nodemap', False), | 412 persistentnodemap=opener.options.get(b'persistent-nodemap', False), |
416 concurrencychecker=concurrencychecker, | 413 concurrencychecker=concurrencychecker, |
417 ) | 414 ) |