[PATCH 1 of 1] hgweb: side-by-side comparison functionality

Wujek Srujek wujek.srujek at googlemail.com
Mon Jun 18 09:38:32 CDT 2012


Hi.

On Mon, Jun 18, 2012 at 4:24 PM, Patrick Mézard <patrick at mezard.eu> wrote:

> Le 16/06/12 14:24, wujek srujek a écrit :
> > # HG changeset patch
> > # User wujek srujek
> > # Date 1339796087 -7200
> > # Node ID 42dcd87d2a3472da563003824e19d92380a78a7c
> > # Parent  622aa57a90b1d1f09b3204458b087de12ce2de82
> > hgweb: side-by-side comparison functionality
> >
> > Adds new web command to the core, ``comparison``, which enables colorful
> > side-by-side change display, which for some might be much easier to work
> with
> > than the standard line diff output. The idea how to implement comes from
> the
> > SonicHq extension.
> >
> > The web interface gets a new link to call the comparison functionality.
> It lets
> > users configure the amount of context lines around change blocks, or to
> show
> > full files - check help (also in this changeset) for details and
> defaults. The
> > setting in hgrc can be overridden by adding ``context=<value>`` to the
> request
> > query string. The comparison creates addressable lines, so as to enable
> sharing
> > links to specific lines, just as standard diff does.
> >
> > Known limitations:
> > * the column diff is done against the first parent, just as the standard
> diff
> > * this change allows examining diffs for single files only (as I am not
> sure if
> >   examining the whole changeset in this way would be helpful)
> > * syntax highlighting of the output changes is not performed (enabling
> the
> >   highlight extension has no influence on it)
> > * * *
> > hgweb, comparison: adapts monoblue style templates
>
> (You probably want to remove this last line ^ )
>

Yes, I will rework the commit message one I integrate all the styles (this
line is just a result of qfold, as you most likely know ;d).


> +1 for the python part, I would have named the "context" URL argument
> "comparisoncontext" for consistency, but I will let Matt decide on that.


It was comparisoncontext initially, but then again, if you have an URL:
http://host/hg/comparison/13434131/...?comparisoncontext=full

the 'comparison' is repetead. I think someone in this thread mentioned it
already. But that's an easy fix, and I am not passionate about the topic.


> I see an horizontal scrollbar at the bottom of:
>
>  http://mezard.eu/hg/hg-does-it-look-good-for-you/?style=monoblue
>
> I have it in Firefox 14.0 (beta) on OSX. It does not appear with the
> original monoblue template. Is it just me?
>
> --
> Patrick Mézard
>

The horizontal line is probably the effect of using overflow: auto now (I
also see it). If I don't use it, the output in comparison is very bad, as
the screen is not wide enough for both lines side by side - it completely
breaks the page layout. Try removing the line overflow: auto in
style-monoblue.css in div#container to see what I mean. Maybe I should turn
it on the overflow just for the single comparison template only?

wujek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20120618/ce889c03/attachment.html>


More information about the Mercurial-devel mailing list