graft: use a real conflict for the tests
authorMartin von Zweigbergk <martinvonz@google.com>
Wed, 03 Dec 2014 15:03:29 -0800
changeset 23463 bb0143e12f35
parent 23462 afa3fbbcabd3
child 23464 73d4f6551798
graft: use a real conflict for the tests One of the graft tests grafts a changeset that changes a file's content from 'a' to 'b' onto a branch that has changed the file's content from 'a', via 'b', and then back to 'a' again. To prepare for not considering this a file in need of merging, let's use 'c' as the file's new content to make sure it has to be considered conflicting. There's a second similar case further down where an ancestor is grafted. Make sure that is also considered a conflict.
tests/test-graft.t
--- a/tests/test-graft.t	Wed Dec 03 14:33:29 2014 -0800
+++ b/tests/test-graft.t	Wed Dec 03 15:03:29 2014 -0800
@@ -361,7 +361,7 @@
   $ echo b > a
   $ hg ci -m 8
   created new head
-  $ echo a > a
+  $ echo c > a
   $ hg ci -m 9
   $ hg graft 1 --tool internal:fail
   grafting revision 1
@@ -370,6 +370,17 @@
   [255]
   $ hg resolve --all
   merging a
+  warning: conflicts during merge.
+  merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
+  [1]
+  $ cat a
+  <<<<<<< local: aaa4406d4f0a - test: 9
+  c
+  =======
+  b
+  >>>>>>> other: 5d205f8b35b6  - bar: 1
+  $ echo b > a
+  $ hg resolve -m a
   (no more unresolved files)
   $ hg graft -c
   grafting revision 1
@@ -378,15 +389,15 @@
   # User bar
   # Date 0 0
   #      Thu Jan 01 00:00:00 1970 +0000
-  # Node ID 64ecd9071ce83c6e62f538d8ce7709d53f32ebf7
-  # Parent  4bdb9a9d0b84ffee1d30f0dfc7744cade17aa19c
+  # Node ID f67661df0c4804d301f064f332b57e7d5ddaf2be
+  # Parent  aaa4406d4f0ae9befd6e58c82ec63706460cbca6
   1
   
   diff --git a/a b/a
   --- a/a
   +++ b/a
   @@ -1,1 +1,1 @@
-  -a
+  -c
   +b
 
 Resolve conflicted graft with rename
@@ -407,8 +418,8 @@
   # User test
   # Date 0 0
   #      Thu Jan 01 00:00:00 1970 +0000
-  # Node ID 2e80e1351d6ed50302fe1e05f8bd1d4d412b6e11
-  # Parent  e5a51ae854a8bbaaf25cc5c6a57ff46042dadbb4
+  # Node ID 9627f653b421c61fc1ea4c4e366745070fa3d2bc
+  # Parent  ee295f490a40b97f3d18dd4c4f1c8936c233b612
   2
   
   diff --git a/a b/b
@@ -537,12 +548,12 @@
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     3
   
-  changeset:   17:64ecd9071ce8
+  changeset:   17:f67661df0c48
   user:        bar
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     1
   
-  changeset:   19:2e80e1351d6e
+  changeset:   19:9627f653b421
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     2
@@ -566,7 +577,7 @@
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     2
   
-  changeset:   19:2e80e1351d6e
+  changeset:   19:9627f653b421
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     2
@@ -608,7 +619,7 @@
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     2
   
-  changeset:   19:2e80e1351d6e
+  changeset:   19:9627f653b421
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     2
@@ -669,9 +680,8 @@
 
 graft --continue after --force
 
-  $ hg backout 30
-  reverting a
-  changeset 31:3b96c18b7a1b backs out changeset 30:8f539994be33
+  $ echo def > a
+  $ hg ci -m 31
   $ hg graft 28 --force --tool internal:fail
   grafting revision 28
   abort: unresolved conflicts, can't continue
@@ -679,6 +689,11 @@
   [255]
   $ hg resolve --all
   merging a
+  warning: conflicts during merge.
+  merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
+  [1]
+  $ echo abc > a
+  $ hg resolve -m a
   (no more unresolved files)
   $ hg graft -c
   grafting revision 28