changeset 42686:22c4bd7d1cbf

fix: add a test case around the effect of cwd on pattern matching This was not covered by previous tests. It is related to a regression encountered at Google due to misconfiguration of [fix]. Differential Revision: https://phab.mercurial-scm.org/D6692
author Danny Hooper <hooper@google.com>
date Wed, 24 Jul 2019 16:21:12 -0700
parents 9ed63cd0026c
children 2987d015aba4
files tests/test-fix.t
diffstat 1 files changed, 25 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-fix.t	Wed Jul 24 16:22:45 2019 -0700
+++ b/tests/test-fix.t	Wed Jul 24 16:21:12 2019 -0700
@@ -1242,3 +1242,28 @@
 
   $ cd ..
 
+Test that we can configure a fixer to affect all files regardless of the cwd.
+The way we invoke matching must not prohibit this.
+
+  $ hg init affectallfiles
+  $ cd affectallfiles
+
+  $ mkdir foo bar
+  $ printf "foo" > foo/file
+  $ printf "bar" > bar/file
+  $ printf "baz" > baz_file
+  $ hg add -q
+
+  $ cd bar
+  $ hg fix --working-dir --config "fix.cooltool:command=echo fixed" \
+  >                      --config "fix.cooltool:pattern=rootglob:**"
+  $ cd ..
+
+  $ cat foo/file
+  fixed
+  $ cat bar/file
+  fixed
+  $ cat baz_file
+  fixed
+
+  $ cd ..