[RFC] Changing annotate to show merge points

Aaron Bentley aaron.bentley at utoronto.ca
Wed Nov 22 18:45:19 GMT 2006


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

Henri Wiechers wrote:
> Thanks for the feedback.
> 
>> One of the nice features of our annotate is that we show the revision
>> that originated the change.  I believe that's more useful than showing
>> the revision where the change was merged.
> 
> 
> I prefer seeing when the change was merged. This is because generally
> I'm more interesting in knowing when something entered my branch
> rather than when it was  authored. If you're trying to track down a
> bug, would you prefer to know that the it was merged in 2415 or that
> it was authored in 2342.1.5.1.7?

I'd rather know that it was authored in 2342.1.5.1.7, because then I can
see the commit message that accompanied the change, and who wrote the
code.  Those help me figure out what the code was trying to accomplish,
so that I can fix it properly.  Whereas the merge message may just be
"merged bzr.dev", and the committer may be myself.

> It's probably best to show both.

Agreed (or perhaps with an option to toggle that).

> Yeah, merge_sort sounds like the way to go. Especially for the
> non-mainline revno's.

Yes, though once you've got it for non-mainline revnos, it's simpler to
use it for the mainline revnos also.

> 
>> Getting the graph with ghosts is much more expensive than getting it
>> without ghosts.

> I'm not sure if there is much of a difference anymore. 

I thought you were saying it was 3x slower?

> I think the
> difference I saw was related to bottlenecks in the current code. It
> does something like:
> 
> rh = branch.revision_history() #rh is a list.
> for each line in file:
>    if line in rh:
>        revno = rh.indexof(some_revid)
> 
> For long files and revision histories, it gets slow.

Right.  You'd want to do:

rh = dict(r, n+1 for n, r in enumerate(branch.revision_history()))

Dict lookups are much more efficient than indexof.

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

iD8DBQFFZJq/0F+nu1YWqI0RApoQAJ9AaDpyGDwGw+E03iJHGbNINqiw/wCcDZXJ
xTi8rKq30VvWT8Liedrk828=
=huiF
-----END PGP SIGNATURE-----




More information about the bazaar mailing list