# HG changeset patch # User Boris Feld # Date 2018-10-16 12:46:28 # Node ID a32ccd32982b6b9ed960184e32ed21a78490e721 # Parent 3ac23dad6364373e2f3a35d1098c1aab11e82599 sparse-revlog: drop unused deltainfo parameter from segmentspan We no longer need to deal with slicing logic including uncommitted revision. We drop the associated code. diff --git a/mercurial/revlogutils/deltas.py b/mercurial/revlogutils/deltas.py --- a/mercurial/revlogutils/deltas.py +++ b/mercurial/revlogutils/deltas.py @@ -378,7 +378,7 @@ def _trimchunk(revlog, revs, startidx, e return revs[startidx:endidx] -def segmentspan(revlog, revs, deltainfo=None): +def segmentspan(revlog, revs): """Get the byte span of a segment of revisions revs is a sorted array of revision numbers @@ -404,13 +404,7 @@ def segmentspan(revlog, revs, deltainfo= """ if not revs: return 0 - if deltainfo is not None and len(revlog) <= revs[-1]: - if len(revs) == 1: - return deltainfo.deltalen - offset = revlog.end(len(revlog) - 1) - end = deltainfo.deltalen + offset - else: - end = revlog.end(revs[-1]) + end = revlog.end(revs[-1]) return end - revlog.start(revs[0]) def _textfromdelta(fh, revlog, baserev, delta, p1, p2, flags, expectednode):