[merge] really fix the trailing newline bugs (was Re: Plans for 0.9: bundle format)

John Arbash Meinel john at arbash-meinel.com
Tue Jul 11 17:29:14 BST 2006


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

Matthieu Moy wrote:
> John Arbash Meinel <john at arbash-meinel.com> writes:
> 
>> I just did a test and it seemed to work. There seem to still be a couple
>> bugs if you remove the last newline (There is a place where I'm not
>> checking if _next_line is None).
> 
> Yes, indeed, this was the bug I thought of.
> 
>> But yes, one goal is to make it clearer when we do/don't have hunks left
>> to read. If we switch to one big base64 + bzip2 hunk at the bottom, this
>> is reasonably easy.
> 
> I'd put an end marker like
> 
> # bzr bundle ends here
> 
> or whatever. A user will probably like to see that too (like "you can
> stop reviewing here, this is the end").

Actually the bundle reader was originially designed to do just that. It
would read until it found '# Bazaar bundle ...' and then read in a #
prefixed hunk, a set of patches, and then another '#' prefixed footer.
It just had a bug in how it handled final lines. (It expected a line,
and got None)

The attached patch actually cleans up and tests the code to make sure
that it supports having both proceeding and trailing text.

At one point I had a trailing marker like you mentioned. The only thing
that would mess up the parser at this point, is if your trailing text
starts with '#'. Since the parser will think it is an information line.

We got rid of the trailing marker because it was a bit of an eyesore.
(Though now we have base64 encoded stuff, so maybe it would be
reasonable to bring back.)

John
=:->

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

iD8DBQFEs9HaJdeBCYSNAAMRArlqAJ4n6nGNYQoCEWZAQg+kayi9VhwnNACfXq2v
e6cdvt7x62pONxb9BJGtbT8=
=+XcK
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bundle-trailing-text.patch
Type: text/x-patch
Size: 13899 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060711/9d06ba19/attachment.bin 


More information about the bazaar mailing list