##// END OF EJS Templates
context: special-case changectx setup for integer changeid
Dirkjan Ochtman -
r7367:ad0eb876 default
parent child Browse files
Show More
@@ -17,8 +17,12 b' class changectx(object):'
17 if changeid == '':
17 if changeid == '':
18 changeid = '.'
18 changeid = '.'
19 self._repo = repo
19 self._repo = repo
20 self._node = self._repo.lookup(changeid)
20 if isinstance(changeid, (long, int)):
21 self._rev = self._repo.changelog.rev(self._node)
21 self._rev = changeid
22 self._node = self._repo.changelog.node(changeid)
23 else:
24 self._node = self._repo.lookup(changeid)
25 self._rev = self._repo.changelog.rev(self._node)
22
26
23 def __str__(self):
27 def __str__(self):
24 return short(self.node())
28 return short(self.node())
@@ -59,8 +63,8 b' class changectx(object):'
59 self._manifestdelta = md
63 self._manifestdelta = md
60 return self._manifestdelta
64 return self._manifestdelta
61 elif name == '_parents':
65 elif name == '_parents':
62 p = self._repo.changelog.parents(self._node)
66 p = self._repo.changelog.parentrevs(self._rev)
63 if p[1] == nullid:
67 if p[1] == nullrev:
64 p = p[:-1]
68 p = p[:-1]
65 self._parents = [changectx(self._repo, x) for x in p]
69 self._parents = [changectx(self._repo, x) for x in p]
66 return self._parents
70 return self._parents
General Comments 0
You need to be logged in to leave comments. Login now