Patchwork pure: use int instead of long

login
register
mail settings
Submitter via Mercurial-devel
Date March 21, 2017, 4:58 a.m.
Message ID <8360d7a65480d45606ee.1490072300@martinvonz.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/19512/
State Accepted
Headers show

Comments

via Mercurial-devel - March 21, 2017, 4:58 a.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1490071228 25200
#      Mon Mar 20 21:40:28 2017 -0700
# Node ID 8360d7a65480d45606ee61ca737beefd2087b731
# Parent  f42ec07db6a995d972fee8ce2a7fb122c5372109
pure: use int instead of long

Similar to the recent 73aa13bc8dac (revlog: use int instead of long,
2017-03-19).
Yuya Nishihara - March 21, 2017, 1:18 p.m.
On Mon, 20 Mar 2017 21:58:20 -0700, Martin von Zweigbergk via Mercurial-devel wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz@google.com>
> # Date 1490071228 25200
> #      Mon Mar 20 21:40:28 2017 -0700
> # Node ID 8360d7a65480d45606ee61ca737beefd2087b731
> # Parent  f42ec07db6a995d972fee8ce2a7fb122c5372109
> pure: use int instead of long
> 
> Similar to the recent 73aa13bc8dac (revlog: use int instead of long,
> 2017-03-19).

Sure. Queued, thanks.

Patch

diff -r f42ec07db6a9 -r 8360d7a65480 mercurial/pure/parsers.py
--- a/mercurial/pure/parsers.py	Mon Mar 20 22:06:57 2017 -0400
+++ b/mercurial/pure/parsers.py	Mon Mar 20 21:40:28 2017 -0700
@@ -14,8 +14,6 @@ 
 from . import pycompat
 stringio = pycompat.stringio
 
-if pycompat.ispy3:
-    long = int
 
 _pack = struct.pack
 _unpack = struct.unpack
@@ -37,7 +35,7 @@ 
     return int(q & 0xFFFF)
 
 def offset_type(offset, type):
-    return long(long(offset) << 16 | type)
+    return int(int(offset) << 16 | type)
 
 class BaseIndexObject(object):
     def __len__(self):