##// END OF EJS Templates
test-parse-date: test 12-hours time formats (issue1804)
Patrick Mezard -
r9384:d91078a2 default
parent child Browse files
Show More
@@ -1,83 +1,87
1 #!/bin/sh
1 #!/bin/sh
2
2
3 # This runs with TZ="GMT"
3 # This runs with TZ="GMT"
4 hg init
4 hg init
5 echo "test-parse-date" > a
5 echo "test-parse-date" > a
6 hg add a
6 hg add a
7 hg ci -d "2006-02-01 13:00:30" -m "rev 0"
7 hg ci -d "2006-02-01 13:00:30" -m "rev 0"
8 echo "hi!" >> a
8 echo "hi!" >> a
9 hg ci -d "2006-02-01 13:00:30 -0500" -m "rev 1"
9 hg ci -d "2006-02-01 13:00:30 -0500" -m "rev 1"
10 hg tag -d "2006-04-15 13:30" "Hi"
10 hg tag -d "2006-04-15 13:30" "Hi"
11 hg backout --merge -d "2006-04-15 13:30 +0200" -m "rev 3" 1
11 hg backout --merge -d "2006-04-15 13:30 +0200" -m "rev 3" 1
12 hg ci -d "1150000000 14400" -m "rev 4 (merge)"
12 hg ci -d "1150000000 14400" -m "rev 4 (merge)"
13 echo "fail" >> a
13 echo "fail" >> a
14 hg ci -d "should fail" -m "fail"
14 hg ci -d "should fail" -m "fail"
15 hg ci -d "100000000000000000 1400" -m "fail"
15 hg ci -d "100000000000000000 1400" -m "fail"
16 hg ci -d "100000 1400000" -m "fail"
16 hg ci -d "100000 1400000" -m "fail"
17
17
18 # Check with local timezone other than GMT and with DST
18 # Check with local timezone other than GMT and with DST
19 TZ="PST+8PDT"
19 TZ="PST+8PDT"
20 export TZ
20 export TZ
21 # PST=UTC-8 / PDT=UTC-7
21 # PST=UTC-8 / PDT=UTC-7
22 hg debugrebuildstate
22 hg debugrebuildstate
23 echo "a" > a
23 echo "a" > a
24 hg ci -d "2006-07-15 13:30" -m "summer@UTC-7"
24 hg ci -d "2006-07-15 13:30" -m "summer@UTC-7"
25 hg debugrebuildstate
25 hg debugrebuildstate
26 echo "b" > a
26 echo "b" > a
27 hg ci -d "2006-07-15 13:30 +0500" -m "summer@UTC+5"
27 hg ci -d "2006-07-15 13:30 +0500" -m "summer@UTC+5"
28 hg debugrebuildstate
28 hg debugrebuildstate
29 echo "c" > a
29 echo "c" > a
30 hg ci -d "2006-01-15 13:30" -m "winter@UTC-8"
30 hg ci -d "2006-01-15 13:30" -m "winter@UTC-8"
31 hg debugrebuildstate
31 hg debugrebuildstate
32 echo "d" > a
32 echo "d" > a
33 hg ci -d "2006-01-15 13:30 +0500" -m "winter@UTC+5"
33 hg ci -d "2006-01-15 13:30 +0500" -m "winter@UTC+5"
34 hg log --template '{date|date}\n'
34 hg log --template '{date|date}\n'
35
35
36 # Test issue1014 (fractional timezones)
36 # Test issue1014 (fractional timezones)
37 hg debugdate "1000000000 -16200" # 0430
37 hg debugdate "1000000000 -16200" # 0430
38 hg debugdate "1000000000 -15300" # 0415
38 hg debugdate "1000000000 -15300" # 0415
39 hg debugdate "1000000000 -14400" # 0400
39 hg debugdate "1000000000 -14400" # 0400
40 hg debugdate "1000000000 0" # GMT
40 hg debugdate "1000000000 0" # GMT
41 hg debugdate "1000000000 14400" # -0400
41 hg debugdate "1000000000 14400" # -0400
42 hg debugdate "1000000000 15300" # -0415
42 hg debugdate "1000000000 15300" # -0415
43 hg debugdate "1000000000 16200" # -0430
43 hg debugdate "1000000000 16200" # -0430
44 hg debugdate "Sat Sep 08 21:16:40 2001 +0430"
44 hg debugdate "Sat Sep 08 21:16:40 2001 +0430"
45 hg debugdate "Sat Sep 08 21:16:40 2001 -0430"
45 hg debugdate "Sat Sep 08 21:16:40 2001 -0430"
46
46
47 # Test 12-hours times
48 hg debugdate "2006-02-01 1:00:30PM +0000"
49 hg debugdate "1:00:30PM" > /dev/null || echo 'failed'
50
47 #Test date formats with '>' or '<' accompanied by space characters
51 #Test date formats with '>' or '<' accompanied by space characters
48 hg log -d '>' --template '{date|date}\n'
52 hg log -d '>' --template '{date|date}\n'
49 hg log -d '<' hg log -d '>' --template '{date|date}\n'
53 hg log -d '<' hg log -d '>' --template '{date|date}\n'
50
54
51 hg log -d ' >' --template '{date|date}\n'
55 hg log -d ' >' --template '{date|date}\n'
52 hg log -d ' <' --template '{date|date}\n'
56 hg log -d ' <' --template '{date|date}\n'
53
57
54 hg log -d '> ' --template '{date|date}\n'
58 hg log -d '> ' --template '{date|date}\n'
55 hg log -d '< ' --template '{date|date}\n'
59 hg log -d '< ' --template '{date|date}\n'
56
60
57 hg log -d ' > ' --template '{date|date}\n'
61 hg log -d ' > ' --template '{date|date}\n'
58 hg log -d ' < ' --template '{date|date}\n'
62 hg log -d ' < ' --template '{date|date}\n'
59
63
60
64
61 hg log -d '>02/01' --template '{date|date}\n'
65 hg log -d '>02/01' --template '{date|date}\n'
62 hg log -d '<02/01' --template '{date|date}\n'
66 hg log -d '<02/01' --template '{date|date}\n'
63
67
64 hg log -d ' >02/01' --template '{date|date}\n'
68 hg log -d ' >02/01' --template '{date|date}\n'
65 hg log -d ' <02/01' --template '{date|date}\n'
69 hg log -d ' <02/01' --template '{date|date}\n'
66
70
67 hg log -d '> 02/01' --template '{date|date}\n'
71 hg log -d '> 02/01' --template '{date|date}\n'
68 hg log -d '< 02/01' --template '{date|date}\n'
72 hg log -d '< 02/01' --template '{date|date}\n'
69
73
70 hg log -d ' > 02/01' --template '{date|date}\n'
74 hg log -d ' > 02/01' --template '{date|date}\n'
71 hg log -d ' < 02/01' --template '{date|date}\n'
75 hg log -d ' < 02/01' --template '{date|date}\n'
72
76
73 hg log -d '>02/01 ' --template '{date|date}\n'
77 hg log -d '>02/01 ' --template '{date|date}\n'
74 hg log -d '<02/01 ' --template '{date|date}\n'
78 hg log -d '<02/01 ' --template '{date|date}\n'
75
79
76 hg log -d ' >02/01 ' --template '{date|date}\n'
80 hg log -d ' >02/01 ' --template '{date|date}\n'
77 hg log -d ' <02/01 ' --template '{date|date}\n'
81 hg log -d ' <02/01 ' --template '{date|date}\n'
78
82
79 hg log -d '> 02/01 ' --template '{date|date}\n'
83 hg log -d '> 02/01 ' --template '{date|date}\n'
80 hg log -d '< 02/01 ' --template '{date|date}\n'
84 hg log -d '< 02/01 ' --template '{date|date}\n'
81
85
82 hg log -d ' > 02/01 ' --template '{date|date}\n'
86 hg log -d ' > 02/01 ' --template '{date|date}\n'
83 hg log -d ' < 02/01 ' --template '{date|date}\n' No newline at end of file
87 hg log -d ' < 02/01 ' --template '{date|date}\n'
@@ -1,144 +1,146
1 reverting a
1 reverting a
2 created new head
2 created new head
3 changeset 3:107ce1ee2b43 backs out changeset 1:25a1420a55f8
3 changeset 3:107ce1ee2b43 backs out changeset 1:25a1420a55f8
4 merging with changeset 3:107ce1ee2b43
4 merging with changeset 3:107ce1ee2b43
5 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
5 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
6 (branch merge, don't forget to commit)
6 (branch merge, don't forget to commit)
7 abort: invalid date: 'should fail'
7 abort: invalid date: 'should fail'
8 abort: date exceeds 32 bits: 100000000000000000
8 abort: date exceeds 32 bits: 100000000000000000
9 abort: impossible time zone offset: 1400000
9 abort: impossible time zone offset: 1400000
10 Sun Jan 15 13:30:00 2006 +0500
10 Sun Jan 15 13:30:00 2006 +0500
11 Sun Jan 15 13:30:00 2006 -0800
11 Sun Jan 15 13:30:00 2006 -0800
12 Sat Jul 15 13:30:00 2006 +0500
12 Sat Jul 15 13:30:00 2006 +0500
13 Sat Jul 15 13:30:00 2006 -0700
13 Sat Jul 15 13:30:00 2006 -0700
14 Sun Jun 11 00:26:40 2006 -0400
14 Sun Jun 11 00:26:40 2006 -0400
15 Sat Apr 15 13:30:00 2006 +0200
15 Sat Apr 15 13:30:00 2006 +0200
16 Sat Apr 15 13:30:00 2006 +0000
16 Sat Apr 15 13:30:00 2006 +0000
17 Wed Feb 01 13:00:30 2006 -0500
17 Wed Feb 01 13:00:30 2006 -0500
18 Wed Feb 01 13:00:30 2006 +0000
18 Wed Feb 01 13:00:30 2006 +0000
19 internal: 1000000000 -16200
19 internal: 1000000000 -16200
20 standard: Sun Sep 09 06:16:40 2001 +0430
20 standard: Sun Sep 09 06:16:40 2001 +0430
21 internal: 1000000000 -15300
21 internal: 1000000000 -15300
22 standard: Sun Sep 09 06:01:40 2001 +0415
22 standard: Sun Sep 09 06:01:40 2001 +0415
23 internal: 1000000000 -14400
23 internal: 1000000000 -14400
24 standard: Sun Sep 09 05:46:40 2001 +0400
24 standard: Sun Sep 09 05:46:40 2001 +0400
25 internal: 1000000000 0
25 internal: 1000000000 0
26 standard: Sun Sep 09 01:46:40 2001 +0000
26 standard: Sun Sep 09 01:46:40 2001 +0000
27 internal: 1000000000 14400
27 internal: 1000000000 14400
28 standard: Sat Sep 08 21:46:40 2001 -0400
28 standard: Sat Sep 08 21:46:40 2001 -0400
29 internal: 1000000000 15300
29 internal: 1000000000 15300
30 standard: Sat Sep 08 21:31:40 2001 -0415
30 standard: Sat Sep 08 21:31:40 2001 -0415
31 internal: 1000000000 16200
31 internal: 1000000000 16200
32 standard: Sat Sep 08 21:16:40 2001 -0430
32 standard: Sat Sep 08 21:16:40 2001 -0430
33 internal: 999967600 -16200
33 internal: 999967600 -16200
34 standard: Sat Sep 08 21:16:40 2001 +0430
34 standard: Sat Sep 08 21:16:40 2001 +0430
35 internal: 1000000000 16200
35 internal: 1000000000 16200
36 standard: Sat Sep 08 21:16:40 2001 -0430
36 standard: Sat Sep 08 21:16:40 2001 -0430
37 internal: 1138798830 0
38 standard: Wed Feb 01 13:00:30 2006 +0000
37 Sun Jan 15 13:30:00 2006 +0500
39 Sun Jan 15 13:30:00 2006 +0500
38 Sun Jan 15 13:30:00 2006 -0800
40 Sun Jan 15 13:30:00 2006 -0800
39 Sat Jul 15 13:30:00 2006 +0500
41 Sat Jul 15 13:30:00 2006 +0500
40 Sat Jul 15 13:30:00 2006 -0700
42 Sat Jul 15 13:30:00 2006 -0700
41 Sun Jun 11 00:26:40 2006 -0400
43 Sun Jun 11 00:26:40 2006 -0400
42 Sat Apr 15 13:30:00 2006 +0200
44 Sat Apr 15 13:30:00 2006 +0200
43 Sat Apr 15 13:30:00 2006 +0000
45 Sat Apr 15 13:30:00 2006 +0000
44 Wed Feb 01 13:00:30 2006 -0500
46 Wed Feb 01 13:00:30 2006 -0500
45 Wed Feb 01 13:00:30 2006 +0000
47 Wed Feb 01 13:00:30 2006 +0000
46 Sun Jan 15 13:30:00 2006 +0500
48 Sun Jan 15 13:30:00 2006 +0500
47 Sun Jan 15 13:30:00 2006 -0800
49 Sun Jan 15 13:30:00 2006 -0800
48 Sat Jul 15 13:30:00 2006 +0500
50 Sat Jul 15 13:30:00 2006 +0500
49 Sat Jul 15 13:30:00 2006 -0700
51 Sat Jul 15 13:30:00 2006 -0700
50 Sun Jun 11 00:26:40 2006 -0400
52 Sun Jun 11 00:26:40 2006 -0400
51 Sat Apr 15 13:30:00 2006 +0200
53 Sat Apr 15 13:30:00 2006 +0200
52 Sat Apr 15 13:30:00 2006 +0000
54 Sat Apr 15 13:30:00 2006 +0000
53 Wed Feb 01 13:00:30 2006 -0500
55 Wed Feb 01 13:00:30 2006 -0500
54 Wed Feb 01 13:00:30 2006 +0000
56 Wed Feb 01 13:00:30 2006 +0000
55 Sun Jan 15 13:30:00 2006 +0500
57 Sun Jan 15 13:30:00 2006 +0500
56 Sun Jan 15 13:30:00 2006 -0800
58 Sun Jan 15 13:30:00 2006 -0800
57 Sat Jul 15 13:30:00 2006 +0500
59 Sat Jul 15 13:30:00 2006 +0500
58 Sat Jul 15 13:30:00 2006 -0700
60 Sat Jul 15 13:30:00 2006 -0700
59 Sun Jun 11 00:26:40 2006 -0400
61 Sun Jun 11 00:26:40 2006 -0400
60 Sat Apr 15 13:30:00 2006 +0200
62 Sat Apr 15 13:30:00 2006 +0200
61 Sat Apr 15 13:30:00 2006 +0000
63 Sat Apr 15 13:30:00 2006 +0000
62 Wed Feb 01 13:00:30 2006 -0500
64 Wed Feb 01 13:00:30 2006 -0500
63 Wed Feb 01 13:00:30 2006 +0000
65 Wed Feb 01 13:00:30 2006 +0000
64 Sun Jan 15 13:30:00 2006 +0500
66 Sun Jan 15 13:30:00 2006 +0500
65 Sun Jan 15 13:30:00 2006 -0800
67 Sun Jan 15 13:30:00 2006 -0800
66 Sat Jul 15 13:30:00 2006 +0500
68 Sat Jul 15 13:30:00 2006 +0500
67 Sat Jul 15 13:30:00 2006 -0700
69 Sat Jul 15 13:30:00 2006 -0700
68 Sun Jun 11 00:26:40 2006 -0400
70 Sun Jun 11 00:26:40 2006 -0400
69 Sat Apr 15 13:30:00 2006 +0200
71 Sat Apr 15 13:30:00 2006 +0200
70 Sat Apr 15 13:30:00 2006 +0000
72 Sat Apr 15 13:30:00 2006 +0000
71 Wed Feb 01 13:00:30 2006 -0500
73 Wed Feb 01 13:00:30 2006 -0500
72 Wed Feb 01 13:00:30 2006 +0000
74 Wed Feb 01 13:00:30 2006 +0000
73 Sun Jan 15 13:30:00 2006 +0500
75 Sun Jan 15 13:30:00 2006 +0500
74 Sun Jan 15 13:30:00 2006 -0800
76 Sun Jan 15 13:30:00 2006 -0800
75 Sat Jul 15 13:30:00 2006 +0500
77 Sat Jul 15 13:30:00 2006 +0500
76 Sat Jul 15 13:30:00 2006 -0700
78 Sat Jul 15 13:30:00 2006 -0700
77 Sun Jun 11 00:26:40 2006 -0400
79 Sun Jun 11 00:26:40 2006 -0400
78 Sat Apr 15 13:30:00 2006 +0200
80 Sat Apr 15 13:30:00 2006 +0200
79 Sat Apr 15 13:30:00 2006 +0000
81 Sat Apr 15 13:30:00 2006 +0000
80 Wed Feb 01 13:00:30 2006 -0500
82 Wed Feb 01 13:00:30 2006 -0500
81 Wed Feb 01 13:00:30 2006 +0000
83 Wed Feb 01 13:00:30 2006 +0000
82 Sun Jan 15 13:30:00 2006 +0500
84 Sun Jan 15 13:30:00 2006 +0500
83 Sun Jan 15 13:30:00 2006 -0800
85 Sun Jan 15 13:30:00 2006 -0800
84 Sat Jul 15 13:30:00 2006 +0500
86 Sat Jul 15 13:30:00 2006 +0500
85 Sat Jul 15 13:30:00 2006 -0700
87 Sat Jul 15 13:30:00 2006 -0700
86 Sun Jun 11 00:26:40 2006 -0400
88 Sun Jun 11 00:26:40 2006 -0400
87 Sat Apr 15 13:30:00 2006 +0200
89 Sat Apr 15 13:30:00 2006 +0200
88 Sat Apr 15 13:30:00 2006 +0000
90 Sat Apr 15 13:30:00 2006 +0000
89 Wed Feb 01 13:00:30 2006 -0500
91 Wed Feb 01 13:00:30 2006 -0500
90 Wed Feb 01 13:00:30 2006 +0000
92 Wed Feb 01 13:00:30 2006 +0000
91 Sun Jan 15 13:30:00 2006 +0500
93 Sun Jan 15 13:30:00 2006 +0500
92 Sun Jan 15 13:30:00 2006 -0800
94 Sun Jan 15 13:30:00 2006 -0800
93 Sat Jul 15 13:30:00 2006 +0500
95 Sat Jul 15 13:30:00 2006 +0500
94 Sat Jul 15 13:30:00 2006 -0700
96 Sat Jul 15 13:30:00 2006 -0700
95 Sun Jun 11 00:26:40 2006 -0400
97 Sun Jun 11 00:26:40 2006 -0400
96 Sat Apr 15 13:30:00 2006 +0200
98 Sat Apr 15 13:30:00 2006 +0200
97 Sat Apr 15 13:30:00 2006 +0000
99 Sat Apr 15 13:30:00 2006 +0000
98 Wed Feb 01 13:00:30 2006 -0500
100 Wed Feb 01 13:00:30 2006 -0500
99 Wed Feb 01 13:00:30 2006 +0000
101 Wed Feb 01 13:00:30 2006 +0000
100 Sun Jan 15 13:30:00 2006 +0500
102 Sun Jan 15 13:30:00 2006 +0500
101 Sun Jan 15 13:30:00 2006 -0800
103 Sun Jan 15 13:30:00 2006 -0800
102 Sat Jul 15 13:30:00 2006 +0500
104 Sat Jul 15 13:30:00 2006 +0500
103 Sat Jul 15 13:30:00 2006 -0700
105 Sat Jul 15 13:30:00 2006 -0700
104 Sun Jun 11 00:26:40 2006 -0400
106 Sun Jun 11 00:26:40 2006 -0400
105 Sat Apr 15 13:30:00 2006 +0200
107 Sat Apr 15 13:30:00 2006 +0200
106 Sat Apr 15 13:30:00 2006 +0000
108 Sat Apr 15 13:30:00 2006 +0000
107 Wed Feb 01 13:00:30 2006 -0500
109 Wed Feb 01 13:00:30 2006 -0500
108 Wed Feb 01 13:00:30 2006 +0000
110 Wed Feb 01 13:00:30 2006 +0000
109 Sun Jan 15 13:30:00 2006 +0500
111 Sun Jan 15 13:30:00 2006 +0500
110 Sun Jan 15 13:30:00 2006 -0800
112 Sun Jan 15 13:30:00 2006 -0800
111 Sat Jul 15 13:30:00 2006 +0500
113 Sat Jul 15 13:30:00 2006 +0500
112 Sat Jul 15 13:30:00 2006 -0700
114 Sat Jul 15 13:30:00 2006 -0700
113 Sun Jun 11 00:26:40 2006 -0400
115 Sun Jun 11 00:26:40 2006 -0400
114 Sat Apr 15 13:30:00 2006 +0200
116 Sat Apr 15 13:30:00 2006 +0200
115 Sat Apr 15 13:30:00 2006 +0000
117 Sat Apr 15 13:30:00 2006 +0000
116 Wed Feb 01 13:00:30 2006 -0500
118 Wed Feb 01 13:00:30 2006 -0500
117 Wed Feb 01 13:00:30 2006 +0000
119 Wed Feb 01 13:00:30 2006 +0000
118 Sun Jan 15 13:30:00 2006 +0500
120 Sun Jan 15 13:30:00 2006 +0500
119 Sun Jan 15 13:30:00 2006 -0800
121 Sun Jan 15 13:30:00 2006 -0800
120 Sat Jul 15 13:30:00 2006 +0500
122 Sat Jul 15 13:30:00 2006 +0500
121 Sat Jul 15 13:30:00 2006 -0700
123 Sat Jul 15 13:30:00 2006 -0700
122 Sun Jun 11 00:26:40 2006 -0400
124 Sun Jun 11 00:26:40 2006 -0400
123 Sat Apr 15 13:30:00 2006 +0200
125 Sat Apr 15 13:30:00 2006 +0200
124 Sat Apr 15 13:30:00 2006 +0000
126 Sat Apr 15 13:30:00 2006 +0000
125 Wed Feb 01 13:00:30 2006 -0500
127 Wed Feb 01 13:00:30 2006 -0500
126 Wed Feb 01 13:00:30 2006 +0000
128 Wed Feb 01 13:00:30 2006 +0000
127 Sun Jan 15 13:30:00 2006 +0500
129 Sun Jan 15 13:30:00 2006 +0500
128 Sun Jan 15 13:30:00 2006 -0800
130 Sun Jan 15 13:30:00 2006 -0800
129 Sat Jul 15 13:30:00 2006 +0500
131 Sat Jul 15 13:30:00 2006 +0500
130 Sat Jul 15 13:30:00 2006 -0700
132 Sat Jul 15 13:30:00 2006 -0700
131 Sun Jun 11 00:26:40 2006 -0400
133 Sun Jun 11 00:26:40 2006 -0400
132 Sat Apr 15 13:30:00 2006 +0200
134 Sat Apr 15 13:30:00 2006 +0200
133 Sat Apr 15 13:30:00 2006 +0000
135 Sat Apr 15 13:30:00 2006 +0000
134 Wed Feb 01 13:00:30 2006 -0500
136 Wed Feb 01 13:00:30 2006 -0500
135 Wed Feb 01 13:00:30 2006 +0000
137 Wed Feb 01 13:00:30 2006 +0000
136 Sun Jan 15 13:30:00 2006 +0500
138 Sun Jan 15 13:30:00 2006 +0500
137 Sun Jan 15 13:30:00 2006 -0800
139 Sun Jan 15 13:30:00 2006 -0800
138 Sat Jul 15 13:30:00 2006 +0500
140 Sat Jul 15 13:30:00 2006 +0500
139 Sat Jul 15 13:30:00 2006 -0700
141 Sat Jul 15 13:30:00 2006 -0700
140 Sun Jun 11 00:26:40 2006 -0400
142 Sun Jun 11 00:26:40 2006 -0400
141 Sat Apr 15 13:30:00 2006 +0200
143 Sat Apr 15 13:30:00 2006 +0200
142 Sat Apr 15 13:30:00 2006 +0000
144 Sat Apr 15 13:30:00 2006 +0000
143 Wed Feb 01 13:00:30 2006 -0500
145 Wed Feb 01 13:00:30 2006 -0500
144 Wed Feb 01 13:00:30 2006 +0000
146 Wed Feb 01 13:00:30 2006 +0000
General Comments 0
You need to be logged in to leave comments. Login now