Mercurial > hg-stable
diff mercurial/util.py @ 13889:9a96efc4af8a
util: make 'hg log -d --2' abort (issue2734)
author | Yun Lee <yunlee.bj@gmail.com> |
---|---|
date | Tue, 05 Apr 2011 16:55:47 +0800 |
parents | fe48c57390f2 |
children | 31eb145b50b6 |
line wrap: on
line diff
--- 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: