diff tests/test-hgignore.t @ 23629:a04c7b74b3d5

ignore: resolve ignore files relative to repo root (issue4473) (BC) Previously these would be considered to be relative to the current working directory. That behavior is both undocumented and doesn't really make sense. There are two reasonable options for how to resolve relative paths: - relative to the repo root - relative to the config file Resolving these files relative to the repo root matches existing behavior with hooks. An earlier discussion about this is available at http://mercurial.markmail.org/thread/tvu7yhzsiywgkjzl. Thanks to Isaac Jurado <diptongo@gmail.com> for the initial patchset that spurred the discussion.
author Siddharth Agarwal <sid0@fb.com>
date Tue, 16 Dec 2014 14:34:53 -0800
parents 7d7a4848fff4
children 4040e06e9b99
line wrap: on
line diff
--- a/tests/test-hgignore.t	Wed Dec 17 18:53:38 2014 -0800
+++ b/tests/test-hgignore.t	Tue Dec 16 14:34:53 2014 -0800
@@ -80,13 +80,23 @@
 
 empty out testhgignore
   $ echo > .hg/testhgignore
-  $ echo "glob:*.o" > .hgignore
+
+Test relative ignore path (issue4473):
+
+  $ cat >> $HGRCPATH << EOF
+  > [ui]
+  > ignore.relative = .hg/testhgignorerel
+  > EOF
+  $ echo "glob:*.o" > .hg/testhgignorerel
+  $ cd dir
   $ hg status
   A dir/b.o
   ? .hgignore
   ? a.c
   ? syntax
 
+  $ cd ..
+  $ echo > .hg/testhgignorerel
   $ echo "syntax: glob" > .hgignore
   $ echo "re:.*\.o" >> .hgignore
   $ hg status