comparison tests/test-rewind.t @ 3861:bbe635dfd75c

rewind: obsolete latest successors unless instructed otherwise To prevent the creations of divergence, we automatically mark the successors set of the rewinded changeset as obsoleted by the rewind result. A new flag `--as-divergence` is added to disable this behavior.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sun, 17 Jun 2018 00:15:18 +0200
parents fa184c5edfe8
children 8d3eed113b77
comparison
equal deleted inserted replaced
3860:fa184c5edfe8 3861:bbe635dfd75c
258 258
259 259
260 Actual rewind 260 Actual rewind
261 ````````````` 261 `````````````
262 262
263 $ hg rewind --hidden --to 'desc("c_B0")' 263 $ hg rewind --hidden --to 'desc("c_B0")' --as-divergence
264 2 new content-divergent changesets 264 2 new content-divergent changesets
265 rewinded to 1 changesets 265 rewinded to 1 changesets
266 $ hg debugobsolete 266 $ hg debugobsolete
267 7e594302a05d3769b27be88fc3cdfd39d7498498 25c8f5ab0c3bb569ec672570f1a901be4c6f032b 0 (Thu Jan 01 00:00:01 1970 +0000) {'ef1': '9', 'operation': 'amend', 'user': 'test'} 267 7e594302a05d3769b27be88fc3cdfd39d7498498 25c8f5ab0c3bb569ec672570f1a901be4c6f032b 0 (Thu Jan 01 00:00:01 1970 +0000) {'ef1': '9', 'operation': 'amend', 'user': 'test'}
268 7e594302a05d3769b27be88fc3cdfd39d7498498 48acf2c0d9c8961859ce9a913671eb2adc9b057b 4 (Thu Jan 01 00:00:01 1970 +0000) {'ef1': '34', 'operation': 'rewind', 'user': 'test'} 268 7e594302a05d3769b27be88fc3cdfd39d7498498 48acf2c0d9c8961859ce9a913671eb2adc9b057b 4 (Thu Jan 01 00:00:01 1970 +0000) {'ef1': '34', 'operation': 'rewind', 'user': 'test'}
353 o changeset: 0:eba9c2249fe7 353 o changeset: 0:eba9c2249fe7
354 user: test 354 user: test
355 date: Thu Jan 01 00:00:00 1970 +0000 355 date: Thu Jan 01 00:00:00 1970 +0000
356 summary: c_ROOT 356 summary: c_ROOT
357 357
358 $ echo 'default-date = 2 0' >> $HGRCPATH
359
360 rewind a simple amend - obsoleting the current latest successors
361 ----------------------------------------------------------------
362
363 $ hg rewind --hidden --to 'min(desc("c_B0"))'
364 rewinded to 1 changesets
365 $ hg debugobsolete
366 7e594302a05d3769b27be88fc3cdfd39d7498498 25c8f5ab0c3bb569ec672570f1a901be4c6f032b 0 (Thu Jan 01 00:00:01 1970 +0000) {'ef1': '9', 'operation': 'amend', 'user': 'test'}
367 7e594302a05d3769b27be88fc3cdfd39d7498498 48acf2c0d9c8961859ce9a913671eb2adc9b057b 4 (Thu Jan 01 00:00:01 1970 +0000) {'ef1': '34', 'operation': 'rewind', 'user': 'test'}
368 48acf2c0d9c8961859ce9a913671eb2adc9b057b 0 {579f120ba91885449adc92eedf48ef3569742cee} (Thu Jan 01 00:00:01 1970 +0000) {'ef1': '0', 'operation': 'prune', 'user': 'test'}
369 7e594302a05d3769b27be88fc3cdfd39d7498498 d8b4471cfb3caa290e0a78ae6bc57d78656c9075 4 (Thu Jan 01 00:00:02 1970 +0000) {'ef1': '34', 'operation': 'rewind', 'user': 'test'}
370 25c8f5ab0c3bb569ec672570f1a901be4c6f032b d8b4471cfb3caa290e0a78ae6bc57d78656c9075 0 (Thu Jan 01 00:00:02 1970 +0000) {'ef1': '43', 'operation': 'rewind', 'user': 'test'}
371 $ hg obslog --rev 'desc("c_B0")'
372 o d8b4471cfb3c (5) c_B0
373 |\
374 @ | 25c8f5ab0c3b (3) c_B1
375 |/ rewritten(description, meta, date, content) as d8b4471cfb3c using rewind by test (Thu Jan 01 00:00:02 1970 +0000)
376 |
377 x 7e594302a05d (2) c_B0
378 rewritten(description, content) as 25c8f5ab0c3b using amend by test (Thu Jan 01 00:00:01 1970 +0000)
379 rewritten(meta, date) as 48acf2c0d9c8 using rewind by test (Thu Jan 01 00:00:01 1970 +0000)
380 rewritten(meta, date) as d8b4471cfb3c using rewind by test (Thu Jan 01 00:00:02 1970 +0000)
381
382 $ hg log -G
383 o changeset: 5:d8b4471cfb3c
384 | tag: tip
385 | parent: 1:579f120ba918
386 | user: test
387 | date: Thu Jan 01 00:00:02 1970 +0000
388 | summary: c_B0
389 |
390 | @ changeset: 3:25c8f5ab0c3b
391 |/ parent: 1:579f120ba918
392 | user: test
393 | date: Thu Jan 01 00:00:00 1970 +0000
394 | obsolete: rewritten using rewind as 5:d8b4471cfb3c
395 | summary: c_B1
396 |
397 o changeset: 1:579f120ba918
398 | user: test
399 | date: Thu Jan 01 00:00:00 1970 +0000
400 | summary: c_A0
401 |
402 o changeset: 0:eba9c2249fe7
403 user: test
404 date: Thu Jan 01 00:00:00 1970 +0000
405 summary: c_ROOT
406
407 $ hg log -G --hidden
408 o changeset: 5:d8b4471cfb3c
409 | tag: tip
410 | parent: 1:579f120ba918
411 | user: test
412 | date: Thu Jan 01 00:00:02 1970 +0000
413 | summary: c_B0
414 |
415 | x changeset: 4:48acf2c0d9c8
416 |/ parent: 1:579f120ba918
417 | user: test
418 | date: Thu Jan 01 00:00:01 1970 +0000
419 | obsolete: pruned using prune
420 | summary: c_B0
421 |
422 | @ changeset: 3:25c8f5ab0c3b
423 |/ parent: 1:579f120ba918
424 | user: test
425 | date: Thu Jan 01 00:00:00 1970 +0000
426 | obsolete: rewritten using rewind as 5:d8b4471cfb3c
427 | summary: c_B1
428 |
429 | x changeset: 2:7e594302a05d
430 |/ user: test
431 | date: Thu Jan 01 00:00:00 1970 +0000
432 | obsolete: rewritten using rewind as 5:d8b4471cfb3c
433 | obsolete: rewritten using rewind as 4:48acf2c0d9c8
434 | obsolete: rewritten using amend as 3:25c8f5ab0c3b
435 | summary: c_B0
436 |
437 o changeset: 1:579f120ba918
438 | user: test
439 | date: Thu Jan 01 00:00:00 1970 +0000
440 | summary: c_A0
441 |
442 o changeset: 0:eba9c2249fe7
443 user: test
444 date: Thu Jan 01 00:00:00 1970 +0000
445 summary: c_ROOT
446