Mercurial > public > mercurial-scm > hg-stable
diff mercurial/templater.py @ 37399:0b64416224d9
templater: add class representing a nested mappings
The mappinggenerator class is necessary to fix hgweb bugs without BC. The
mappinglist is for nested formatter items. They are similar, so factored
out the base class. The mappinglist could be implemented by using the
mappinggenerator, but we'll probably need a direct access to the raw list,
so they are implemented as separate classes.
Note that tovalue() isn't conforming to the spec yet in that it may return
a list of dicts containing unprintable resources. This problem will be
fixed later.
Tests will be added by subsequent patches.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 17 Mar 2018 22:47:02 +0900 |
parents | 3235afdfcf1c |
children | 75c13343cf38 |
line wrap: on
line diff
--- a/mercurial/templater.py Sat Mar 17 22:56:49 2018 +0900 +++ b/mercurial/templater.py Sat Mar 17 22:47:02 2018 +0900 @@ -44,6 +44,10 @@ mappable represents a scalar printable value, also supports % operator. + +mappinggenerator, mappinglist + represents mappings (i.e. a list of dicts), which may have default + output format. """ from __future__ import absolute_import, print_function