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

login
register
mail settings
Submitter phabricator
Date March 2, 2018, 12:56 a.m.
Message ID <5faebc4cad3f40995867391aefe48485@localhost.localdomain>
Download mbox | patch
Permalink /patch/28637/
State Not Applicable
Headers show

Comments

phabricator - March 2, 2018, 12:56 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGd40cfe72b79d: webcommands: use explicit integer division for Python 3 compat (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2532?vs=6308&id=6311

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

AFFECTED FILES
  mercurial/hgweb/webcommands.py

CHANGE DETAILS




To: durin42, #hg-reviewers, yuja
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