changeset 40657:2eb48aa0acce

sparse-revlog: align endrevidx usages in the _slicechunktosize All "startrevidx..endrevidx" ranges in this function are now half-open.
author Boris Feld <boris.feld@octobus.net>
date Thu, 15 Nov 2018 14:57:26 +0100
parents fd1d41ccbe38
children 4ec8bee15930
files mercurial/revlogutils/deltas.py
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revlogutils/deltas.py	Thu Nov 15 14:55:11 2018 +0100
+++ b/mercurial/revlogutils/deltas.py	Thu Nov 15 14:57:26 2018 +0100
@@ -234,7 +234,7 @@
         return
 
     startrevidx = 0
-    endrevidx = 0
+    endrevidx = 1
     iterrevs = enumerate(revs)
     next(iterrevs) # skip first rev.
     # first step: get snapshots out of the way
@@ -242,14 +242,14 @@
         span = revlog.end(r) - startdata
         snapshot = revlog.issnapshot(r)
         if span <= targetsize and snapshot:
-            endrevidx = idx
+            endrevidx = idx + 1
         else:
-            chunk = _trimchunk(revlog, revs, startrevidx, endrevidx + 1)
+            chunk = _trimchunk(revlog, revs, startrevidx, endrevidx)
             if chunk:
                 yield chunk
             startrevidx = idx
             startdata = revlog.start(r)
-            endrevidx = idx
+            endrevidx = idx + 1
         if not snapshot:
             break