comparison tests/test-stabilize-result.t @ 3787:dc81a788f278

evolve: use cmdrewrite.amend() instead of creating a new commit This patch backs out changeset 88601e1cd5d8. We replaced cmdrewrite.amend() with creating new commit because using amend(), a high level function was not good and creating a new commit gave us more control over things. **HOWEVER** to get more control, you need to get arrange all the pieces together perfectly. Creating a new commit, the existing logic has some bugs around dirstate handling, the `repo.dirstate.setparents()` call especially. Sometimes this fixes the dirstate correctly sometimes not. As Pierre-Yves David said, "Having a "clumsy" implementation with the right behavior is usually a good first step. So having an amend based implementation seems like a good first step.", let's take a step back and get back using amend so that we can have a correct basic implementation which is bug free.
author Pulkit Goyal <7895pulkit@gmail.com>
date Tue, 05 Jun 2018 00:53:21 +0530
parents 88601e1cd5d8
children ededd22e7c7b
comparison
equal deleted inserted replaced
3786:41fc764bf28c 3787:dc81a788f278
292 base: [12] More addition 292 base: [12] More addition
293 merging "other" content-divergent changeset 'd2f173e25686' 293 merging "other" content-divergent changeset 'd2f173e25686'
294 resolving manifests 294 resolving manifests
295 merging a 295 merging a
296 0 files updated, 1 files merged, 0 files removed, 0 files unresolved 296 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
297 amending changeset eacc9c8240fe
297 committing files: 298 committing files:
298 a 299 a
299 committing manifest 300 committing manifest
300 committing changelog 301 committing changelog
301 working directory is now at 4d6ed26797bc 302 committed changeset 15:f344982e63c4
303 working directory is now at f344982e63c4
302 $ hg st 304 $ hg st
303 $ glog 305 $ glog
304 @ 15:4d6ed26797bc@default(draft) bk:[] More addition 306 @ 15:f344982e63c4@default(draft) bk:[] More addition
305 | 307 |
306 | o 11:8fc63fe1f297@default(draft) bk:[] phase-divergent update to 1cf0aacfd363: 308 | o 11:8fc63fe1f297@default(draft) bk:[] phase-divergent update to 1cf0aacfd363:
307 | | 309 | |
308 o | 7:7bc2f5967f5e@default(draft) bk:[] add c 310 o | 7:7bc2f5967f5e@default(draft) bk:[] add c
309 | | 311 | |
312 o 5:66719795a494@default(public) bk:[changea] changea 314 o 5:66719795a494@default(public) bk:[changea] changea
313 | 315 |
314 o 0:07f494440405@default(public) bk:[] adda 316 o 0:07f494440405@default(public) bk:[] adda
315 317
316 $ hg summary 318 $ hg summary
317 parent: 15:4d6ed26797bc tip 319 parent: 15:f344982e63c4 tip
318 More addition 320 More addition
319 branch: default 321 branch: default
320 commit: (clean) 322 commit: (clean)
321 update: 2 new changesets, 2 branch heads (merge) 323 update: 2 new changesets, 2 branch heads (merge)
322 phases: 3 draft 324 phases: 3 draft
323 $ hg export . 325 $ hg export .
324 # HG changeset patch 326 # HG changeset patch
325 # User test 327 # User test
326 # Date 0 0 328 # Date 0 0
327 # Thu Jan 01 00:00:00 1970 +0000 329 # Thu Jan 01 00:00:00 1970 +0000
328 # Node ID 4d6ed26797bc392c0099e48402a5134e669f1a60 330 # Node ID f344982e63c462b1e44c0371c804685389e673a9
329 # Parent 7bc2f5967f5e4ed277f60a89b7b04cc5d6407ced 331 # Parent 7bc2f5967f5e4ed277f60a89b7b04cc5d6407ced
330 More addition 332 More addition
331 333
332 diff -r 7bc2f5967f5e -r 4d6ed26797bc a 334 diff -r 7bc2f5967f5e -r f344982e63c4 a
333 --- a/a Thu Jan 01 00:00:00 1970 +0000 335 --- a/a Thu Jan 01 00:00:00 1970 +0000
334 +++ b/a Thu Jan 01 00:00:00 1970 +0000 336 +++ b/a Thu Jan 01 00:00:00 1970 +0000
335 @@ -1,1 +1,9 @@ 337 @@ -1,1 +1,9 @@
336 +jungle 338 +jungle
337 a 339 a
347 ------------------------------------------------- 349 -------------------------------------------------
348 350
349 $ hg up --hidden 3932c176bbaa 351 $ hg up --hidden 3932c176bbaa
350 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 352 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
351 updated to hidden changeset 3932c176bbaa 353 updated to hidden changeset 3932c176bbaa
352 (hidden revision '3932c176bbaa' was rewritten as: 4d6ed26797bc) 354 (hidden revision '3932c176bbaa' was rewritten as: f344982e63c4)
353 working directory parent is obsolete! (3932c176bbaa) 355 working directory parent is obsolete! (3932c176bbaa)
354 (use 'hg evolve' to update to its successor: 4d6ed26797bc) 356 (use 'hg evolve' to update to its successor: f344982e63c4)
355 $ echo 'gotta break' >> a 357 $ echo 'gotta break' >> a
356 $ hg amend 358 $ hg amend
357 2 new content-divergent changesets 359 2 new content-divergent changesets
358 # reamend so that the case is not the first precursor. 360 # reamend so that the case is not the first precursor.
359 $ hg amend -m "More addition (2)" 361 $ hg amend -m "More addition (2)"
362 17: draft 364 17: draft
363 365
364 $ glog 366 $ glog
365 @ 17:0b336205a5d0@default(draft) bk:[] More addition (2) 367 @ 17:0b336205a5d0@default(draft) bk:[] More addition (2)
366 | 368 |
367 | * 15:4d6ed26797bc@default(draft) bk:[] More addition 369 | * 15:f344982e63c4@default(draft) bk:[] More addition
368 |/ 370 |/
369 | o 11:8fc63fe1f297@default(draft) bk:[] phase-divergent update to 1cf0aacfd363: 371 | o 11:8fc63fe1f297@default(draft) bk:[] phase-divergent update to 1cf0aacfd363:
370 | | 372 | |
371 o | 7:7bc2f5967f5e@default(draft) bk:[] add c 373 o | 7:7bc2f5967f5e@default(draft) bk:[] add c
372 | | 374 | |
377 o 0:07f494440405@default(public) bk:[] adda 379 o 0:07f494440405@default(public) bk:[] adda
378 380
379 381
380 $ hg evolve -qn --content-divergent 382 $ hg evolve -qn --content-divergent
381 hg update -c 0b336205a5d0 && 383 hg update -c 0b336205a5d0 &&
382 hg merge 4d6ed26797bc && 384 hg merge f344982e63c4 &&
383 hg commit -m "auto merge resolving conflict between 0b336205a5d0 and 4d6ed26797bc"&& 385 hg commit -m "auto merge resolving conflict between 0b336205a5d0 and f344982e63c4"&&
384 hg up -C 3932c176bbaa && 386 hg up -C 3932c176bbaa &&
385 hg revert --all --rev tip && 387 hg revert --all --rev tip &&
386 hg commit -m "`hg log -r 0b336205a5d0 --template={desc}`"; 388 hg commit -m "`hg log -r 0b336205a5d0 --template={desc}`";
387 $ hg evolve --content-divergent 389 $ hg evolve --content-divergent
388 merge:[17] More addition (2) 390 merge:[17] More addition (2)
389 with: [15] More addition 391 with: [15] More addition
390 base: [12] More addition 392 base: [12] More addition
391 merging "other" content-divergent changeset '4d6ed26797bc' 393 merging "other" content-divergent changeset 'f344982e63c4'
392 merging a 394 merging a
393 warning: conflicts while merging a! (edit, then use 'hg resolve --mark') 395 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
394 0 files updated, 0 files merged, 0 files removed, 1 files unresolved 396 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
395 abort: fix conflicts and run 'hg evolve --continue' or use 'hg update -C .' to abort 397 abort: fix conflicts and run 'hg evolve --continue' or use 'hg update -C .' to abort
396 [255] 398 [255]
409 411
410 $ hg resolve -m 412 $ hg resolve -m
411 (no more unresolved files) 413 (no more unresolved files)
412 continue: hg evolve --continue 414 continue: hg evolve --continue
413 $ hg evolve --continue 415 $ hg evolve --continue
414 working directory is now at e8746835a2a1 416 working directory is now at e015aa78acee
415 $ glog 417 $ glog
416 @ 18:e8746835a2a1@default(draft) bk:[] More addition (2) 418 @ 18:e015aa78acee@default(draft) bk:[] More addition (2)
417 | 419 |
418 | o 11:8fc63fe1f297@default(draft) bk:[] phase-divergent update to 1cf0aacfd363: 420 | o 11:8fc63fe1f297@default(draft) bk:[] phase-divergent update to 1cf0aacfd363:
419 | | 421 | |
420 o | 7:7bc2f5967f5e@default(draft) bk:[] add c 422 o | 7:7bc2f5967f5e@default(draft) bk:[] add c
421 | | 423 | |
428 $ hg exp 430 $ hg exp
429 # HG changeset patch 431 # HG changeset patch
430 # User test 432 # User test
431 # Date 0 0 433 # Date 0 0
432 # Thu Jan 01 00:00:00 1970 +0000 434 # Thu Jan 01 00:00:00 1970 +0000
433 # Node ID e8746835a2a13122bc8c0ed84fe4ee35649af25d 435 # Node ID e015aa78acee692d26215fafdb7f70974682739c
434 # Parent 7bc2f5967f5e4ed277f60a89b7b04cc5d6407ced 436 # Parent 7bc2f5967f5e4ed277f60a89b7b04cc5d6407ced
435 More addition (2) 437 More addition (2)
436 438
437 diff -r 7bc2f5967f5e -r e8746835a2a1 a 439 diff -r 7bc2f5967f5e -r e015aa78acee a
438 --- a/a Thu Jan 01 00:00:00 1970 +0000 440 --- a/a Thu Jan 01 00:00:00 1970 +0000
439 +++ b/a Thu Jan 01 00:00:00 1970 +0000 441 +++ b/a Thu Jan 01 00:00:00 1970 +0000
440 @@ -1,1 +1,9 @@ 442 @@ -1,1 +1,9 @@
441 +jungle 443 +jungle
442 a 444 a