# HG changeset patch # User Yun Lee # Date 1301993747 -28800 # Node ID 9a96efc4af8a90a5d910a39b84cf1cc82adc0f90 # Parent 9e5407a67dea4adc122d93de36b64c0c7ef21623 util: make 'hg log -d --2' abort (issue2734) diff -r 9e5407a67dea -r 9a96efc4af8a mercurial/util.py --- a/mercurial/util.py Tue Apr 05 12:40:47 2011 +0800 +++ b/mercurial/util.py Tue Apr 05 16:55:47 2011 +0800 @@ -1209,6 +1209,9 @@ days = int(date[1:]) except ValueError: raise Abort(_("invalid day spec: %s") % date[1:]) + if days < 0: + raise Abort(_("%s must be nonnegative (see 'hg help dates')") + % date[1:]) when = makedate()[0] - days * 3600 * 24 return lambda x: x >= when elif " to " in date: diff -r 9e5407a67dea -r 9a96efc4af8a tests/test-log.t --- a/tests/test-log.t Tue Apr 05 12:40:47 2011 +0800 +++ b/tests/test-log.t Tue Apr 05 16:55:47 2011 +0800 @@ -534,6 +534,11 @@ abort: invalid day spec, use '