[MERGE] compare_trees with all unknowns

John Arbash Meinel john at arbash-meinel.com
Thu Jul 27 16:25:43 BST 2006


Robert Collins wrote:

>> Is there a need for 'get_file_text()'?
>>
> 
> The ''/'_text'/'_lines' pattern for describing whether we want a file, a
> text or a sequence of lines seems very clean to me. my tests needed to
> check the contents of files and a string was the most convenient - so I
> added that method (which already exists on RevisionTree).
> 
> Do we *need* it ? Well, we have this somewhat bad pattern of casting
> lots of things into StringIO because our interface does not have this
> three-way-split consistently available, so yes, I think this is good to
> have on Tree.
> 
> Cheers,
> Rob 

Well, I think the 'three-way-split' is actually going the other way. (We
require file-like objects to be passed in, rather than strings or lists
of strings).
It really isn't relevant on the way out. If you got a file-like object,
you can just issue .read() or .readlines().

You decided you didn't want magic interfaces, so all of our interfaces
now just require a file-like object.
It would be reasonable to change them to an iterator of strings, as
Aaron would like, since that works for files, strings, and lists of strings.

But we have the performance issue of iterating over a plain string,
which would mean an 'if isinstance()' which you didn't want.

So I think you are fixing the wrong direction by adding
'get_file_text()'. But I'm not going to block on it.

John
=:->

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


More information about the bazaar mailing list