changeset 13886:fe48c57390f2

help/dates: use DATE as place-holder in help and abort texts The use of "{datetime}" was unfortunate since I as a user never knew if I was expected to do hg log -d '>{2011-04-01}' or hg log -d '>2011-04-01' The word "datetime" is also confusing -- calling it a date it much simpler.
author Martin Geisler <mg@aragost.com>
date Tue, 05 Apr 2011 10:01:39 +0200
parents 5d115ea4030b
children 06803dc5fc19
files mercurial/help/dates.txt mercurial/util.py tests/test-log.t tests/test-parse-date.t
diffstat 4 files changed, 16 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/help/dates.txt	Tue Apr 05 11:07:25 2011 +0200
+++ b/mercurial/help/dates.txt	Tue Apr 05 10:01:39 2011 +0200
@@ -30,7 +30,7 @@
 
 The log command also accepts date ranges:
 
-- ``<{datetime}`` - at or before a given date/time
-- ``>{datetime}`` - on or after a given date/time
-- ``{datetime} to {datetime}`` - a date range, inclusive
-- ``-{days}`` - within a given number of days of today
+- ``<DATE`` - at or before a given date/time
+- ``>DATE`` - on or after a given date/time
+- ``DATE to DATE`` - a date range, inclusive
+- ``-DAYS`` - within a given number of days of today
--- a/mercurial/util.py	Tue Apr 05 11:07:25 2011 +0200
+++ b/mercurial/util.py	Tue Apr 05 10:01:39 2011 +0200
@@ -1196,12 +1196,12 @@
         raise Abort(_("dates cannot consist entirely of whitespace"))
     elif date[0] == "<":
         if not date[1:]:
-            raise Abort(_("invalid day spec. use '<{datetime}' "))
+            raise Abort(_("invalid day spec, use '<DATE'"))
         when = upper(date[1:])
         return lambda x: x <= when
     elif date[0] == ">":
         if not date[1:]:
-            raise Abort(_("invalid day spec. use '>{datetime}' "))
+            raise Abort(_("invalid day spec, use '>DATE'"))
         when = lower(date[1:])
         return lambda x: x >= when
     elif date[0] == "-":
--- a/tests/test-log.t	Tue Apr 05 11:07:25 2011 +0200
+++ b/tests/test-log.t	Tue Apr 05 10:01:39 2011 +0200
@@ -525,13 +525,13 @@
 log -d ">"
 
   $ hg log -d ">"
-  abort: invalid day spec. use '>{datetime}' 
+  abort: invalid day spec, use '>DATE'
   [255]
 
 log -d "<"
 
   $ hg log -d "<"
-  abort: invalid day spec. use '<{datetime}' 
+  abort: invalid day spec, use '<DATE'
   [255]
 
 
--- a/tests/test-parse-date.t	Tue Apr 05 11:07:25 2011 +0200
+++ b/tests/test-parse-date.t	Tue Apr 05 10:01:39 2011 +0200
@@ -96,31 +96,31 @@
 Test date formats with '>' or '<' accompanied by space characters
 
   $ hg log -d '>' --template '{date|date}\n'
-  abort: invalid day spec. use '>{datetime}' 
+  abort: invalid day spec, use '>DATE'
   [255]
   $ hg log -d '<' hg log -d '>' --template '{date|date}\n'
-  abort: invalid day spec. use '>{datetime}' 
+  abort: invalid day spec, use '>DATE'
   [255]
 
   $ hg log -d ' >' --template '{date|date}\n'
-  abort: invalid day spec. use '>{datetime}' 
+  abort: invalid day spec, use '>DATE'
   [255]
   $ hg log -d ' <' --template '{date|date}\n'
-  abort: invalid day spec. use '<{datetime}' 
+  abort: invalid day spec, use '<DATE'
   [255]
 
   $ hg log -d '> ' --template '{date|date}\n'
-  abort: invalid day spec. use '>{datetime}' 
+  abort: invalid day spec, use '>DATE'
   [255]
   $ hg log -d '< ' --template '{date|date}\n'
-  abort: invalid day spec. use '<{datetime}' 
+  abort: invalid day spec, use '<DATE'
   [255]
 
   $ hg log -d ' > ' --template '{date|date}\n'
-  abort: invalid day spec. use '>{datetime}' 
+  abort: invalid day spec, use '>DATE'
   [255]
   $ hg log -d ' < ' --template '{date|date}\n'
-  abort: invalid day spec. use '<{datetime}' 
+  abort: invalid day spec, use '<DATE'
   [255]
 
   $ hg log -d '>02/01' --template '{date|date}\n'