equal
deleted
inserted
replaced
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')])) |