Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 03 May 2021 12:26:17 +0200] rev 47171
revlog: rename `newversionflags` to `new_header`
This make it consistent with the previous changeset.
Differential Revision: https://phab.mercurial-scm.org/D10597
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 03 May 2021 12:26:06 +0200] rev 47170
revlog: rename `versionflags` to header
The variable is named as such because it contains "version" information and
"flags" information. However you mostly needs to know the code to understand the
name which is not great. The fact that this is the very first four bytes in all
revlog seems more relevant, so we rename the variable "header".
Differential Revision: https://phab.mercurial-scm.org/D10596
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 03 May 2021 12:25:56 +0200] rev 47169
revlog: move index reading logic in a dedicated method
They are multiple motivation to do it:
* The logic is complicated enough to deserver its own method.
* We will need to reuse this once we put a docket in use.
* This split the actual reading from the processing of the read data better.
Differential Revision: https://phab.mercurial-scm.org/D10595
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 03 May 2021 12:25:45 +0200] rev 47168
revlog: define the actual index and datafile at loading time
This is just code movement, to make the code closer to where we actually use it
and where it will be defined in the future.
Differential Revision: https://phab.mercurial-scm.org/D10594
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 03 May 2021 12:25:34 +0200] rev 47167
revlog: simplify a conditionnal in _enforceinlinesize
This is a gratuitous change to make things a bit easier to read.
Differential Revision: https://phab.mercurial-scm.org/D10593
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 03 May 2021 12:25:23 +0200] rev 47166
revlog: drop `flush` parameter from `_peek_iscensored`
This is not used anywhere.
Differential Revision: https://phab.mercurial-scm.org/D10592
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 03 May 2021 12:25:12 +0200] rev 47165
revlog: fix error message when data are missing
The error message the message was not using the requested offset, but the
adjusted offset to that read more data for improved caching. This resulted in
confusing error message.
Differential Revision: https://phab.mercurial-scm.org/D10591
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 03 May 2021 12:25:01 +0200] rev 47164
revlog: rename `nodemap_file` to `_nodemap_file`
Same reasoning as for `indexfile and datafile`, lets hide these implementation
details.
Differential Revision: https://phab.mercurial-scm.org/D10590
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 03 May 2021 12:24:50 +0200] rev 47163
revlog: use revlog.display_id in error related to bad revisions
Differential Revision: https://phab.mercurial-scm.org/D10589
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 03 May 2021 12:24:40 +0200] rev 47162
revlog: use revlog.display_id in "revision too big" errors
Differential Revision: https://phab.mercurial-scm.org/D10588
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 03 May 2021 12:24:29 +0200] rev 47161
revlog: use revlog.display_id in censor related errors
Differential Revision: https://phab.mercurial-scm.org/D10587
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 03 May 2021 12:24:18 +0200] rev 47160
revlog: use revlog.display_id in integrity error
Differential Revision: https://phab.mercurial-scm.org/D10586
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 03 May 2021 12:24:08 +0200] rev 47159
revlog: use revlog.display_id in ambiguity errors
Differential Revision: https://phab.mercurial-scm.org/D10585
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 03 May 2021 12:23:58 +0200] rev 47158
revlog: use revlog.display_id for corruption error
Differential Revision: https://phab.mercurial-scm.org/D10584
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 03 May 2021 12:23:48 +0200] rev 47157
revlog: use revlog.display_id in format related errors
Differential Revision: https://phab.mercurial-scm.org/D10583
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 03 May 2021 12:23:37 +0200] rev 47156
revlog: use revlog.display_id in narrow error message
Differential Revision: https://phab.mercurial-scm.org/D10582
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 03 May 2021 12:23:27 +0200] rev 47155
revlog: use revlog.display_id in LookupError
Differential Revision: https://phab.mercurial-scm.org/D10581
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 03 May 2021 12:23:17 +0200] rev 47154
revlog: use revlog.display_id for FilteredLookupError
Differential Revision: https://phab.mercurial-scm.org/D10580
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 03 May 2021 12:23:07 +0200] rev 47153
revlog: introduce a `display_id` property
We currently using the "index file" to identify a revlog in error output. Since
we are about to make the "index file" location more volatile, we need something
better. We move to use the "radix", as it is close to what we currently use.
We could probably do better, as pointed out in the comment, however that would
be a quite detour from my current goal.
Differential Revision: https://phab.mercurial-scm.org/D10579
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 03 May 2021 12:22:57 +0200] rev 47152
revlog: also use radix when computing nodemap data file
We have a radix, lets use it!
Differential Revision: https://phab.mercurial-scm.org/D10578
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 03 May 2021 12:22:47 +0200] rev 47151
revlog: stop usage of `_indexfile` to computing nodemap path
We now have the radix explicitely lets use the radix explicitely
Differential Revision: https://phab.mercurial-scm.org/D10577
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 03 May 2021 12:22:36 +0200] rev 47150
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
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 03 May 2021 12:22:26 +0200] rev 47149
revlog: rename `datafile` to `datafile`
We want to make the actual location of the datafile and location more of an
implementation details than what is is currently. In that process, we make the
attribute private.
Differential Revision: https://phab.mercurial-scm.org/D10575
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 03 May 2021 12:22:16 +0200] rev 47148
revlog: rename `indexfile` to `_indexfile`
We want to make the actual location of the indexfile and location more of an
implementation details than what is is currently. In that process, we make the
attribute private.
Differential Revision: https://phab.mercurial-scm.org/D10574
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 03 May 2021 12:22:06 +0200] rev 47147
filelog: drop `indexfile` from `filelog`
Since `filelog` objects are not revlog (no really, they are not…) we drop the
revlog specific attribute. We need to directly access the underlying revlog in a
couple of place that already assume that we have a revlog here.
This is motivated by future change to that revlog attribute.
Differential Revision: https://phab.mercurial-scm.org/D10573
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 03 May 2021 12:21:56 +0200] rev 47146
manifest: drop the `indexfile` from `manifestrevlog`
Since `manifestrevlog` object are not revlog (no really, they are not…) we drop
the revlog specific attribute. We need to directly access the underlying revlog
in a couple of place that already assume that we have a revlog here.
This is motivated by future change to that revlog attribute.
Differential Revision: https://phab.mercurial-scm.org/D10572
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 03 May 2021 12:21:46 +0200] rev 47145
revlog: deal with special "postfix" explicitely
revlog usually use a straight forward '.i' and '.d' naming except for two cases
"in-transaction" changelog, and censoring. Our goal is to let the revlog code
deal with the internal of the file naming itself. To do so, we need to start
dealing with these postfix explicitly.
Differential Revision: https://phab.mercurial-scm.org/D10571
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 03 May 2021 12:21:35 +0200] rev 47144
revlog: split the option initialisation in its own method
The part of the code is huge, keeping it separated will keep the `_loadindex`
method simpler and help keeping logic well insulated.
Differential Revision: https://phab.mercurial-scm.org/D10570
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 03 May 2021 12:21:25 +0200] rev 47143
revlog: always "append" full size tuple
Same reasoning as the previous patch.
Differential Revision: https://phab.mercurial-scm.org/D10569
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 03 May 2021 12:21:15 +0200] rev 47142
revlog: make the index always return the same tuple
It is simpler to manage the diferrence in on disk format in the internal index
code itself and lets the rest of the code always handle the same object.
This will become even more important when the data we store will be entirely
different (for example the changelog does not need the "linkrev" field.
We start with item reading, we will deal with item writing in the next
changesets.
Differential Revision: https://phab.mercurial-scm.org/D10568