comparison mercurial/context.py @ 5558:7c1a9a21dcd7

make LookupError more detailed
author Bryan O'Sullivan <bos@serpentine.com>
date Wed, 28 Nov 2007 08:36:55 -0800
parents 8c0756f7b18b
children 0145f9afb0e7
comparison
equal deleted inserted replaced
5556:61fdf2558c0a 5558:7c1a9a21dcd7
98 def _fileinfo(self, path): 98 def _fileinfo(self, path):
99 if '_manifest' in self.__dict__: 99 if '_manifest' in self.__dict__:
100 try: 100 try:
101 return self._manifest[path], self._manifest.flags(path) 101 return self._manifest[path], self._manifest.flags(path)
102 except KeyError: 102 except KeyError:
103 raise revlog.LookupError(_("'%s' not found in manifest") % path) 103 raise revlog.LookupError(path, _("'%s' not found in manifest") % path)
104 if '_manifestdelta' in self.__dict__ or path in self.files(): 104 if '_manifestdelta' in self.__dict__ or path in self.files():
105 if path in self._manifestdelta: 105 if path in self._manifestdelta:
106 return self._manifestdelta[path], self._manifestdelta.flags(path) 106 return self._manifestdelta[path], self._manifestdelta.flags(path)
107 node, flag = self._repo.manifest.find(self._changeset[0], path) 107 node, flag = self._repo.manifest.find(self._changeset[0], path)
108 if not node: 108 if not node:
109 raise revlog.LookupError(_("'%s' not found in manifest") % path) 109 raise revlog.LookupError(path, _("'%s' not found in manifest") % path)
110 110
111 return node, flag 111 return node, flag
112 112
113 def filenode(self, path): 113 def filenode(self, path):
114 return self._fileinfo(path)[0] 114 return self._fileinfo(path)[0]