Patchwork [2,of,3] templater: rename variable "i" to "v" in runmap()

login
register
mail settings
Submitter Yuya Nishihara
Date April 2, 2017, 2:32 p.m.
Message ID <18aabf8f98c69cbbcff0.1491143532@mimosa>
Download mbox | patch
Permalink /patch/19909/
State Accepted
Headers show

Comments

Yuya Nishihara - April 2, 2017, 2:32 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1461329106 -32400
#      Fri Apr 22 21:45:06 2016 +0900
# Node ID 18aabf8f98c69cbbcff07a1f290f8bd4cf347293
# Parent  926cfc20a8563bd4726380045dbf3207359b0922
templater: rename variable "i" to "v" in runmap()

I want to reuse "i" for index.

Patch

diff --git a/mercurial/templater.py b/mercurial/templater.py
--- a/mercurial/templater.py
+++ b/mercurial/templater.py
@@ -411,17 +411,17 @@  def runmap(context, mapping, data):
             else:
                 raise error.ParseError(_("%r is not iterable") % d)
 
-    for i in diter:
+    for v in diter:
         lm = mapping.copy()
-        if isinstance(i, dict):
-            lm.update(i)
+        if isinstance(v, dict):
+            lm.update(v)
             lm['originalnode'] = mapping.get('node')
             yield tfunc(context, lm, tdata)
         else:
             # v is not an iterable of dicts, this happen when 'key'
             # has been fully expanded already and format is useless.
             # If so, return the expanded value.
-            yield i
+            yield v
 
 def buildnegate(exp, context):
     arg = compileexp(exp[1], context, exprmethods)