From patchwork Tue Sep 12 18:23:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D691: cmdutil: fix amend when passing a date From: phabricator X-Patchwork-Id: 23816 Message-Id: <3b2349e569978905e8e87983ee6d9e13@localhost.localdomain> To: mercurial-devel@mercurial-scm.org Date: Tue, 12 Sep 2017 18:23:04 +0000 This revision was automatically updated to reflect the committed changes. Closed by commit rHGae95853c250a: cmdutil: fix amend when passing a date (authored by lothiraldan, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D691?vs=1763&id=1765 REVISION DETAIL https://phab.mercurial-scm.org/D691 AFFECTED FILES mercurial/cmdutil.py tests/test-amend.t CHANGE DETAILS To: lothiraldan, #hg-reviewers, singhsrb Cc: singhsrb, mercurial-devel diff --git a/tests/test-amend.t b/tests/test-amend.t --- a/tests/test-amend.t +++ b/tests/test-amend.t @@ -85,6 +85,14 @@ nothing changed [1] + $ hg amend -d "0 0" + nothing changed + [1] + + $ hg amend -d "Thu Jan 01 00:00:00 1970 UTC" + nothing changed + [1] + Matcher and metadata options $ echo 3 > C diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -3059,6 +3059,9 @@ user = opts.get('user') or old.user() date = opts.get('date') or old.date() + # Parse the date to allow comparison between date and old.date() + date = util.parsedate(date) + if len(old.parents()) > 1: # ctx.files() isn't reliable for merges, so fall back to the # slower repo.status() method