comparison mercurial/verify.py @ 17719:2e3ceb59c312

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".
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Thu, 04 Oct 2012 01:24:05 +0900
parents 4562570ae0f7
children 9a1796af4f8d
comparison
equal deleted inserted replaced
17718:4562570ae0f7 17719:2e3ceb59c312
94 94
95 try: 95 try:
96 p1, p2 = obj.parents(node) 96 p1, p2 = obj.parents(node)
97 if p1 not in seen and p1 != nullid: 97 if p1 not in seen and p1 != nullid:
98 err(lr, _("unknown parent 1 %s of %s") % 98 err(lr, _("unknown parent 1 %s of %s") %
99 (short(p1), short(n)), f) 99 (short(p1), short(node)), f)
100 if p2 not in seen and p2 != nullid: 100 if p2 not in seen and p2 != nullid:
101 err(lr, _("unknown parent 2 %s of %s") % 101 err(lr, _("unknown parent 2 %s of %s") %
102 (short(p2), short(n)), f) 102 (short(p2), short(node)), f)
103 except Exception, inst: 103 except Exception, inst:
104 exc(lr, _("checking parents of %s") % short(node), inst, f) 104 exc(lr, _("checking parents of %s") % short(node), inst, f)
105 105
106 if node in seen: 106 if node in seen:
107 err(lr, _("duplicate revision %d (%d)") % (i, seen[n]), f) 107 err(lr, _("duplicate revision %d (%d)") % (i, seen[node]), f)
108 seen[n] = i 108 seen[node] = i
109 return lr 109 return lr
110 110
111 if os.path.exists(repo.sjoin("journal")): 111 if os.path.exists(repo.sjoin("journal")):
112 ui.warn(_("abandoned transaction found - run hg recover\n")) 112 ui.warn(_("abandoned transaction found - run hg recover\n"))
113 113