# HG changeset patch # User Martin von Zweigbergk # Date 2015-03-10 23:26:13 # Node ID 22d560fe1516516261f22cc822102e03115f9b58 # Parent 2720f967a7b139f2935cf2e6b3916a890c1c0857 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. diff --git a/mercurial/manifest.py b/mercurial/manifest.py --- a/mercurial/manifest.py +++ b/mercurial/manifest.py @@ -100,6 +100,9 @@ class manifestdict(object): 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 @@ class manifest(revlog.revlog): 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