test-git-import: test patching existing copy targets
authorPatrick Mezard <pmezard@gmail.com>
Wed, 25 May 2011 10:06:17 +0200
changeset 14431 a6b543e05305
parent 14430 c864f5e743ef
child 14432 0969d91fad5c
test-git-import: test patching existing copy targets
tests/test-git-import.t
--- a/tests/test-git-import.t	Tue May 24 17:30:00 2011 -0500
+++ b/tests/test-git-import.t	Wed May 25 10:06:17 2011 +0200
@@ -402,3 +402,42 @@
     a
   R a
   $ cd ..
+
+Pure copy with existing destination
+
+  $ hg init copytoexisting
+  $ cd copytoexisting
+  $ echo a > a
+  $ echo b > b
+  $ hg ci -Am add
+  adding a
+  adding b
+  $ hg import --no-commit - <<EOF
+  > diff --git a/a b/b
+  > copy from a
+  > copy to b
+  > EOF
+  applying patch from stdin
+  abort: cannot create b: destination already exists
+  [255]
+  $ cat b
+  b
+
+Copy and changes with existing destination
+
+  $ hg import --no-commit - <<EOF
+  > diff --git a/a b/b
+  > copy from a
+  > copy to b
+  > --- a/a
+  > +++ b/b
+  > @@ -1,1 +1,2 @@
+  > a
+  > +b
+  > EOF
+  applying patch from stdin
+  abort: cannot create b: destination already exists
+  [255]
+  $ cat b
+  b
+  $ cd ..