Patchwork D8109: context: use manifest.find() instead of two separate calls

login
register
mail settings
Submitter phabricator
Date Feb. 11, 2020, 5:08 a.m.
Message ID <differential-rev-PHID-DREV-zpgiidd4j434nsf7vysd-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/45162/
State Superseded
Headers show

Comments

phabricator - Feb. 11, 2020, 5:08 a.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  I noticed this while debugging an extension that's implementing the manifest
  interface. Always nice to save a function call.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D8109

AFFECTED FILES
  mercurial/context.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -267,7 +267,7 @@ 
     def _fileinfo(self, path):
         if '_manifest' in self.__dict__:
             try:
-                return self._manifest[path], self._manifest.flags(path)
+                return self._manifest.find(path)
             except KeyError:
                 raise error.ManifestLookupError(
                     self._node, path, _(b'not found in manifest')