Implementation Details about Changesets Evolution

/!\ This page is intended for developer

For a user perspective have a look at the ChangesetEvolution page.

Obsstore Format

Markers are stored in an append-only file stored in '.hg/store/obsstore'.

V1 (current) Format

(see in line document for latest data)

quick summary

longer explanation

The file starts with a version header:

The header is followed by the markers. Each marker is made of:

V2 (current) Format

motivation

There is two extra information we would like to see in a second version of the format:

possible change

Date:

Parents:

We have multiple option for storing parents:

  1. Having an explicite field similar to successors (one byte to know how many parents, then parents)
  2. Having an explicite field but store the number of parent in the bit fields (since we never have more than 2 parents)
  3. Using the successors field. Having negative number of successors mean it is a prune.

Option (3) is the most space saving but prevent use to store parent information for more changesets if needed in the future (We do not have a final exchange plan yet).

Option (1) and (2) takes 2 to 8 bits more than (3) but are more flexible.

bit field

If we extend the bit field to 2 Bytes, it makes sense to use option (2) for storing parent.

Proposed Format

The P number would be hidden in the bit field. We need to store 4 possible values here: 0 parents, 1 parent, 2 parents, ø parents information stored. Possible assignement is 00, 01, 10, 11. this let both 0 parent and ø parent info to be 0 module 3.