Weave.join(), and progress indicator fixes
Robert Collins
robertc at robertcollins.net
Mon Jan 30 02:01:46 GMT 2006
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
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060130/0e510f23/attachment.pgp
More information about the bazaar
mailing list