[patch] log: abort for -d '>' or -d '<' (issue 2749)

Matt Mackall mpm at selenic.com
Mon Apr 4 09:39:35 CDT 2011


On Sun, 2011-04-03 at 17:43 -0500, Matt Mackall wrote:
> On Mon, 2011-04-04 at 00:24 +0800, yun lee wrote:
> > log: abort for -d '>' or -d '<' (2749)
> > 
> > Just now, hg log -d '>' gives the whole history, while hg log -d '<' gives
> > nothing. It's obviously meaningless. It's better to abort definitely.
> > 
> > # HG changeset patch
> > # User Yun Lee <yunlee.bj at gmail.com>
> > # Date 1301847801 -28800
> > # Node ID 00d4b089b7727c9f434f5dc343b079c3bff2e677
> > # Parent  0995eee8ffe4a24478379fb16fd6c38812bc3dd5
> > log: abort for -d '>' or -d '<' (issue 2749)
> 
> Queued, thanks. I've dropped the space between 'issue' and '2749' so our
> BTS robot can pick it up.

Looks like this broke a few tests. It's important that you run the
entire test suite. First, there were a couple problems with your coding
style:

ERROR: /export/p4-matt/hg-test/tests/test-check-code-hg.py output
changed
--- /export/hg-test/tests/test-check-code-hg.py.out 
+++ /export/hg-test/tests/test-check-code-hg.py.err 
@@ -1,0 +1,6 @@
+/export/hg-test/mercurial/util.py:1225:
+ > 	if not date[1:]:
+ don't use tabs
+/export/hg-test/mercurial/util.py:1230:
+ > 	if not date[1:]:
+ don't use tabs

Next, there were some whitespace issues in the test you added:

--- /home/mpm/hg/tests/test-log.t 
+++ /home/mpm/hg/tests/test-log.t.err 
@@ -525,13 +525,13 @@
 log -d ">"
 
   $ hg log -d ">"
-  abort: invalid day spec. use '>{datetime}'
+  abort: invalid day spec. use '>{datetime}' 
   [255]
 
 log -d "<"
 
   $ hg log -d "<"
-  abort: invalid day spec. use '<{datetime}'
+  abort: invalid day spec. use '<{datetime}' 
   [255]
 
And finally, there were already tests of the "<" behavior in
test-parse-date:

--- /home/mpm/hg/tests/test-parse-date.t 
+++ /home/mpm/hg/tests/test-parse-date.t.err 
@@ -96,52 +96,32 @@
 Test date formats with '>' or '<' accompanied by space characters
 
   $ hg log -d '>' --template '{date|date}\n'
-  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
+  abort: invalid day spec. use '>{datetime}' 
+  [255]
   $ hg log -d '<' hg log -d '>' --template '{date|date}\n'
+  abort: invalid day spec. use '>{datetime}' 
+  [255]
 

I've gone ahead and fixed these up since I already accidentally pushed
your patch.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list