Mercurial > public > mercurial-scm > hg
comparison mercurial/templater.py @ 34137:a8994d08e4a2
doctest: use print_function and convert bytes to unicode where needed
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 03 Sep 2017 14:56:31 +0900 |
parents | 0fa781320203 |
children | be00af4a1ac5 |
comparison
equal
deleted
inserted
replaced
34136:414a3513c2bd | 34137:a8994d08e4a2 |
---|---|
3 # Copyright 2005, 2006 Matt Mackall <mpm@selenic.com> | 3 # Copyright 2005, 2006 Matt Mackall <mpm@selenic.com> |
4 # | 4 # |
5 # This software may be used and distributed according to the terms of the | 5 # This software may be used and distributed according to the terms of the |
6 # GNU General Public License version 2 or any later version. | 6 # GNU General Public License version 2 or any later version. |
7 | 7 |
8 from __future__ import absolute_import | 8 from __future__ import absolute_import, print_function |
9 | 9 |
10 import os | 10 import os |
11 import re | 11 import re |
12 import types | 12 import types |
13 | 13 |
190 | 190 |
191 def _unnesttemplatelist(tree): | 191 def _unnesttemplatelist(tree): |
192 """Expand list of templates to node tuple | 192 """Expand list of templates to node tuple |
193 | 193 |
194 >>> def f(tree): | 194 >>> def f(tree): |
195 ... print prettyformat(_unnesttemplatelist(tree)) | 195 ... print(pycompat.sysstr(prettyformat(_unnesttemplatelist(tree)))) |
196 >>> f((b'template', [])) | 196 >>> f((b'template', [])) |
197 (string '') | 197 (string '') |
198 >>> f((b'template', [(b'string', b'foo')])) | 198 >>> f((b'template', [(b'string', b'foo')])) |
199 (string 'foo') | 199 (string 'foo') |
200 >>> f((b'template', [(b'string', b'foo'), (b'symbol', b'rev')])) | 200 >>> f((b'template', [(b'string', b'foo'), (b'symbol', b'rev')])) |