Mercurial > hg
comparison mercurial/templater.py @ 36596:b5d39a09656a
templatekw: switch latesttags template keywords to new API
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 25 Feb 2018 19:23:06 +0900 |
parents | 2da414105809 |
children | c6061cadb400 |
comparison
equal
deleted
inserted
replaced
36595:2da414105809 | 36596:b5d39a09656a |
---|---|
940 raise error.ParseError(_("latesttag expects at most one argument")) | 940 raise error.ParseError(_("latesttag expects at most one argument")) |
941 | 941 |
942 pattern = None | 942 pattern = None |
943 if len(args) == 1: | 943 if len(args) == 1: |
944 pattern = evalstring(context, mapping, args[0]) | 944 pattern = evalstring(context, mapping, args[0]) |
945 | 945 return templatekw.showlatesttags(context, mapping, pattern) |
946 # TODO: pass (context, mapping) pair to keyword function | |
947 props = context._resources.copy() | |
948 props.update(mapping) | |
949 return templatekw.showlatesttags(pattern, **pycompat.strkwargs(props)) | |
950 | 946 |
951 @templatefunc('localdate(date[, tz])') | 947 @templatefunc('localdate(date[, tz])') |
952 def localdate(context, mapping, args): | 948 def localdate(context, mapping, args): |
953 """Converts a date to the specified timezone. | 949 """Converts a date to the specified timezone. |
954 The default is local date.""" | 950 The default is local date.""" |