comparison tests/test-commit-amend.t @ 17475:63e45aee46d4

amend: add obsolete support If the obsolete feature is enabled, `hg commit --amend` marks a changeset as obsolete instead of stripping it.
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Tue, 11 Sep 2012 00:12:07 +0200
parents 9732473aa24b
children a8aba2921456
comparison
equal deleted inserted replaced
17474:f85816af6294 17475:63e45aee46d4
368 $ hg commit --amend -m 'amend for phase' -q 368 $ hg commit --amend -m 'amend for phase' -q
369 $ hg phase '.^::.' 369 $ hg phase '.^::.'
370 11: draft 370 11: draft
371 13: secret 371 13: secret
372 372
373 Test amend with obsolete
374 ---------------------------
375
376 Enable obsolete
377
378 $ cat > ${TESTTMP}/obs.py << EOF
379 > import mercurial.obsolete
380 > mercurial.obsolete._enabled = True
381 > EOF
382 $ echo '[extensions]' >> $HGRCPATH
383 $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH
384
385
386 Amend with no files changes
387
388 $ hg id -n
389 13
390 $ hg ci --amend -m 'babar'
391 $ hg id -n
392 14
393 $ hg log -Gl 3 --style=compact
394 @ 14[tip]:11 43df5a5434ad 1970-01-01 00:00 +0000 test
395 | babar
396 |
397 | o 12:0 2647734878ef 1970-01-01 00:00 +0000 test
398 | | fork
399 | |
400 o | 11 7e09f708a0e9 1970-01-01 00:00 +0000 test
401 | | a''
402 | |
403 $ hg log -Gl 4 --hidden --style=compact
404 @ 14[tip]:11 43df5a5434ad 1970-01-01 00:00 +0000 test
405 | babar
406 |
407 | x 13:11 175fafee6f44 1970-01-01 00:00 +0000 test
408 |/ amend for phase
409 |
410 | o 12:0 2647734878ef 1970-01-01 00:00 +0000 test
411 | | fork
412 | |
413 o | 11 7e09f708a0e9 1970-01-01 00:00 +0000 test
414 | | a''
415 | |
416
417 Amend with files changes
418
419 (note: the extra commit over 15 is a temporary junk I would be happy to get
420 ride of)
421
422 $ echo 'babar' >> a
423 $ hg commit --amend
424 $ hg log -Gl 6 --hidden --style=compact
425 @ 16[tip]:11 31e0a4a1b04a 1970-01-01 00:00 +0000 test
426 | babar
427 |
428 | x 15 053c696ada75 1970-01-01 00:00 +0000 test
429 | | temporary amend commit for 43df5a5434ad
430 | |
431 | x 14:11 43df5a5434ad 1970-01-01 00:00 +0000 test
432 |/ babar
433 |
434 | x 13:11 175fafee6f44 1970-01-01 00:00 +0000 test
435 |/ amend for phase
436 |
437 | o 12:0 2647734878ef 1970-01-01 00:00 +0000 test
438 | | fork
439 | |
440 o | 11 7e09f708a0e9 1970-01-01 00:00 +0000 test
441 | | a''
442 | |
443
444