changeset 38467:09b09fe7ee90

terse: add tests of running from subdirectory I also included comments explaining what I think the output should be (discussion started on D3628). Differential Revision: https://phab.mercurial-scm.org/D3837
author Martin von Zweigbergk <martinvonz@google.com>
date Mon, 25 Jun 2018 11:01:11 -0700
parents 2c2e82469b89
children 854c2ccc800e
files tests/test-status-terse.t
diffstat 1 files changed, 42 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-status-terse.t	Sat Jun 23 19:23:53 2018 +0900
+++ b/tests/test-status-terse.t	Mon Jun 25 11:01:11 2018 -0700
@@ -67,6 +67,48 @@
   ? x/
   ? y/
 
+Run from subdirectory
+  $ hg status --terse u --cwd x/l
+  ? .hgignore
+  ? a
+  ? b
+  ? x/
+  ? y/
+  $ relstatus() {
+  >   hg status --terse u --config commands.status.relative=1 "$@";
+  > }
+This should probably have {"l/", "m/", "n/"} instead of {"."}. They should
+probably come after "../y/".
+  $ relstatus --cwd x
+  ? ../.hgignore
+  ? ../a
+  ? ../b
+  ? .
+  ? ../y/
+This should probably have {"u/", "../m/", "../n/"} instead of {"../"}.
+  $ relstatus --cwd x/l
+  ? ../../.hgignore
+  ? ../../a
+  ? ../../b
+  ? ../
+  ? ../../y/
+This should probably have {"a/", "bb", "../aa", "../../m/", "../../n/"}
+instead of {"../../"}.
+  $ relstatus --cwd x/l/u
+  ? ../../../.hgignore
+  ? ../../../a
+  ? ../../../b
+  ? ../../
+  ? ../../../y/
+This should probably have {"bb", "../bb", "../../aa", "../../../m/",
+"../../../n/"} instead of {"../../../"}.
+  $ relstatus --cwd x/l/u/a
+  ? ../../../../.hgignore
+  ? ../../../../a
+  ? ../../../../b
+  ? ../../../
+  ? ../../../../y/
+
   $ hg add x/aa x/bb .hgignore
   $ hg status --terse au
   A .hgignore