# HG changeset patch # User Christian Ebert # Date 2009-09-04 09:51:28 # Node ID c8e4dc218aaf94a33a7fd1317785882863bc186b # Parent d0db168136dc0612cc63f877ced0201cf1053357 log: prevent negative date range from displaying entire log (issue1805) diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -2044,7 +2044,7 @@ def log(ui, repo, *pats, **opts): 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'): diff --git a/tests/test-log b/tests/test-log --- a/tests/test-log +++ b/tests/test-log @@ -107,6 +107,9 @@ hg log -r 100000000000000000000000000000 echo '% log -k r1' hg log -k r1 +echo '% log -d -1' +hg log -d -1 + cd .. hg init usertest diff --git a/tests/test-log.out b/tests/test-log.out --- a/tests/test-log.out +++ b/tests/test-log.out @@ -245,6 +245,7 @@ user: test date: Thu Jan 01 00:00:01 1970 +0000 summary: r1 +% log -d -1 adding a adding b changeset: 0:29a4c94f1924