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