Mercurial > public > mercurial-scm > hg-stable
diff mercurial/cmdutil.py @ 30350:608ba935e041
manifest: remove manifest.find
As part of removing dependencies on manifest, this drops the find function and
fixes up the two existing callers to use the equivalent apis on manifestctx.
author | Durham Goode <durham@fb.com> |
---|---|
date | Tue, 08 Nov 2016 08:03:43 -0800 |
parents | 318a24b52eeb |
children | fccc3eea2ddb |
line wrap: on
line diff
--- 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)