changegroup: initialize the state variable a bit earlier
authorPulkit Goyal <pulkit@yandex-team.ru>
Tue, 29 Jan 2019 15:43:02 +0300
changeset 41445 73a33fe625bb
parent 41444 d5357238eda9
child 41448 fa7d61f9c512
changegroup: initialize the state variable a bit earlier This will make the next patch much easier. Differential Revision: https://phab.mercurial-scm.org/D5732
mercurial/changegroup.py
--- a/mercurial/changegroup.py	Sat Jan 26 11:23:31 2019 -0800
+++ b/mercurial/changegroup.py	Tue Jan 29 15:43:02 2019 +0300
@@ -930,6 +930,13 @@
         changedfiles = set()
         clrevtomanifestrev = {}
 
+        state = {
+            'clrevorder': clrevorder,
+            'manifests': manifests,
+            'changedfiles': changedfiles,
+            'clrevtomanifestrev': clrevtomanifestrev,
+        }
+
         # Callback for the changelog, used to collect changed files and
         # manifest nodes.
         # Returns the linkrev node (identity in the changelog case).
@@ -970,13 +977,6 @@
 
             return x
 
-        state = {
-            'clrevorder': clrevorder,
-            'manifests': manifests,
-            'changedfiles': changedfiles,
-            'clrevtomanifestrev': clrevtomanifestrev,
-        }
-
         gen = deltagroup(
             self._repo, cl, nodes, True, lookupcl,
             self._forcedeltaparentprev,