mercurial/cmdutil.py
changeset 30340 608ba935e041
parent 30332 318a24b52eeb
child 30371 fccc3eea2ddb
--- a/mercurial/cmdutil.py	Tue Nov 08 08:03:43 2016 -0800
+++ b/mercurial/cmdutil.py	Tue Nov 08 08:03:43 2016 -0800
@@ -2566,11 +2566,14 @@
     # for performance to avoid the cost of parsing the manifest.
     if len(matcher.files()) == 1 and not matcher.anypats():
         file = matcher.files()[0]
-        mf = repo.manifest
+        mfl = repo.manifestlog
         mfnode = ctx.manifestnode()
-        if mfnode and mf.find(mfnode, file)[0]:
-            write(file)
-            return 0
+        try:
+            if mfnode and mfl[mfnode].find(file)[0]:
+                write(file)
+                return 0
+        except KeyError:
+            pass
 
     for abs in ctx.walk(matcher):
         write(abs)