comparison hglib/context.py @ 148:c1b966866ed7

hglib: make all imports absolute (issue4520)
author Brett Cannon <brett@python.org>
date Fri, 13 Mar 2015 14:46:13 -0400
parents fe74d5599539
children 958307b30af3
comparison
equal deleted inserted replaced
147:98829bf71f10 148:c1b966866ed7
1 import hglib.client # Circular dependency.
2 from hglib import util, templates
1 from hglib.error import CommandError 3 from hglib.error import CommandError
2 import client, util, templates
3 from hglib.util import b 4 from hglib.util import b
4 5
5 _nullcset = [b('-1'), b('0000000000000000000000000000000000000000'), b(''), 6 _nullcset = [b('-1'), b('0000000000000000000000000000000000000000'), b(''),
6 b(''), b(''), b(''), b('')] 7 b(''), b(''), b(''), b('')]
7 8
11 def __init__(self, repo, changeid=b('')): 12 def __init__(self, repo, changeid=b('')):
12 """changeid is a revision number, node, or tag""" 13 """changeid is a revision number, node, or tag"""
13 if changeid == b(''): 14 if changeid == b(''):
14 changeid = b('.') 15 changeid = b('.')
15 self._repo = repo 16 self._repo = repo
16 if isinstance(changeid, client.revision): 17 if isinstance(changeid, hglib.client.revision):
17 cset = changeid 18 cset = changeid
18 elif changeid == -1: 19 elif changeid == -1:
19 cset = _nullcset 20 cset = _nullcset
20 else: 21 else:
21 if isinstance(changeid, (long, int)): 22 if isinstance(changeid, (long, int)):