452
452
Multiple versions of nodes for the same PREFIX and internal prefix width should
453
453
compress well for the same tree.
459
An inventory is a serialization of the in-memory inventory delta. To serialize
460
an inventory delta, one takes an existing inventory delta and the revision_id
461
of the revision it was created it against and the revision id of the inventory
462
which should result by applying the delta to the parent. We then serialize
463
every item in the delta in a simple format:
465
'format: bzr inventory delta v1 (1.14)' NL
466
'parent:' SP BASIS_INVENTORY NL
467
'version:' SP NULL_OR_REVISION NL
468
'versioned_root:' SP BOOL NL
469
'tree_references:' SP BOOL NL
472
DELTA_LINES ::= (DELTA_LINE NL)*
473
DELTA_LINE ::= OLDPATH NULL NEWPATH NULL file-id NULL PARENT_ID NULL LAST_MODIFIED NULL CONTENT
475
BOOL ::= 'true' | 'false'
477
OLDPATH ::= NONE | PATH
478
NEWPATH ::= NONE | PATH
481
PARENT_ID ::= FILE_ID | ''
482
CONTENT ::= DELETED_CONTENT | FILE_CONTENT | DIR_CONTENT | TREE_CONTENT | LINK_CONTENT
483
DELETED_CONTENT ::= 'deleted'
484
FILE_CONTENT ::= 'file' NULL text_size NULL EXEC NULL text_sha1
485
DIR_CONTENT ::= 'dir'
486
TREE_CONTENT ::= 'tree' NULL tree-revision
487
LINK_CONTENT ::= 'link' NULL link-target
488
BASIS_INVENTORY ::= NULL_OR_REVISION
489
LAST_MODIFIED ::= NULL_OR_REVISION
490
NULL_OR_REVISION ::= 'null:' | REVISION
491
REVISION ::= revision-id-in-utf8-no-whitespace
494
DELTA_LINES is lexicographically sorted.
496
Some explanation is in order. When NEWPATH is 'None' a delete has been
497
recorded, and because this inventory delta is not attempting to be a reversible
498
delta, the only other valid fields are OLDPATH and 'file-id'. PARENT_ID is ''
499
when a delete has been recorded or when recording a new root entry.