mercurial/cmdutil.py
changeset 30340 608ba935e041
parent 30332 318a24b52eeb
child 30371 fccc3eea2ddb
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