comparison tests/test-diffstat.t @ 41681:db69a763bc89

diff: make --stat respect ui.relative-paths It would have been easy to make all diffs respect ui.relative-paths, but we don't want that since it makes the diff invalid. Perhaps it makes sense to do that with --noprefix since the point of that is to make paths that are easy to copy&paste, and the diff is already invalid anyway. But this patch just makes the --stat version respect the config option. The --stat view is not even close to a valid diff, so I think it makes sense to show the paths in more human-friendly form. Differential Revision: https://phab.mercurial-scm.org/D5896
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 31 Jan 2019 15:35:51 -0800
parents 4a33a6bf2b52
children 7b04b1154c15
comparison
equal deleted inserted replaced
41680:a13268524c25 41681:db69a763bc89
144 144
145 $ cd dir1 145 $ cd dir1
146 $ hg diff --stat . 146 $ hg diff --stat .
147 dir1/new | 1 + 147 dir1/new | 1 +
148 1 files changed, 1 insertions(+), 0 deletions(-) 148 1 files changed, 1 insertions(+), 0 deletions(-)
149 $ hg diff --stat . --config ui.relative-paths=yes
150 new | 1 +
151 1 files changed, 1 insertions(+), 0 deletions(-)
149 $ hg diff --stat --root . 152 $ hg diff --stat --root .
150 new | 1 + 153 new | 1 +
151 1 files changed, 1 insertions(+), 0 deletions(-) 154 1 files changed, 1 insertions(+), 0 deletions(-)
152 155
156 $ hg diff --stat --root . --config ui.relative-paths=yes
157 new | 1 +
158 1 files changed, 1 insertions(+), 0 deletions(-)
159 --root trumps ui.relative-paths
160 $ hg diff --stat --root .. --config ui.relative-paths=yes
161 new | 1 +
162 ../dir2/new | 1 +
163 2 files changed, 2 insertions(+), 0 deletions(-)
153 $ hg diff --stat --root ../dir1 ../dir2 164 $ hg diff --stat --root ../dir1 ../dir2
154 warning: ../dir2 not inside relative root . 165 warning: ../dir2 not inside relative root .
155 166
156 $ hg diff --stat --root . -I old 167 $ hg diff --stat --root . -I old
157 168