Show More
@@ -1,87 +1,237 b'' | |||||
1 | #!/bin/sh |
|
1 | This runs with TZ="GMT" | |
|
2 | ||||
|
3 | $ hg init | |||
|
4 | $ echo "test-parse-date" > a | |||
|
5 | $ hg add a | |||
|
6 | $ hg ci -d "2006-02-01 13:00:30" -m "rev 0" | |||
|
7 | $ echo "hi!" >> a | |||
|
8 | $ hg ci -d "2006-02-01 13:00:30 -0500" -m "rev 1" | |||
|
9 | $ hg tag -d "2006-04-15 13:30" "Hi" | |||
|
10 | $ hg backout --merge -d "2006-04-15 13:30 +0200" -m "rev 3" 1 | |||
|
11 | reverting a | |||
|
12 | created new head | |||
|
13 | changeset 3:107ce1ee2b43 backs out changeset 1:25a1420a55f8 | |||
|
14 | merging with changeset 3:107ce1ee2b43 | |||
|
15 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
16 | (branch merge, don't forget to commit) | |||
|
17 | $ hg ci -d "1150000000 14400" -m "rev 4 (merge)" | |||
|
18 | $ echo "fail" >> a | |||
|
19 | $ hg ci -d "should fail" -m "fail" | |||
|
20 | abort: invalid date: 'should fail' | |||
|
21 | $ hg ci -d "100000000000000000 1400" -m "fail" | |||
|
22 | abort: date exceeds 32 bits: 100000000000000000 | |||
|
23 | $ hg ci -d "100000 1400000" -m "fail" | |||
|
24 | abort: impossible time zone offset: 1400000 | |||
|
25 | ||||
|
26 | Check with local timezone other than GMT and with DST | |||
2 |
|
27 | |||
3 | # This runs with TZ="GMT" |
|
28 | $ TZ="PST+8PDT" | |
4 | hg init |
|
29 | $ export TZ | |
5 | echo "test-parse-date" > a |
|
30 | ||
6 | hg add a |
|
31 | PST=UTC-8 / PDT=UTC-7 | |
7 | hg ci -d "2006-02-01 13:00:30" -m "rev 0" |
|
32 | ||
8 | echo "hi!" >> a |
|
33 | $ hg debugrebuildstate | |
9 | hg ci -d "2006-02-01 13:00:30 -0500" -m "rev 1" |
|
34 | $ echo "a" > a | |
10 |
|
|
35 | $ hg ci -d "2006-07-15 13:30" -m "summer@UTC-7" | |
11 | hg backout --merge -d "2006-04-15 13:30 +0200" -m "rev 3" 1 |
|
36 | $ hg debugrebuildstate | |
12 | hg ci -d "1150000000 14400" -m "rev 4 (merge)" |
|
37 | $ echo "b" > a | |
13 | echo "fail" >> a |
|
38 | $ hg ci -d "2006-07-15 13:30 +0500" -m "summer@UTC+5" | |
14 | hg ci -d "should fail" -m "fail" |
|
39 | $ hg debugrebuildstate | |
15 | hg ci -d "100000000000000000 1400" -m "fail" |
|
40 | $ echo "c" > a | |
16 | hg ci -d "100000 1400000" -m "fail" |
|
41 | $ hg ci -d "2006-01-15 13:30" -m "winter@UTC-8" | |
|
42 | $ hg debugrebuildstate | |||
|
43 | $ echo "d" > a | |||
|
44 | $ hg ci -d "2006-01-15 13:30 +0500" -m "winter@UTC+5" | |||
|
45 | $ hg log --template '{date|date}\n' | |||
|
46 | Sun Jan 15 13:30:00 2006 +0500 | |||
|
47 | Sun Jan 15 13:30:00 2006 -0800 | |||
|
48 | Sat Jul 15 13:30:00 2006 +0500 | |||
|
49 | Sat Jul 15 13:30:00 2006 -0700 | |||
|
50 | Sun Jun 11 00:26:40 2006 -0400 | |||
|
51 | Sat Apr 15 13:30:00 2006 +0200 | |||
|
52 | Sat Apr 15 13:30:00 2006 +0000 | |||
|
53 | Wed Feb 01 13:00:30 2006 -0500 | |||
|
54 | Wed Feb 01 13:00:30 2006 +0000 | |||
|
55 | ||||
|
56 | Test issue1014 (fractional timezones) | |||
17 |
|
57 | |||
18 | # Check with local timezone other than GMT and with DST |
|
58 | $ hg debugdate "1000000000 -16200" # 0430 | |
19 | TZ="PST+8PDT" |
|
59 | internal: 1000000000 -16200 | |
20 | export TZ |
|
60 | standard: Sun Sep 09 06:16:40 2001 +0430 | |
21 | # PST=UTC-8 / PDT=UTC-7 |
|
61 | $ hg debugdate "1000000000 -15300" # 0415 | |
22 | hg debugrebuildstate |
|
62 | internal: 1000000000 -15300 | |
23 | echo "a" > a |
|
63 | standard: Sun Sep 09 06:01:40 2001 +0415 | |
24 | hg ci -d "2006-07-15 13:30" -m "summer@UTC-7" |
|
64 | $ hg debugdate "1000000000 -14400" # 0400 | |
25 | hg debugrebuildstate |
|
65 | internal: 1000000000 -14400 | |
26 | echo "b" > a |
|
66 | standard: Sun Sep 09 05:46:40 2001 +0400 | |
27 | hg ci -d "2006-07-15 13:30 +0500" -m "summer@UTC+5" |
|
67 | $ hg debugdate "1000000000 0" # GMT | |
28 | hg debugrebuildstate |
|
68 | internal: 1000000000 0 | |
29 | echo "c" > a |
|
69 | standard: Sun Sep 09 01:46:40 2001 +0000 | |
30 | hg ci -d "2006-01-15 13:30" -m "winter@UTC-8" |
|
70 | $ hg debugdate "1000000000 14400" # -0400 | |
31 | hg debugrebuildstate |
|
71 | internal: 1000000000 14400 | |
32 | echo "d" > a |
|
72 | standard: Sat Sep 08 21:46:40 2001 -0400 | |
33 | hg ci -d "2006-01-15 13:30 +0500" -m "winter@UTC+5" |
|
73 | $ hg debugdate "1000000000 15300" # -0415 | |
34 | hg log --template '{date|date}\n' |
|
74 | internal: 1000000000 15300 | |
|
75 | standard: Sat Sep 08 21:31:40 2001 -0415 | |||
|
76 | $ hg debugdate "1000000000 16200" # -0430 | |||
|
77 | internal: 1000000000 16200 | |||
|
78 | standard: Sat Sep 08 21:16:40 2001 -0430 | |||
|
79 | $ hg debugdate "Sat Sep 08 21:16:40 2001 +0430" | |||
|
80 | internal: 999967600 -16200 | |||
|
81 | standard: Sat Sep 08 21:16:40 2001 +0430 | |||
|
82 | $ hg debugdate "Sat Sep 08 21:16:40 2001 -0430" | |||
|
83 | internal: 1000000000 16200 | |||
|
84 | standard: Sat Sep 08 21:16:40 2001 -0430 | |||
|
85 | ||||
|
86 | Test 12-hours times | |||
|
87 | ||||
|
88 | $ hg debugdate "2006-02-01 1:00:30PM +0000" | |||
|
89 | internal: 1138798830 0 | |||
|
90 | standard: Wed Feb 01 13:00:30 2006 +0000 | |||
|
91 | $ hg debugdate "1:00:30PM" > /dev/null || echo 'failed' | |||
|
92 | ||||
|
93 | Test date formats with '>' or '<' accompanied by space characters | |||
|
94 | ||||
|
95 | $ hg log -d '>' --template '{date|date}\n' | |||
|
96 | Sun Jan 15 13:30:00 2006 +0500 | |||
|
97 | Sun Jan 15 13:30:00 2006 -0800 | |||
|
98 | Sat Jul 15 13:30:00 2006 +0500 | |||
|
99 | Sat Jul 15 13:30:00 2006 -0700 | |||
|
100 | Sun Jun 11 00:26:40 2006 -0400 | |||
|
101 | Sat Apr 15 13:30:00 2006 +0200 | |||
|
102 | Sat Apr 15 13:30:00 2006 +0000 | |||
|
103 | Wed Feb 01 13:00:30 2006 -0500 | |||
|
104 | Wed Feb 01 13:00:30 2006 +0000 | |||
|
105 | $ hg log -d '<' hg log -d '>' --template '{date|date}\n' | |||
|
106 | ||||
|
107 | $ hg log -d ' >' --template '{date|date}\n' | |||
|
108 | Sun Jan 15 13:30:00 2006 +0500 | |||
|
109 | Sun Jan 15 13:30:00 2006 -0800 | |||
|
110 | Sat Jul 15 13:30:00 2006 +0500 | |||
|
111 | Sat Jul 15 13:30:00 2006 -0700 | |||
|
112 | Sun Jun 11 00:26:40 2006 -0400 | |||
|
113 | Sat Apr 15 13:30:00 2006 +0200 | |||
|
114 | Sat Apr 15 13:30:00 2006 +0000 | |||
|
115 | Wed Feb 01 13:00:30 2006 -0500 | |||
|
116 | Wed Feb 01 13:00:30 2006 +0000 | |||
|
117 | $ hg log -d ' <' --template '{date|date}\n' | |||
35 |
|
118 | |||
36 | # Test issue1014 (fractional timezones) |
|
119 | $ hg log -d '> ' --template '{date|date}\n' | |
37 | hg debugdate "1000000000 -16200" # 0430 |
|
120 | Sun Jan 15 13:30:00 2006 +0500 | |
38 | hg debugdate "1000000000 -15300" # 0415 |
|
121 | Sun Jan 15 13:30:00 2006 -0800 | |
39 | hg debugdate "1000000000 -14400" # 0400 |
|
122 | Sat Jul 15 13:30:00 2006 +0500 | |
40 | hg debugdate "1000000000 0" # GMT |
|
123 | Sat Jul 15 13:30:00 2006 -0700 | |
41 | hg debugdate "1000000000 14400" # -0400 |
|
124 | Sun Jun 11 00:26:40 2006 -0400 | |
42 | hg debugdate "1000000000 15300" # -0415 |
|
125 | Sat Apr 15 13:30:00 2006 +0200 | |
43 | hg debugdate "1000000000 16200" # -0430 |
|
126 | Sat Apr 15 13:30:00 2006 +0000 | |
44 | hg debugdate "Sat Sep 08 21:16:40 2001 +0430" |
|
127 | Wed Feb 01 13:00:30 2006 -0500 | |
45 | hg debugdate "Sat Sep 08 21:16:40 2001 -0430" |
|
128 | Wed Feb 01 13:00:30 2006 +0000 | |
|
129 | $ hg log -d '< ' --template '{date|date}\n' | |||
|
130 | ||||
|
131 | $ hg log -d ' > ' --template '{date|date}\n' | |||
|
132 | Sun Jan 15 13:30:00 2006 +0500 | |||
|
133 | Sun Jan 15 13:30:00 2006 -0800 | |||
|
134 | Sat Jul 15 13:30:00 2006 +0500 | |||
|
135 | Sat Jul 15 13:30:00 2006 -0700 | |||
|
136 | Sun Jun 11 00:26:40 2006 -0400 | |||
|
137 | Sat Apr 15 13:30:00 2006 +0200 | |||
|
138 | Sat Apr 15 13:30:00 2006 +0000 | |||
|
139 | Wed Feb 01 13:00:30 2006 -0500 | |||
|
140 | Wed Feb 01 13:00:30 2006 +0000 | |||
|
141 | $ hg log -d ' < ' --template '{date|date}\n' | |||
46 |
|
142 | |||
47 | # Test 12-hours times |
|
143 | $ hg log -d '>02/01' --template '{date|date}\n' | |
48 | hg debugdate "2006-02-01 1:00:30PM +0000" |
|
144 | $ hg log -d '<02/01' --template '{date|date}\n' | |
49 | hg debugdate "1:00:30PM" > /dev/null || echo 'failed' |
|
145 | Sun Jan 15 13:30:00 2006 +0500 | |
|
146 | Sun Jan 15 13:30:00 2006 -0800 | |||
|
147 | Sat Jul 15 13:30:00 2006 +0500 | |||
|
148 | Sat Jul 15 13:30:00 2006 -0700 | |||
|
149 | Sun Jun 11 00:26:40 2006 -0400 | |||
|
150 | Sat Apr 15 13:30:00 2006 +0200 | |||
|
151 | Sat Apr 15 13:30:00 2006 +0000 | |||
|
152 | Wed Feb 01 13:00:30 2006 -0500 | |||
|
153 | Wed Feb 01 13:00:30 2006 +0000 | |||
50 |
|
154 | |||
51 | #Test date formats with '>' or '<' accompanied by space characters |
|
155 | $ hg log -d ' >02/01' --template '{date|date}\n' | |
52 |
hg log -d ' |
|
156 | $ hg log -d ' <02/01' --template '{date|date}\n' | |
53 | hg log -d '<' hg log -d '>' --template '{date|date}\n' |
|
157 | Sun Jan 15 13:30:00 2006 +0500 | |
|
158 | Sun Jan 15 13:30:00 2006 -0800 | |||
|
159 | Sat Jul 15 13:30:00 2006 +0500 | |||
|
160 | Sat Jul 15 13:30:00 2006 -0700 | |||
|
161 | Sun Jun 11 00:26:40 2006 -0400 | |||
|
162 | Sat Apr 15 13:30:00 2006 +0200 | |||
|
163 | Sat Apr 15 13:30:00 2006 +0000 | |||
|
164 | Wed Feb 01 13:00:30 2006 -0500 | |||
|
165 | Wed Feb 01 13:00:30 2006 +0000 | |||
54 |
|
166 | |||
55 |
hg log -d ' |
|
167 | $ hg log -d '> 02/01' --template '{date|date}\n' | |
56 |
hg log -d ' |
|
168 | $ hg log -d '< 02/01' --template '{date|date}\n' | |
57 |
|
169 | Sun Jan 15 13:30:00 2006 +0500 | ||
58 | hg log -d '> ' --template '{date|date}\n' |
|
170 | Sun Jan 15 13:30:00 2006 -0800 | |
59 | hg log -d '< ' --template '{date|date}\n' |
|
171 | Sat Jul 15 13:30:00 2006 +0500 | |
|
172 | Sat Jul 15 13:30:00 2006 -0700 | |||
|
173 | Sun Jun 11 00:26:40 2006 -0400 | |||
|
174 | Sat Apr 15 13:30:00 2006 +0200 | |||
|
175 | Sat Apr 15 13:30:00 2006 +0000 | |||
|
176 | Wed Feb 01 13:00:30 2006 -0500 | |||
|
177 | Wed Feb 01 13:00:30 2006 +0000 | |||
60 |
|
178 | |||
61 | hg log -d ' > ' --template '{date|date}\n' |
|
179 | $ hg log -d ' > 02/01' --template '{date|date}\n' | |
62 | hg log -d ' < ' --template '{date|date}\n' |
|
180 | $ hg log -d ' < 02/01' --template '{date|date}\n' | |
63 |
|
181 | Sun Jan 15 13:30:00 2006 +0500 | ||
|
182 | Sun Jan 15 13:30:00 2006 -0800 | |||
|
183 | Sat Jul 15 13:30:00 2006 +0500 | |||
|
184 | Sat Jul 15 13:30:00 2006 -0700 | |||
|
185 | Sun Jun 11 00:26:40 2006 -0400 | |||
|
186 | Sat Apr 15 13:30:00 2006 +0200 | |||
|
187 | Sat Apr 15 13:30:00 2006 +0000 | |||
|
188 | Wed Feb 01 13:00:30 2006 -0500 | |||
|
189 | Wed Feb 01 13:00:30 2006 +0000 | |||
64 |
|
190 | |||
65 | hg log -d '>02/01' --template '{date|date}\n' |
|
191 | $ hg log -d '>02/01 ' --template '{date|date}\n' | |
66 | hg log -d '<02/01' --template '{date|date}\n' |
|
192 | $ hg log -d '<02/01 ' --template '{date|date}\n' | |
67 |
|
193 | Sun Jan 15 13:30:00 2006 +0500 | ||
68 | hg log -d ' >02/01' --template '{date|date}\n' |
|
194 | Sun Jan 15 13:30:00 2006 -0800 | |
69 | hg log -d ' <02/01' --template '{date|date}\n' |
|
195 | Sat Jul 15 13:30:00 2006 +0500 | |
70 |
|
196 | Sat Jul 15 13:30:00 2006 -0700 | ||
71 | hg log -d '> 02/01' --template '{date|date}\n' |
|
197 | Sun Jun 11 00:26:40 2006 -0400 | |
72 | hg log -d '< 02/01' --template '{date|date}\n' |
|
198 | Sat Apr 15 13:30:00 2006 +0200 | |
|
199 | Sat Apr 15 13:30:00 2006 +0000 | |||
|
200 | Wed Feb 01 13:00:30 2006 -0500 | |||
|
201 | Wed Feb 01 13:00:30 2006 +0000 | |||
73 |
|
202 | |||
74 |
hg log -d ' > |
|
203 | $ hg log -d ' >02/01 ' --template '{date|date}\n' | |
75 |
hg log -d ' < |
|
204 | $ hg log -d ' <02/01 ' --template '{date|date}\n' | |
76 |
|
205 | Sun Jan 15 13:30:00 2006 +0500 | ||
77 | hg log -d '>02/01 ' --template '{date|date}\n' |
|
206 | Sun Jan 15 13:30:00 2006 -0800 | |
78 | hg log -d '<02/01 ' --template '{date|date}\n' |
|
207 | Sat Jul 15 13:30:00 2006 +0500 | |
|
208 | Sat Jul 15 13:30:00 2006 -0700 | |||
|
209 | Sun Jun 11 00:26:40 2006 -0400 | |||
|
210 | Sat Apr 15 13:30:00 2006 +0200 | |||
|
211 | Sat Apr 15 13:30:00 2006 +0000 | |||
|
212 | Wed Feb 01 13:00:30 2006 -0500 | |||
|
213 | Wed Feb 01 13:00:30 2006 +0000 | |||
79 |
|
214 | |||
80 |
hg log -d ' |
|
215 | $ hg log -d '> 02/01 ' --template '{date|date}\n' | |
81 |
hg log -d ' |
|
216 | $ hg log -d '< 02/01 ' --template '{date|date}\n' | |
|
217 | Sun Jan 15 13:30:00 2006 +0500 | |||
|
218 | Sun Jan 15 13:30:00 2006 -0800 | |||
|
219 | Sat Jul 15 13:30:00 2006 +0500 | |||
|
220 | Sat Jul 15 13:30:00 2006 -0700 | |||
|
221 | Sun Jun 11 00:26:40 2006 -0400 | |||
|
222 | Sat Apr 15 13:30:00 2006 +0200 | |||
|
223 | Sat Apr 15 13:30:00 2006 +0000 | |||
|
224 | Wed Feb 01 13:00:30 2006 -0500 | |||
|
225 | Wed Feb 01 13:00:30 2006 +0000 | |||
82 |
|
226 | |||
83 | hg log -d '> 02/01 ' --template '{date|date}\n' |
|
227 | $ hg log -d ' > 02/01 ' --template '{date|date}\n' | |
84 | hg log -d '< 02/01 ' --template '{date|date}\n' |
|
228 | $ hg log -d ' < 02/01 ' --template '{date|date}\n' | |
85 |
|
229 | Sun Jan 15 13:30:00 2006 +0500 | ||
86 | hg log -d ' > 02/01 ' --template '{date|date}\n' |
|
230 | Sun Jan 15 13:30:00 2006 -0800 | |
87 | hg log -d ' < 02/01 ' --template '{date|date}\n' |
|
231 | Sat Jul 15 13:30:00 2006 +0500 | |
|
232 | Sat Jul 15 13:30:00 2006 -0700 | |||
|
233 | Sun Jun 11 00:26:40 2006 -0400 | |||
|
234 | Sat Apr 15 13:30:00 2006 +0200 | |||
|
235 | Sat Apr 15 13:30:00 2006 +0000 | |||
|
236 | Wed Feb 01 13:00:30 2006 -0500 | |||
|
237 | Wed Feb 01 13:00:30 2006 +0000 |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now