[PATCH RFC] hgweb: improve annotate flow

Matt Mackall mpm at selenic.com
Fri Nov 18 12:12:57 CST 2011


On Fri, 2011-11-18 at 15:10 +0100, Patrick Mezard wrote:
> # HG changeset patch
> # User Patrick Mezard <pmezard at gmail.com>
> # Date 1321625296 -3600
> # Node ID 95285db262b74b0db54d73b71380ee7251407800
> # Parent  68b0ecd8ad4d0baaae3dfa6c784c69c02f365023
> hgweb: improve annotate flow
> 
> The current hgweb annotate flow looks like:
> 
>   1- open file
>   2- annotate file
>   3- click on annotate link to open a new annotation
>   4- switch to changeset, select parent changeset, browse files, pick file
>   5- goto [1]
> 
> This patch turns it into:
> 
>   1- open file
>   2- annotate file
> 
>   3- click on annotate link to open the changeset at the right location
>   4- look at the hunk and click on the annotate link on the left
>   5- goto [3]
> 
> You can test it by opening (the host is slow, not this patch):
> 
>   http://mezard.eu/hg/hg-does-it-look-good-for-you/rev/c8e2a5ea7062
> 
> and trying to find when and why the:
> 
>   wctx.undelete([name])
> 
> line I removed in the changeset was introduced in the first place. Then compare
> with a regular setup, like:
> 
>   http://hg.intevation.org/mercurial/crew/rev/c8e2a5ea7062

Very interesting. I'm afraid I've encountered a bug though:

http://mezard.eu/hg/hg-does-it-look-good-for-you/annotate/5564a618f6c4/mercurial/cmdutil.py#l316

links to:

http://mezard.eu/hg/hg-does-it-look-good-for-you/rev/5868dd69fb03/#t1.372

which doesn't exist?

> Note 1: I am not an HTML guy, the new grey "ann" link in the changeset view
> should at least be blue like the regular annotate one, and there are probably
> better way to represent it. And I feel there ought to be better ways to do what
> I did with the templating system.
> 
> Note 2: the annotate step [3] could be skipped completely by moving from diffs
> to diffs. This is a little harder to implement though, as the changeset command
> would need to compute the annotate output to generate the "ann" links.

Well.. it could be done indirectly. This is the sort of thing people use
AJAX for.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list