##// 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 17 if changeid == '':
18 18 changeid = '.'
19 19 self._repo = repo
20 self._node = self._repo.lookup(changeid)
21 self._rev = self._repo.changelog.rev(self._node)
20 if isinstance(changeid, (long, int)):
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 27 def __str__(self):
24 28 return short(self.node())
@@ -59,8 +63,8 b' class changectx(object):'
59 63 self._manifestdelta = md
60 64 return self._manifestdelta
61 65 elif name == '_parents':
62 p = self._repo.changelog.parents(self._node)
63 if p[1] == nullid:
66 p = self._repo.changelog.parentrevs(self._rev)
67 if p[1] == nullrev:
64 68 p = p[:-1]
65 69 self._parents = [changectx(self._repo, x) for x in p]
66 70 return self._parents
General Comments 0
You need to be logged in to leave comments. Login now