[MERGE REVIEW] Tweaks to bundle merging

John Arbash Meinel john at arbash-meinel.com
Wed Jun 7 14:41:02 BST 2006


Alexander Belchenko wrote:
> Aaron Bentley пишет:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Alexander Belchenko wrote:
>>> Aaron Bentley пишет:
>>>> Alexander Belchenko has recently experienced problems because bzr merge
>>>> conflates malformed bundles and not-a-bundle situations.
>>
>>> Actually my problem arise because of line-endings problem: 
>>
>> There were multiple problems.  You didn't get good diagnostics because
>> of the conflation of BadBundle and NotABundle
> 
> Yes it is.
> 
>> BundleReadder
>>> expect to see LF-only line-endings but instead got CRLF. During merge
>>> there is MailformedBundle error raised and after then merge switch to
>>> interpret bundle filepath as merge-branch location.
>>
>> We've been talking about this.  The solution we're leading toward is
>> forcing the output to contain LF only.
> 
> Probably I miss this discussion. But in fact bundle command never
> generate valid bundle on windows if you emit them to stdout. Because
> sys.stdout is file-like stream opened in text-mode, so it make automatic
> conversion LF -> CRLF during execution of write('\n'). I send patch
> yesterday to allow write bundle directly to file.

Sure. But there is usually a way to change a file from text mode to
binary mode. I don't remember the specifics, but it is some 'setmode' or
'setbin' or something like that.

> 
> But probably it is not 100% guaranteed of solving problem with
> line-endings because when I send bundle file as attachment and receiver
> save attachment to the disk, then actual line-endings may be again
> switched to CRLF because of mailer program implementation. At least my
> Mozilla Thunderbird do this, probably because it interpret attachment as
> text file, not binary file.
> 
> I start to think that optionally generating fully binary bundle file
> (e.g. compressed as gzip or zip) is more robust solution.
> 
> -- 
> Alexander

Well, the primary goal is that we want to be able to look over these
bundles for review, and then apply them. I believe there are ways to
tell mail programs that the attachment is something they shouldn't
munge. But as you say, the worst case is that we do 'gzip bundle.foo'
and then send bundle.foo.gz which should never get munged along the way.

John
=:->



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060607/7091ae71/attachment.pgp 


More information about the bazaar mailing list