changeset 17095:45cf6a91a02d

dirstate: add dir/file collision test Add a test exercising collisions in add between files and directories of the same name.
author Joshua Redstone <joshua.redstone@fb.com>
date Wed, 27 Jun 2012 12:28:26 -0700
parents c2016bae3b97
children 14e44933d175
files tests/test-dirstate.t
diffstat 1 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-dirstate.t	Mon Jun 18 08:06:42 2012 -0700
+++ b/tests/test-dirstate.t	Wed Jun 27 12:28:26 2012 -0700
@@ -14,6 +14,21 @@
   moving a/b/c/d/x to z/b/c/d/x (glob)
   moving a/b/c/d/y to z/b/c/d/y (glob)
   moving a/b/c/d/z to z/b/c/d/z (glob)
+
+Test name collisions
+
+  $ rm z/b/c/d/x
+  $ mkdir z/b/c/d/x
+  $ touch z/b/c/d/x/y
+  $ hg add z/b/c/d/x/y
+  abort: file 'z/b/c/d/x' in dirstate clashes with 'z/b/c/d/x/y'
+  [255]
+  $ rm -rf z/b/c/d
+  $ touch z/b/c/d
+  $ hg add z/b/c/d
+  abort: directory 'z/b/c/d' already in dirstate
+  [255]
+
   $ cd ..
 
 Issue1790: dirstate entry locked into unset if file mtime is set into