Mercurial > hg
comparison mercurial/manifest.py @ 47072:4c041c71ec01
revlog: introduce an explicit tracking of what the revlog is about
Since the dawn of time, people have been forced to rely to lossy introspection
of the index filename to determine what the purpose and role of the revlog they
encounter is. This is hacky, error prone, inflexible, abstraction-leaky,
<insert-your-own-complaints-here>.
In f63299ee7e4d Raphaël introduced a new attribute to track this information:
`revlog_kind`. However it is initialized in an odd place and various instances
end up not having it set. In addition is only tracking some of the information
we end up having to introspect in various pieces of code.
So we add a new attribute that holds more data and is more strictly enforced.
This work is done in collaboration with Raphaël.
The `revlog_kind` one will be removed/adapted in the next changeset. We expect
to be able to clean up various existing piece of code and to simplify coming
work around the newer revlog format.
Differential Revision: https://phab.mercurial-scm.org/D10352
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Tue, 06 Apr 2021 05:20:24 +0200 |
parents | 12450fbea288 |
children | 64cd1496bb70 |
comparison
equal
deleted
inserted
replaced
47071:3e381eb557f3 | 47072:4c041c71ec01 |
---|---|
31 util, | 31 util, |
32 ) | 32 ) |
33 from .interfaces import ( | 33 from .interfaces import ( |
34 repository, | 34 repository, |
35 util as interfaceutil, | 35 util as interfaceutil, |
36 ) | |
37 from .revlogutils import ( | |
38 constants as revlog_constants, | |
36 ) | 39 ) |
37 | 40 |
38 parsers = policy.importmod('parsers') | 41 parsers = policy.importmod('parsers') |
39 propertycache = util.propertycache | 42 propertycache = util.propertycache |
40 | 43 |
1608 else: | 1611 else: |
1609 self._dirlogcache = {b'': self} | 1612 self._dirlogcache = {b'': self} |
1610 | 1613 |
1611 self._revlog = revlog.revlog( | 1614 self._revlog = revlog.revlog( |
1612 opener, | 1615 opener, |
1613 indexfile, | 1616 target=(revlog_constants.KIND_MANIFESTLOG, self.tree), |
1617 indexfile=indexfile, | |
1614 # only root indexfile is cached | 1618 # only root indexfile is cached |
1615 checkambig=not bool(tree), | 1619 checkambig=not bool(tree), |
1616 mmaplargeindex=True, | 1620 mmaplargeindex=True, |
1617 upperboundcomp=MAXCOMPRESSION, | 1621 upperboundcomp=MAXCOMPRESSION, |
1618 persistentnodemap=opener.options.get(b'persistent-nodemap', False), | 1622 persistentnodemap=opener.options.get(b'persistent-nodemap', False), |