mercurial/templateutil.py
changeset 39367 83f8f7b9fa60
parent 38930 382b055cc358
child 39368 5b1d406b39f1
--- a/mercurial/templateutil.py	Wed Aug 29 18:52:09 2018 +0300
+++ b/mercurial/templateutil.py	Sun Aug 05 16:14:18 2018 +0900
@@ -570,6 +570,17 @@
     f = _showcompatlist(context, mapping, name, data, plural, separator)
     return hybridlist(data, name=element or name, fmt=fmt, gen=f)
 
+def compatfileslist(context, mapping, name, files):
+    """Wrap list of file names to support old-style list template and field
+    names
+
+    This exists for backward compatibility. Use hybridlist for new template
+    keywords.
+    """
+    f = _showcompatlist(context, mapping, name, files)
+    return hybrid(f, files, lambda x: {'file': x, 'path': x},
+                  pycompat.identity)
+
 def _showcompatlist(context, mapping, name, values, plural=None, separator=' '):
     """Return a generator that renders old-style list template