changeset 41489:30b762a330c8

remotefilelog: cast division result to an int Otherwise mid is a float and this confuses __slice__ on Python 3. Differential Revision: https://phab.mercurial-scm.org/D5760
author Gregory Szorc <gregory.szorc@gmail.com>
date Wed, 30 Jan 2019 13:36:51 -0800
parents e971952db109
children fd2f1f0071b9
files contrib/python3-whitelist hgext/remotefilelog/datapack.py
diffstat 2 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/python3-whitelist	Wed Jan 30 13:34:47 2019 -0800
+++ b/contrib/python3-whitelist	Wed Jan 30 13:36:51 2019 -0800
@@ -588,6 +588,7 @@
 test-remotefilelog-cacheprocess.t
 test-remotefilelog-clone-tree.t
 test-remotefilelog-clone.t
+test-remotefilelog-datapack.py
 test-remotefilelog-gcrepack.t
 test-remotefilelog-histpack.py
 test-remotefilelog-http.t
--- a/hgext/remotefilelog/datapack.py	Wed Jan 30 13:34:47 2019 -0800
+++ b/hgext/remotefilelog/datapack.py	Wed Jan 30 13:36:51 2019 -0800
@@ -243,7 +243,7 @@
         else:
             while start < end - entrylen:
                 mid = start  + (end - start) / 2
-                mid = mid - ((mid - params.indexstart) % entrylen)
+                mid = int(mid - ((mid - params.indexstart) % entrylen))
                 midnode = index[mid:mid + NODELENGTH]
                 if midnode == node:
                     entry = index[mid:mid + entrylen]