Obsstore Format

/!\ This page is intended for developer

{i} This an archive page extracted from ChangesetEvolutionDevel. It contains data related to discussion and design of the obsstore format. V2 of the format have been implemented for a couple of year so this page is kept for historical purpose.

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


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

possible change



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.

CategoryDeveloper CategoryEvolution

CEDObsstoreFormat (last edited 2017-01-23 14:16:51 by Pierre-YvesDavid)