verify: use appropriate local variable in "checkentry()"
authorFUJIWARA Katsunori <foozy@lares.dti.ne.jp>
Thu, 04 Oct 2012 01:24:05 +0900
changeset 17719 2e3ceb59c312
parent 17718 4562570ae0f7
child 17720 9a1796af4f8d
verify: use appropriate local variable in "checkentry()" Before this patch, "checkentry()" internal function uses both "node"(argument of itself) and "n"(defined in outer of it) variables. Because all callers of "checkentry()" use "n" to refer the object which is passed to "checkentry()" as "node", both can refer same object in "checkentry()". So, "checkentry()" works correctly. But such usage is not good for independence of "checkentry()". This patch replaces "n" in "checkentry()" with "node".
mercurial/verify.py
--- a/mercurial/verify.py	Thu Oct 04 01:24:05 2012 +0900
+++ b/mercurial/verify.py	Thu Oct 04 01:24:05 2012 +0900
@@ -96,16 +96,16 @@
             p1, p2 = obj.parents(node)
             if p1 not in seen and p1 != nullid:
                 err(lr, _("unknown parent 1 %s of %s") %
-                    (short(p1), short(n)), f)
+                    (short(p1), short(node)), f)
             if p2 not in seen and p2 != nullid:
                 err(lr, _("unknown parent 2 %s of %s") %
-                    (short(p2), short(n)), f)
+                    (short(p2), short(node)), f)
         except Exception, inst:
             exc(lr, _("checking parents of %s") % short(node), inst, f)
 
         if node in seen:
-            err(lr, _("duplicate revision %d (%d)") % (i, seen[n]), f)
-        seen[n] = i
+            err(lr, _("duplicate revision %d (%d)") % (i, seen[node]), f)
+        seen[node] = i
         return lr
 
     if os.path.exists(repo.sjoin("journal")):