[PATCH] highlight: get around tmpl.load() which now returns a parsed tree

Martin von Zweigbergk martinvonz at google.com
Mon Jun 18 12:08:55 EDT 2018


Queued, thanks!

On Mon, Jun 18, 2018 at 6:05 AM Yuya Nishihara <yuya at tcha.org> wrote:

> # HG changeset patch
> # User Yuya Nishihara <yuya at tcha.org>
> # Date 1529326492 -32400
> #      Mon Jun 18 21:54:52 2018 +0900
> # Node ID 140cfc3770b87c8aad8cbe3be9f21a02f3636ef3
> # Parent  f4f1fb1cbfb42fb24b7b546f39b35f1bf5a7267c
> highlight: get around tmpl.load() which now returns a parsed tree
>
> Broken at e637dc0b3b1f, "templater: parse template string to tree by
> templater class."
>
> diff --git a/hgext/highlight/highlight.py b/hgext/highlight/highlight.py
> --- a/hgext/highlight/highlight.py
> +++ b/hgext/highlight/highlight.py
> @@ -44,7 +44,8 @@ SYNTAX_CSS = ('\n<link rel="stylesheet"
>  def pygmentize(field, fctx, style, tmpl, guessfilenameonly=False):
>
>      # append a <link ...> to the syntax highlighting css
> -    old_header = tmpl.load('header')
> +    tmpl.load('header')
> +    old_header = tmpl.cache['header']
>      if SYNTAX_CSS not in old_header:
>          new_header = old_header + SYNTAX_CSS
>          tmpl.cache['header'] = new_header
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20180618/6c411280/attachment.html>


More information about the Mercurial-devel mailing list