Mercurial > hg
comparison mercurial/commands.py @ 41577:5f827e9ce870
status: if ui.relative-paths=no, don't use relative paths even with patterns
Without ui.relative-paths or command.status.relative set, you get this
behavior:
hgext$ hg st
M hgext/narrow/narrowrepo.py
hgext$ hg st .
M narrow/narrowrepo.py
hgext$ hg st narrow
M narrow/narrowrepo.py
I think it's surprising that some of those produce relative paths. I
suspect it works that way because "hg st ." was an easy way of getting
relative paths. Perhaps not much thought was given to how it should
behave when the pattern was not ".". It also feels wrong to conflate
the request for relative patterns with matching of of patterns.
Since we can now start fresh and define the behavior of
ui.relative-paths as we want, I suggest we make ui.relative-paths=no
consistently not give relative paths. So that's what this paths starts
doing for `hg status`.
Differential Revision: https://phab.mercurial-scm.org/D5802
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 01 Feb 2019 22:52:09 -0800 |
parents | aec185af621e |
children | 92bd3d86f2e0 |
comparison
equal
deleted
inserted
replaced
41576:15f63ac122ea | 41577:5f827e9ce870 |
---|---|
5414 ctx1 = ctx2.p1() | 5414 ctx1 = ctx2.p1() |
5415 else: | 5415 else: |
5416 repo = scmutil.unhidehashlikerevs(repo, revs, 'nowarn') | 5416 repo = scmutil.unhidehashlikerevs(repo, revs, 'nowarn') |
5417 ctx1, ctx2 = scmutil.revpair(repo, revs) | 5417 ctx1, ctx2 = scmutil.revpair(repo, revs) |
5418 | 5418 |
5419 relative = None | 5419 forcerelativevalue = None |
5420 if pats: | 5420 if ui.hasconfig('commands', 'status.relative'): |
5421 relative = True | 5421 forcerelativevalue = ui.configbool('commands', 'status.relative') |
5422 elif ui.hasconfig('commands', 'status.relative'): | 5422 uipathfn = scmutil.getuipathfn(repo, legacyrelativevalue=bool(pats), |
5423 relative = ui.configbool('commands', 'status.relative') | 5423 forcerelativevalue=forcerelativevalue) |
5424 uipathfn = scmutil.getuipathfn(repo, forcerelativevalue=relative) | |
5425 | 5424 |
5426 if opts.get('print0'): | 5425 if opts.get('print0'): |
5427 end = '\0' | 5426 end = '\0' |
5428 else: | 5427 else: |
5429 end = '\n' | 5428 end = '\n' |