Mercurial > public > mercurial-scm > hg
comparison mercurial/revlogutils/deltas.py @ 49614:01ccb45b7393
delta-find: rename a variable for clarity
the index in the delta-chain is also the snapshot depth. So we rename the
variable for clarity.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sun, 06 Nov 2022 12:53:57 -0500 |
parents | 5447c1507c86 |
children | 4956942c0416 |
comparison
equal
deleted
inserted
replaced
49613:5447c1507c86 | 49614:01ccb45b7393 |
---|---|
914 # To avoid unfair competition, we won't use unrelated intermediate | 914 # To avoid unfair competition, we won't use unrelated intermediate |
915 # snapshot that are deeper than the ones from the parent delta | 915 # snapshot that are deeper than the ones from the parent delta |
916 # chain. | 916 # chain. |
917 max_depth = max(parents_snaps.keys()) | 917 max_depth = max(parents_snaps.keys()) |
918 chain = deltachain(other) | 918 chain = deltachain(other) |
919 for idx, s in enumerate(chain): | 919 for depth, s in enumerate(chain): |
920 if s < snapfloor: | 920 if s < snapfloor: |
921 continue | 921 continue |
922 if max_depth < idx: | 922 if max_depth < depth: |
923 break | 923 break |
924 if not revlog.issnapshot(s): | 924 if not revlog.issnapshot(s): |
925 break | 925 break |
926 parents_snaps[idx].add(s) | 926 parents_snaps[depth].add(s) |
927 # Test them as possible intermediate snapshot base | 927 # Test them as possible intermediate snapshot base |
928 # We test them from highest to lowest level. High level one are more | 928 # We test them from highest to lowest level. High level one are more |
929 # likely to result in small delta | 929 # likely to result in small delta |
930 floor = None | 930 floor = None |
931 for idx, snaps in sorted(parents_snaps.items(), reverse=True): | 931 for idx, snaps in sorted(parents_snaps.items(), reverse=True): |