[MERGE] compare_trees with all unknowns
Robert Collins
robertc at robertcollins.net
Fri Jul 28 00:01:49 BST 2006
On Thu, 2006-07-27 at 10:25 -0500, John Arbash Meinel wrote:
> 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.
Isn't that addressed by having an explicit interface to get what you
want?
> So I think you are fixing the wrong direction by adding
> 'get_file_text()'. But I'm not going to block on it.
Ah. So the thing is - we *already have it* on some Trees. I'd rather we
use it consistently, or remove it. As its a read only interface, it
seems reasonable to promote it to use from the base interface to me.
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: 191 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060728/fe6ba53b/attachment.pgp
More information about the bazaar
mailing list