##// END OF EJS Templates
context: check self.__dict__ instead of using hasattr...
Brendan Cully -
r3336:e44eadc9 default
parent child Browse files
Show More
@@ -72,7 +72,7 b' class changectx(object):'
72 72 return [ changectx(self._repo, x) for x in c ]
73 73
74 74 def filenode(self, path):
75 if hasattr(self, "_manifest"):
75 if '_manifest' in self.__dict__:
76 76 try:
77 77 return self._manifest[path]
78 78 except KeyError:
@@ -140,7 +140,7 b' class filectx(object):'
140 140 return self._changeid
141 141 elif name == '_filenode':
142 142 try:
143 if hasattr(self, "_fileid"):
143 if '_fileid' in self.__dict__:
144 144 self._filenode = self._filelog.lookup(self._fileid)
145 145 else:
146 146 self._filenode = self._changectx.filenode(self._path)
@@ -176,7 +176,7 b' class filectx(object):'
176 176 def filelog(self): return self._filelog
177 177
178 178 def rev(self):
179 if hasattr(self, "_changectx"):
179 if '_changectx' in self.__dict__:
180 180 return self._changectx.rev()
181 181 return self._filelog.linkrev(self._filenode)
182 182
@@ -439,7 +439,7 b' class workingfilectx(filectx):'
439 439 filelog=self._filelog)
440 440
441 441 def rev(self):
442 if hasattr(self, "_changectx"):
442 if '_changectx' in self.__dict__:
443 443 return self._changectx.rev()
444 444 return self._filelog.linkrev(self._filenode)
445 445
General Comments 0
You need to be logged in to leave comments. Login now