Patchwork D8324: py3: use integer division in histedit

login
register
mail settings
Submitter phabricator
Date March 25, 2020, 8:33 p.m.
Message ID <7a035f3267fd37f706f28748ebf4f074@localhost.localdomain>
Download mbox | patch
Permalink /patch/45891/
State Not Applicable
Headers show

Comments

phabricator - March 25, 2020, 8:33 p.m.
Closed by commit rHGd06e748cfd02: py3: use integer division in histedit (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8324?vs=20872&id=20883

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8324/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8324

AFFECTED FILES
  hgext/histedit.py

CHANGE DETAILS




To: martinvonz, durin42, #hg-reviewers, marmoute
Cc: marmoute, mercurial-devel

Patch

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -1267,7 +1267,7 @@ 
     num_lines = len(mode_state[b'patchcontents'])
     page_height = state[b'page_height']
     unit = page_height if unit == b'page' else 1
-    num_pages = 1 + (num_lines - 1) / page_height
+    num_pages = 1 + (num_lines - 1) // page_height
     max_offset = (num_pages - 1) * page_height
     newline = mode_state[b'line_offset'] + delta * unit
     mode_state[b'line_offset'] = max(0, min(max_offset, newline))