From patchwork Wed Mar 2 15:35:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [4, of, 4] templater: make date() use helper function to evaluate argument From: Yuya Nishihara X-Patchwork-Id: 13537 Message-Id: To: mercurial-devel@mercurial-scm.org Date: Thu, 03 Mar 2016 00:35:04 +0900 # HG changeset patch # User Yuya Nishihara # Date 1455424610 -32400 # Sun Feb 14 13:36:50 2016 +0900 # Node ID df8d4064c60de72b2204c714917f835ac0266270 # Parent 93252935f1b4490e6061865c45245173855bfb02 templater: make date() use helper function to evaluate argument A date argument should never be a generator, but using evalfuncarg() should be good for consistency. diff --git a/mercurial/templater.py b/mercurial/templater.py --- a/mercurial/templater.py +++ b/mercurial/templater.py @@ -329,7 +329,7 @@ def date(context, mapping, args): # i18n: "date" is a keyword raise error.ParseError(_("date expects one or two arguments")) - date = args[0][0](context, mapping, args[0][1]) + date = evalfuncarg(context, mapping, args[0]) fmt = None if len(args) == 2: fmt = stringify(args[1][0](context, mapping, args[1][1]))