[patch]util: -d ' '(with a whitespace) works consistently with -d ' '(no whitespace) (issue2732)
yun lee
yun.lee.bj at gmail.com
Sun Apr 3 21:15:39 CDT 2011
util: -d ' '(with a whitespace) works consistently with -d ' '(no
whitespace) (issue2732)
# HG changeset patch
# User Yun Lee <yunlee.bj at gmail.com>
# Date 1301882735 -28800
# Node ID 38f54e6dc7bcad4ab6361ad2cde00da40cabd72b
# Parent 0995eee8ffe4a24478379fb16fd6c38812bc3dd5
util: -d ' '(with a whitespace) works consistently with -d ' '(no
whitespace) (issue2732)
diff -r 0995eee8ffe4 -r 38f54e6dc7bc mercurial/util.py
--- a/mercurial/util.py Sat Apr 02 11:07:05 2011 +0200
+++ b/mercurial/util.py Mon Apr 04 10:05:35 2011 +0800
@@ -1220,7 +1220,7 @@
date = date.strip()
if not date:
- raise Abort(_("dates cannot consist entirely of whitespace"))
+ return lambda x: True
elif date[0] == "<":
when = upper(date[1:])
return lambda x: x <= when
diff -r 0995eee8ffe4 -r 38f54e6dc7bc tests/test-log.t
--- a/tests/test-log.t Sat Apr 02 11:07:05 2011 +0200
+++ b/tests/test-log.t Mon Apr 04 10:05:35 2011 +0800
@@ -515,8 +515,46 @@
log -d " " (whitespaces only)
$ hg log -d " "
- abort: dates cannot consist entirely of whitespace
- [255]
+ changeset: 6:2404bbcab562
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:01 1970 +0000
+ summary: b1.1
+
+ changeset: 5:302e9dd6890d
+ parent: 3:e62f78d544b4
+ parent: 4:ddb82e70d1a1
+ user: test
+ date: Thu Jan 01 00:00:01 1970 +0000
+ summary: m12
+
+ changeset: 4:ddb82e70d1a1
+ parent: 0:67e992f2c4f3
+ user: test
+ date: Thu Jan 01 00:00:01 1970 +0000
+ summary: b2
+
+ changeset: 3:e62f78d544b4
+ parent: 1:3d5bf5654eda
+ user: test
+ date: Thu Jan 01 00:00:01 1970 +0000
+ summary: b1
+
+ changeset: 2:60c670bf5b30
+ user: test
+ date: Thu Jan 01 00:00:01 1970 +0000
+ summary: r2
+
+ changeset: 1:3d5bf5654eda
+ user: test
+ date: Thu Jan 01 00:00:01 1970 +0000
+ summary: r1
+
+ changeset: 0:67e992f2c4f3
+ user: test
+ date: Thu Jan 01 00:00:01 1970 +0000
+ summary: base
+
log -d -1
--
Yun Lee
More information about the Mercurial-devel
mailing list