D5483: amend:Added current time update config option(issue5828)

Yuya Nishihara yuya at tcha.org
Wed Dec 26 08:01:45 EST 2018


> +#if updatetime option is turned on
> +  $ hg amend --date '1997-1-1 0:1'

Use `--config` unless you need to re-run the whole tests with various options.

> +  $ hg log --limit 2
> +  # changeset:   40473:a092f9df5a43
> +  # branch:      stable
> +  # bookmark:    @
> +  # tag:         tip
> +  # parent:      40406:7b48c616431d
> +  # user:        Taapas Agrawal<taapas2897 at gmail.com>
> +  # date:        Wed Jan 01 00:01:00 1997 +0530
> +  # summary:     amend:Added current time update config option(issue5828)

Huh? What happened here?

> +coreconfigitem('experimental', 'updatetime',
> +    default=False,
> +)

Martin showed a better name. `rewrite.update-timestamp` sounds good to me.
(I don't know which is a proper term, `timestamp` or `time-stamp`.)

https://phab.mercurial-scm.org/D4876#74017

> +        update = ui.configbool('experimental','updatetime')
> +        if update==True:
> +            date=dateutil.parsedate(datetime.datetime.today().strftime("%Y-%m-%d %H:%M:%S"))

See `commands.graft()` for how to get a current timestamp.


More information about the Mercurial-devel mailing list