Mercurial > public > mercurial-scm > hg
comparison mercurial/cmdutil.py @ 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 | cffa8e0ba77a |
children | 4145fd3569c3 |
comparison
equal
deleted
inserted
replaced
41124:cffa8e0ba77a | 41125:126101284e04 |
---|---|
2441 extra.update(wctx.extra()) | 2441 extra.update(wctx.extra()) |
2442 | 2442 |
2443 user = opts.get('user') or old.user() | 2443 user = opts.get('user') or old.user() |
2444 | 2444 |
2445 datemaydiffer = False # date-only change should be ignored? | 2445 datemaydiffer = False # date-only change should be ignored? |
2446 if opts.get('date') and opts.get('currentdate'): | |
2447 raise error.Abort(_('--date and --currentdate are mutually ' | |
2448 'exclusive')) | |
2446 if opts.get('date'): | 2449 if opts.get('date'): |
2447 date = dateutil.parsedate(opts.get('date')) | 2450 date = dateutil.parsedate(opts.get('date')) |
2451 elif opts.get('currentdate'): | |
2452 date = dateutil.makedate() | |
2448 elif ui.configbool('rewrite', 'update-timestamp'): | 2453 elif ui.configbool('rewrite', 'update-timestamp'): |
2449 date = dateutil.makedate() | 2454 date = dateutil.makedate() |
2450 datemaydiffer = True | 2455 datemaydiffer = True |
2451 else: | 2456 else: |
2452 date = old.date() | 2457 date = old.date() |