comparison tests/test-evolve-content-divergent-case-A3.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 29366c95306d
children c2fab88e6d60
comparison
equal deleted inserted replaced
5571:b2de5825e5ca 5572:d7d954b6d518
171 o 1:f5bc6836db60 (draft): A 171 o 1:f5bc6836db60 (draft): A
172 | 172 |
173 o 0:a9bdc8b26820 (public): O 173 o 0:a9bdc8b26820 (public): O
174 174
175 $ hg evolve --content-divergent 175 $ hg evolve --content-divergent
176 merge:[5] C 176 merge:[4] C
177 with: [4] C 177 with: [5] C
178 base: [3] C 178 base: [3] C
179 rebasing "other" content-divergent changeset 710d96992b40 on f6fbb35d8ac9 179 rebasing "divergent" content-divergent changeset 710d96992b40 on f6fbb35d8ac9
180 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 180 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
181 working directory is now at 3ad062d48137 181 working directory is now at 8f91b97f6f9a
182 182
183 $ hg log -G 183 $ hg log -G
184 @ 7:3ad062d48137 (draft): C 184 @ 7:8f91b97f6f9a (draft): C
185 | 185 |
186 o 2:f6fbb35d8ac9 (draft): B 186 o 2:f6fbb35d8ac9 (draft): B
187 | 187 |
188 o 1:f5bc6836db60 (draft): A 188 o 1:f5bc6836db60 (draft): A
189 | 189 |
190 o 0:a9bdc8b26820 (public): O 190 o 0:a9bdc8b26820 (public): O
191 191
192 $ hg evolve -l 192 $ hg evolve -l
193 193
194 $ hg log -pl1 194 $ hg log -pl1
195 7:3ad062d48137 (draft): C 195 7:8f91b97f6f9a (draft): C
196 diff -r f6fbb35d8ac9 -r 3ad062d48137 C 196 diff -r f6fbb35d8ac9 -r 8f91b97f6f9a C
197 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 197 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
198 +++ b/C Thu Jan 01 00:00:00 1970 +0000 198 +++ b/C Thu Jan 01 00:00:00 1970 +0000
199 @@ -0,0 +1,1 @@ 199 @@ -0,0 +1,1 @@
200 +newC 200 +newC
201 201