Patchwork D2532: webcommands: use explicit integer division for Python 3 compat

login
register
mail settings
Submitter phabricator
Date March 1, 2018, 11:39 p.m.
Message ID <differential-rev-PHID-DREV-urud3gvvqwj4s5jajpcx-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/28624/
State Superseded
Headers show

Comments

phabricator - March 1, 2018, 11:39 p.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/hgweb/webcommands.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py
+++ b/mercurial/hgweb/webcommands.py
@@ -300,7 +300,7 @@ 
             pass
 
     lessvars = copy.copy(tmpl.defaults['sessionvars'])
-    lessvars['revcount'] = max(revcount / 2, 1)
+    lessvars['revcount'] = max(revcount // 2, 1)
     lessvars['rev'] = query
     morevars = copy.copy(tmpl.defaults['sessionvars'])
     morevars['revcount'] = revcount * 2
@@ -395,7 +395,7 @@ 
             pass
 
     lessvars = copy.copy(tmpl.defaults['sessionvars'])
-    lessvars['revcount'] = max(revcount / 2, 1)
+    lessvars['revcount'] = max(revcount // 2, 1)
     morevars = copy.copy(tmpl.defaults['sessionvars'])
     morevars['revcount'] = revcount * 2
 
@@ -990,7 +990,7 @@ 
     lrange = webutil.linerange(req)
 
     lessvars = copy.copy(tmpl.defaults['sessionvars'])
-    lessvars['revcount'] = max(revcount / 2, 1)
+    lessvars['revcount'] = max(revcount // 2, 1)
     morevars = copy.copy(tmpl.defaults['sessionvars'])
     morevars['revcount'] = revcount * 2
 
@@ -1208,7 +1208,7 @@ 
             pass
 
     lessvars = copy.copy(tmpl.defaults['sessionvars'])
-    lessvars['revcount'] = max(revcount / 2, 1)
+    lessvars['revcount'] = max(revcount // 2, 1)
     morevars = copy.copy(tmpl.defaults['sessionvars'])
     morevars['revcount'] = revcount * 2