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.
--- 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