comparison mercurial/revlogutils/sidedata.py @ 43033:21025a4107d4

sidedata: add a new module with basic documentation For now the storage strategy is very simple. We can augment it in the future if needed. Code to actually support what is described will be introduced in later changesets. Differential Revision: https://phab.mercurial-scm.org/D6889
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 09 Sep 2019 14:03:12 +0200
parents
children 294afb982a88
comparison
equal deleted inserted replaced
43032:a12a9af7536c 43033:21025a4107d4
1 # sidedata.py - Logic around store extra data alongside revlog revisions
2 #
3 # Copyright 2019 Pierre-Yves David <pierre-yves.david@octobus.net)
4 #
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
7 """core code for "sidedata" support
8
9 The "sidedata" are stored alongside the revision without actually being part of
10 its content and not affecting its hash. It's main use cases is to cache
11 important information related to a changesets.
12
13 The current implementation is experimental and subject to changes. Do not rely
14 on it in production.
15
16 Sidedata are stored in the revlog itself, withing the revision rawtext. They
17 are inserted, removed from it using the flagprocessors mechanism. The following
18 format is currently used::
19
20 initial header:
21 <number of sidedata; 2 bytes>
22 sidedata (repeated N times):
23 <sidedata-key; 2 bytes>
24 <sidedata-entry-length: 4 bytes>
25 <sidedata-content-sha1-digest: 20 bytes>
26 <sidedata-content; X bytes>
27 normal raw text:
28 <all bytes remaining in the rawtext>
29
30 This is a simple and effective format. It should be enought to experiment with
31 the concept.
32 """
33
34 from __future__ import absolute_import