Mercurial > public > mercurial-scm > hg
diff 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 |
line wrap: on
line diff
--- a/tests/test-amend.t Mon Jan 07 21:39:35 2019 +0900 +++ b/tests/test-amend.t Mon Jan 07 21:43:06 2019 +0900 @@ -438,3 +438,25 @@ user: foobar date: Thu Jan 01 00:01:00 1998 +0000 summary: commit 1 + +Unlike rewrite.update-timestamp, -D/--currentdate always updates the timestamp + + $ hg amend -D + $ hg log --limit 1 + user: foobar + date: Thu Jan 01 00:00:04 1970 +0000 + summary: commit 1 + + $ hg amend -D --config rewrite.update-timestamp=True + $ hg log --limit 1 + user: foobar + date: Thu Jan 01 00:00:05 1970 +0000 + summary: commit 1 + +Bad combination of date options: + + $ hg amend -D --date '0 0' + abort: --date and --currentdate are mutually exclusive + [255] + + $ cd ..