##// END OF EJS Templates
amend: turn currentdate into tri-state bool so config option can be negated...
Yuya Nishihara -
r41209:4145fd35 default
parent child Browse files
Show More
@@ -36,7 +36,7 b' command = registrar.command(cmdtable)'
36 36 ('e', 'edit', None, _('invoke editor on commit messages')),
37 37 ('i', 'interactive', None, _('use interactive mode')),
38 38 ('n', 'note', '', _('store a note on the amend')),
39 ('D', 'currentdate', False,
39 ('D', 'currentdate', None,
40 40 _('record the current date as commit date')),
41 41 ] + cmdutil.walkopts + cmdutil.commitopts + cmdutil.commitopts2,
42 42 _('[OPTION]... [FILE]...'),
@@ -2450,7 +2450,8 b' def amend(ui, repo, old, extra, pats, op'
2450 2450 date = dateutil.parsedate(opts.get('date'))
2451 2451 elif opts.get('currentdate'):
2452 2452 date = dateutil.makedate()
2453 elif ui.configbool('rewrite', 'update-timestamp'):
2453 elif (ui.configbool('rewrite', 'update-timestamp')
2454 and opts.get('currentdate') is None):
2454 2455 date = dateutil.makedate()
2455 2456 datemaydiffer = True
2456 2457 else:
@@ -453,6 +453,14 b' Unlike rewrite.update-timestamp, -D/--cu'
453 453 date: Thu Jan 01 00:00:05 1970 +0000
454 454 summary: commit 1
455 455
456 rewrite.update-timestamp can be negated by --no-currentdate
457
458 $ hg amend --config rewrite.update-timestamp=True --no-currentdate -u baz
459 $ hg log --limit 1
460 user: baz
461 date: Thu Jan 01 00:00:05 1970 +0000
462 summary: commit 1
463
456 464 Bad combination of date options:
457 465
458 466 $ hg amend -D --date '0 0'
General Comments 0
You need to be logged in to leave comments. Login now