I have had a similar issue when trying to use {files|tabindent} in a template.
It crashed hg with:
AttributeError: 'generator' object has no attribute 'splitlines'
To fix this, I added a new filter in templatefilters.py:
"ws2nl": lambda x: re.sub('\s+', '\n', x),
that simply replaces one or more white spaces with a single newline. Now
I get the effect I want with {files|stringify|ws2nl|tabindent} in my template.
I'd like to propose adding this filter to the official HG sources but am not
sure what the process is. |