mercurial/commands.py
changeset 38276 fa4a286410a5
parent 38238 2b8c8b8d1a06
child 38279 a8e7ea176437
equal deleted inserted replaced
38275:f1d55ae2c5c8 38276:fa4a286410a5
  3331     ret = 1
  3331     ret = 1
  3332     m = scmutil.match(ctx, pats, opts, default='relglob',
  3332     m = scmutil.match(ctx, pats, opts, default='relglob',
  3333                       badfn=lambda x, y: False)
  3333                       badfn=lambda x, y: False)
  3334 
  3334 
  3335     ui.pager('locate')
  3335     ui.pager('locate')
  3336     for abs in ctx.matches(m):
  3336     if ctx.rev() is None:
       
  3337         # When run on the working copy, "locate" includes removed files, so
       
  3338         # we get the list of files from the dirstate.
       
  3339         filesgen = sorted(repo.dirstate.matches(m))
       
  3340     else:
       
  3341         filesgen = ctx.matches(m)
       
  3342     for abs in filesgen:
  3337         if opts.get('fullpath'):
  3343         if opts.get('fullpath'):
  3338             ui.write(repo.wjoin(abs), end)
  3344             ui.write(repo.wjoin(abs), end)
  3339         else:
  3345         else:
  3340             ui.write(((pats and m.rel(abs)) or abs), end)
  3346             ui.write(((pats and m.rel(abs)) or abs), end)
  3341         ret = 0
  3347         ret = 0