Patchwork [5,of,6] changegroup: don't reuse 'mfest' variable for different type

login
register
mail settings
Submitter Martin von Zweigbergk
Date May 1, 2015, 10:50 p.m.
Message ID <936eff6f83d7b97f7dff.1430520643@martinvonz.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/8826/
State Accepted
Headers show

Comments

Martin von Zweigbergk - May 1, 2015, 10:50 p.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1430241664 25200
#      Tue Apr 28 10:21:04 2015 -0700
# Node ID 936eff6f83d7b97f7dffe0373980cf26aecbc645
# Parent  bb89e35096d2792b16f102cad8f05a0e3b8534e1
changegroup: don't reuse 'mfest' variable for different type

We have a variable 'mfest' that's first a manifest nodeid and then a
manifest. Let's make it clearer by using separate variables for the
two uses.

Patch

diff -r bb89e35096d2 -r 936eff6f83d7 mercurial/changegroup.py
--- a/mercurial/changegroup.py	Tue Apr 28 10:19:42 2015 -0700
+++ b/mercurial/changegroup.py	Tue Apr 28 10:21:04 2015 -0700
@@ -789,8 +789,8 @@ 
         if repo.ui.configbool('server', 'validate', default=False):
             # validate incoming csets have their manifests
             for cset in xrange(clstart, clend):
-                mfest = repo.changelog.read(repo.changelog.node(cset))[0]
-                mfest = repo.manifest.readdelta(mfest)
+                mfnode = repo.changelog.read(repo.changelog.node(cset))[0]
+                mfest = repo.manifest.readdelta(mfnode)
                 # store file nodes we must see
                 for f, n in mfest.iteritems():
                     needfiles.setdefault(f, set()).add(n)