Mercurial > public > mercurial-scm > hg
comparison mercurial/templater.py @ 31806:8f203b491bb5
templater: rename variable "i" to "v" in runmap()
I want to reuse "i" for index.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Fri, 22 Apr 2016 21:45:06 +0900 |
parents | 44c591f63458 |
children | e6eb86b154c5 |
comparison
equal
deleted
inserted
replaced
31805:dca9b6922514 | 31806:8f203b491bb5 |
---|---|
409 if func is runsymbol: | 409 if func is runsymbol: |
410 raise error.ParseError(_("keyword '%s' is not iterable") % data) | 410 raise error.ParseError(_("keyword '%s' is not iterable") % data) |
411 else: | 411 else: |
412 raise error.ParseError(_("%r is not iterable") % d) | 412 raise error.ParseError(_("%r is not iterable") % d) |
413 | 413 |
414 for i in diter: | 414 for v in diter: |
415 lm = mapping.copy() | 415 lm = mapping.copy() |
416 if isinstance(i, dict): | 416 if isinstance(v, dict): |
417 lm.update(i) | 417 lm.update(v) |
418 lm['originalnode'] = mapping.get('node') | 418 lm['originalnode'] = mapping.get('node') |
419 yield tfunc(context, lm, tdata) | 419 yield tfunc(context, lm, tdata) |
420 else: | 420 else: |
421 # v is not an iterable of dicts, this happen when 'key' | 421 # v is not an iterable of dicts, this happen when 'key' |
422 # has been fully expanded already and format is useless. | 422 # has been fully expanded already and format is useless. |
423 # If so, return the expanded value. | 423 # If so, return the expanded value. |
424 yield i | 424 yield v |
425 | 425 |
426 def buildnegate(exp, context): | 426 def buildnegate(exp, context): |
427 arg = compileexp(exp[1], context, exprmethods) | 427 arg = compileexp(exp[1], context, exprmethods) |
428 return (runnegate, arg) | 428 return (runnegate, arg) |
429 | 429 |