Mercurial > hg-stable
comparison mercurial/templater.py @ 35381:073bc922d349
py3: handle keyword arguments correctly in templater.py
Differential Revision: https://phab.mercurial-scm.org/D1645
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Sun, 10 Dec 2017 04:49:53 +0530 |
parents | b81ad5b78a81 |
children | a51541681b8d |
comparison
equal
deleted
inserted
replaced
35380:c999d246e48c | 35381:073bc922d349 |
---|---|
878 | 878 |
879 pattern = None | 879 pattern = None |
880 if len(args) == 1: | 880 if len(args) == 1: |
881 pattern = evalstring(context, mapping, args[0]) | 881 pattern = evalstring(context, mapping, args[0]) |
882 | 882 |
883 return templatekw.showlatesttags(pattern, **mapping) | 883 return templatekw.showlatesttags(pattern, **pycompat.strkwargs(mapping)) |
884 | 884 |
885 @templatefunc('localdate(date[, tz])') | 885 @templatefunc('localdate(date[, tz])') |
886 def localdate(context, mapping, args): | 886 def localdate(context, mapping, args): |
887 """Converts a date to the specified timezone. | 887 """Converts a date to the specified timezone. |
888 The default is local date.""" | 888 The default is local date.""" |
1061 else: | 1061 else: |
1062 revs = query(raw) | 1062 revs = query(raw) |
1063 revs = list(revs) | 1063 revs = list(revs) |
1064 revsetcache[raw] = revs | 1064 revsetcache[raw] = revs |
1065 | 1065 |
1066 return templatekw.showrevslist("revision", revs, **mapping) | 1066 return templatekw.showrevslist("revision", revs, |
1067 **pycompat.strkwargs(mapping)) | |
1067 | 1068 |
1068 @templatefunc('rstdoc(text, style)') | 1069 @templatefunc('rstdoc(text, style)') |
1069 def rstdoc(context, mapping, args): | 1070 def rstdoc(context, mapping, args): |
1070 """Format reStructuredText.""" | 1071 """Format reStructuredText.""" |
1071 if len(args) != 2: | 1072 if len(args) != 2: |