Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/util.py @ 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 | e574207e3bcd |
children | b470894c33f8 |
comparison
equal
deleted
inserted
replaced
13866:2f93a4a10144 | 13867:28f557e8b419 |
---|---|
1220 date = date.strip() | 1220 date = date.strip() |
1221 | 1221 |
1222 if not date: | 1222 if not date: |
1223 raise Abort(_("dates cannot consist entirely of whitespace")) | 1223 raise Abort(_("dates cannot consist entirely of whitespace")) |
1224 elif date[0] == "<": | 1224 elif date[0] == "<": |
1225 if not date[1:]: | |
1226 raise Abort(_("invalid day spec. use '<{datetime}' ")) | |
1225 when = upper(date[1:]) | 1227 when = upper(date[1:]) |
1226 return lambda x: x <= when | 1228 return lambda x: x <= when |
1227 elif date[0] == ">": | 1229 elif date[0] == ">": |
1230 if not date[1:]: | |
1231 raise Abort(_("invalid day spec. use '>{datetime}' ")) | |
1228 when = lower(date[1:]) | 1232 when = lower(date[1:]) |
1229 return lambda x: x >= when | 1233 return lambda x: x >= when |
1230 elif date[0] == "-": | 1234 elif date[0] == "-": |
1231 try: | 1235 try: |
1232 days = int(date[1:]) | 1236 days = int(date[1:]) |