webcommands: use explicit integer division for Python 3 compat
authorAugie Fackler <augie@google.com>
Thu, 01 Mar 2018 18:39:21 -0500
changeset 36553 24897a9d18ac
parent 36552 a185b1af207c
child 36554 06f59bdde626
webcommands: use explicit integer division for Python 3 compat Differential Revision: https://phab.mercurial-scm.org/D2532
mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py	Fri Mar 02 04:59:27 2018 +0530
+++ b/mercurial/hgweb/webcommands.py	Thu Mar 01 18:39:21 2018 -0500
@@ -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