# HG changeset patch # User Justin Peng # Date 1238602260 25200 # Node ID 8c6f823efcc93d8a6e6e2ec62c9fc41d91086d43 # Parent b214066b7e1dbcfec6d922f7184a8d049f933b98 Correct a bug on date formats with '>' or '<' accompanied by space characters. diff -r b214066b7e1d -r 8c6f823efcc9 mercurial/util.py --- a/mercurial/util.py Sun Mar 29 14:43:49 2009 +0200 +++ b/mercurial/util.py Wed Apr 01 09:11:00 2009 -0700 @@ -1315,6 +1315,7 @@ d["d"] = "28" return parsedate(date, extendeddateformats, d)[0] + date = date.strip() if date[0] == "<": when = upper(date[1:]) return lambda x: x <= when diff -r b214066b7e1d -r 8c6f823efcc9 tests/test-parse-date --- a/tests/test-parse-date Sun Mar 29 14:43:49 2009 +0200 +++ b/tests/test-parse-date Wed Apr 01 09:11:00 2009 -0700 @@ -43,3 +43,41 @@ hg debugdate "1000000000 16200" # -0430 hg debugdate "Sat Sep 08 21:16:40 2001 +0430" hg debugdate "Sat Sep 08 21:16:40 2001 -0430" + +#Test date formats with '>' or '<' accompanied by space characters +hg log -d '>' --template '{date|date}\n' +hg log -d '<' hg log -d '>' --template '{date|date}\n' + +hg log -d ' >' --template '{date|date}\n' +hg log -d ' <' --template '{date|date}\n' + +hg log -d '> ' --template '{date|date}\n' +hg log -d '< ' --template '{date|date}\n' + +hg log -d ' > ' --template '{date|date}\n' +hg log -d ' < ' --template '{date|date}\n' + + +hg log -d '>02/01' --template '{date|date}\n' +hg log -d '<02/01' --template '{date|date}\n' + +hg log -d ' >02/01' --template '{date|date}\n' +hg log -d ' <02/01' --template '{date|date}\n' + +hg log -d '> 02/01' --template '{date|date}\n' +hg log -d '< 02/01' --template '{date|date}\n' + +hg log -d ' > 02/01' --template '{date|date}\n' +hg log -d ' < 02/01' --template '{date|date}\n' + +hg log -d '>02/01 ' --template '{date|date}\n' +hg log -d '<02/01 ' --template '{date|date}\n' + +hg log -d ' >02/01 ' --template '{date|date}\n' +hg log -d ' <02/01 ' --template '{date|date}\n' + +hg log -d '> 02/01 ' --template '{date|date}\n' +hg log -d '< 02/01 ' --template '{date|date}\n' + +hg log -d ' > 02/01 ' --template '{date|date}\n' +hg log -d ' < 02/01 ' --template '{date|date}\n' \ No newline at end of file diff -r b214066b7e1d -r 8c6f823efcc9 tests/test-parse-date.out --- a/tests/test-parse-date.out Sun Mar 29 14:43:49 2009 +0200 +++ b/tests/test-parse-date.out Wed Apr 01 09:11:00 2009 -0700 @@ -34,3 +34,111 @@ standard: Sat Sep 08 21:16:40 2001 +0430 internal: 1000000000 16200 standard: Sat Sep 08 21:16:40 2001 -0430 +Sun Jan 15 13:30:00 2006 +0500 +Sun Jan 15 13:30:00 2006 -0800 +Sat Jul 15 13:30:00 2006 +0500 +Sat Jul 15 13:30:00 2006 -0700 +Sun Jun 11 00:26:40 2006 -0400 +Sat Apr 15 13:30:00 2006 +0200 +Sat Apr 15 13:30:00 2006 +0000 +Wed Feb 01 13:00:30 2006 -0500 +Wed Feb 01 13:00:30 2006 +0000 +Sun Jan 15 13:30:00 2006 +0500 +Sun Jan 15 13:30:00 2006 -0800 +Sat Jul 15 13:30:00 2006 +0500 +Sat Jul 15 13:30:00 2006 -0700 +Sun Jun 11 00:26:40 2006 -0400 +Sat Apr 15 13:30:00 2006 +0200 +Sat Apr 15 13:30:00 2006 +0000 +Wed Feb 01 13:00:30 2006 -0500 +Wed Feb 01 13:00:30 2006 +0000 +Sun Jan 15 13:30:00 2006 +0500 +Sun Jan 15 13:30:00 2006 -0800 +Sat Jul 15 13:30:00 2006 +0500 +Sat Jul 15 13:30:00 2006 -0700 +Sun Jun 11 00:26:40 2006 -0400 +Sat Apr 15 13:30:00 2006 +0200 +Sat Apr 15 13:30:00 2006 +0000 +Wed Feb 01 13:00:30 2006 -0500 +Wed Feb 01 13:00:30 2006 +0000 +Sun Jan 15 13:30:00 2006 +0500 +Sun Jan 15 13:30:00 2006 -0800 +Sat Jul 15 13:30:00 2006 +0500 +Sat Jul 15 13:30:00 2006 -0700 +Sun Jun 11 00:26:40 2006 -0400 +Sat Apr 15 13:30:00 2006 +0200 +Sat Apr 15 13:30:00 2006 +0000 +Wed Feb 01 13:00:30 2006 -0500 +Wed Feb 01 13:00:30 2006 +0000 +Sun Jan 15 13:30:00 2006 +0500 +Sun Jan 15 13:30:00 2006 -0800 +Sat Jul 15 13:30:00 2006 +0500 +Sat Jul 15 13:30:00 2006 -0700 +Sun Jun 11 00:26:40 2006 -0400 +Sat Apr 15 13:30:00 2006 +0200 +Sat Apr 15 13:30:00 2006 +0000 +Wed Feb 01 13:00:30 2006 -0500 +Wed Feb 01 13:00:30 2006 +0000 +Sun Jan 15 13:30:00 2006 +0500 +Sun Jan 15 13:30:00 2006 -0800 +Sat Jul 15 13:30:00 2006 +0500 +Sat Jul 15 13:30:00 2006 -0700 +Sun Jun 11 00:26:40 2006 -0400 +Sat Apr 15 13:30:00 2006 +0200 +Sat Apr 15 13:30:00 2006 +0000 +Wed Feb 01 13:00:30 2006 -0500 +Wed Feb 01 13:00:30 2006 +0000 +Sun Jan 15 13:30:00 2006 +0500 +Sun Jan 15 13:30:00 2006 -0800 +Sat Jul 15 13:30:00 2006 +0500 +Sat Jul 15 13:30:00 2006 -0700 +Sun Jun 11 00:26:40 2006 -0400 +Sat Apr 15 13:30:00 2006 +0200 +Sat Apr 15 13:30:00 2006 +0000 +Wed Feb 01 13:00:30 2006 -0500 +Wed Feb 01 13:00:30 2006 +0000 +Sun Jan 15 13:30:00 2006 +0500 +Sun Jan 15 13:30:00 2006 -0800 +Sat Jul 15 13:30:00 2006 +0500 +Sat Jul 15 13:30:00 2006 -0700 +Sun Jun 11 00:26:40 2006 -0400 +Sat Apr 15 13:30:00 2006 +0200 +Sat Apr 15 13:30:00 2006 +0000 +Wed Feb 01 13:00:30 2006 -0500 +Wed Feb 01 13:00:30 2006 +0000 +Sun Jan 15 13:30:00 2006 +0500 +Sun Jan 15 13:30:00 2006 -0800 +Sat Jul 15 13:30:00 2006 +0500 +Sat Jul 15 13:30:00 2006 -0700 +Sun Jun 11 00:26:40 2006 -0400 +Sat Apr 15 13:30:00 2006 +0200 +Sat Apr 15 13:30:00 2006 +0000 +Wed Feb 01 13:00:30 2006 -0500 +Wed Feb 01 13:00:30 2006 +0000 +Sun Jan 15 13:30:00 2006 +0500 +Sun Jan 15 13:30:00 2006 -0800 +Sat Jul 15 13:30:00 2006 +0500 +Sat Jul 15 13:30:00 2006 -0700 +Sun Jun 11 00:26:40 2006 -0400 +Sat Apr 15 13:30:00 2006 +0200 +Sat Apr 15 13:30:00 2006 +0000 +Wed Feb 01 13:00:30 2006 -0500 +Wed Feb 01 13:00:30 2006 +0000 +Sun Jan 15 13:30:00 2006 +0500 +Sun Jan 15 13:30:00 2006 -0800 +Sat Jul 15 13:30:00 2006 +0500 +Sat Jul 15 13:30:00 2006 -0700 +Sun Jun 11 00:26:40 2006 -0400 +Sat Apr 15 13:30:00 2006 +0200 +Sat Apr 15 13:30:00 2006 +0000 +Wed Feb 01 13:00:30 2006 -0500 +Wed Feb 01 13:00:30 2006 +0000 +Sun Jan 15 13:30:00 2006 +0500 +Sun Jan 15 13:30:00 2006 -0800 +Sat Jul 15 13:30:00 2006 +0500 +Sat Jul 15 13:30:00 2006 -0700 +Sun Jun 11 00:26:40 2006 -0400 +Sat Apr 15 13:30:00 2006 +0200 +Sat Apr 15 13:30:00 2006 +0000 +Wed Feb 01 13:00:30 2006 -0500 +Wed Feb 01 13:00:30 2006 +0000