comparison tests/test-amend.t @ 41125:126101284e04

amend: add -D/--currentdate option It bumps the date field even if there's no other change. The help text is copied from commands.graft(). Unlike graft, --date with --currentdate is disallowed, which I think is saner behavior.
author Yuya Nishihara <yuya@tcha.org>
date Mon, 07 Jan 2019 21:43:06 +0900
parents 14271b524d76
children 4145fd3569c3
comparison
equal deleted inserted replaced
41124:cffa8e0ba77a 41125:126101284e04
436 $ hg amend --date '1998-1-1 0:1' --config rewrite.update-timestamp=True 436 $ hg amend --date '1998-1-1 0:1' --config rewrite.update-timestamp=True
437 $ hg log --limit 1 437 $ hg log --limit 1
438 user: foobar 438 user: foobar
439 date: Thu Jan 01 00:01:00 1998 +0000 439 date: Thu Jan 01 00:01:00 1998 +0000
440 summary: commit 1 440 summary: commit 1
441
442 Unlike rewrite.update-timestamp, -D/--currentdate always updates the timestamp
443
444 $ hg amend -D
445 $ hg log --limit 1
446 user: foobar
447 date: Thu Jan 01 00:00:04 1970 +0000
448 summary: commit 1
449
450 $ hg amend -D --config rewrite.update-timestamp=True
451 $ hg log --limit 1
452 user: foobar
453 date: Thu Jan 01 00:00:05 1970 +0000
454 summary: commit 1
455
456 Bad combination of date options:
457
458 $ hg amend -D --date '0 0'
459 abort: --date and --currentdate are mutually exclusive
460 [255]
461
462 $ cd ..