# HG changeset patch # User Pierre-Yves David # Date 1537975031 -7200 # Node ID f7aa0ecae3a44c1c9880636ebb4bbe1905ea2df1 # Parent 08b3c370e8b33e58752cd9f22cbafe159d322117 pullbundle: deal with another special case introduced by arbitrary ranges previous, we dealt with the case where the tippest subrange of the stable parent was too long. Now, we need to deal with the case where it is too small. diff -r 08b3c370e8b3 -r f7aa0ecae3a4 hgext3rd/evolve/stablerange.py --- a/hgext3rd/evolve/stablerange.py Wed Sep 26 13:15:40 2018 +0200 +++ b/hgext3rd/evolve/stablerange.py Wed Sep 26 17:17:11 2018 +0200 @@ -419,9 +419,16 @@ # (and the top range is always the same) subranges = self.subranges(repo, stable_parent_range)[:] parenttop = subranges.pop() - if (stable_parent_depth - slicepoint) < self.rangelength(repo, parenttop): - # possible case when we reduce an arbitrary range to its - # canonical parts + lenparenttop = self.rangelength(repo, parenttop) + skimfromparent = stable_parent_depth - slicepoint + if lenparenttop < skimfromparent: + # dropping the first subrange of the stable parent range is not + # enough to skip what we need to skip, change in approach is needed + subranges = self._slicesrangeat(repo, stable_parent_range, slicepoint) + subranges.pop() + elif lenparenttop > skimfromparent: + # The first subrange of the parent is longer that what we want + # to drop, we need to keep some of it. midranges = self._slicesrangeat(repo, parenttop, slicepoint) subranges.extend(midranges[:-1]) subranges.append(top_range)