comparison mercurial/context.py @ 18855:50c922c1b514 stable 2.5.3

hgweb: show correct error message for i18n environment If exception is error.LookupError and running in i18n environment, below condition is always true. Because msg is translated and dosen't contain 'manifest'. if util.safehasattr(err, 'name') and 'manifest' not in msg: This patch creates a new exception class and uses it instead of string match.
author Takumi IINO <trot.thunder@gmail.com>
date Fri, 15 Feb 2013 18:07:14 +0900
parents a2e9fe93d9ea
children f02045645d12
comparison
equal deleted inserted replaced
18854:afab180307be 18855:50c922c1b514
289 def _fileinfo(self, path): 289 def _fileinfo(self, path):
290 if '_manifest' in self.__dict__: 290 if '_manifest' in self.__dict__:
291 try: 291 try:
292 return self._manifest[path], self._manifest.flags(path) 292 return self._manifest[path], self._manifest.flags(path)
293 except KeyError: 293 except KeyError:
294 raise error.LookupError(self._node, path, 294 raise error.ManifestLookupError(self._node, path,
295 _('not found in manifest')) 295 _('not found in manifest'))
296 if '_manifestdelta' in self.__dict__ or path in self.files(): 296 if '_manifestdelta' in self.__dict__ or path in self.files():
297 if path in self._manifestdelta: 297 if path in self._manifestdelta:
298 return (self._manifestdelta[path], 298 return (self._manifestdelta[path],
299 self._manifestdelta.flags(path)) 299 self._manifestdelta.flags(path))
300 node, flag = self._repo.manifest.find(self._changeset[0], path) 300 node, flag = self._repo.manifest.find(self._changeset[0], path)
301 if not node: 301 if not node:
302 raise error.LookupError(self._node, path, 302 raise error.ManifestLookupError(self._node, path,
303 _('not found in manifest')) 303 _('not found in manifest'))
304 304
305 return node, flag 305 return node, flag
306 306
307 def filenode(self, path): 307 def filenode(self, path):
308 return self._fileinfo(path)[0] 308 return self._fileinfo(path)[0]