mercurial/commands.py
changeset 21986 48166e46f111
parent 21980 f4e5753745e9
child 22007 a5bb0c4001ae
equal deleted inserted replaced
21985:7e871e771300 21986:48166e46f111
  4038     """
  4038     """
  4039     end = opts.get('print0') and '\0' or '\n'
  4039     end = opts.get('print0') and '\0' or '\n'
  4040     rev = scmutil.revsingle(repo, opts.get('rev'), None).node()
  4040     rev = scmutil.revsingle(repo, opts.get('rev'), None).node()
  4041 
  4041 
  4042     ret = 1
  4042     ret = 1
  4043     m = scmutil.match(repo[rev], pats, opts, default='relglob')
  4043     ctx = repo[rev]
       
  4044     m = scmutil.match(ctx, pats, opts, default='relglob')
  4044     m.bad = lambda x, y: False
  4045     m.bad = lambda x, y: False
  4045     for abs in repo[rev].walk(m):
  4046 
  4046         if not rev and abs not in repo.dirstate:
  4047     for abs in ctx.matches(m):
  4047             continue
       
  4048         if opts.get('fullpath'):
  4048         if opts.get('fullpath'):
  4049             ui.write(repo.wjoin(abs), end)
  4049             ui.write(repo.wjoin(abs), end)
  4050         else:
  4050         else:
  4051             ui.write(((pats and m.rel(abs)) or abs), end)
  4051             ui.write(((pats and m.rel(abs)) or abs), end)
  4052         ret = 0
  4052         ret = 0