[PATCH] hgweb: display difference for a changeset against any parents (issue2810)

Weiwen Liu weiwen at fb.com
Mon Nov 19 12:49:13 CST 2012


Yes, y is always the same as z.

The challenge is that I can't find x when trying to display diff/x:y using

{baseline%changesetbaseline}

changesetbaseline = '<a
href="{url}rev/{originalnode|short}:{node|short}{sessionvars%urlparameter}"
>{node|short} </a> '

Baseline is to walk all parents and it replaces original node with the
current parent node value.


Is there a way to retrieve original node without passing it through
template variables?

Thanks,
Weiwen


On 11/17/12 12:25 PM, "Matt Mackall" <mpm at selenic.com> wrote:

>On Fri, 2012-11-16 at 19:28 +0000, Weiwen Liu wrote:
>> Thanks for feedback.
>> 
>> On URL scheme, I like your suggestions.  diff/<node a>:<node b>
>> extends diff command instead of introducing a new one.  And it follows
>> more closely pattern in the NewWebInterface (NewWebInterface considers
>> anything beyond the first node as file path). I will try this one out.
>> 
>> Conditional template is interesting.
>> Two new template variables are used: original node and baseline.
>> With expansion of diff command, it makes it easier to know which
>> baseline is used by displaying baseline info in the page.
>> If a diff is against a node's only parent, we can skip the link for
>> changing baseline.  If a diff is against a node's ancestor, or sibling
>> from a different branch, it is convenient to have a link to see
>> difference against direct parent.
>> I prefer to keep these new variables for the purpose of consistency and
>>simplicity in code.  Let me know if this makes sense.
>
>The template needs the following information:
>
>a) which two revs (x, y) are involved in the diff
>b) the bits relevant to the "header" revision z
>
>I'm pretty sure it makes sense for y to always be the same as z, so I
>think the only additional information needed is x (usually the same as
>p1(y)).
>
>Note that the "list of choices of diff base" are already inherent in b
>as p1 and p2.
>
>-- 
>Mathematics is the supreme nostalgia of our time.
>
>



More information about the Mercurial-devel mailing list