changeset 24277:22d560fe1516

manifest: don't let find() look inside manifestdict The find() method is currently implemented by looking inside the _lm field of the manifest dict. Future manifests types (tree manifests) may not have such a field, so add a method for getting to the data instead.
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 10 Mar 2015 16:26:13 -0700
parents 2720f967a7b1
children 0b94b68aace9
files mercurial/manifest.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/manifest.py	Mon Mar 09 17:13:22 2015 -0700
+++ b/mercurial/manifest.py	Tue Mar 10 16:26:13 2015 -0700
@@ -100,6 +100,9 @@
     def __getitem__(self, key):
         return self._lm[key][0]
 
+    def find(self, key):
+        return self._lm[key]
+
     def __len__(self):
         return len(self._lm)
 
@@ -352,7 +355,7 @@
             return m.get(f), m.flags(f)
         text = self.revision(node)
         try:
-            return manifestdict(text)._lm[f]
+            return manifestdict(text).find(f)
         except KeyError:
             return None, None