Mercurial > hg
changeset 13867:28f557e8b419
log: abort for -d '>' or -d '<' (issue2749)
author | Yun Lee <yunlee.bj@gmail.com> |
---|---|
date | Mon, 04 Apr 2011 00:23:21 +0800 |
parents | 2f93a4a10144 |
children | 38906cf9d15c |
files | mercurial/util.py tests/test-log.t |
diffstat | 2 files changed, 16 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/util.py Mon Apr 04 00:05:41 2011 +0200 +++ b/mercurial/util.py Mon Apr 04 00:23:21 2011 +0800 @@ -1222,9 +1222,13 @@ if not date: raise Abort(_("dates cannot consist entirely of whitespace")) elif date[0] == "<": + if not date[1:]: + raise Abort(_("invalid day spec. use '<{datetime}' ")) when = upper(date[1:]) return lambda x: x <= when elif date[0] == ">": + if not date[1:]: + raise Abort(_("invalid day spec. use '>{datetime}' ")) when = lower(date[1:]) return lambda x: x >= when elif date[0] == "-":
--- a/tests/test-log.t Mon Apr 04 00:05:41 2011 +0200 +++ b/tests/test-log.t Mon Apr 04 00:23:21 2011 +0800 @@ -522,6 +522,18 @@ $ hg log -d -1 +log -d ">" + + $ hg log -d ">" + abort: invalid day spec. use '>{datetime}' + [255] + +log -d "<" + + $ hg log -d "<" + abort: invalid day spec. use '<{datetime}' + [255] + log -p -l2 --color=always