snapshot: extract parent chain computation
authorBoris Feld <boris.feld@octobus.net>
Fri, 07 Sep 2018 11:17:37 -0400
changeset 39504 05a165dc4f55
parent 39503 5aef5afa8654
child 39505 c6b8eab5db19
snapshot: extract parent chain computation The final step of this series is to include chain related to "prev" in the search. Before adding that code we do some simple code movement to clarify the next diff.
mercurial/revlogutils/deltas.py
--- a/mercurial/revlogutils/deltas.py	Fri Sep 07 11:17:36 2018 -0400
+++ b/mercurial/revlogutils/deltas.py	Fri Sep 07 11:17:37 2018 -0400
@@ -711,8 +711,9 @@
         # search for snapshot in parents delta chain
         # map: snapshot-level: snapshot-rev
         parents_snaps = collections.defaultdict(set)
-        for p in parents:
-            for idx, s in enumerate(deltachain(p)):
+        candidate_chains = [deltachain(p) for p in parents]
+        for chain in candidate_chains:
+            for idx, s in enumerate(chain):
                 if not revlog.issnapshot(s):
                     break
                 parents_snaps[idx].add(s)