versioned file api audit
Robert Collins
robertc at robertcollins.net
Tue Mar 18 01:44:01 GMT 2008
On Tue, 2008-03-18 at 12:22 +1100, Martin Pool wrote:
> On 18/03/2008, Robert Collins <robertc at robertcollins.net> wrote:
> > > You could say perhaps this will not vary with VF implementation, and
> > > the vf should instead just give annotation data to something else.
> >
> > Thats what I'm mulling over :). It's neither hard or easy to keep it; I
> > haven't done a lot with the text merging stuff, most of my hacking has
> > been lower or higher in the stack. So moar input please!
>
> Then I would say, keep it for now, you will have a big enough patch
> already, and it is not particularly coupled to anything else,
> cluttering the api, or encouraging bad performance.
Keeping it will make the patch bigger: we have a new api that is a
migration of the old one; every retained function adds to the code
migrated.
> > >
> > > > apis to remove:
> > > > has_version
> > >
> > > Why get rid of this?
> >
> > Its slow (single version lookup), and it encourages look before you leap
> > programming; there are extremely few reasons to use this, and a trivial
> > replacement is
> > len(collection.get_parent_map([key])) == 1
> > for the places that really honestly need it. (I think there is one -
> > has_revision).
>
> I would leave it and add a note to the docstring that it should not be used.
Why?
> > Bah! I was meaning to choose one :). Lets have two, because we have
> > substantial performance impact from line splitting/joining, and the
> > native implementation should be used directly when possible:
> > get_bytes(versions) -> iterator of (sha1, bytestrings)
> > get_lines(versions) -> iterator of (sha1, lines_list)
>
> So that would be
>
> iter([(sha1, [bytes, ...]), ...])
>
> ?
The above.
> or iter([(sha1, iter([bytes, ...])), ...])
>
> Since we currently use get_bytes(version) to get just one I suggest
> you call it get_bytes_multi() or something.
get_bytes is not currently present on versioned file at all. I'm not
fond of _multi. We could do iter_bytes I guess, but its really no better
at explaining the difference.
-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/20080318/9695e594/attachment.pgp
More information about the bazaar
mailing list