comparison hglib/context.py @ 153:ef8eb78fc88d

hglib: don't try to use long under Python 3 (issue4520)
author Brett Cannon <brett@python.org>
date Fri, 20 Mar 2015 16:34:42 -0400
parents b91356bf7186
children 6ec4075191ce
comparison
equal deleted inserted replaced
152:0808bb03add5 153:ef8eb78fc88d
1 import hglib.client # Circular dependency. 1 import hglib.client # Circular dependency.
2 from hglib import util, templates 2 from hglib import util, templates
3 from hglib.error import CommandError 3 from hglib.error import CommandError
4 from hglib.util import b, strtobytes 4 from hglib.util import b, strtobytes, integertypes
5 5
6 _nullcset = [b('-1'), b('0000000000000000000000000000000000000000'), b(''), 6 _nullcset = [b('-1'), b('0000000000000000000000000000000000000000'), b(''),
7 b(''), b(''), b(''), b('')] 7 b(''), b(''), b(''), b('')]
8 8
9 class changectx(object): 9 class changectx(object):
17 if isinstance(changeid, hglib.client.revision): 17 if isinstance(changeid, hglib.client.revision):
18 cset = changeid 18 cset = changeid
19 elif changeid == -1: 19 elif changeid == -1:
20 cset = _nullcset 20 cset = _nullcset
21 else: 21 else:
22 if isinstance(changeid, (long, int)): 22 if isinstance(changeid, integertypes):
23 changeid = b('rev(') + strtobytes(changeid) + b(')') 23 changeid = b('rev(') + strtobytes(changeid) + b(')')
24 24
25 notfound = False 25 notfound = False
26 try: 26 try:
27 cset = self._repo.log(changeid) 27 cset = self._repo.log(changeid)