# HG changeset patch
# User Boris Feld
# Date 1549184503 -3600
# Sun Feb 03 10:01:43 2019 +0100
# Node ID 23e2af1929c66ab34e9f09bb2caec298e9a8e71c
# Parent 9955776e2adf36c5baabad8f73840a0cdfa19589
# EXP-Topic div-cleanup
# Available At https://bitbucket.org/octobus/mercurial-devel/
# hg pull https://bitbucket.org/octobus/mercurial-devel/ -r
23e2af1929c6
py3: use integer division instead of `int(...)` call
Changeset 38a82e0333c9 and 7f853549823b introduced explicit conversion to
integer to work around the division behavior change from python2 to python3.
Using the integer division operator is a simpler and clearer way to achieve
this.
diff --git a/hgext/remotefilelog/datapack.py b/hgext/remotefilelog/datapack.py
--- a/hgext/remotefilelog/datapack.py
+++ b/hgext/remotefilelog/datapack.py
@@ -242,8 +242,8 @@ class datapack(basepack.basepack):
entry = index[end:end + entrylen]
else:
while start < end - entrylen:
-mid = start + (end - start) / 2
-mid = int(mid - ((mid - params.indexstart) % entrylen))
+mid = start + (end - start) // 2
+mid = mid - ((mid - params.indexstart) % entrylen)
midnode = index[mid:mid + NODELENGTH]
if midnode == node:
entry = index[mid:mid + entrylen]
diff --git a/tests/test-remotefilelog-datapack.py
b/tests/test-remotefilelog-datapack.py
--- a/tests/test-remotefilelog-datapack.py
+++ b/tests/test-remotefilelog-datapack.py
@@ -292,7 +292,7 @@ class datapacktestsbase(object):
class testdatapackstore(datapack.datapackstore):
# Ensures that we are not keeping everything in the cache.
-DEFAULTCACHESIZE = int(numpacks / 2)
+DEFAULTCACHESIZE = numpacks // 2
store = testdatapackstore(uimod.ui(), packdir)
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel