Mercurial > public > mercurial-scm > hg
diff tests/test-diffstat.t @ 24432:e22248f6d257
commands.diff: add support for diffs relative to a subdirectory
Previous patches added all the backend support for this. This exposes this
option in the UI.
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Tue, 17 Mar 2015 15:46:30 -0700 |
parents | 2944a6d35158 |
children | 16961d43dc89 |
line wrap: on
line diff
--- a/tests/test-diffstat.t Tue Mar 17 15:06:40 2015 -0700 +++ b/tests/test-diffstat.t Tue Mar 17 15:46:30 2015 -0700 @@ -69,4 +69,39 @@ file with spaces | Bin 1 files changed, 0 insertions(+), 0 deletions(-) +diffstat within directories: + + $ hg rm -f 'file with spaces' + + $ mkdir dir1 dir2 + $ echo new1 > dir1/new + $ echo new2 > dir2/new + $ hg add dir1/new dir2/new + $ hg diff --stat + dir1/new | 1 + + dir2/new | 1 + + 2 files changed, 2 insertions(+), 0 deletions(-) + + $ hg diff --stat --relative dir1 + new | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + + $ hg diff --stat --relative dir1 dir2 + warning: dir2 not inside relative root dir1 + + $ hg diff --stat --relative dir1 -I dir1/old + + $ cd dir1 + $ hg diff --stat . + dir1/new | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + $ hg diff --stat --relative . + new | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + + $ hg diff --stat --relative ../dir1 ../dir2 + warning: ../dir2 not inside relative root . + + $ hg diff --stat --relative . -I old + $ cd ..