comparison tests/test-evolve-stop-contentdiv.t @ 3914:96945ea908df stable

branching: merge default into stable The stable branch of Mercurial core now contains Mercurial 4.7 so evolve branch policy requires this merge. The @ bookmark is in the right location, so people doing clone will get to the latest release.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 31 Jul 2018 12:52:06 +0200
parents 796334340cad
children f7afd3a158e3
comparison
equal deleted inserted replaced
3901:f2b8429db565 3914:96945ea908df
1 Tests for the --stop flag for `hg evolve` command while resolving content-divergence
2 ==================================================================================
3
4 The `--stop` flag stops the interrupted evolution and delete the state file so
5 user can do other things and comeback and do evolution later on
6
7 This is testing cases when `hg evolve` command is doing content-divergence resolution.
8
9 Setup
10 =====
11
12 $ cat >> $HGRCPATH <<EOF
13 > [alias]
14 > glog = log -GT "{rev}:{node|short} {desc}\n ({bookmarks}) {phase}"
15 > [extensions]
16 > EOF
17 $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/" >> $HGRCPATH
18
19 $ hg init stoprepo
20 $ cd stoprepo
21 $ echo ".*\.orig" > .hgignore
22 $ hg add .hgignore
23 $ hg ci -m "added hgignore"
24 $ for ch in a b c d; do echo foo > $ch; hg add $ch; hg ci -qm "added "$ch; done;
25
26 $ hg glog
27 @ 4:c41c793e0ef1 added d
28 | () draft
29 o 3:ca1b80f7960a added c
30 | () draft
31 o 2:b1661037fa25 added b
32 | () draft
33 o 1:c7586e2a9264 added a
34 | () draft
35 o 0:8fa14d15e168 added hgignore
36 () draft
37
38 Creating content divergence, resolution of which will lead to conflicts
39 -----------------------------------------------------------------------
40
41 $ echo bar > d
42 $ hg amend
43
44 $ hg up c41c793e0ef1 --hidden
45 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
46 updated to hidden changeset c41c793e0ef1
47 (hidden revision 'c41c793e0ef1' was rewritten as: e49523854bc8)
48 working directory parent is obsolete! (c41c793e0ef1)
49 (use 'hg evolve' to update to its successor: e49523854bc8)
50
51 $ echo foobar > d
52 $ hg amend
53 2 new content-divergent changesets
54 $ hg glog --hidden
55 @ 6:9c1631e352d9 added d
56 | () draft
57 | * 5:e49523854bc8 added d
58 |/ () draft
59 | x 4:c41c793e0ef1 added d
60 |/ () draft
61 o 3:ca1b80f7960a added c
62 | () draft
63 o 2:b1661037fa25 added b
64 | () draft
65 o 1:c7586e2a9264 added a
66 | () draft
67 o 0:8fa14d15e168 added hgignore
68 () draft
69
70 $ hg evolve --content-divergent
71 merge:[6] added d
72 with: [5] added d
73 base: [4] added d
74 merging "other" content-divergent changeset 'e49523854bc8'
75 merging d
76 warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
77 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
78 fix conflicts and see `hg help evolve.interrupted`
79 [1]
80
81 $ hg evolve --stop
82 stopped the interrupted evolve
83 working directory is now at 9c1631e352d9
84
85 $ hg glog --hidden
86 @ 6:9c1631e352d9 added d
87 | () draft
88 | * 5:e49523854bc8 added d
89 |/ () draft
90 | x 4:c41c793e0ef1 added d
91 |/ () draft
92 o 3:ca1b80f7960a added c
93 | () draft
94 o 2:b1661037fa25 added b
95 | () draft
96 o 1:c7586e2a9264 added a
97 | () draft
98 o 0:8fa14d15e168 added hgignore
99 () draft
100
101 Content divergence with parent change which will result in conflicts while
102 merging
103 ---------------------------------------------------------------------------
104
105 $ hg rebase -r . -d .^^^ --config extensions.rebase=
106 rebasing 6:9c1631e352d9 "added d" (tip)
107
108 $ hg glog
109 @ 7:517d4375cb72 added d
110 | () draft
111 | * 5:e49523854bc8 added d
112 | | () draft
113 | o 3:ca1b80f7960a added c
114 | | () draft
115 | o 2:b1661037fa25 added b
116 |/ () draft
117 o 1:c7586e2a9264 added a
118 | () draft
119 o 0:8fa14d15e168 added hgignore
120 () draft
121
122 $ hg evolve --content-divergent
123 merge:[5] added d
124 with: [7] added d
125 base: [4] added d
126 rebasing "other" content-divergent changeset 517d4375cb72 on ca1b80f7960a
127 updating to "local" side of the conflict: e49523854bc8
128 merging "other" content-divergent changeset '606ad96040fc'
129 merging d
130 warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
131 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
132 fix conflicts and see `hg help evolve.interrupted`
133 [1]
134
135 $ hg evolve --stop
136 stopped the interrupted evolve
137 working directory is now at 517d4375cb72
138
139 $ hg glog
140 @ 7:517d4375cb72 added d
141 | () draft
142 | * 5:e49523854bc8 added d
143 | | () draft
144 | o 3:ca1b80f7960a added c
145 | | () draft
146 | o 2:b1661037fa25 added b
147 |/ () draft
148 o 1:c7586e2a9264 added a
149 | () draft
150 o 0:8fa14d15e168 added hgignore
151 () draft
152
153 Content-divergence with parent-change which will result in conflicts while
154 relocation
155 ---------------------------------------------------------------------------
156
157 $ echo babar > c
158 $ hg add c
159 $ hg amend
160 $ hg glog
161 @ 8:8fd1c4bd144c added d
162 | () draft
163 | * 5:e49523854bc8 added d
164 | | () draft
165 | o 3:ca1b80f7960a added c
166 | | () draft
167 | o 2:b1661037fa25 added b
168 |/ () draft
169 o 1:c7586e2a9264 added a
170 | () draft
171 o 0:8fa14d15e168 added hgignore
172 () draft
173
174 $ hg evolve --content-divergent
175 merge:[5] added d
176 with: [8] added d
177 base: [4] added d
178 rebasing "other" content-divergent changeset 8fd1c4bd144c on ca1b80f7960a
179 merging c
180 warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
181 fix conflicts and see `hg help evolve.interrupted`
182 [1]
183
184 $ hg diff
185 diff -r ca1b80f7960a c
186 --- a/c Thu Jan 01 00:00:00 1970 +0000
187 +++ b/c Thu Jan 01 00:00:00 1970 +0000
188 @@ -1,1 +1,5 @@
189 +<<<<<<< destination: ca1b80f7960a - test: added c
190 foo
191 +=======
192 +babar
193 +>>>>>>> evolving: 8fd1c4bd144c - test: added d
194 diff -r ca1b80f7960a d
195 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
196 +++ b/d Thu Jan 01 00:00:00 1970 +0000
197 @@ -0,0 +1,1 @@
198 +foobar
199
200 $ hg evolve --stop
201 stopped the interrupted evolve
202 working directory is now at ca1b80f7960a
203
204 XXX: we should have preserved the wdir to be at rev 8
205 $ hg glog
206 * 8:8fd1c4bd144c added d
207 | () draft
208 | * 5:e49523854bc8 added d
209 | | () draft
210 | @ 3:ca1b80f7960a added c
211 | | () draft
212 | o 2:b1661037fa25 added b
213 |/ () draft
214 o 1:c7586e2a9264 added a
215 | () draft
216 o 0:8fa14d15e168 added hgignore
217 () draft