comparison tests/test-evolve-content-divergent-case-A4.t @ 5572:d7d954b6d518

evolve: remove swapping nodes logic while resolving divergence Before this patch, while solving content-divergence if one of the divergent cset need to relocate to resolution parent we used to set that cset to "other" side; so it was like we are always going to relocate "other" side which made us to swap the two if "divergent" cset need to relocate. Above mentioned solution for relocating cset was not good and led us to incorrect output in some cases. So this patch, simplify the logic and remove the swapping thing and clearly depend on resolution parent to check if any of the divergent cset needs to relocate. This also means that now in some cases if both the divergent csets needs to relocate, both will be relocated. Even before this patch, there are some cases where both the divergent csets relocated but not in every case where it should have. Coming to the changes in test files: 1) changes in order of merging the two divergent csets is due to fact that now "divergent" and "other" are not swapped and hence "divergent" will be at local side and "other" will be at "other", which also results in change in the hash id for some cases. 2) extra changesets: which is the result of the fact that now we don't miss any case where both the divergent csets should be based on resolution parent before performing the merge -> which caught some cases and performed relocation, hence extra changesets. Although you can find that there is no changes in file content because of these relocation, but I remember loosing some data because of not relocating the "divergent", so why leave any risk out there by not relocating "other" to the resolution parent.
author Sushil khanchi <sushilkhanchi97@gmail.com>
date Sun, 20 Sep 2020 09:22:04 +0530
parents 5c08b3bec031
children c2fab88e6d60
comparison
equal deleted inserted replaced
5571:b2de5825e5ca 5572:d7d954b6d518
175 o 1:f5bc6836db60 (draft): A 175 o 1:f5bc6836db60 (draft): A
176 | 176 |
177 o 0:a9bdc8b26820 (public): O 177 o 0:a9bdc8b26820 (public): O
178 178
179 $ hg evolve --content-divergent 179 $ hg evolve --content-divergent
180 merge:[6] D 180 merge:[5] D
181 with: [5] D 181 with: [6] D
182 base: [4] D 182 base: [4] D
183 rebasing "other" content-divergent changeset 5d3fd66cb347 on d90aa47aa5d3 183 rebasing "divergent" content-divergent changeset 5d3fd66cb347 on d90aa47aa5d3
184 0 files updated, 0 files merged, 0 files removed, 0 files unresolved 184 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
185 working directory is now at 898f6bbfb21e 185 working directory is now at b2ef9cafa8ac
186 186
187 $ hg log -G 187 $ hg log -G
188 @ 8:898f6bbfb21e (draft): D 188 @ 8:b2ef9cafa8ac (draft): D
189 | 189 |
190 o 3:d90aa47aa5d3 (draft): C 190 o 3:d90aa47aa5d3 (draft): C
191 | 191 |
192 o 2:f6fbb35d8ac9 (draft): B 192 o 2:f6fbb35d8ac9 (draft): B
193 | 193 |