changeset 39575:aa022f8873ea

rebase: add tests showing patch conflict detection needs to be smarter in IMM This patch adds test which shows that you can't rebase a cset which removes a dir and adds a file of the same as that of dir as there are False positives path conflicts reported. I fixed the case when there is a file and we adds a dir of same name while removing the file, but missed testing the current case. Next patch will fix this. Differential Revision: https://phab.mercurial-scm.org/D4544
author Pulkit Goyal <pulkit@yandex-team.ru>
date Wed, 12 Sep 2018 17:22:46 +0300
parents a2d17b699628
children fa4d16daf1be
files tests/test-rebase-inmemory.t
diffstat 1 files changed, 42 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-rebase-inmemory.t	Mon Sep 10 16:47:02 2018 +0800
+++ b/tests/test-rebase-inmemory.t	Wed Sep 12 17:22:46 2018 +0300
@@ -179,6 +179,48 @@
   rebasing 4:daf7dfc139cb "a/a" (tip)
   saved backup bundle to $TESTTMP/repo1/repo2/.hg/strip-backup/daf7dfc139cb-fdbfcf4f-rebase.hg
 
+  $ hg tglog
+  @  4: c6ad37a4f250 'a/a'
+  |
+  | o  3: 844a7de3e617 'c'
+  | |
+  o |  2: 09c044d2cb43 'd'
+  | |
+  o |  1: fc055c3b4d33 'b'
+  |/
+  o  0: b173517d0057 'a'
+  
+  $ echo foo > foo
+  $ hg ci -Aqm "added foo"
+  $ hg up '.^'
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo bar > bar
+  $ hg ci -Aqm "added bar"
+  $ hg rm a/a
+  $ echo a > a
+  $ hg ci -Aqm "added a back!"
+  $ hg tglog
+  @  7: 855e9797387e 'added a back!'
+  |
+  o  6: d14530e5e3e6 'added bar'
+  |
+  | o  5: 9b94b9373deb 'added foo'
+  |/
+  o  4: c6ad37a4f250 'a/a'
+  |
+  | o  3: 844a7de3e617 'c'
+  | |
+  o |  2: 09c044d2cb43 'd'
+  | |
+  o |  1: fc055c3b4d33 'b'
+  |/
+  o  0: b173517d0057 'a'
+  
+  $ hg rebase -r . -d 5
+  rebasing 7:855e9797387e "added a back!" (tip)
+  abort: error: file 'a' cannot be written because  'a/' is a folder in 9b94b9373deb (containing 1 entries: a/a)
+  [255]
+
   $ cd ..
 
 Test dry-run rebasing