Mercurial > public > mercurial-scm > hg-stable
diff 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 |
line wrap: on
line diff
--- a/tests/test-diffstat.t Sat Feb 09 23:48:19 2019 -0800 +++ b/tests/test-diffstat.t Thu Jan 31 15:35:51 2019 -0800 @@ -146,10 +146,21 @@ $ hg diff --stat . dir1/new | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) + $ hg diff --stat . --config ui.relative-paths=yes + new | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) $ hg diff --stat --root . new | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) + $ hg diff --stat --root . --config ui.relative-paths=yes + new | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) +--root trumps ui.relative-paths + $ hg diff --stat --root .. --config ui.relative-paths=yes + new | 1 + + ../dir2/new | 1 + + 2 files changed, 2 insertions(+), 0 deletions(-) $ hg diff --stat --root ../dir1 ../dir2 warning: ../dir2 not inside relative root .