[PATCH 1 of 2 evolve-ext] template: pass all mapping data to showlist()

Yuya Nishihara yuya at tcha.org
Wed Apr 19 12:48:17 UTC 2017


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1492603929 -32400
#      Wed Apr 19 21:12:09 2017 +0900
# Node ID 2b435b72427c3cfb4afeff0b61f353d2b8182da5
# Parent  dad84c052463e5cf57d8a74655c9ee514e76be7b
template: pass all mapping data to showlist()

Otherwise a keyword depending on repo or ctx couldn't be rendered.

diff --git a/hgext3rd/evolve/__init__.py b/hgext3rd/evolve/__init__.py
--- a/hgext3rd/evolve/__init__.py
+++ b/hgext3rd/evolve/__init__.py
@@ -432,9 +432,10 @@ def obsoletekw(repo, ctx, templ, **args)
     return ''
 
 @eh.templatekw('troubles')
-def showtroubles(repo, ctx, **args):
+def showtroubles(**args):
     """:troubles: List of strings. Evolution troubles affecting the changeset
     (zero or more of "unstable", "divergent" or "bumped")."""
+    ctx = args['ctx']
     return templatekw.showlist('trouble', ctx.troubles(), plural='troubles',
                                **args)
 


More information about the Mercurial-devel mailing list