Mercurial > hg
comparison mercurial/revlog.py @ 31504:73aa13bc8dac
revlog: use int instead of long
By my reading of PEP 237[0], this is completely safe and has been
since Python 2.2.
0: https://www.python.org/dev/peps/pep-0237/
author | Augie Fackler <augie@google.com> |
---|---|
date | Sun, 19 Mar 2017 01:05:28 -0400 |
parents | b6f5af372c0c |
children | a8e55d6f1d67 |
comparison
equal
deleted
inserted
replaced
31503:0ca00905f769 | 31504:73aa13bc8dac |
---|---|
115 return int(q & 0xFFFF) | 115 return int(q & 0xFFFF) |
116 | 116 |
117 def offset_type(offset, type): | 117 def offset_type(offset, type): |
118 if (type & ~REVIDX_KNOWN_FLAGS) != 0: | 118 if (type & ~REVIDX_KNOWN_FLAGS) != 0: |
119 raise ValueError('unknown revlog index flags') | 119 raise ValueError('unknown revlog index flags') |
120 return long(long(offset) << 16 | type) | 120 return int(int(offset) << 16 | type) |
121 | 121 |
122 _nullhash = hashlib.sha1(nullid) | 122 _nullhash = hashlib.sha1(nullid) |
123 | 123 |
124 def hash(text, p1, p2): | 124 def hash(text, p1, p2): |
125 """generate a hash from the given text and its parent hashes | 125 """generate a hash from the given text and its parent hashes |