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.
--- 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)