diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -2191,7 +2191,7 @@ else: break else: - raise error.ParseError(_('invalid date: %r') % date) + raise error.ParseError(_('invalid date: %s') % shellquote(date)) # validate explicit (probably user-specified) date and # time zone offset. values must fit in signed 32 bits for # current 32-bit linux runtimes. timezones go from UTC-12 diff --git a/tests/test-commit.t b/tests/test-commit.t --- a/tests/test-commit.t +++ b/tests/test-commit.t @@ -18,7 +18,7 @@ hg: parse error: impossible time zone offset: 4444444 [255] $ hg commit -d '1 15.1' -m commit-4 - hg: parse error: invalid date: '1\t15.1' + hg: parse error: invalid date: '1 15.1' [255] $ hg commit -d 'foo bar' -m commit-5 hg: parse error: invalid date: 'foo bar' diff --git a/tests/test-revset.t b/tests/test-revset.t --- a/tests/test-revset.t +++ b/tests/test-revset.t @@ -413,7 +413,7 @@ hg: parse error: invalid \x escape [255] $ log 'date(tip)' - hg: parse error: invalid date: 'tip' + hg: parse error: invalid date: tip [255] $ log '0:date' abort: unknown revision 'date'!