comparison mercurial/cmdutil.py @ 30340: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
comparison
equal deleted inserted replaced
30339:6cdfb7e15a35 30340:608ba935e041
2564 2564
2565 # Automation often uses hg cat on single files, so special case it 2565 # Automation often uses hg cat on single files, so special case it
2566 # for performance to avoid the cost of parsing the manifest. 2566 # for performance to avoid the cost of parsing the manifest.
2567 if len(matcher.files()) == 1 and not matcher.anypats(): 2567 if len(matcher.files()) == 1 and not matcher.anypats():
2568 file = matcher.files()[0] 2568 file = matcher.files()[0]
2569 mf = repo.manifest 2569 mfl = repo.manifestlog
2570 mfnode = ctx.manifestnode() 2570 mfnode = ctx.manifestnode()
2571 if mfnode and mf.find(mfnode, file)[0]: 2571 try:
2572 write(file) 2572 if mfnode and mfl[mfnode].find(file)[0]:
2573 return 0 2573 write(file)
2574 return 0
2575 except KeyError:
2576 pass
2574 2577
2575 for abs in ctx.walk(matcher): 2578 for abs in ctx.walk(matcher):
2576 write(abs) 2579 write(abs)
2577 err = 0 2580 err = 0
2578 2581