Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 41606:eeab8c1c926b
locate: respect ui.relative-paths
Differential Revision: https://phab.mercurial-scm.org/D5875
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Wed, 30 Jan 2019 16:21:30 -0800 |
parents | 92bd3d86f2e0 |
children | 446e1dcc3b5c |
comparison
equal
deleted
inserted
replaced
41605:7068c6b0114b | 41606:eeab8c1c926b |
---|---|
3681 # When run on the working copy, "locate" includes removed files, so | 3681 # When run on the working copy, "locate" includes removed files, so |
3682 # we get the list of files from the dirstate. | 3682 # we get the list of files from the dirstate. |
3683 filesgen = sorted(repo.dirstate.matches(m)) | 3683 filesgen = sorted(repo.dirstate.matches(m)) |
3684 else: | 3684 else: |
3685 filesgen = ctx.matches(m) | 3685 filesgen = ctx.matches(m) |
3686 uipathfn = scmutil.getuipathfn(repo, legacyrelativevalue=bool(pats)) | |
3686 for abs in filesgen: | 3687 for abs in filesgen: |
3687 if opts.get('fullpath'): | 3688 if opts.get('fullpath'): |
3688 ui.write(repo.wjoin(abs), end) | 3689 ui.write(repo.wjoin(abs), end) |
3689 else: | 3690 else: |
3690 ui.write(((pats and m.rel(abs)) or abs), end) | 3691 ui.write(uipathfn(abs), end) |
3691 ret = 0 | 3692 ret = 0 |
3692 | 3693 |
3693 return ret | 3694 return ret |
3694 | 3695 |
3695 @command('log|history', | 3696 @command('log|history', |