Weave.join(), and progress indicator fixes
John Arbash Meinel
john at arbash-meinel.com
Tue Jan 31 14:07:47 GMT 2006
Robert Collins wrote:
> On Sun, 2006-01-29 at 19:06 -0600, John Arbash Meinel wrote:
>
>
>> Also, while I was tracking down Aaron's problem, I wrote this code:
>>
>> === modified file 'bzrlib/weave.py'
>> --- bzrlib/weave.py
>> +++ bzrlib/weave.py
>> @@ -946,7 +946,15 @@
>> if name in wa._name_map:
>> lines = wa.get_lines(name)
>> if name in wb._name_map:
>> - assert lines == wb.get_lines(name)
>> + lines_b = wb.get_lines(name)
>> + if lines != lines_b:
>> + print '*** Weaves differ on content'
>> + print '*** Revision: {%s}' % (name,)
>> + import difflib
>> + for line in difflib.unified_diff(lines, lines_b,
>> + wa._weave_name, wb._weave_name):
>> + print line
>> + assert lines == lines_b
>> else:
>> lines = wb.get_lines(name)
>> wr.add(name, combined_parents[name], lines)
>>
>> I would like to see something like it, since it gives you a diagnostic
>> output when reweave fails, rather than just a plain assertion error.
>> I suppose we could print it into the log if you would prefer not writing
>> it to the screen. (unified_diff helps highlight what is actually
>> different, rather than just printing the files).
>
> I agree. I think bzr.log is appropriate though, for both ui and ensuring
> we capture the content.
>
> Rob
>
Well, I rewrote it into the attached patch. It is committed on the same
'fix-weave-join' branch.
Now it just mutters() the difference into the log, and then raises a
WeaveTextDiffers exception.
It isn't code that gets executed very often, but now we have it, just in
case.
John
=:->
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: log-text-differences.diff
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20060131/25792e0f/attachment.diff
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060131/25792e0f/attachment.pgp
More information about the bazaar
mailing list