newformat format change

John A Meinel john at arbash-meinel.com
Wed Oct 5 23:15:03 BST 2005


John A Meinel wrote:
> Martin Pool wrote:
>
>>On 05/10/05, John A Meinel <john at arbash-meinel.com> wrote:
>>
>>
>>
>>>Just print it. XML is actually relatively easy to produce. Parsing it is
>>>more complicated.
>>
>>
>>That's true.  I just used print in my previous project.
>>
>>--
>>Martin
>>
>>
>
>
> Well, I played around with it, you can see my branch here:
> http://bzr.arbash-meinel.com/branches/bzr/sax/

I wanted to mention an update that I just did. Basically, I implemented
the version="" attribute that I had mentioned in the past. So now an
inventory looks like:
<inventory version="5">
<file
 file_id="README-20050309040720-8f368abf9f346b9d"
 kind="file"
 name="README"
 revision="mbp at sourcefrog.net-20050309040815-13242001617e4a06"
 text_sha1="927db98067c7ac359e85be0d4845e413cb161085"
 text_size="656"
/>
<directory
 file_id="bzrlib-20050309040749-4ac9a0e211602846"
 kind="directory"
 name="bzrlib"
 revision="mbp at sourcefrog.net-20050309040815-13242001617e4a06"
/>
...
</inventory>

And a revision looks like:
<revision version="5">
<info
 committer="mbp at sourcefrog.net"
 inventory_sha1="ae1a6daaa47f4e0458f4f45ae4ccc1ed47b70ffd"
 revision_id="mbp at sourcefrog.net-20050309040815-13242001617e4a06"
 timestamp="1110341295.066698074"
/>
<message>import from baz patch-364</message>
</revision>

I wouldn't have to introduce the <info> element, just adding version as
a revision attribute.
However, I thought that having version be the only attribute of revision
is more forward compatible, so that future parsers could key off of just
that line.

The only downside, is that without this change the xml is effectively
identical between bzr.newformat and my sax branch. There is an extra
tag, but the parsers were identical.

Either way, I figured now is the time to break compatibility, since the
weave breaks lots of stuff. And if we are doing it, it is a good time to
add a version tag into the xml to allow easier backwards compatibility
in the future.

John
=:->

>
> I only really modified the code which handles inventories, since the
> Revision XML is pretty straightforward.
>
> The specific changeset is also attached.
>
> In my testing, it didn't seem to change the processing speed by a whole
> lot. (The speed of bzr selftest was only about 1s faster).
>
> I'm still testing stuff like upgrade.
>
> John
> =:->
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 253 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051005/34fbcfb1/attachment.pgp 


More information about the bazaar mailing list