[PATCH 1 of 3 RFC v2] web: provide diffstat summary to the changeset page

Matt Mackall mpm at selenic.com
Sun May 22 12:20:58 CDT 2011


On Mon, 2011-05-23 at 01:06 +0800, Steven Brown wrote:

> > > >> Then hgweb or diffstat() could decide how to render this. Then hgweb,
> > > >> for instance, could use spans and colors to render a graphical,
> > scalable
> > > >> bar chart rather than using monospaced text.
> > > >
> > > > So now what's needed is a way to provide the data to hgweb in a way
> > that
> > > > it can be rendered nicely.
> > > >
> > > > Thoughts?
> > > >
> > >
> > > This is what I now have in mind for the UI.
> > >
> > > coal, paper and spartan: Add an expand link to the list of files. A plus
> > > symbol will do. When clicked, it expands to display the 'file',
> > 'annotate',
> > > 'diff' and 'revisions' links for each file (like monoblue) and also the
> > > diffstat summary. If necessary, this expanded view could be loaded as a
> > > separate page to avoid slowing down the initial page load.
> > >
> > > monoblue: Add the diffstat summary to the existing HTML table of files.
> > >
> > > gitweb: No changes. It is intended to look like git's gitweb.
> > >
> > > The diffstat summary will show the total number of changes for each file
> > > followed by a horizontal bar chart:
> > >
> > >     --------------------
> > > 33  |               |  |
> > >     --------------------
> > >
> > >       ^               ^
> > >       Adds (Green)    Removes (Red)
> > >
> > > How does this sound?
> >
> > Excellent.
> >
> > So it seems the templater will need to get at least
> >
> > (file, total, addpct, removepct)
> >
> Perhaps we should give it (file, adds, removes, scale) instead, which would
> allow the number of adds and removes to be displayed without rounding
> errors.

I think we want to avoid having to do math in HTML. But maybe I'm wrong.

>  For example, a style may choose to display this information in a
> tool-tip.
> 
> It also needs parity (for the row stripes) and node (for the links).

Sure.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list