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

Matt Mackall mpm at selenic.com
Wed Nov 28 22:27:17 UTC 2012


On Tue, 2012-11-27 at 21:29 +0000, Weiwen Liu wrote:
> --- a/mercurial/templater.py
> +++ b/mercurial/templater.py
> @@ -8,6 +8,7 @@
>  from i18n import _
>  import sys, os, re
>  import util, config, templatefilters, parser, error
> +import types
>  
>  # template parsing
>  
> @@ -140,6 +141,10 @@
>          v = context._defaults.get(key, '')
>      if util.safehasattr(v, '__call__'):
>          return v(**mapping)
> +    if isinstance(v, types.GeneratorType):
> +        v = list(v)
> +        mapping[key] = v
> +        return v
>      return v
>  
>  def buildfilter(exp, context):

This should be its own preliminary patch. One change per patch.

> @@ -179,6 +184,7 @@
>      for i in d:
>          if isinstance(i, dict):
>              lm.update(i)
> +            lm['originalnode'] = mapping.get('node')

??

This looks like debug code. The templater code should not know about
'nodes'.

-- 
Mathematics is the supreme nostalgia of our time.





More information about the Mercurial-devel mailing list