Patchwork [03,of,14] sparse-revlog: drop unused deltainfo parameter from segmentspan

login
register
mail settings
Submitter Boris Feld
Date Nov. 12, 2018, 9:55 a.m.
Message ID <c8eba56f115019badd26.1542016538@localhost.localdomain>
Download mbox | patch
Permalink /patch/36512/
State Accepted
Headers show

Comments

Boris Feld - Nov. 12, 2018, 9:55 a.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1539693988 -7200
#      Tue Oct 16 14:46:28 2018 +0200
# Node ID c8eba56f115019badd26223e504ca4899210075a
# Parent  1db931d5c9bbec37af644f4e2fafaf9cc292c9d7
# EXP-Topic sparse-perf
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r c8eba56f1150
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.

Patch

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