comparison mercurial/context.py @ 44354:2e2cfc3bea0b

context: use manifest.find() instead of two separate calls I noticed this while debugging an extension that's implementing the manifest interface. Always nice to save a function call. Differential Revision: https://phab.mercurial-scm.org/D8109
author Augie Fackler <augie@google.com>
date Tue, 11 Feb 2020 00:08:28 -0500
parents beea86e4d332
children 7c4b98a4e536
comparison
equal deleted inserted replaced
44353:54d185eb24b5 44354:2e2cfc3bea0b
265 return self._repo[nullrev] 265 return self._repo[nullrev]
266 266
267 def _fileinfo(self, path): 267 def _fileinfo(self, path):
268 if '_manifest' in self.__dict__: 268 if '_manifest' in self.__dict__:
269 try: 269 try:
270 return self._manifest[path], self._manifest.flags(path) 270 return self._manifest.find(path)
271 except KeyError: 271 except KeyError:
272 raise error.ManifestLookupError( 272 raise error.ManifestLookupError(
273 self._node, path, _(b'not found in manifest') 273 self._node, path, _(b'not found in manifest')
274 ) 274 )
275 if '_manifestdelta' in self.__dict__ or path in self.files(): 275 if '_manifestdelta' in self.__dict__ or path in self.files():