[MERGE] Developer doc: container format

Aaron Bentley aaron.bentley at utoronto.ca
Tue Jun 5 12:36:11 BST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Andrew Bennetts wrote:
> +The format is:
> +
> +  * a **container lead-in**, "``bzr pack format 1\n``",
> +  * followed by one or more **records**.
> +
> +A record is:
> +
> +  * a 3 byte **kind marker**.
> +  * 0 or more bytes of record content, depending on the record type.

To me, the layering seems a bit strange.  Because the name and size
fields are defined as part of the record type, you need to understand
all the record types used in the container in order to know where the
record named "foo" begins and ends.

When implementing this, I would expect the lowest layer not to
understand any record types, other than knowing that every content
record has a name and size.  That layer would simply provide access to
bytes and record type, and higher layers would worry about the meaning
of said bytes.

So I think it makes sense to define size and name as being part of every
record, except the end marker.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGZUqr0F+nu1YWqI0RAni4AKCIoc0JkRDJUYh5h98TQgIV5xjUeACfRZJv
gEiT4Wove96j5hW+2rtxFNQ=
=Bb6T
-----END PGP SIGNATURE-----



More information about the bazaar mailing list