[RFC] Changing annotate to show merge points

Henri Wiechers hwiechers at gmail.com
Wed Nov 22 18:08:10 GMT 2006


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?

It's probably best to show both.

> So I'd like to look at using dotted revnos instead of "merged-by"
> revnos.  I think they're short enough.
>
> (Though I must admit that I never use annotate, only gannotate.)

They're too long but maybe the format needs a redesign.

> It might be better to use the merge_sort code used by "log" and "viz".
> That provides a list of revisions and their merge depths, so you just
> have to find the revision, then iterate until you find a 0-depth revision.

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

> Getting the graph with ghosts is much more expensive than getting it
> without ghosts.  Even if you get ghosts, you can still have entries in
> the annotate output that you can't determine where they were merged in
> (i.e. the ancestors of a ghost).  So get_revision_graph is probably a
> better choice than get_revision_graph_with_ghosts.

I'm not sure if there is much of a difference anymore. 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.

-- 

Thanks again. I'll see what I can do using merge_sort and a better
annotate format.

Henri




More information about the bazaar mailing list