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

login
register
mail settings
Submitter Yuya Nishihara
Date April 19, 2017, 12:48 p.m.
Message ID <2b435b72427c3cfb4afe.1492606097@mimosa>
Download mbox | patch
Permalink /patch/20260/
State Accepted
Headers show

Comments

Yuya Nishihara - April 19, 2017, 12:48 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@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.

Patch

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)