diff tests/test-hgignore.t @ 25870:3de48ff62733 stable

ignore: fix include: rules depending on current directory (issue4759) When reading pattern files, we just call open(path), which is relative to the current directory. Let's fix this by resolving the paths before attempting to read the file.
author Durham Goode <durham@fb.com>
date Fri, 24 Jul 2015 16:44:52 -0700
parents a72e304df528
children ee2d7b5daa8a
line wrap: on
line diff
--- a/tests/test-hgignore.t	Fri Jul 24 16:43:21 2015 -0700
+++ b/tests/test-hgignore.t	Fri Jul 24 16:44:52 2015 -0700
@@ -186,8 +186,9 @@
 
 Check recursive uses of 'include:'
 
-  $ echo "include:nestedignore" >> otherignore
-  $ echo "glob:*ignore" > nestedignore
+  $ echo "include:nested/ignore" >> otherignore
+  $ mkdir nested
+  $ echo "glob:*ignore" > nested/ignore
   $ hg status
   A dir/b.o
 
@@ -199,6 +200,13 @@
 
   $ mv goodignore otherignore
 
+Check using 'include:' while in a non-root directory
+
+  $ cd ..
+  $ hg -R ignorerepo status
+  A dir/b.o
+  $ cd ignorerepo
+
 Check including subincludes
 
   $ hg revert -q --all