Mercurial > public > mercurial-scm > hg-stable
diff mercurial/templater.py @ 34090:7bbc4e113e5f
parser: stabilize output of prettyformat() by using byte-safe repr()
The format of leaf nodes is slightly changed so they look more similar to
internal nodes.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 03 Sep 2017 21:17:25 +0900 |
parents | f55769e41803 |
children | 0fa781320203 |
line wrap: on
line diff
--- a/mercurial/templater.py Sun Sep 03 17:51:23 2017 +0900 +++ b/mercurial/templater.py Sun Sep 03 21:17:25 2017 +0900 @@ -194,18 +194,18 @@ >>> def f(tree): ... print prettyformat(_unnesttemplatelist(tree)) >>> f(('template', [])) - ('string', '') + (string '') >>> f(('template', [('string', 'foo')])) - ('string', 'foo') + (string 'foo') >>> f(('template', [('string', 'foo'), ('symbol', 'rev')])) (template - ('string', 'foo') - ('symbol', 'rev')) + (string 'foo') + (symbol 'rev')) >>> f(('template', [('symbol', 'rev')])) # template(rev) -> str (template - ('symbol', 'rev')) + (symbol 'rev')) >>> f(('template', [('template', [('string', 'foo')])])) - ('string', 'foo') + (string 'foo') """ if not isinstance(tree, tuple): return tree