comparison tests/test-evolve-content-divergent-stack.t @ 4991:2928f35023a1 stable

evolve: make sure divergence resolution doesn't undo changes (issue6203) Before this patch, in content-divergence resolution logic if resolution parent is not the parent of any of the two divergent changesets then it could undo some changes introduced by previous revs (while resolving stack of content-divergent changesets) as demonstrated by the test added in previous patch. To solve this, what this patch doing is: if divergent cset has obsolete parent with a successor then first resolve the "orphan" instability of divergent cset by relocating, then perform the content-divergence resolution. After this change in logic, I found that it's kind of more correct as reflected by the changes in tests/test-evolve-content-divergent-corner-cases.t where it prevented creating conflicts while merging. Changes in tests/test-evolve-content-divergent-stack.t demonstrate the fixed behaviour. Next patches will be covering the `evolve --continue` case for the relocation of "divergent" cset.
author Sushil khanchi <sushilkhanchi97@gmail.com>
date Sat, 23 Nov 2019 16:17:04 +0530
parents f3fd3c1c3da0
children e0b5ce458af5
comparison
equal deleted inserted replaced
4990:f3fd3c1c3da0 4991:2928f35023a1
145 base: [1] added a 145 base: [1] added a
146 0 files updated, 0 files merged, 0 files removed, 0 files unresolved 146 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
147 merge:[6] added b 147 merge:[6] added b
148 with: [10] added b 148 with: [10] added b
149 base: [2] added b 149 base: [2] added b
150 rebasing "divergent" content-divergent changeset d5f148423c16 on f66f262fff6c
150 0 files updated, 0 files merged, 0 files removed, 0 files unresolved 151 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
151 merge:[7] added c 152 merge:[7] added c
152 with: [11] added c 153 with: [11] added c
153 base: [3] added c 154 base: [3] added c
155 rebasing "divergent" content-divergent changeset 3ce4be6d8e5e on eadfd9d70680
154 0 files updated, 0 files merged, 0 files removed, 0 files unresolved 156 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
155 merge:[8] added d 157 merge:[8] added d
156 with: [12] added d 158 with: [12] added d
157 base: [4] added d 159 base: [4] added d
160 rebasing "divergent" content-divergent changeset c72d2885eb51 on b2cac10f3836
158 0 files updated, 0 files merged, 0 files removed, 0 files unresolved 161 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
159 working directory is now at f66f262fff6c 162 working directory is now at f66f262fff6c
160 163
161 $ hg glog 164 $ hg glog
162 o 16:038fe7db3d88 added d 165 o 19:038fe7db3d88 added d
163 | () [default] draft 166 | () [default] draft
164 o 15:b2cac10f3836 added c 167 o 17:b2cac10f3836 added c
165 | () [default] draft 168 | () [default] draft
166 o 14:eadfd9d70680 added b 169 o 15:eadfd9d70680 added b
167 | () [default] draft 170 | () [default] draft
168 @ 13:f66f262fff6c watbar to a 171 @ 13:f66f262fff6c watbar to a
169 | () [default] draft 172 | () [default] draft
170 o 0:8fa14d15e168 added hgignore 173 o 0:8fa14d15e168 added hgignore
171 () [default] draft 174 () [default] draft
313 rebasing "other" content-divergent changeset 8e222f257bbf on 2228e3b74514 316 rebasing "other" content-divergent changeset 8e222f257bbf on 2228e3b74514
314 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 317 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
315 merge:[11] added b 318 merge:[11] added b
316 with: [6] added b 319 with: [6] added b
317 base: [2] added b 320 base: [2] added b
318 rebasing "other" content-divergent changeset d5f148423c16 on c04ff147ef79 321 rebasing "divergent" content-divergent changeset 6eb54b5af3fb on 74fbf3e6a0b6
322 rebasing "other" content-divergent changeset d5f148423c16 on 74fbf3e6a0b6
319 0 files updated, 0 files merged, 0 files removed, 0 files unresolved 323 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
320 merge:[12] added c 324 merge:[12] added c
321 with: [7] added c 325 with: [7] added c
322 base: [3] added c 326 base: [3] added c
323 rebasing "other" content-divergent changeset 3ce4be6d8e5e on 6eb54b5af3fb 327 rebasing "divergent" content-divergent changeset 8ed612937375 on 4e29776e83a5
328 rebasing "other" content-divergent changeset 3ce4be6d8e5e on 4e29776e83a5
324 0 files updated, 0 files merged, 0 files removed, 0 files unresolved 329 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
325 merge:[13] added d 330 merge:[13] added d
326 with: [8] added d 331 with: [8] added d
327 base: [4] added d 332 base: [4] added d
328 rebasing "other" content-divergent changeset c72d2885eb51 on 8ed612937375 333 rebasing "divergent" content-divergent changeset d45f050514c2 on 77126af93a25
334 rebasing "other" content-divergent changeset c72d2885eb51 on 77126af93a25
329 0 files updated, 0 files merged, 0 files removed, 0 files unresolved 335 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
330 working directory is now at 74fbf3e6a0b6 336 working directory is now at 74fbf3e6a0b6
331 337
332 $ hg glog 338 $ hg glog
333 o 21:5f7a38bdb75c added d 339 o 24:c8f73c376a6e added d
334 | () [default] draft 340 | () [default] draft
335 o 19:9865d598f0e0 added c 341 o 21:77126af93a25 added c
336 | () [default] draft 342 | () [default] draft
337 o 17:ac70b8c8eb63 added b 343 o 18:4e29776e83a5 added b
338 | () [default] draft 344 | () [default] draft
339 @ 15:74fbf3e6a0b6 watbar to a 345 @ 15:74fbf3e6a0b6 watbar to a
340 | () [default] draft 346 | () [default] draft
341 o 9:2228e3b74514 add newfile 347 o 9:2228e3b74514 add newfile
342 | () [default] draft 348 | () [default] draft
471 rebasing "other" content-divergent changeset 5b2d00df9c4e on 980f7dc84c29 477 rebasing "other" content-divergent changeset 5b2d00df9c4e on 980f7dc84c29
472 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 478 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
473 merge:[7] c 479 merge:[7] c
474 with: [4] c 480 with: [4] c
475 base: [2] c 481 base: [2] c
476 rebasing "other" content-divergent changeset fef59171875e on fe788ccf5416 482 rebasing "divergent" content-divergent changeset ef4885dea3da on 0999c349998d
483 rebasing "other" content-divergent changeset fef59171875e on 0999c349998d
477 0 files updated, 0 files merged, 0 files removed, 0 files unresolved 484 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
478 485
479 Expected result: 486 Expected result:
480 Changeset with description "b" only adds file "b" with content "b without typo". 487 Changeset with description "b" only adds file "b" with content "b without typo".
481 Changeset with description "c" only adds file "c" with content "c". 488 Changeset with description "c" only adds file "c" with content "c".
482 489
483 Actual result:
484 In addition, changeset with description "c" also changes the content of file
485 "b" from "b without typo" to "b with typo" (undoing the changes introduced by the amend).
486 $ hg glog -l2 -p 490 $ hg glog -l2 -p
487 o 11:344b9ba79c10 c 491 o 12:4ca627f76da9 c
488 | () [default] draftdiff -r 0999c349998d -r 344b9ba79c10 b 492 | () [default] draftdiff -r 0999c349998d -r 4ca627f76da9 c
489 | --- a/b Thu Jan 01 00:00:00 1970 +0000
490 | +++ b/b Thu Jan 01 00:00:00 1970 +0000
491 | @@ -1,1 +1,1 @@
492 | -b without typo
493 | +b with typo
494 | diff -r 0999c349998d -r 344b9ba79c10 c
495 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 493 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000
496 | +++ b/c Thu Jan 01 00:00:00 1970 +0000 494 | +++ b/c Thu Jan 01 00:00:00 1970 +0000
497 | @@ -0,0 +1,1 @@ 495 | @@ -0,0 +1,1 @@
498 | +c 496 | +c
499 | 497 |