changegroup: don't define lookupmf() until it is needed stable
authorGregory Szorc <gregory.szorc@gmail.com>
Thu, 06 Nov 2014 20:57:12 -0800
branchstable
changeset 23224 f4ab47ccefde
parent 23223 a4af6fd99fb0
child 23225 bdf7b1ea1dae
changegroup: don't define lookupmf() until it is needed lookupmf() is currently defined earlier than when it is needed. Future patches further refactoring this code will be easier to read when lookupmf() is in its new home.
mercurial/changegroup.py
--- a/mercurial/changegroup.py	Wed Nov 05 18:31:39 2014 +0000
+++ b/mercurial/changegroup.py	Thu Nov 06 20:57:12 2014 -0800
@@ -330,6 +330,14 @@
             mfs.setdefault(c[0], x)
             return x
 
+        for chunk in self.group(clnodes, cl, lookupcl, units=_('changesets'),
+                                reorder=reorder):
+            yield chunk
+        progress(msgbundling, None)
+
+        for f in changedfiles:
+            fnodes[f] = {}
+
         # Callback for the manifest, used to collect linkrevs for filelog
         # revisions.
         # Returns the linkrev node (collected in lookupcl).
@@ -344,13 +352,6 @@
                         fnodes[f].setdefault(n, clnode)
             return clnode
 
-        for chunk in self.group(clnodes, cl, lookupcl, units=_('changesets'),
-                                reorder=reorder):
-            yield chunk
-        progress(msgbundling, None)
-
-        for f in changedfiles:
-            fnodes[f] = {}
         mfnodes = self.prune(mf, mfs, commonrevs, source)
         for chunk in self.group(mfnodes, mf, lookupmf, units=_('manifests'),
                                 reorder=reorder):