comparison tests/test-evolve-public-content-divergent.t @ 4385:34322fb3afca

evolve: add test for the case where public divergence on difference parents This test make sure that public divergence resolution also handle the case when divergentes changeset does not share the same parent at one end because one end simply rebase. The other side has actual an actual diff change. For now this would work only for the case when we need to relocate the mutable one. Other case is still left to work on.
author Sushil khanchi <sushilkhanchi97@gmail.com>
date Tue, 22 Jan 2019 18:40:10 +0530
parents 8993fd4805d0
children dcbe64c954dc
comparison
equal deleted inserted replaced
4384:8993fd4805d0 4385:34322fb3afca
187 | public 187 | public
188 | 188 |
189 o 0:9092f1db7931 added a 189 o 0:9092f1db7931 added a
190 public 190 public
191 191
192 Testing the case when divergence is not created by actual diff change, but because of rebasing:
193 ------------------------------------------------------------------------------------------------
194
195 Prepare the repo:
196
197 $ cd ..
198 $ hg init rebasediv
199 $ cd rebasediv
200 $ for ch in a b c; do
201 > echo $ch > $ch;
202 > hg ci -Am "added "$ch;
203 > done;
204 adding a
205 adding b
206 adding c
207
208 $ hg glog
209 @ 2:155349b645be added c
210 | draft
211 |
212 o 1:5f6d8a4bf34a added b
213 | draft
214 |
215 o 0:9092f1db7931 added a
216 draft
217
218
219 On server side: a new cset is added based on rev 1 and rev 2 is rebased on newly added cset:
220
221 $ hg up .^ -q
222 $ echo d > d
223 $ hg ci -Am "added d"
224 adding d
225 created new head
226
227 $ hg rebase -r 2 -d .
228 rebasing 2:155349b645be "added c"
229
230 $ hg glog
231 o 4:c0d7ee6604ea added c
232 | draft
233 |
234 @ 3:c9241b0f2d5b added d
235 | draft
236 |
237 o 1:5f6d8a4bf34a added b
238 | draft
239 |
240 o 0:9092f1db7931 added a
241 draft
242
243
244 On user side: user has not pulled yet and amended the rev 2 which created the divergence after pull:
245 $ hg up 2 --hidden -q
246 updated to hidden changeset 155349b645be
247 (hidden revision '155349b645be' was rewritten as: c0d7ee6604ea)
248 working directory parent is obsolete! (155349b645be)
249
250 $ echo cc >> c
251 $ hg ci --amend -m "updated c"
252 2 new content-divergent changesets
253
254 Lets change the phase to --public of branch which is pulled from server:
255 $ hg phase --public -r 4
256 $ hg glog -p
257 @ 5:f5f9b4fc8b77 updated c
258 | draft content-divergent
259 |
260 | diff -r 5f6d8a4bf34a -r f5f9b4fc8b77 c
261 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000
262 | +++ b/c Thu Jan 01 00:00:00 1970 +0000
263 | @@ -0,0 +1,2 @@
264 | +c
265 | +cc
266 |
267 | o 4:c0d7ee6604ea added c
268 | | public
269 | |
270 | | diff -r c9241b0f2d5b -r c0d7ee6604ea c
271 | | --- /dev/null Thu Jan 01 00:00:00 1970 +0000
272 | | +++ b/c Thu Jan 01 00:00:00 1970 +0000
273 | | @@ -0,0 +1,1 @@
274 | | +c
275 | |
276 | o 3:c9241b0f2d5b added d
277 |/ public
278 |
279 | diff -r 5f6d8a4bf34a -r c9241b0f2d5b d
280 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000
281 | +++ b/d Thu Jan 01 00:00:00 1970 +0000
282 | @@ -0,0 +1,1 @@
283 | +d
284 |
285 o 1:5f6d8a4bf34a added b
286 | public
287 |
288 | diff -r 9092f1db7931 -r 5f6d8a4bf34a b
289 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000
290 | +++ b/b Thu Jan 01 00:00:00 1970 +0000
291 | @@ -0,0 +1,1 @@
292 | +b
293 |
294 o 0:9092f1db7931 added a
295 public
296
297 diff -r 000000000000 -r 9092f1db7931 a
298 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
299 +++ b/a Thu Jan 01 00:00:00 1970 +0000
300 @@ -0,0 +1,1 @@
301 +a
302
303
304 Evolve:
305 $ hg evolve --content-divergent
306 merge:[4] added c
307 with: [5] updated c
308 base: [2] added c
309 rebasing "other" content-divergent changeset f5f9b4fc8b77 on c9241b0f2d5b
310 updating to "local" side of the conflict: c0d7ee6604ea
311 merging "other" content-divergent changeset 'c3d442d80993'
312 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
313 computing new diff
314 committed as 3b336cbee992
315 working directory is now at 3b336cbee992
316
317 $ hg glog -p
318 @ 8:3b336cbee992 phase-divergent update to c0d7ee6604ea:
319 | draft
320 |
321 | diff -r c0d7ee6604ea -r 3b336cbee992 c
322 | --- a/c Thu Jan 01 00:00:00 1970 +0000
323 | +++ b/c Thu Jan 01 00:00:00 1970 +0000
324 | @@ -1,1 +1,2 @@
325 | c
326 | +cc
327 |
328 o 4:c0d7ee6604ea added c
329 | public
330 |
331 | diff -r c9241b0f2d5b -r c0d7ee6604ea c
332 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000
333 | +++ b/c Thu Jan 01 00:00:00 1970 +0000
334 | @@ -0,0 +1,1 @@
335 | +c
336 |
337 o 3:c9241b0f2d5b added d
338 | public
339 |
340 | diff -r 5f6d8a4bf34a -r c9241b0f2d5b d
341 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000
342 | +++ b/d Thu Jan 01 00:00:00 1970 +0000
343 | @@ -0,0 +1,1 @@
344 | +d
345 |
346 o 1:5f6d8a4bf34a added b
347 | public
348 |
349 | diff -r 9092f1db7931 -r 5f6d8a4bf34a b
350 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000
351 | +++ b/b Thu Jan 01 00:00:00 1970 +0000
352 | @@ -0,0 +1,1 @@
353 | +b
354 |
355 o 0:9092f1db7931 added a
356 public
357
358 diff -r 000000000000 -r 9092f1db7931 a
359 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
360 +++ b/a Thu Jan 01 00:00:00 1970 +0000
361 @@ -0,0 +1,1 @@
362 +a
363
364 Check that we don't have any troubled cset now:
365 $ hg evolve -l