Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 30 May 2021 18:08:52 +0200] rev 47400
util: add `nb_bytes` argument to `copyfile` to partially copy a file
When set, this allow to copy only the first `nb_bytes` of a file. This will be
useful for censor/strip operation with revlogv2.
Differential Revision: https://phab.mercurial-scm.org/D10798
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 30 May 2021 16:20:36 +0200] rev 47399
revlog: move `revisioninfo` in `revlogutils`
We will need it in other utility module. So lets extract it from `revlog.py`,
the module is too large already anyway.
Differential Revision: https://phab.mercurial-scm.org/D10797
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 30 May 2021 17:11:49 +0200] rev 47398
revlog: use the `entry` function in bundlerepo
We can use some of the default value again!
Differential Revision: https://phab.mercurial-scm.org/D10796
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 30 May 2021 17:11:21 +0200] rev 47397
revlog: use entry in revlogv0.py
This make things clearer and we can reply on some of the default value directly.
Differential Revision: https://phab.mercurial-scm.org/D10795
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 30 May 2021 17:11:10 +0200] rev 47396
revlog: use the new `entry` function in revlog.py
This just make the construction of the tuple clearer.
Differential Revision: https://phab.mercurial-scm.org/D10794
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 30 May 2021 17:10:56 +0200] rev 47395
revlog: add a function to build index entry tuple
Keeping index entry as tuple make sense for performance reason, however it does
not means we need to manually build that tuple for all piece of python code that
are not performance critical.
So we add a nice function responsible to build the tuple using argument using
explicit keyword argument.
Differential Revision: https://phab.mercurial-scm.org/D10793
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 30 May 2021 16:19:36 +0200] rev 47394
revlog: move `offset_type` to `revlogutils`
This multiple module are using this so it make sense to move it at the utility
level.
Differential Revision: https://phab.mercurial-scm.org/D10792
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 22 May 2021 00:06:22 +0200] rev 47393
revlog: move entry documentation alongside new related constants
Accessing individual index-entry element is usually done using integer directly.
This is presumably for "performance reasons". However as the index entry gain
more and more element it seems useful to get the option to use symbolic constant
to access item, for both clarify and versatility. We will probably keep using
integer for performance critical path, but less critical code may start using
them now that they are declared.
Differential Revision: https://phab.mercurial-scm.org/D10791