[PATCH 2 of 2 evolve-ext] template: adapt to new showlist() API introduced by hg e5eab0fe69ee

Yuya Nishihara yuya at tcha.org
Wed Apr 19 08:48:18 EDT 2017


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1492604263 -32400
#      Wed Apr 19 21:17:43 2017 +0900
# Node ID ac51b873fc37a7302e1e49bf653e62afe80e31c8
# Parent  2b435b72427c3cfb4afeff0b61f353d2b8182da5
template: adapt to new showlist() API introduced by hg e5eab0fe69ee

diff --git a/hgext3rd/evolve/__init__.py b/hgext3rd/evolve/__init__.py
--- a/hgext3rd/evolve/__init__.py
+++ b/hgext3rd/evolve/__init__.py
@@ -436,8 +436,13 @@ 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)
+    try:
+        # specify plural= explicitly to trigger TypeError on hg < 4.2
+        return templatekw.showlist('trouble', ctx.troubles(), args,
+                                   plural='troubles')
+    except TypeError:
+        return templatekw.showlist('trouble', ctx.troubles(), plural='troubles',
+                                   **args)
 
 #####################################################################
 ### Various trouble warning                                       ###


More information about the Mercurial-devel mailing list