# HG changeset patch # User Matt Mackall # Date 2006-12-06 19:13:26 # Node ID 92a3532a01d9ca58ceb0d3411d2464a9a5015534 # Parent 299d6cce6c0b3cbcd5f47078ba3239c0673b4d32 parsedate: use Abort rather than ValueError diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -1079,17 +1079,15 @@ def parsedate(string, formats=None): else: break else: - raise ValueError(_('invalid date: %r ' - 'see hg(1) manual page for details') - % string) + raise Abort(_('invalid date: %r ') % string) # 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 # to UTC+14 if abs(when) > 0x7fffffff: - raise ValueError(_('date exceeds 32 bits: %d') % when) + raise Abort(_('date exceeds 32 bits: %d') % when) if offset < -50400 or offset > 43200: - raise ValueError(_('impossible time zone offset: %d') % offset) + raise Abort(_('impossible time zone offset: %d') % offset) return when, offset def shortuser(user): diff --git a/tests/test-parse-date.out b/tests/test-parse-date.out --- a/tests/test-parse-date.out +++ b/tests/test-parse-date.out @@ -3,7 +3,7 @@ changeset 3:107ce1ee2b43 backs out chang merging with changeset 2:e6c3abc120e7 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) -abort: invalid date: 'should fail' see hg(1) manual page for details +abort: invalid date: 'should fail' transaction abort! rollback completed abort: date exceeds 32 bits: 100000000000000000