Whats the difference between annotate and tree.annotate_iter ?

Aaron Bentley aaron.bentley at utoronto.ca
Fri Apr 27 13:58:53 BST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Robert Collins wrote:
> On Fri, 2007-04-27 at 00:40 -0400, Aaron Bentley wrote:
>>> Really though I think the API needed for the text ui should be more
>>> properly on Tree, so that we can find bugs in annotations with
>> different
>>> tree representations via our parameterised tests.
>> I don't understand what you mean.  Even if we put annotate_file on
>> Tree,
>> it wouldn't vary.  What varies is the implementation of
>> Tree.iter_annotate, so that's what we should be testing.  And we
>> already
>> can.
> 
> Well annotate_file seems to be doing mapping to revisions and other
> things that iter_annotate doesn't. Naively I'd expect that to be of use
> to gannotate.

It's outputting it all to flat text.  So anything that would be useful
to gannotate is lost.

Gannotate doesn't need all the revisions at once, because it only shows
part of the file at a time.  So it's not helpful that annotate_file maps
all revisions at once.

Gannotate can also annotate multiple versions (e.g. when you press
"back"), and it uses the same cached revsion objects (and dotted revnos?
 can't remember) that it has already loaded.

So using annotate_file would make Gannotate load revisions more often
than it currently does, making it slower.

_annotate_file would be closer to what Gannotate needs, but it doesn't
produce revisions, and it would still make Gannotate slower by
redundantly loading revisions.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGMfON0F+nu1YWqI0RAk2EAJ0TpUeoe/CHcjMPzVp8TUm/TeqLEQCdHtg2
gPIHE1WSB+HXCPSSFzBk8t0=
=51fg
-----END PGP SIGNATURE-----



More information about the bazaar mailing list