Mercurial > hg
comparison mercurial/templater.py @ 25562:9452112c8eb0 stable
templater: evaluate arguments passed to diff() appropriately
Before this patch, diff() crashed by passing non-string expression because
it didn't evaluate arguments at all.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 13 Jun 2015 20:14:22 +0900 |
parents | 7298da81f5a9 |
children | a69983942fb4 5eccebe23942 |
comparison
equal
deleted
inserted
replaced
25561:50a6c3c55db1 | 25562:9452112c8eb0 |
---|---|
246 # i18n: "diff" is a keyword | 246 # i18n: "diff" is a keyword |
247 raise error.ParseError(_("diff expects one, two or no arguments")) | 247 raise error.ParseError(_("diff expects one, two or no arguments")) |
248 | 248 |
249 def getpatterns(i): | 249 def getpatterns(i): |
250 if i < len(args): | 250 if i < len(args): |
251 s = args[i][1].strip() | 251 s = stringify(args[i][0](context, mapping, args[i][1])).strip() |
252 if s: | 252 if s: |
253 return [s] | 253 return [s] |
254 return [] | 254 return [] |
255 | 255 |
256 ctx = mapping['ctx'] | 256 ctx = mapping['ctx'] |