Show More
@@ -5414,7 +5414,11 b' def status(ui, repo, *pats, **opts):' | |||||
5414 | repo = scmutil.unhidehashlikerevs(repo, revs, 'nowarn') |
|
5414 | repo = scmutil.unhidehashlikerevs(repo, revs, 'nowarn') | |
5415 | ctx1, ctx2 = scmutil.revpair(repo, revs) |
|
5415 | ctx1, ctx2 = scmutil.revpair(repo, revs) | |
5416 |
|
5416 | |||
5417 | relative = pats or ui.configbool('commands', 'status.relative') |
|
5417 | relative = None | |
|
5418 | if pats: | |||
|
5419 | relative = True | |||
|
5420 | elif ui.hasconfig('commands', 'status.relative'): | |||
|
5421 | relative = ui.configbool('commands', 'status.relative') | |||
5418 | uipathfn = scmutil.getuipathfn(repo, relative) |
|
5422 | uipathfn = scmutil.getuipathfn(repo, relative) | |
5419 |
|
5423 | |||
5420 | if opts.get('print0'): |
|
5424 | if opts.get('print0'): |
@@ -1233,6 +1233,9 b" coreconfigitem('ui', 'quiet'," | |||||
1233 | coreconfigitem('ui', 'quietbookmarkmove', |
|
1233 | coreconfigitem('ui', 'quietbookmarkmove', | |
1234 | default=False, |
|
1234 | default=False, | |
1235 | ) |
|
1235 | ) | |
|
1236 | coreconfigitem('ui', 'relative-paths', | |||
|
1237 | default=False, | |||
|
1238 | ) | |||
1236 | coreconfigitem('ui', 'remotecmd', |
|
1239 | coreconfigitem('ui', 'remotecmd', | |
1237 | default='hg', |
|
1240 | default='hg', | |
1238 | ) |
|
1241 | ) |
@@ -2331,6 +2331,9 b' User interface controls.' | |||||
2331 | Reduce the amount of output printed. |
|
2331 | Reduce the amount of output printed. | |
2332 | (default: False) |
|
2332 | (default: False) | |
2333 |
|
2333 | |||
|
2334 | ``relative-paths`` | |||
|
2335 | Prefer relative paths in the UI. | |||
|
2336 | ||||
2334 | ``remotecmd`` |
|
2337 | ``remotecmd`` | |
2335 | Remote command to use for clone/push/pull operations. |
|
2338 | Remote command to use for clone/push/pull operations. | |
2336 | (default: ``hg``) |
|
2339 | (default: ``hg``) |
@@ -725,7 +725,9 b' def meaningfulparents(repo, ctx):' | |||||
725 | return [] |
|
725 | return [] | |
726 | return parents |
|
726 | return parents | |
727 |
|
727 | |||
728 | def getuipathfn(repo, relative): |
|
728 | def getuipathfn(repo, relative=None): | |
|
729 | if relative is None: | |||
|
730 | relative = repo.ui.configbool('ui', 'relative-paths') | |||
729 | if relative: |
|
731 | if relative: | |
730 | cwd = repo.getcwd() |
|
732 | cwd = repo.getcwd() | |
731 | pathto = repo.pathto |
|
733 | pathto = repo.pathto |
@@ -133,6 +133,22 b' tweaking defaults works' | |||||
133 | relative paths can be requested |
|
133 | relative paths can be requested | |
134 |
|
134 | |||
135 | $ cat >> $HGRCPATH <<EOF |
|
135 | $ cat >> $HGRCPATH <<EOF | |
|
136 | > [ui] | |||
|
137 | > relative-paths = True | |||
|
138 | > EOF | |||
|
139 | $ hg status --cwd a | |||
|
140 | ? 1/in_a_1 | |||
|
141 | ? in_a | |||
|
142 | ? ../b/1/in_b_1 | |||
|
143 | ? ../b/2/in_b_2 | |||
|
144 | ? ../b/in_b | |||
|
145 | ? ../in_root | |||
|
146 | ||||
|
147 | commands.status.relative overrides ui.relative-paths | |||
|
148 | ||||
|
149 | $ cat >> $HGRCPATH <<EOF | |||
|
150 | > [ui] | |||
|
151 | > relative-paths = False | |||
136 | > [commands] |
|
152 | > [commands] | |
137 | > status.relative = True |
|
153 | > status.relative = True | |
138 | > EOF |
|
154 | > EOF |
General Comments 0
You need to be logged in to leave comments.
Login now