log: prevent negative date range from displaying entire log (issue1805)
authorChristian Ebert <blacktrash@gmx.net>
Fri, 04 Sep 2009 11:51:28 +0200
changeset 9421 c8e4dc218aaf
parent 9420 d0db168136dc
child 9422 ec26d6986d85
log: prevent negative date range from displaying entire log (issue1805)
mercurial/commands.py
tests/test-log
tests/test-log.out
--- a/mercurial/commands.py	Fri Sep 04 10:47:55 2009 +0200
+++ b/mercurial/commands.py	Fri Sep 04 11:51:28 2009 +0200
@@ -2044,7 +2044,7 @@
             if only_branches and ctx.branch() not in only_branches:
                 continue
 
-            if df and not df(ctx.date()):
+            if df and not df(ctx.date()[0]):
                 continue
 
             if opts.get('keyword'):
--- a/tests/test-log	Fri Sep 04 10:47:55 2009 +0200
+++ b/tests/test-log	Fri Sep 04 11:51:28 2009 +0200
@@ -107,6 +107,9 @@
 echo '% log -k r1'
 hg log -k r1
 
+echo '% log -d -1'
+hg log -d -1
+
 cd ..
 
 hg init usertest
--- a/tests/test-log.out	Fri Sep 04 10:47:55 2009 +0200
+++ b/tests/test-log.out	Fri Sep 04 11:51:28 2009 +0200
@@ -245,6 +245,7 @@
 date:        Thu Jan 01 00:00:01 1970 +0000
 summary:     r1
 
+% log -d -1
 adding a
 adding b
 changeset:   0:29a4c94f1924