tests: show failure to `hg add -I` a dir->symlink transition
authorMartin von Zweigbergk <martinvonz@google.com>
Tue, 28 Nov 2023 22:44:04 -0800
changeset 51162 b0a6084f9cd6
parent 51161 f816ca29a285
child 51163 b8f9911c8dca
tests: show failure to `hg add -I` a dir->symlink transition
tests/test-symlinks.t
--- a/tests/test-symlinks.t	Tue Apr 11 21:56:16 2023 +0200
+++ b/tests/test-symlinks.t	Tue Nov 28 22:44:04 2023 -0800
@@ -188,6 +188,39 @@
 
   $ cd ..
 
+== symlinks and add with --include ==
+
+directory moved and symlinked
+
+  $ hg init add-include
+  $ cd add-include
+  $ mkdir foo
+  $ touch foo/a
+  $ hg ci -Ama
+  adding foo/a
+  $ hg mv foo bar
+  moving foo/a to bar/a
+  $ ln -s bar foo
+  $ hg status
+  A bar/a
+  R foo/a
+  ? foo
+
+can add with --include
+
+  $ hg add -I foo
+  adding foo
+  adding foo/a (known-bad-output !)
+  abort: file 'foo' in dirstate clashes with 'foo/a' (known-bad-output !)
+  [255]
+  $ hg status
+  A bar/a
+  A foo (missing-correct-output !)
+  R foo/a
+  ? foo (known-bad-output !)
+
+  $ cd ..
+
 == root of repository is symlinked ==
 
   $ hg init root