template: adapt to new showlist() API introduced by hg e5eab0fe69ee stable
authorYuya Nishihara <yuya@tcha.org>
Wed, 19 Apr 2017 21:17:43 +0900
branchstable
changeset 2272 eb47d436cdc3
parent 2271 1af1b0debd4b
child 2273 228111491788
template: adapt to new showlist() API introduced by hg e5eab0fe69ee
README
hgext3rd/evolve/__init__.py
--- a/README	Wed Apr 19 21:12:09 2017 +0900
+++ b/README	Wed Apr 19 21:17:43 2017 +0900
@@ -112,6 +112,12 @@
 Changelog
 =========
 
+
+6.0.1 - in progress
+-------------------
+
+ - template: adapt to change in 4.2
+
 6.0.0 -- 2017-02-31
 -------------------
 
--- a/hgext3rd/evolve/__init__.py	Wed Apr 19 21:12:09 2017 +0900
+++ b/hgext3rd/evolve/__init__.py	Wed Apr 19 21:17:43 2017 +0900
@@ -436,8 +436,13 @@
     """: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                                       ###