manifest: don't let find() look inside manifestdict
authorMartin von Zweigbergk <martinvonz@google.com>
Tue, 10 Mar 2015 16:26:13 -0700
changeset 24277 22d560fe1516
parent 24276 2720f967a7b1
child 24278 0b94b68aace9
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.
mercurial/manifest.py
--- 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