changeset 40652:a32ccd32982b

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.
author Boris Feld <boris.feld@octobus.net>
date Tue, 16 Oct 2018 14:46:28 +0200
parents 3ac23dad6364
children bfbfd15d65bd
files mercurial/revlogutils/deltas.py
diffstat 1 files changed, 2 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- 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):