# HG changeset patch # User Boris Feld # Date 1549184503 -3600 # Node ID eb37d95cc4867f83c03bd800b11cf229e8626f6c # Parent 1be7a9b994a2eb7890f2040884097ac25b02bafc 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 -r 1be7a9b994a2 -r eb37d95cc486 hgext/remotefilelog/datapack.py --- a/hgext/remotefilelog/datapack.py Sun Feb 03 17:15:11 2019 +0530 +++ b/hgext/remotefilelog/datapack.py Sun Feb 03 10:01:43 2019 +0100 @@ -242,8 +242,8 @@ 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 -r 1be7a9b994a2 -r eb37d95cc486 tests/test-remotefilelog-datapack.py --- a/tests/test-remotefilelog-datapack.py Sun Feb 03 17:15:11 2019 +0530 +++ b/tests/test-remotefilelog-datapack.py Sun Feb 03 10:01:43 2019 +0100 @@ -292,7 +292,7 @@ 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)