# HG changeset patch # User Yuya Nishihara # Date 1519554875 -32400 # Node ID c9dcc379e2dcc8d7718bdae3aa9df23ed54ff358 # Parent c3f9d0c303e87dd843ac40a8b85924fa0bcf7f0f templatekw: deprecate showdict() and showlist() (API) .. api:: templatekw.showdict() and showlist() are deprecated in favor of new (context, mapping) API. Switch the keyword function to new API and use templatekw.compatdict() and compatlist() instead. diff -r c3f9d0c303e8 -r c9dcc379e2dc mercurial/templatekw.py --- a/mercurial/templatekw.py Sun Feb 25 19:25:14 2018 +0900 +++ b/mercurial/templatekw.py Sun Feb 25 19:34:35 2018 +0900 @@ -161,11 +161,19 @@ def showdict(name, data, mapping, plural=None, key='key', value='value', fmt='%s=%s', separator=' '): + ui = mapping.get('ui') + if ui: + ui.deprecwarn("templatekw.showdict() is deprecated, use compatdict()", + '4.6') c = [{key: k, value: v} for k, v in data.iteritems()] f = _showlist(name, c, mapping['templ'], mapping, plural, separator) return hybriddict(data, key=key, value=value, fmt=fmt, gen=f) def showlist(name, values, mapping, plural=None, element=None, separator=' '): + ui = mapping.get('ui') + if ui: + ui.deprecwarn("templatekw.showlist() is deprecated, use compatlist()", + '4.6') if not element: element = name f = _showlist(name, values, mapping['templ'], mapping, plural, separator)