bzr branch
http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar
|
3152.1.2
by Robert Collins
Add documentation about the inventory system. |
1 |
=========== |
2 |
Inventories |
|
3 |
=========== |
|
4 |
||
5 |
.. contents:: |
|
6 |
||
7 |
Overview |
|
8 |
======== |
|
9 |
||
10 |
Inventories provide an abstraction for talking about the shape of a tree. |
|
11 |
Generally only tree object implementors should be concerned about inventories. |
|
12 |
||
13 |
In memory inventories |
|
14 |
===================== |
|
15 |
||
16 |
In memory inventories are often used in diff and status operations between |
|
17 |
trees. We are working to reduce the number of times this occurs with 'full |
|
18 |
tree' inventory objects, and instead use more custom tailored data structures |
|
19 |
that allow operations on only a small amount of data regardless of the size of |
|
20 |
the tree. |
|
21 |
||
22 |
||
23 |
Serialization |
|
24 |
============= |
|
25 |
||
26 |
There are several variants of serialised tree shape in use by bzr. To date |
|
27 |
these have been mostly xml based, though plugins have offered non-xml versions. |
|
28 |
||
29 |
dirstate |
|
30 |
-------- |
|
31 |
||
32 |
The dirstate file in a working tree includes many different tree shapes - one |
|
33 |
for the working tree and one for each parent tree, interleaved to allow |
|
34 |
efficient diff and status operations. |
|
35 |
||
36 |
xml |
|
37 |
--- |
|
38 |
||
39 |
All the xml serialized forms write to and read from a single byte string, whose |
|
40 |
hash is then the inventory validator for the commit object. |
|
41 |
||
42 |
journalled |
|
43 |
---------- |
|
44 |
||
45 |
The in development journalled inventory serializer generates a single byte |
|
46 |
string during serialization, but may require many byte strings to deserialize, |
|
47 |
and these are discovered recursively. |