##// END OF EJS Templates
context: special-case changectx setup for integer changeid
Dirkjan Ochtman -
r7367:ad0eb876 default
parent child Browse files
Show More
@@ -17,6 +17,10 b' class changectx(object):'
17 if changeid == '':
17 if changeid == '':
18 changeid = '.'
18 changeid = '.'
19 self._repo = repo
19 self._repo = repo
20 if isinstance(changeid, (long, int)):
21 self._rev = changeid
22 self._node = self._repo.changelog.node(changeid)
23 else:
20 self._node = self._repo.lookup(changeid)
24 self._node = self._repo.lookup(changeid)
21 self._rev = self._repo.changelog.rev(self._node)
25 self._rev = self._repo.changelog.rev(self._node)
22
26
@@ -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