comparison tests/test-evolve-abort-contentdiv.t @ 3841:82b79a8dafd9

tests: add test about aborting content-divergence when multiple parents This patch adds tests for --abort flag of hg evolve command when we are resolving content-divergence which are on different parents and parent of one of them is the gca of both of them. The tests shows that we are doing good and we should advertise the flag during conflicts.
author Pulkit Goyal <7895pulkit@gmail.com>
date Tue, 12 Jun 2018 03:29:13 +0530
parents ac0717f23921
children b293cce4ff55
comparison
equal deleted inserted replaced
3840:231f593ccd5f 3841:82b79a8dafd9
219 | 219 |
220 x ca1b80f7960a (3) added c 220 x ca1b80f7960a (3) added c
221 rewritten(content) as 2ba73e31f264 using amend by test (Thu Jan 01 00:00:00 1970 +0000) 221 rewritten(content) as 2ba73e31f264 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
222 rewritten(content) as 7398f702a162 using amend by test (Thu Jan 01 00:00:00 1970 +0000) 222 rewritten(content) as 7398f702a162 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
223 223
224 $ cd ..
225
226 Creating content-divergence on multiple parents when gca of divergent changesets
227 is parent of one of the divergents and relocating leads to conflicts
228 ---------------------------------------------------------------------------------
229
230 $ hg init multiparent
231 $ cd multiparent
232 $ echo ".*\.orig" > .hgignore
233 $ hg add .hgignore
234 $ hg ci -m "added hgignore"
235 $ for ch in a b c d; do echo foo > $ch; hg add $ch; hg ci -qm "added "$ch; done;
236
237 $ hg glog
238 @ 4:c41c793e0ef1 added d
239 | () draft
240 o 3:ca1b80f7960a added c
241 | () draft
242 o 2:b1661037fa25 added b
243 | () draft
244 o 1:c7586e2a9264 added a
245 | () draft
246 o 0:8fa14d15e168 added hgignore
247 () draft
248
249 $ hg rebase -r . -d .^^^ --config extensions.rebase=
250 rebasing 4:c41c793e0ef1 "added d" (tip)
251 $ echo bar > c
252 $ hg add c
253 $ hg amend
254
255 $ hg up --hidden c41c793e0ef1
256 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
257 updated to hidden changeset c41c793e0ef1
258 (hidden revision 'c41c793e0ef1' was rewritten as: 69bdd23a9b0d)
259 working directory parent is obsolete! (c41c793e0ef1)
260 (use 'hg evolve' to update to its successor: 69bdd23a9b0d)
261 $ echo bar > d
262 $ hg amend
263 2 new content-divergent changesets
264
265 $ hg glog
266 @ 7:e49523854bc8 added d
267 | () draft
268 | * 6:69bdd23a9b0d added d
269 | | () draft
270 o | 3:ca1b80f7960a added c
271 | | () draft
272 o | 2:b1661037fa25 added b
273 |/ () draft
274 o 1:c7586e2a9264 added a
275 | () draft
276 o 0:8fa14d15e168 added hgignore
277 () draft
278
279 $ hg evolve --content-divergent
280 merge:[7] added d
281 with: [6] added d
282 base: [4] added d
283 rebasing "other" content-divergent changeset 69bdd23a9b0d on ca1b80f7960a
284 merging c
285 warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
286 abort: unresolved merge conflicts (see hg help resolve)
287 [255]
288
289 $ hg evolve --abort
290 evolve aborted
291 working directory is now at e49523854bc8
292
293 $ hg glog
294 @ 7:e49523854bc8 added d
295 | () draft
296 | * 6:69bdd23a9b0d added d
297 | | () draft
298 o | 3:ca1b80f7960a added c
299 | | () draft
300 o | 2:b1661037fa25 added b
301 |/ () draft
302 o 1:c7586e2a9264 added a
303 | () draft
304 o 0:8fa14d15e168 added hgignore
305 () draft
306
307 Creating content-divergence on multiple parents when gca of divergent changesets
308 is parent of one of the divergents and merging divergent leads to conflicts
309 ---------------------------------------------------------------------------------
310
311 $ hg up 69bdd23a9b0d
312 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
313 $ hg rm c
314 $ echo wat > d
315 $ hg amend
316
317 $ hg glog
318 @ 8:33e4442acf98 added d
319 | () draft
320 | * 7:e49523854bc8 added d
321 | | () draft
322 | o 3:ca1b80f7960a added c
323 | | () draft
324 | o 2:b1661037fa25 added b
325 |/ () draft
326 o 1:c7586e2a9264 added a
327 | () draft
328 o 0:8fa14d15e168 added hgignore
329 () draft
330
331 $ hg evolve --content-divergent
332 merge:[7] added d
333 with: [8] added d
334 base: [4] added d
335 rebasing "other" content-divergent changeset 33e4442acf98 on ca1b80f7960a
336 updating to "local" side of the conflict: e49523854bc8
337 merging "other" content-divergent changeset 'a663d1567f0b'
338 merging d
339 warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
340 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
341 abort: fix conflicts and run 'hg evolve --continue' or use 'hg update -C .' to abort
342 [255]
343
344 $ hg evolve --abort
345 evolve aborted
346 working directory is now at 33e4442acf98
347
348 $ hg glog
349 @ 8:33e4442acf98 added d
350 | () draft
351 | * 7:e49523854bc8 added d
352 | | () draft
353 | o 3:ca1b80f7960a added c
354 | | () draft
355 | o 2:b1661037fa25 added b
356 |/ () draft
357 o 1:c7586e2a9264 added a
358 | () draft
359 o 0:8fa14d15e168 added hgignore
360 () draft