sparse-revlog: drop unused deltainfo parameter from segmentspan
authorBoris Feld <boris.feld@octobus.net>
Tue, 16 Oct 2018 14:46:28 +0200
changeset 40652 a32ccd32982b
parent 40651 3ac23dad6364
child 40653 bfbfd15d65bd
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.
mercurial/revlogutils/deltas.py
--- a/mercurial/revlogutils/deltas.py	Tue Oct 16 14:43:51 2018 +0200
+++ b/mercurial/revlogutils/deltas.py	Tue Oct 16 14:46:28 2018 +0200
@@ -378,7 +378,7 @@
 
     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 @@
     """
     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):