Mercurial > hg
comparison mercurial/templater.py @ 36591:121a20e5da56
templatekw: switch most of showlist template keywords to new API (issue5779)
Non-trivial changes will follow.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 25 Feb 2018 16:45:44 +0900 |
parents | 7f6be7121b28 |
children | 2da414105809 |
comparison
equal
deleted
inserted
replaced
36590:0083e373e5f5 | 36591:121a20e5da56 |
---|---|
720 | 720 |
721 raw = evalstring(context, mapping, args[0]) | 721 raw = evalstring(context, mapping, args[0]) |
722 ctx = context.resource(mapping, 'ctx') | 722 ctx = context.resource(mapping, 'ctx') |
723 m = ctx.match([raw]) | 723 m = ctx.match([raw]) |
724 files = list(ctx.matches(m)) | 724 files = list(ctx.matches(m)) |
725 # TODO: pass (context, mapping) pair to keyword function | 725 return templatekw.compatlist(context, mapping, "file", files) |
726 props = context._resources.copy() | |
727 props.update(mapping) | |
728 return templatekw.showlist("file", files, props) | |
729 | 726 |
730 @templatefunc('fill(text[, width[, initialident[, hangindent]]])') | 727 @templatefunc('fill(text[, width[, initialident[, hangindent]]])') |
731 def fill(context, mapping, args): | 728 def fill(context, mapping, args): |
732 """Fill many | 729 """Fill many |
733 paragraphs with optional indentation. See the "fill" filter.""" | 730 paragraphs with optional indentation. See the "fill" filter.""" |