##// 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 ('e', 'edit', None, _('invoke editor on commit messages')),
36 ('e', 'edit', None, _('invoke editor on commit messages')),
37 ('i', 'interactive', None, _('use interactive mode')),
37 ('i', 'interactive', None, _('use interactive mode')),
38 ('n', 'note', '', _('store a note on the amend')),
38 ('n', 'note', '', _('store a note on the amend')),
39 ('D', 'currentdate', False,
39 ('D', 'currentdate', None,
40 _('record the current date as commit date')),
40 _('record the current date as commit date')),
41 ] + cmdutil.walkopts + cmdutil.commitopts + cmdutil.commitopts2,
41 ] + cmdutil.walkopts + cmdutil.commitopts + cmdutil.commitopts2,
42 _('[OPTION]... [FILE]...'),
42 _('[OPTION]... [FILE]...'),
@@ -2450,7 +2450,8 b' def amend(ui, repo, old, extra, pats, op'
2450 date = dateutil.parsedate(opts.get('date'))
2450 date = dateutil.parsedate(opts.get('date'))
2451 elif opts.get('currentdate'):
2451 elif opts.get('currentdate'):
2452 date = dateutil.makedate()
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 date = dateutil.makedate()
2455 date = dateutil.makedate()
2455 datemaydiffer = True
2456 datemaydiffer = True
2456 else:
2457 else:
@@ -453,6 +453,14 b' Unlike rewrite.update-timestamp, -D/--cu'
453 date: Thu Jan 01 00:00:05 1970 +0000
453 date: Thu Jan 01 00:00:05 1970 +0000
454 summary: commit 1
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 Bad combination of date options:
464 Bad combination of date options:
457
465
458 $ hg amend -D --date '0 0'
466 $ hg amend -D --date '0 0'
General Comments 0
You need to be logged in to leave comments. Login now