Mercurial > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
13888:9e5407a67dea | 13889:9a96efc4af8a |
---|---|
1207 elif date[0] == "-": | 1207 elif date[0] == "-": |
1208 try: | 1208 try: |
1209 days = int(date[1:]) | 1209 days = int(date[1:]) |
1210 except ValueError: | 1210 except ValueError: |
1211 raise Abort(_("invalid day spec: %s") % date[1:]) | 1211 raise Abort(_("invalid day spec: %s") % date[1:]) |
1212 if days < 0: | |
1213 raise Abort(_("%s must be nonnegative (see 'hg help dates')") | |
1214 % date[1:]) | |
1212 when = makedate()[0] - days * 3600 * 24 | 1215 when = makedate()[0] - days * 3600 * 24 |
1213 return lambda x: x >= when | 1216 return lambda x: x >= when |
1214 elif " to " in date: | 1217 elif " to " in date: |
1215 a, b = date.split(" to ") | 1218 a, b = date.split(" to ") |
1216 start, stop = lower(a), upper(b) | 1219 start, stop = lower(a), upper(b) |