changeset 42192:818051048c2e stable

tests: show IMM is broken when merging file empty in destination When we are doing in-memory merging, and we are merging a file which is empty in merge destination, it leads to error 'abort: xxx not found in manifest'. Next patch will fix this error. Differential Revision: https://phab.mercurial-scm.org/D6307
author Pulkit Goyal <pulkit@yandex-team.ru>
date Wed, 24 Apr 2019 19:28:46 +0300
parents ae68418cc3a1
children 14589f1989e9
files tests/test-rebase-inmemory.t
diffstat 1 files changed, 39 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-rebase-inmemory.t	Fri Apr 19 02:24:25 2019 +0200
+++ b/tests/test-rebase-inmemory.t	Wed Apr 24 19:28:46 2019 +0300
@@ -760,3 +760,42 @@
   rebasing 3:ca58782ad1e4 "b"
   rebasing 5:71cb43376053 "merge"
   note: not rebasing 5:71cb43376053 "merge", its destination already has all its changes
+
+  $ cd ..
+
+Test rebasing when the file we are merging in destination is empty
+
+  $ hg init test
+  $ cd test
+  $ echo a > foo
+  $ hg ci -Aqm 'added a to foo'
+
+  $ rm foo
+  $ touch foo
+  $ hg di
+  diff --git a/foo b/foo
+  --- a/foo
+  +++ b/foo
+  @@ -1,1 +0,0 @@
+  -a
+
+  $ hg ci -m "make foo an empty file"
+
+  $ hg up '.^'
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo b > foo
+  $ hg di
+  diff --git a/foo b/foo
+  --- a/foo
+  +++ b/foo
+  @@ -1,1 +1,1 @@
+  -a
+  +b
+  $ hg ci -m "add b to foo"
+  created new head
+
+  $ hg rebase -r . -d 1 --config ui.merge=internal:merge3
+  rebasing 2:fb62b706688e "add b to foo" (tip)
+  merging foo
+  abort: foo.orig@e780cf6f9041: not found in manifest!
+  [255]