comparison mercurial/pure/parsers.py @ 31529:61ff3852f6ed

pure: use int instead of long Similar to the recent 73aa13bc8dac (revlog: use int instead of long, 2017-03-19).
author Martin von Zweigbergk <martinvonz@google.com>
date Mon, 20 Mar 2017 21:40:28 -0700
parents 37596c980662
children df448de7cf3b
comparison
equal deleted inserted replaced
31528:2b599f5468a4 31529:61ff3852f6ed
12 12
13 from .node import nullid 13 from .node import nullid
14 from . import pycompat 14 from . import pycompat
15 stringio = pycompat.stringio 15 stringio = pycompat.stringio
16 16
17 if pycompat.ispy3:
18 long = int
19 17
20 _pack = struct.pack 18 _pack = struct.pack
21 _unpack = struct.unpack 19 _unpack = struct.unpack
22 _compress = zlib.compress 20 _compress = zlib.compress
23 _decompress = zlib.decompress 21 _decompress = zlib.decompress
35 33
36 def gettype(q): 34 def gettype(q):
37 return int(q & 0xFFFF) 35 return int(q & 0xFFFF)
38 36
39 def offset_type(offset, type): 37 def offset_type(offset, type):
40 return long(long(offset) << 16 | type) 38 return int(int(offset) << 16 | type)
41 39
42 class BaseIndexObject(object): 40 class BaseIndexObject(object):
43 def __len__(self): 41 def __len__(self):
44 return self._lgt + len(self._extra) + 1 42 return self._lgt + len(self._extra) + 1
45 43