##// END OF EJS Templates
test-template: fix stdio mode on Windows...
Yuya Nishihara -
r42167:a6696540 default
parent child Browse files
Show More
@@ -1,1605 +1,1609 b''
1 Test template filters and functions
1 Test template filters and functions
2 ===================================
2 ===================================
3
3
4 $ hg init a
4 $ hg init a
5 $ cd a
5 $ cd a
6 $ echo a > a
6 $ echo a > a
7 $ hg add a
7 $ hg add a
8 $ echo line 1 > b
8 $ echo line 1 > b
9 $ echo line 2 >> b
9 $ echo line 2 >> b
10 $ hg commit -l b -d '1000000 0' -u 'User Name <user@hostname>'
10 $ hg commit -l b -d '1000000 0' -u 'User Name <user@hostname>'
11
11
12 $ hg add b
12 $ hg add b
13 $ echo other 1 > c
13 $ echo other 1 > c
14 $ echo other 2 >> c
14 $ echo other 2 >> c
15 $ echo >> c
15 $ echo >> c
16 $ echo other 3 >> c
16 $ echo other 3 >> c
17 $ hg commit -l c -d '1100000 0' -u 'A. N. Other <other@place>'
17 $ hg commit -l c -d '1100000 0' -u 'A. N. Other <other@place>'
18
18
19 $ hg add c
19 $ hg add c
20 $ hg commit -m 'no person' -d '1200000 0' -u 'other@place'
20 $ hg commit -m 'no person' -d '1200000 0' -u 'other@place'
21 $ echo c >> c
21 $ echo c >> c
22 $ hg commit -m 'no user, no domain' -d '1300000 0' -u 'person'
22 $ hg commit -m 'no user, no domain' -d '1300000 0' -u 'person'
23
23
24 $ echo foo > .hg/branch
24 $ echo foo > .hg/branch
25 $ hg commit -m 'new branch' -d '1400000 0' -u 'person'
25 $ hg commit -m 'new branch' -d '1400000 0' -u 'person'
26
26
27 $ hg co -q 3
27 $ hg co -q 3
28 $ echo other 4 >> d
28 $ echo other 4 >> d
29 $ hg add d
29 $ hg add d
30 $ hg commit -m 'new head' -d '1500000 0' -u 'person'
30 $ hg commit -m 'new head' -d '1500000 0' -u 'person'
31
31
32 $ hg merge -q foo
32 $ hg merge -q foo
33 $ hg commit -m 'merge' -d '1500001 0' -u 'person'
33 $ hg commit -m 'merge' -d '1500001 0' -u 'person'
34
34
35 Second branch starting at nullrev:
35 Second branch starting at nullrev:
36
36
37 $ hg update null
37 $ hg update null
38 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
38 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
39 $ echo second > second
39 $ echo second > second
40 $ hg add second
40 $ hg add second
41 $ hg commit -m second -d '1000000 0' -u 'User Name <user@hostname>'
41 $ hg commit -m second -d '1000000 0' -u 'User Name <user@hostname>'
42 created new head
42 created new head
43
43
44 $ echo third > third
44 $ echo third > third
45 $ hg add third
45 $ hg add third
46 $ hg mv second fourth
46 $ hg mv second fourth
47 $ hg commit -m third -d "2020-01-01 10:01"
47 $ hg commit -m third -d "2020-01-01 10:01"
48
48
49 $ hg phase -r 5 --public
49 $ hg phase -r 5 --public
50 $ hg phase -r 7 --secret --force
50 $ hg phase -r 7 --secret --force
51
51
52 Filters work:
52 Filters work:
53
53
54 $ hg log --template '{author|domain}\n'
54 $ hg log --template '{author|domain}\n'
55
55
56 hostname
56 hostname
57
57
58
58
59
59
60
60
61 place
61 place
62 place
62 place
63 hostname
63 hostname
64
64
65 $ hg log --template '{author|person}\n'
65 $ hg log --template '{author|person}\n'
66 test
66 test
67 User Name
67 User Name
68 person
68 person
69 person
69 person
70 person
70 person
71 person
71 person
72 other
72 other
73 A. N. Other
73 A. N. Other
74 User Name
74 User Name
75
75
76 $ hg log --template '{author|user}\n'
76 $ hg log --template '{author|user}\n'
77 test
77 test
78 user
78 user
79 person
79 person
80 person
80 person
81 person
81 person
82 person
82 person
83 other
83 other
84 other
84 other
85 user
85 user
86
86
87 $ hg log --template '{date|date}\n'
87 $ hg log --template '{date|date}\n'
88 Wed Jan 01 10:01:00 2020 +0000
88 Wed Jan 01 10:01:00 2020 +0000
89 Mon Jan 12 13:46:40 1970 +0000
89 Mon Jan 12 13:46:40 1970 +0000
90 Sun Jan 18 08:40:01 1970 +0000
90 Sun Jan 18 08:40:01 1970 +0000
91 Sun Jan 18 08:40:00 1970 +0000
91 Sun Jan 18 08:40:00 1970 +0000
92 Sat Jan 17 04:53:20 1970 +0000
92 Sat Jan 17 04:53:20 1970 +0000
93 Fri Jan 16 01:06:40 1970 +0000
93 Fri Jan 16 01:06:40 1970 +0000
94 Wed Jan 14 21:20:00 1970 +0000
94 Wed Jan 14 21:20:00 1970 +0000
95 Tue Jan 13 17:33:20 1970 +0000
95 Tue Jan 13 17:33:20 1970 +0000
96 Mon Jan 12 13:46:40 1970 +0000
96 Mon Jan 12 13:46:40 1970 +0000
97
97
98 $ hg log --template '{date|isodate}\n'
98 $ hg log --template '{date|isodate}\n'
99 2020-01-01 10:01 +0000
99 2020-01-01 10:01 +0000
100 1970-01-12 13:46 +0000
100 1970-01-12 13:46 +0000
101 1970-01-18 08:40 +0000
101 1970-01-18 08:40 +0000
102 1970-01-18 08:40 +0000
102 1970-01-18 08:40 +0000
103 1970-01-17 04:53 +0000
103 1970-01-17 04:53 +0000
104 1970-01-16 01:06 +0000
104 1970-01-16 01:06 +0000
105 1970-01-14 21:20 +0000
105 1970-01-14 21:20 +0000
106 1970-01-13 17:33 +0000
106 1970-01-13 17:33 +0000
107 1970-01-12 13:46 +0000
107 1970-01-12 13:46 +0000
108
108
109 $ hg log --template '{date|isodatesec}\n'
109 $ hg log --template '{date|isodatesec}\n'
110 2020-01-01 10:01:00 +0000
110 2020-01-01 10:01:00 +0000
111 1970-01-12 13:46:40 +0000
111 1970-01-12 13:46:40 +0000
112 1970-01-18 08:40:01 +0000
112 1970-01-18 08:40:01 +0000
113 1970-01-18 08:40:00 +0000
113 1970-01-18 08:40:00 +0000
114 1970-01-17 04:53:20 +0000
114 1970-01-17 04:53:20 +0000
115 1970-01-16 01:06:40 +0000
115 1970-01-16 01:06:40 +0000
116 1970-01-14 21:20:00 +0000
116 1970-01-14 21:20:00 +0000
117 1970-01-13 17:33:20 +0000
117 1970-01-13 17:33:20 +0000
118 1970-01-12 13:46:40 +0000
118 1970-01-12 13:46:40 +0000
119
119
120 $ hg log --template '{date|rfc822date}\n'
120 $ hg log --template '{date|rfc822date}\n'
121 Wed, 01 Jan 2020 10:01:00 +0000
121 Wed, 01 Jan 2020 10:01:00 +0000
122 Mon, 12 Jan 1970 13:46:40 +0000
122 Mon, 12 Jan 1970 13:46:40 +0000
123 Sun, 18 Jan 1970 08:40:01 +0000
123 Sun, 18 Jan 1970 08:40:01 +0000
124 Sun, 18 Jan 1970 08:40:00 +0000
124 Sun, 18 Jan 1970 08:40:00 +0000
125 Sat, 17 Jan 1970 04:53:20 +0000
125 Sat, 17 Jan 1970 04:53:20 +0000
126 Fri, 16 Jan 1970 01:06:40 +0000
126 Fri, 16 Jan 1970 01:06:40 +0000
127 Wed, 14 Jan 1970 21:20:00 +0000
127 Wed, 14 Jan 1970 21:20:00 +0000
128 Tue, 13 Jan 1970 17:33:20 +0000
128 Tue, 13 Jan 1970 17:33:20 +0000
129 Mon, 12 Jan 1970 13:46:40 +0000
129 Mon, 12 Jan 1970 13:46:40 +0000
130
130
131 $ hg log --template '{desc|firstline}\n'
131 $ hg log --template '{desc|firstline}\n'
132 third
132 third
133 second
133 second
134 merge
134 merge
135 new head
135 new head
136 new branch
136 new branch
137 no user, no domain
137 no user, no domain
138 no person
138 no person
139 other 1
139 other 1
140 line 1
140 line 1
141
141
142 $ hg log --template '{node|short}\n'
142 $ hg log --template '{node|short}\n'
143 95c24699272e
143 95c24699272e
144 29114dbae42b
144 29114dbae42b
145 d41e714fe50d
145 d41e714fe50d
146 13207e5a10d9
146 13207e5a10d9
147 bbe44766e73d
147 bbe44766e73d
148 10e46f2dcbf4
148 10e46f2dcbf4
149 97054abb4ab8
149 97054abb4ab8
150 b608e9d1a3f0
150 b608e9d1a3f0
151 1e4e1b8f71e0
151 1e4e1b8f71e0
152
152
153 $ hg log --template '<changeset author="{author|xmlescape}"/>\n'
153 $ hg log --template '<changeset author="{author|xmlescape}"/>\n'
154 <changeset author="test"/>
154 <changeset author="test"/>
155 <changeset author="User Name &lt;user@hostname&gt;"/>
155 <changeset author="User Name &lt;user@hostname&gt;"/>
156 <changeset author="person"/>
156 <changeset author="person"/>
157 <changeset author="person"/>
157 <changeset author="person"/>
158 <changeset author="person"/>
158 <changeset author="person"/>
159 <changeset author="person"/>
159 <changeset author="person"/>
160 <changeset author="other@place"/>
160 <changeset author="other@place"/>
161 <changeset author="A. N. Other &lt;other@place&gt;"/>
161 <changeset author="A. N. Other &lt;other@place&gt;"/>
162 <changeset author="User Name &lt;user@hostname&gt;"/>
162 <changeset author="User Name &lt;user@hostname&gt;"/>
163
163
164 $ hg log --template '{rev}: {children}\n'
164 $ hg log --template '{rev}: {children}\n'
165 8:
165 8:
166 7: 8:95c24699272e
166 7: 8:95c24699272e
167 6:
167 6:
168 5: 6:d41e714fe50d
168 5: 6:d41e714fe50d
169 4: 6:d41e714fe50d
169 4: 6:d41e714fe50d
170 3: 4:bbe44766e73d 5:13207e5a10d9
170 3: 4:bbe44766e73d 5:13207e5a10d9
171 2: 3:10e46f2dcbf4
171 2: 3:10e46f2dcbf4
172 1: 2:97054abb4ab8
172 1: 2:97054abb4ab8
173 0: 1:b608e9d1a3f0
173 0: 1:b608e9d1a3f0
174
174
175 Formatnode filter works:
175 Formatnode filter works:
176
176
177 $ hg -q log -r 0 --template '{node|formatnode}\n'
177 $ hg -q log -r 0 --template '{node|formatnode}\n'
178 1e4e1b8f71e0
178 1e4e1b8f71e0
179
179
180 $ hg log -r 0 --template '{node|formatnode}\n'
180 $ hg log -r 0 --template '{node|formatnode}\n'
181 1e4e1b8f71e0
181 1e4e1b8f71e0
182
182
183 $ hg -v log -r 0 --template '{node|formatnode}\n'
183 $ hg -v log -r 0 --template '{node|formatnode}\n'
184 1e4e1b8f71e0
184 1e4e1b8f71e0
185
185
186 $ hg --debug log -r 0 --template '{node|formatnode}\n'
186 $ hg --debug log -r 0 --template '{node|formatnode}\n'
187 1e4e1b8f71e05681d422154f5421e385fec3454f
187 1e4e1b8f71e05681d422154f5421e385fec3454f
188
188
189 Age filter:
189 Age filter:
190
190
191 $ hg init unstable-hash
191 $ hg init unstable-hash
192 $ cd unstable-hash
192 $ cd unstable-hash
193 $ hg log --template '{date|age}\n' > /dev/null || exit 1
193 $ hg log --template '{date|age}\n' > /dev/null || exit 1
194
194
195 >>> from __future__ import absolute_import
195 >>> from __future__ import absolute_import
196 >>> import datetime
196 >>> import datetime
197 >>> fp = open('a', 'wb')
197 >>> fp = open('a', 'wb')
198 >>> n = datetime.datetime.now() + datetime.timedelta(366 * 7)
198 >>> n = datetime.datetime.now() + datetime.timedelta(366 * 7)
199 >>> fp.write(b'%d-%d-%d 00:00' % (n.year, n.month, n.day)) and None
199 >>> fp.write(b'%d-%d-%d 00:00' % (n.year, n.month, n.day)) and None
200 >>> fp.close()
200 >>> fp.close()
201 $ hg add a
201 $ hg add a
202 $ hg commit -m future -d "`cat a`"
202 $ hg commit -m future -d "`cat a`"
203
203
204 $ hg log -l1 --template '{date|age}\n'
204 $ hg log -l1 --template '{date|age}\n'
205 7 years from now
205 7 years from now
206
206
207 $ cd ..
207 $ cd ..
208 $ rm -rf unstable-hash
208 $ rm -rf unstable-hash
209
209
210 Filename filters:
210 Filename filters:
211
211
212 $ hg debugtemplate '{"foo/bar"|basename}|{"foo/"|basename}|{"foo"|basename}|\n'
212 $ hg debugtemplate '{"foo/bar"|basename}|{"foo/"|basename}|{"foo"|basename}|\n'
213 bar||foo|
213 bar||foo|
214 $ hg debugtemplate '{"foo/bar"|dirname}|{"foo/"|dirname}|{"foo"|dirname}|\n'
214 $ hg debugtemplate '{"foo/bar"|dirname}|{"foo/"|dirname}|{"foo"|dirname}|\n'
215 foo|foo||
215 foo|foo||
216 $ hg debugtemplate '{"foo/bar"|stripdir}|{"foo/"|stripdir}|{"foo"|stripdir}|\n'
216 $ hg debugtemplate '{"foo/bar"|stripdir}|{"foo/"|stripdir}|{"foo"|stripdir}|\n'
217 foo|foo|foo|
217 foo|foo|foo|
218
218
219 commondir() filter:
219 commondir() filter:
220
220
221 $ hg debugtemplate '{""|splitlines|commondir}\n'
221 $ hg debugtemplate '{""|splitlines|commondir}\n'
222
222
223 $ hg debugtemplate '{"foo/bar\nfoo/baz\nfoo/foobar\n"|splitlines|commondir}\n'
223 $ hg debugtemplate '{"foo/bar\nfoo/baz\nfoo/foobar\n"|splitlines|commondir}\n'
224 foo
224 foo
225 $ hg debugtemplate '{"foo/bar\nfoo/bar\n"|splitlines|commondir}\n'
225 $ hg debugtemplate '{"foo/bar\nfoo/bar\n"|splitlines|commondir}\n'
226 foo
226 foo
227 $ hg debugtemplate '{"/foo/bar\n/foo/bar\n"|splitlines|commondir}\n'
227 $ hg debugtemplate '{"/foo/bar\n/foo/bar\n"|splitlines|commondir}\n'
228 foo
228 foo
229 $ hg debugtemplate '{"/foo\n/foo\n"|splitlines|commondir}\n'
229 $ hg debugtemplate '{"/foo\n/foo\n"|splitlines|commondir}\n'
230
230
231 $ hg debugtemplate '{"foo/bar\nbar/baz"|splitlines|commondir}\n'
231 $ hg debugtemplate '{"foo/bar\nbar/baz"|splitlines|commondir}\n'
232
232
233 $ hg debugtemplate '{"foo/bar\nbar/baz\nbar/foo\n"|splitlines|commondir}\n'
233 $ hg debugtemplate '{"foo/bar\nbar/baz\nbar/foo\n"|splitlines|commondir}\n'
234
234
235 $ hg debugtemplate '{"foo/../bar\nfoo/bar"|splitlines|commondir}\n'
235 $ hg debugtemplate '{"foo/../bar\nfoo/bar"|splitlines|commondir}\n'
236 foo
236 foo
237 $ hg debugtemplate '{"foo\n/foo"|splitlines|commondir}\n'
237 $ hg debugtemplate '{"foo\n/foo"|splitlines|commondir}\n'
238
238
239
239
240 $ hg log -r null -T '{rev|commondir}'
240 $ hg log -r null -T '{rev|commondir}'
241 hg: parse error: argument is not a list of text
241 hg: parse error: argument is not a list of text
242 (template filter 'commondir' is not compatible with keyword 'rev')
242 (template filter 'commondir' is not compatible with keyword 'rev')
243 [255]
243 [255]
244
244
245 Add a dummy commit to make up for the instability of the above:
245 Add a dummy commit to make up for the instability of the above:
246
246
247 $ echo a > a
247 $ echo a > a
248 $ hg add a
248 $ hg add a
249 $ hg ci -m future
249 $ hg ci -m future
250
250
251 Count filter:
251 Count filter:
252
252
253 $ hg log -l1 --template '{node|count} {node|short|count}\n'
253 $ hg log -l1 --template '{node|count} {node|short|count}\n'
254 40 12
254 40 12
255
255
256 $ hg log -l1 --template '{revset("null^")|count} {revset(".")|count} {revset("0::3")|count}\n'
256 $ hg log -l1 --template '{revset("null^")|count} {revset(".")|count} {revset("0::3")|count}\n'
257 0 1 4
257 0 1 4
258
258
259 $ hg log -G --template '{rev}: children: {children|count}, \
259 $ hg log -G --template '{rev}: children: {children|count}, \
260 > tags: {tags|count}, file_adds: {file_adds|count}, \
260 > tags: {tags|count}, file_adds: {file_adds|count}, \
261 > ancestors: {revset("ancestors(%s)", rev)|count}'
261 > ancestors: {revset("ancestors(%s)", rev)|count}'
262 @ 9: children: 0, tags: 1, file_adds: 1, ancestors: 3
262 @ 9: children: 0, tags: 1, file_adds: 1, ancestors: 3
263 |
263 |
264 o 8: children: 1, tags: 0, file_adds: 2, ancestors: 2
264 o 8: children: 1, tags: 0, file_adds: 2, ancestors: 2
265 |
265 |
266 o 7: children: 1, tags: 0, file_adds: 1, ancestors: 1
266 o 7: children: 1, tags: 0, file_adds: 1, ancestors: 1
267
267
268 o 6: children: 0, tags: 0, file_adds: 0, ancestors: 7
268 o 6: children: 0, tags: 0, file_adds: 0, ancestors: 7
269 |\
269 |\
270 | o 5: children: 1, tags: 0, file_adds: 1, ancestors: 5
270 | o 5: children: 1, tags: 0, file_adds: 1, ancestors: 5
271 | |
271 | |
272 o | 4: children: 1, tags: 0, file_adds: 0, ancestors: 5
272 o | 4: children: 1, tags: 0, file_adds: 0, ancestors: 5
273 |/
273 |/
274 o 3: children: 2, tags: 0, file_adds: 0, ancestors: 4
274 o 3: children: 2, tags: 0, file_adds: 0, ancestors: 4
275 |
275 |
276 o 2: children: 1, tags: 0, file_adds: 1, ancestors: 3
276 o 2: children: 1, tags: 0, file_adds: 1, ancestors: 3
277 |
277 |
278 o 1: children: 1, tags: 0, file_adds: 1, ancestors: 2
278 o 1: children: 1, tags: 0, file_adds: 1, ancestors: 2
279 |
279 |
280 o 0: children: 1, tags: 0, file_adds: 1, ancestors: 1
280 o 0: children: 1, tags: 0, file_adds: 1, ancestors: 1
281
281
282
282
283 $ hg log -l1 -T '{termwidth|count}\n'
283 $ hg log -l1 -T '{termwidth|count}\n'
284 hg: parse error: not countable
284 hg: parse error: not countable
285 (template filter 'count' is not compatible with keyword 'termwidth')
285 (template filter 'count' is not compatible with keyword 'termwidth')
286 [255]
286 [255]
287
287
288 Upper/lower filters:
288 Upper/lower filters:
289
289
290 $ hg log -r0 --template '{branch|upper}\n'
290 $ hg log -r0 --template '{branch|upper}\n'
291 DEFAULT
291 DEFAULT
292 $ hg log -r0 --template '{author|lower}\n'
292 $ hg log -r0 --template '{author|lower}\n'
293 user name <user@hostname>
293 user name <user@hostname>
294 $ hg log -r0 --template '{date|upper}\n'
294 $ hg log -r0 --template '{date|upper}\n'
295 1000000.00
295 1000000.00
296
296
297 Add a commit that does all possible modifications at once
297 Add a commit that does all possible modifications at once
298
298
299 $ echo modify >> third
299 $ echo modify >> third
300 $ touch b
300 $ touch b
301 $ hg add b
301 $ hg add b
302 $ hg mv fourth fifth
302 $ hg mv fourth fifth
303 $ hg rm a
303 $ hg rm a
304 $ hg ci -m "Modify, add, remove, rename"
304 $ hg ci -m "Modify, add, remove, rename"
305
305
306 Pass generator object created by template function to filter
306 Pass generator object created by template function to filter
307
307
308 $ hg log -l 1 --template '{if(author, author)|user}\n'
308 $ hg log -l 1 --template '{if(author, author)|user}\n'
309 test
309 test
310
310
311 Test diff function:
311 Test diff function:
312
312
313 $ hg diff -c 8
313 $ hg diff -c 8
314 diff -r 29114dbae42b -r 95c24699272e fourth
314 diff -r 29114dbae42b -r 95c24699272e fourth
315 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
315 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
316 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
316 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
317 @@ -0,0 +1,1 @@
317 @@ -0,0 +1,1 @@
318 +second
318 +second
319 diff -r 29114dbae42b -r 95c24699272e second
319 diff -r 29114dbae42b -r 95c24699272e second
320 --- a/second Mon Jan 12 13:46:40 1970 +0000
320 --- a/second Mon Jan 12 13:46:40 1970 +0000
321 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
321 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
322 @@ -1,1 +0,0 @@
322 @@ -1,1 +0,0 @@
323 -second
323 -second
324 diff -r 29114dbae42b -r 95c24699272e third
324 diff -r 29114dbae42b -r 95c24699272e third
325 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
325 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
326 +++ b/third Wed Jan 01 10:01:00 2020 +0000
326 +++ b/third Wed Jan 01 10:01:00 2020 +0000
327 @@ -0,0 +1,1 @@
327 @@ -0,0 +1,1 @@
328 +third
328 +third
329
329
330 $ hg log -r 8 -T "{diff()}"
330 $ hg log -r 8 -T "{diff()}"
331 diff -r 29114dbae42b -r 95c24699272e fourth
331 diff -r 29114dbae42b -r 95c24699272e fourth
332 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
332 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
333 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
333 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
334 @@ -0,0 +1,1 @@
334 @@ -0,0 +1,1 @@
335 +second
335 +second
336 diff -r 29114dbae42b -r 95c24699272e second
336 diff -r 29114dbae42b -r 95c24699272e second
337 --- a/second Mon Jan 12 13:46:40 1970 +0000
337 --- a/second Mon Jan 12 13:46:40 1970 +0000
338 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
338 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
339 @@ -1,1 +0,0 @@
339 @@ -1,1 +0,0 @@
340 -second
340 -second
341 diff -r 29114dbae42b -r 95c24699272e third
341 diff -r 29114dbae42b -r 95c24699272e third
342 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
342 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
343 +++ b/third Wed Jan 01 10:01:00 2020 +0000
343 +++ b/third Wed Jan 01 10:01:00 2020 +0000
344 @@ -0,0 +1,1 @@
344 @@ -0,0 +1,1 @@
345 +third
345 +third
346
346
347 $ hg log -r 8 -T "{diff('glob:f*')}"
347 $ hg log -r 8 -T "{diff('glob:f*')}"
348 diff -r 29114dbae42b -r 95c24699272e fourth
348 diff -r 29114dbae42b -r 95c24699272e fourth
349 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
349 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
350 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
350 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
351 @@ -0,0 +1,1 @@
351 @@ -0,0 +1,1 @@
352 +second
352 +second
353
353
354 $ hg log -r 8 -T "{diff('', 'glob:f*')}"
354 $ hg log -r 8 -T "{diff('', 'glob:f*')}"
355 diff -r 29114dbae42b -r 95c24699272e second
355 diff -r 29114dbae42b -r 95c24699272e second
356 --- a/second Mon Jan 12 13:46:40 1970 +0000
356 --- a/second Mon Jan 12 13:46:40 1970 +0000
357 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
357 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
358 @@ -1,1 +0,0 @@
358 @@ -1,1 +0,0 @@
359 -second
359 -second
360 diff -r 29114dbae42b -r 95c24699272e third
360 diff -r 29114dbae42b -r 95c24699272e third
361 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
361 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
362 +++ b/third Wed Jan 01 10:01:00 2020 +0000
362 +++ b/third Wed Jan 01 10:01:00 2020 +0000
363 @@ -0,0 +1,1 @@
363 @@ -0,0 +1,1 @@
364 +third
364 +third
365
365
366 $ hg log -r 8 -T "{diff('FOURTH'|lower)}"
366 $ hg log -r 8 -T "{diff('FOURTH'|lower)}"
367 diff -r 29114dbae42b -r 95c24699272e fourth
367 diff -r 29114dbae42b -r 95c24699272e fourth
368 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
368 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
369 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
369 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
370 @@ -0,0 +1,1 @@
370 @@ -0,0 +1,1 @@
371 +second
371 +second
372
372
373 $ cd ..
373 $ cd ..
374
374
375 latesttag() function:
375 latesttag() function:
376
376
377 $ hg init latesttag
377 $ hg init latesttag
378 $ cd latesttag
378 $ cd latesttag
379
379
380 $ echo a > file
380 $ echo a > file
381 $ hg ci -Am a -d '0 0'
381 $ hg ci -Am a -d '0 0'
382 adding file
382 adding file
383
383
384 $ echo b >> file
384 $ echo b >> file
385 $ hg ci -m b -d '1 0'
385 $ hg ci -m b -d '1 0'
386
386
387 $ echo c >> head1
387 $ echo c >> head1
388 $ hg ci -Am h1c -d '2 0'
388 $ hg ci -Am h1c -d '2 0'
389 adding head1
389 adding head1
390
390
391 $ hg update -q 1
391 $ hg update -q 1
392 $ echo d >> head2
392 $ echo d >> head2
393 $ hg ci -Am h2d -d '3 0'
393 $ hg ci -Am h2d -d '3 0'
394 adding head2
394 adding head2
395 created new head
395 created new head
396
396
397 $ echo e >> head2
397 $ echo e >> head2
398 $ hg ci -m h2e -d '4 0'
398 $ hg ci -m h2e -d '4 0'
399
399
400 $ hg merge -q
400 $ hg merge -q
401 $ hg ci -m merge -d '5 -3600'
401 $ hg ci -m merge -d '5 -3600'
402
402
403 $ hg tag -r 1 -m t1 -d '6 0' t1
403 $ hg tag -r 1 -m t1 -d '6 0' t1
404 $ hg tag -r 2 -m t2 -d '7 0' t2
404 $ hg tag -r 2 -m t2 -d '7 0' t2
405 $ hg tag -r 3 -m t3 -d '8 0' t3
405 $ hg tag -r 3 -m t3 -d '8 0' t3
406 $ hg tag -r 4 -m t4 -d '4 0' t4 # older than t2, but should not matter
406 $ hg tag -r 4 -m t4 -d '4 0' t4 # older than t2, but should not matter
407 $ hg tag -r 5 -m t5 -d '9 0' t5
407 $ hg tag -r 5 -m t5 -d '9 0' t5
408 $ hg tag -r 3 -m at3 -d '10 0' at3
408 $ hg tag -r 3 -m at3 -d '10 0' at3
409
409
410 $ hg log -G --template "{rev}: {latesttag('re:^t[13]$') % '{tag}, C: {changes}, D: {distance}'}\n"
410 $ hg log -G --template "{rev}: {latesttag('re:^t[13]$') % '{tag}, C: {changes}, D: {distance}'}\n"
411 @ 11: t3, C: 9, D: 8
411 @ 11: t3, C: 9, D: 8
412 |
412 |
413 o 10: t3, C: 8, D: 7
413 o 10: t3, C: 8, D: 7
414 |
414 |
415 o 9: t3, C: 7, D: 6
415 o 9: t3, C: 7, D: 6
416 |
416 |
417 o 8: t3, C: 6, D: 5
417 o 8: t3, C: 6, D: 5
418 |
418 |
419 o 7: t3, C: 5, D: 4
419 o 7: t3, C: 5, D: 4
420 |
420 |
421 o 6: t3, C: 4, D: 3
421 o 6: t3, C: 4, D: 3
422 |
422 |
423 o 5: t3, C: 3, D: 2
423 o 5: t3, C: 3, D: 2
424 |\
424 |\
425 | o 4: t3, C: 1, D: 1
425 | o 4: t3, C: 1, D: 1
426 | |
426 | |
427 | o 3: t3, C: 0, D: 0
427 | o 3: t3, C: 0, D: 0
428 | |
428 | |
429 o | 2: t1, C: 1, D: 1
429 o | 2: t1, C: 1, D: 1
430 |/
430 |/
431 o 1: t1, C: 0, D: 0
431 o 1: t1, C: 0, D: 0
432 |
432 |
433 o 0: null, C: 1, D: 1
433 o 0: null, C: 1, D: 1
434
434
435
435
436 $ cd ..
436 $ cd ..
437
437
438 Test filter() empty values:
438 Test filter() empty values:
439
439
440 $ hg log -R a -r 1 -T '{filter(desc|splitlines) % "{line}\n"}'
440 $ hg log -R a -r 1 -T '{filter(desc|splitlines) % "{line}\n"}'
441 other 1
441 other 1
442 other 2
442 other 2
443 other 3
443 other 3
444 $ hg log -R a -r 0 -T '{filter(dict(a=0, b=1) % "{ifeq(key, "a", "{value}\n")}")}'
444 $ hg log -R a -r 0 -T '{filter(dict(a=0, b=1) % "{ifeq(key, "a", "{value}\n")}")}'
445 0
445 0
446
446
447 0 should not be falsy
447 0 should not be falsy
448
448
449 $ hg log -R a -r 0 -T '{filter(revset("0:2"))}\n'
449 $ hg log -R a -r 0 -T '{filter(revset("0:2"))}\n'
450 0 1 2
450 0 1 2
451
451
452 Test filter() by expression:
452 Test filter() by expression:
453
453
454 $ hg log -R a -r 1 -T '{filter(desc|splitlines, ifcontains("1", line, "t"))}\n'
454 $ hg log -R a -r 1 -T '{filter(desc|splitlines, ifcontains("1", line, "t"))}\n'
455 other 1
455 other 1
456 $ hg log -R a -r 0 -T '{filter(dict(a=0, b=1), ifeq(key, "b", "t"))}\n'
456 $ hg log -R a -r 0 -T '{filter(dict(a=0, b=1), ifeq(key, "b", "t"))}\n'
457 b=1
457 b=1
458
458
459 Test filter() shouldn't crash:
459 Test filter() shouldn't crash:
460
460
461 $ hg log -R a -r 0 -T '{filter(extras)}\n'
461 $ hg log -R a -r 0 -T '{filter(extras)}\n'
462 branch=default
462 branch=default
463 $ hg log -R a -r 0 -T '{filter(files)}\n'
463 $ hg log -R a -r 0 -T '{filter(files)}\n'
464 a
464 a
465
465
466 Test filter() unsupported arguments:
466 Test filter() unsupported arguments:
467
467
468 $ hg log -R a -r 0 -T '{filter()}\n'
468 $ hg log -R a -r 0 -T '{filter()}\n'
469 hg: parse error: filter expects one or two arguments
469 hg: parse error: filter expects one or two arguments
470 [255]
470 [255]
471 $ hg log -R a -r 0 -T '{filter(date)}\n'
471 $ hg log -R a -r 0 -T '{filter(date)}\n'
472 hg: parse error: date is not iterable
472 hg: parse error: date is not iterable
473 [255]
473 [255]
474 $ hg log -R a -r 0 -T '{filter(rev)}\n'
474 $ hg log -R a -r 0 -T '{filter(rev)}\n'
475 hg: parse error: 0 is not iterable
475 hg: parse error: 0 is not iterable
476 [255]
476 [255]
477 $ hg log -R a -r 0 -T '{filter(desc|firstline)}\n'
477 $ hg log -R a -r 0 -T '{filter(desc|firstline)}\n'
478 hg: parse error: 'line 1' is not filterable
478 hg: parse error: 'line 1' is not filterable
479 [255]
479 [255]
480 $ hg log -R a -r 0 -T '{filter(manifest)}\n'
480 $ hg log -R a -r 0 -T '{filter(manifest)}\n'
481 hg: parse error: '0:a0c8bcbbb45c' is not filterable
481 hg: parse error: '0:a0c8bcbbb45c' is not filterable
482 [255]
482 [255]
483 $ hg log -R a -r 0 -T '{filter(succsandmarkers)}\n'
483 $ hg log -R a -r 0 -T '{filter(succsandmarkers)}\n'
484 hg: parse error: not filterable without template
484 hg: parse error: not filterable without template
485 [255]
485 [255]
486 $ hg log -R a -r 0 -T '{filter(desc|splitlines % "{line}", "")}\n'
486 $ hg log -R a -r 0 -T '{filter(desc|splitlines % "{line}", "")}\n'
487 hg: parse error: not filterable by expression
487 hg: parse error: not filterable by expression
488 [255]
488 [255]
489
489
490 Test manifest/get() can be join()-ed as string, though it's silly:
490 Test manifest/get() can be join()-ed as string, though it's silly:
491
491
492 $ hg log -R latesttag -r tip -T '{join(manifest, ".")}\n'
492 $ hg log -R latesttag -r tip -T '{join(manifest, ".")}\n'
493 1.1.:.2.b.c.6.e.9.0.0.6.c.e.2
493 1.1.:.2.b.c.6.e.9.0.0.6.c.e.2
494 $ hg log -R latesttag -r tip -T '{join(get(extras, "branch"), ".")}\n'
494 $ hg log -R latesttag -r tip -T '{join(get(extras, "branch"), ".")}\n'
495 d.e.f.a.u.l.t
495 d.e.f.a.u.l.t
496
496
497 Test join() over string
497 Test join() over string
498
498
499 $ hg log -R latesttag -r tip -T '{join(rev|stringify, ".")}\n'
499 $ hg log -R latesttag -r tip -T '{join(rev|stringify, ".")}\n'
500 1.1
500 1.1
501
501
502 Test join() over uniterable
502 Test join() over uniterable
503
503
504 $ hg log -R latesttag -r tip -T '{join(rev, "")}\n'
504 $ hg log -R latesttag -r tip -T '{join(rev, "")}\n'
505 hg: parse error: 11 is not iterable
505 hg: parse error: 11 is not iterable
506 [255]
506 [255]
507
507
508 Test min/max of integers
508 Test min/max of integers
509
509
510 $ hg log -R latesttag -l1 -T '{min(revset("9:10"))}\n'
510 $ hg log -R latesttag -l1 -T '{min(revset("9:10"))}\n'
511 9
511 9
512 $ hg log -R latesttag -l1 -T '{max(revset("9:10"))}\n'
512 $ hg log -R latesttag -l1 -T '{max(revset("9:10"))}\n'
513 10
513 10
514
514
515 Test min/max over map operation:
515 Test min/max over map operation:
516
516
517 $ hg log -R latesttag -r3 -T '{min(tags % "{tag}")}\n'
517 $ hg log -R latesttag -r3 -T '{min(tags % "{tag}")}\n'
518 at3
518 at3
519 $ hg log -R latesttag -r3 -T '{max(tags % "{tag}")}\n'
519 $ hg log -R latesttag -r3 -T '{max(tags % "{tag}")}\n'
520 t3
520 t3
521
521
522 Test min/max of strings:
522 Test min/max of strings:
523
523
524 $ hg log -R latesttag -l1 -T '{min(desc)}\n'
524 $ hg log -R latesttag -l1 -T '{min(desc)}\n'
525 3
525 3
526 $ hg log -R latesttag -l1 -T '{max(desc)}\n'
526 $ hg log -R latesttag -l1 -T '{max(desc)}\n'
527 t
527 t
528
528
529 Test min/max of non-iterable:
529 Test min/max of non-iterable:
530
530
531 $ hg debugtemplate '{min(1)}'
531 $ hg debugtemplate '{min(1)}'
532 hg: parse error: 1 is not iterable
532 hg: parse error: 1 is not iterable
533 (min first argument should be an iterable)
533 (min first argument should be an iterable)
534 [255]
534 [255]
535 $ hg debugtemplate '{max(2)}'
535 $ hg debugtemplate '{max(2)}'
536 hg: parse error: 2 is not iterable
536 hg: parse error: 2 is not iterable
537 (max first argument should be an iterable)
537 (max first argument should be an iterable)
538 [255]
538 [255]
539
539
540 $ hg log -R latesttag -l1 -T '{min(date)}'
540 $ hg log -R latesttag -l1 -T '{min(date)}'
541 hg: parse error: date is not iterable
541 hg: parse error: date is not iterable
542 (min first argument should be an iterable)
542 (min first argument should be an iterable)
543 [255]
543 [255]
544 $ hg log -R latesttag -l1 -T '{max(date)}'
544 $ hg log -R latesttag -l1 -T '{max(date)}'
545 hg: parse error: date is not iterable
545 hg: parse error: date is not iterable
546 (max first argument should be an iterable)
546 (max first argument should be an iterable)
547 [255]
547 [255]
548
548
549 Test min/max of empty sequence:
549 Test min/max of empty sequence:
550
550
551 $ hg debugtemplate '{min("")}'
551 $ hg debugtemplate '{min("")}'
552 hg: parse error: empty string
552 hg: parse error: empty string
553 (min first argument should be an iterable)
553 (min first argument should be an iterable)
554 [255]
554 [255]
555 $ hg debugtemplate '{max("")}'
555 $ hg debugtemplate '{max("")}'
556 hg: parse error: empty string
556 hg: parse error: empty string
557 (max first argument should be an iterable)
557 (max first argument should be an iterable)
558 [255]
558 [255]
559 $ hg debugtemplate '{min(dict())}'
559 $ hg debugtemplate '{min(dict())}'
560 hg: parse error: empty sequence
560 hg: parse error: empty sequence
561 (min first argument should be an iterable)
561 (min first argument should be an iterable)
562 [255]
562 [255]
563 $ hg debugtemplate '{max(dict())}'
563 $ hg debugtemplate '{max(dict())}'
564 hg: parse error: empty sequence
564 hg: parse error: empty sequence
565 (max first argument should be an iterable)
565 (max first argument should be an iterable)
566 [255]
566 [255]
567 $ hg debugtemplate '{min(dict() % "")}'
567 $ hg debugtemplate '{min(dict() % "")}'
568 hg: parse error: empty sequence
568 hg: parse error: empty sequence
569 (min first argument should be an iterable)
569 (min first argument should be an iterable)
570 [255]
570 [255]
571 $ hg debugtemplate '{max(dict() % "")}'
571 $ hg debugtemplate '{max(dict() % "")}'
572 hg: parse error: empty sequence
572 hg: parse error: empty sequence
573 (max first argument should be an iterable)
573 (max first argument should be an iterable)
574 [255]
574 [255]
575
575
576 Test min/max of if() result
576 Test min/max of if() result
577
577
578 $ cd latesttag
578 $ cd latesttag
579 $ hg log -l1 -T '{min(if(true, revset("9:10"), ""))}\n'
579 $ hg log -l1 -T '{min(if(true, revset("9:10"), ""))}\n'
580 9
580 9
581 $ hg log -l1 -T '{max(if(false, "", revset("9:10")))}\n'
581 $ hg log -l1 -T '{max(if(false, "", revset("9:10")))}\n'
582 10
582 10
583 $ hg log -l1 -T '{min(ifcontains("a", "aa", revset("9:10"), ""))}\n'
583 $ hg log -l1 -T '{min(ifcontains("a", "aa", revset("9:10"), ""))}\n'
584 9
584 9
585 $ hg log -l1 -T '{max(ifcontains("a", "bb", "", revset("9:10")))}\n'
585 $ hg log -l1 -T '{max(ifcontains("a", "bb", "", revset("9:10")))}\n'
586 10
586 10
587 $ hg log -l1 -T '{min(ifeq(0, 0, revset("9:10"), ""))}\n'
587 $ hg log -l1 -T '{min(ifeq(0, 0, revset("9:10"), ""))}\n'
588 9
588 9
589 $ hg log -l1 -T '{max(ifeq(0, 1, "", revset("9:10")))}\n'
589 $ hg log -l1 -T '{max(ifeq(0, 1, "", revset("9:10")))}\n'
590 10
590 10
591 $ cd ..
591 $ cd ..
592
592
593 Test laziness of if() then/else clause
593 Test laziness of if() then/else clause
594
594
595 $ hg debugtemplate '{count(0)}'
595 $ hg debugtemplate '{count(0)}'
596 hg: parse error: not countable
596 hg: parse error: not countable
597 (incompatible use of template filter 'count')
597 (incompatible use of template filter 'count')
598 [255]
598 [255]
599 $ hg debugtemplate '{if(true, "", count(0))}'
599 $ hg debugtemplate '{if(true, "", count(0))}'
600 $ hg debugtemplate '{if(false, count(0), "")}'
600 $ hg debugtemplate '{if(false, count(0), "")}'
601 $ hg debugtemplate '{ifcontains("a", "aa", "", count(0))}'
601 $ hg debugtemplate '{ifcontains("a", "aa", "", count(0))}'
602 $ hg debugtemplate '{ifcontains("a", "bb", count(0), "")}'
602 $ hg debugtemplate '{ifcontains("a", "bb", count(0), "")}'
603 $ hg debugtemplate '{ifeq(0, 0, "", count(0))}'
603 $ hg debugtemplate '{ifeq(0, 0, "", count(0))}'
604 $ hg debugtemplate '{ifeq(0, 1, count(0), "")}'
604 $ hg debugtemplate '{ifeq(0, 1, count(0), "")}'
605
605
606 Test search() function:
606 Test search() function:
607
607
608 $ hg log -R a -r2 -T '{desc}\n'
608 $ hg log -R a -r2 -T '{desc}\n'
609 no person
609 no person
610
610
611 $ hg log -R a -r2 -T '{search(r"p.*", desc)}\n'
611 $ hg log -R a -r2 -T '{search(r"p.*", desc)}\n'
612 person
612 person
613
613
614 as bool
614 as bool
615
615
616 $ hg log -R a -r2 -T '{if(search(r"p.*", desc), "", "not ")}found\n'
616 $ hg log -R a -r2 -T '{if(search(r"p.*", desc), "", "not ")}found\n'
617 found
617 found
618 $ hg log -R a -r2 -T '{if(search(r"q", desc), "", "not ")}found\n'
618 $ hg log -R a -r2 -T '{if(search(r"q", desc), "", "not ")}found\n'
619 not found
619 not found
620
620
621 match as json
621 match as json
622
622
623 $ hg log -R a -r2 -T '{search(r"(no) p.*", desc)|json}\n'
623 $ hg log -R a -r2 -T '{search(r"(no) p.*", desc)|json}\n'
624 {"0": "no person", "1": "no"}
624 {"0": "no person", "1": "no"}
625 $ hg log -R a -r2 -T '{search(r"q", desc)|json}\n'
625 $ hg log -R a -r2 -T '{search(r"q", desc)|json}\n'
626 null
626 null
627
627
628 group reference
628 group reference
629
629
630 $ hg log -R a -r2 -T '{search(r"(no) (p.*)", desc) % "{1|upper} {2|hex}"}\n'
630 $ hg log -R a -r2 -T '{search(r"(no) (p.*)", desc) % "{1|upper} {2|hex}"}\n'
631 NO 706572736f6e
631 NO 706572736f6e
632 $ hg log -R a -r2 -T '{search(r"(?P<foo>[a-z]*)", desc) % "{foo}"}\n'
632 $ hg log -R a -r2 -T '{search(r"(?P<foo>[a-z]*)", desc) % "{foo}"}\n'
633 no
633 no
634 $ hg log -R a -r2 -T '{search(r"(?P<foo>[a-z]*)", desc).foo}\n'
634 $ hg log -R a -r2 -T '{search(r"(?P<foo>[a-z]*)", desc).foo}\n'
635 no
635 no
636
636
637 group reference with no match
637 group reference with no match
638
638
639 $ hg log -R a -r2 -T '{search(r"q", desc) % "match: {0}"}\n'
639 $ hg log -R a -r2 -T '{search(r"q", desc) % "match: {0}"}\n'
640
640
641
641
642 bad group names
642 bad group names
643
643
644 $ hg log -R a -r2 -T '{search(r"(?P<0>.)", desc) % "{0}"}\n'
644 $ hg log -R a -r2 -T '{search(r"(?P<0>.)", desc) % "{0}"}\n'
645 hg: parse error: search got an invalid pattern: (?P<0>.)
645 hg: parse error: search got an invalid pattern: (?P<0>.)
646 [255]
646 [255]
647 $ hg log -R a -r2 -T '{search(r"(?P<repo>.)", desc) % "{repo}"}\n'
647 $ hg log -R a -r2 -T '{search(r"(?P<repo>.)", desc) % "{repo}"}\n'
648 hg: parse error: invalid group 'repo' in search pattern: (?P<repo>.)
648 hg: parse error: invalid group 'repo' in search pattern: (?P<repo>.)
649 [255]
649 [255]
650
650
651 Test the sub function of templating for expansion:
651 Test the sub function of templating for expansion:
652
652
653 $ hg log -R latesttag -r 10 --template '{sub("[0-9]", "x", "{rev}")}\n'
653 $ hg log -R latesttag -r 10 --template '{sub("[0-9]", "x", "{rev}")}\n'
654 xx
654 xx
655
655
656 $ hg log -R latesttag -r 10 -T '{sub("[", "x", rev)}\n'
656 $ hg log -R latesttag -r 10 -T '{sub("[", "x", rev)}\n'
657 hg: parse error: sub got an invalid pattern: [
657 hg: parse error: sub got an invalid pattern: [
658 [255]
658 [255]
659 $ hg log -R latesttag -r 10 -T '{sub("[0-9]", r"\1", rev)}\n'
659 $ hg log -R latesttag -r 10 -T '{sub("[0-9]", r"\1", rev)}\n'
660 hg: parse error: sub got an invalid replacement: \1
660 hg: parse error: sub got an invalid replacement: \1
661 [255]
661 [255]
662
662
663 Test the strip function with chars specified:
663 Test the strip function with chars specified:
664
664
665 $ hg log -R latesttag --template '{desc}\n'
665 $ hg log -R latesttag --template '{desc}\n'
666 at3
666 at3
667 t5
667 t5
668 t4
668 t4
669 t3
669 t3
670 t2
670 t2
671 t1
671 t1
672 merge
672 merge
673 h2e
673 h2e
674 h2d
674 h2d
675 h1c
675 h1c
676 b
676 b
677 a
677 a
678
678
679 $ hg log -R latesttag --template '{strip(desc, "te")}\n'
679 $ hg log -R latesttag --template '{strip(desc, "te")}\n'
680 at3
680 at3
681 5
681 5
682 4
682 4
683 3
683 3
684 2
684 2
685 1
685 1
686 merg
686 merg
687 h2
687 h2
688 h2d
688 h2d
689 h1c
689 h1c
690 b
690 b
691 a
691 a
692
692
693 Test date format:
693 Test date format:
694
694
695 $ hg log -R latesttag --template 'date: {date(date, "%y %m %d %S %z")}\n'
695 $ hg log -R latesttag --template 'date: {date(date, "%y %m %d %S %z")}\n'
696 date: 70 01 01 10 +0000
696 date: 70 01 01 10 +0000
697 date: 70 01 01 09 +0000
697 date: 70 01 01 09 +0000
698 date: 70 01 01 04 +0000
698 date: 70 01 01 04 +0000
699 date: 70 01 01 08 +0000
699 date: 70 01 01 08 +0000
700 date: 70 01 01 07 +0000
700 date: 70 01 01 07 +0000
701 date: 70 01 01 06 +0000
701 date: 70 01 01 06 +0000
702 date: 70 01 01 05 +0100
702 date: 70 01 01 05 +0100
703 date: 70 01 01 04 +0000
703 date: 70 01 01 04 +0000
704 date: 70 01 01 03 +0000
704 date: 70 01 01 03 +0000
705 date: 70 01 01 02 +0000
705 date: 70 01 01 02 +0000
706 date: 70 01 01 01 +0000
706 date: 70 01 01 01 +0000
707 date: 70 01 01 00 +0000
707 date: 70 01 01 00 +0000
708
708
709 Test invalid date:
709 Test invalid date:
710
710
711 $ hg log -R latesttag -T '{date(rev)}\n'
711 $ hg log -R latesttag -T '{date(rev)}\n'
712 hg: parse error: date expects a date information
712 hg: parse error: date expects a date information
713 [255]
713 [255]
714
714
715 Set up repository containing template fragments in commit metadata:
715 Set up repository containing template fragments in commit metadata:
716
716
717 $ hg init r
717 $ hg init r
718 $ cd r
718 $ cd r
719 $ echo a > a
719 $ echo a > a
720 $ hg ci -Am '{rev}'
720 $ hg ci -Am '{rev}'
721 adding a
721 adding a
722
722
723 $ hg branch -q 'text.{rev}'
723 $ hg branch -q 'text.{rev}'
724 $ echo aa >> aa
724 $ echo aa >> aa
725 $ hg ci -u '{node|short}' -m 'desc to be wrapped desc to be wrapped'
725 $ hg ci -u '{node|short}' -m 'desc to be wrapped desc to be wrapped'
726
726
727 color effect can be specified without quoting:
727 color effect can be specified without quoting:
728
728
729 $ hg log --color=always -l 1 --template '{label(red, "text\n")}'
729 $ hg log --color=always -l 1 --template '{label(red, "text\n")}'
730 \x1b[0;31mtext\x1b[0m (esc)
730 \x1b[0;31mtext\x1b[0m (esc)
731
731
732 color effects can be nested (issue5413)
732 color effects can be nested (issue5413)
733
733
734 $ hg debugtemplate --color=always \
734 $ hg debugtemplate --color=always \
735 > '{label(red, "red{label(magenta, "ma{label(cyan, "cyan")}{label(yellow, "yellow")}genta")}")}\n'
735 > '{label(red, "red{label(magenta, "ma{label(cyan, "cyan")}{label(yellow, "yellow")}genta")}")}\n'
736 \x1b[0;31mred\x1b[0;35mma\x1b[0;36mcyan\x1b[0m\x1b[0;31m\x1b[0;35m\x1b[0;33myellow\x1b[0m\x1b[0;31m\x1b[0;35mgenta\x1b[0m (esc)
736 \x1b[0;31mred\x1b[0;35mma\x1b[0;36mcyan\x1b[0m\x1b[0;31m\x1b[0;35m\x1b[0;33myellow\x1b[0m\x1b[0;31m\x1b[0;35mgenta\x1b[0m (esc)
737
737
738 pad() should interact well with color codes (issue5416)
738 pad() should interact well with color codes (issue5416)
739
739
740 $ hg debugtemplate --color=always \
740 $ hg debugtemplate --color=always \
741 > '{pad(label(red, "red"), 5, label(cyan, "-"))}\n'
741 > '{pad(label(red, "red"), 5, label(cyan, "-"))}\n'
742 \x1b[0;31mred\x1b[0m\x1b[0;36m-\x1b[0m\x1b[0;36m-\x1b[0m (esc)
742 \x1b[0;31mred\x1b[0m\x1b[0;36m-\x1b[0m\x1b[0;36m-\x1b[0m (esc)
743
743
744 pad() with truncate has to strip color codes, though
744 pad() with truncate has to strip color codes, though
745
745
746 $ hg debugtemplate --color=always \
746 $ hg debugtemplate --color=always \
747 > '{pad(label(red, "scarlet"), 5, truncate=true)}\n'
747 > '{pad(label(red, "scarlet"), 5, truncate=true)}\n'
748 scarl
748 scarl
749
749
750 label should be no-op if color is disabled:
750 label should be no-op if color is disabled:
751
751
752 $ hg log --color=never -l 1 --template '{label(red, "text\n")}'
752 $ hg log --color=never -l 1 --template '{label(red, "text\n")}'
753 text
753 text
754 $ hg log --config extensions.color=! -l 1 --template '{label(red, "text\n")}'
754 $ hg log --config extensions.color=! -l 1 --template '{label(red, "text\n")}'
755 text
755 text
756
756
757 Test branches inside if statement:
757 Test branches inside if statement:
758
758
759 $ hg log -r 0 --template '{if(branches, "yes", "no")}\n'
759 $ hg log -r 0 --template '{if(branches, "yes", "no")}\n'
760 no
760 no
761
761
762 Test dict constructor:
762 Test dict constructor:
763
763
764 $ hg log -r 0 -T '{dict(y=node|short, x=rev)}\n'
764 $ hg log -r 0 -T '{dict(y=node|short, x=rev)}\n'
765 y=f7769ec2ab97 x=0
765 y=f7769ec2ab97 x=0
766 $ hg log -r 0 -T '{dict(x=rev, y=node|short) % "{key}={value}\n"}'
766 $ hg log -r 0 -T '{dict(x=rev, y=node|short) % "{key}={value}\n"}'
767 x=0
767 x=0
768 y=f7769ec2ab97
768 y=f7769ec2ab97
769 $ hg log -r 0 -T '{dict(x=rev, y=node|short)|json}\n'
769 $ hg log -r 0 -T '{dict(x=rev, y=node|short)|json}\n'
770 {"x": 0, "y": "f7769ec2ab97"}
770 {"x": 0, "y": "f7769ec2ab97"}
771 $ hg log -r 0 -T '{dict()|json}\n'
771 $ hg log -r 0 -T '{dict()|json}\n'
772 {}
772 {}
773
773
774 $ hg log -r 0 -T '{dict(rev, node=node|short)}\n'
774 $ hg log -r 0 -T '{dict(rev, node=node|short)}\n'
775 rev=0 node=f7769ec2ab97
775 rev=0 node=f7769ec2ab97
776 $ hg log -r 0 -T '{dict(rev, node|short)}\n'
776 $ hg log -r 0 -T '{dict(rev, node|short)}\n'
777 rev=0 node=f7769ec2ab97
777 rev=0 node=f7769ec2ab97
778
778
779 $ hg log -r 0 -T '{dict(rev, rev=rev)}\n'
779 $ hg log -r 0 -T '{dict(rev, rev=rev)}\n'
780 hg: parse error: duplicated dict key 'rev' inferred
780 hg: parse error: duplicated dict key 'rev' inferred
781 [255]
781 [255]
782 $ hg log -r 0 -T '{dict(node, node|short)}\n'
782 $ hg log -r 0 -T '{dict(node, node|short)}\n'
783 hg: parse error: duplicated dict key 'node' inferred
783 hg: parse error: duplicated dict key 'node' inferred
784 [255]
784 [255]
785 $ hg log -r 0 -T '{dict(1 + 2)}'
785 $ hg log -r 0 -T '{dict(1 + 2)}'
786 hg: parse error: dict key cannot be inferred
786 hg: parse error: dict key cannot be inferred
787 [255]
787 [255]
788
788
789 $ hg log -r 0 -T '{dict(x=rev, x=node)}'
789 $ hg log -r 0 -T '{dict(x=rev, x=node)}'
790 hg: parse error: dict got multiple values for keyword argument 'x'
790 hg: parse error: dict got multiple values for keyword argument 'x'
791 [255]
791 [255]
792
792
793 Test get function:
793 Test get function:
794
794
795 $ hg log -r 0 --template '{get(extras, "branch")}\n'
795 $ hg log -r 0 --template '{get(extras, "branch")}\n'
796 default
796 default
797 $ hg log -r 0 --template '{get(extras, "br{"anch"}")}\n'
797 $ hg log -r 0 --template '{get(extras, "br{"anch"}")}\n'
798 default
798 default
799 $ hg log -r 0 --template '{get(files, "should_fail")}\n'
799 $ hg log -r 0 --template '{get(files, "should_fail")}\n'
800 hg: parse error: not a dictionary
800 hg: parse error: not a dictionary
801 (get() expects a dict as first argument)
801 (get() expects a dict as first argument)
802 [255]
802 [255]
803
803
804 Test json filter applied to wrapped object:
804 Test json filter applied to wrapped object:
805
805
806 $ hg log -r0 -T '{files|json}\n'
806 $ hg log -r0 -T '{files|json}\n'
807 ["a"]
807 ["a"]
808 $ hg log -r0 -T '{extras|json}\n'
808 $ hg log -r0 -T '{extras|json}\n'
809 {"branch": "default"}
809 {"branch": "default"}
810 $ hg log -r0 -T '{date|json}\n'
810 $ hg log -r0 -T '{date|json}\n'
811 [0, 0]
811 [0, 0]
812
812
813 Test json filter applied to map result:
813 Test json filter applied to map result:
814
814
815 $ hg log -r0 -T '{json(extras % "{key}")}\n'
815 $ hg log -r0 -T '{json(extras % "{key}")}\n'
816 ["branch"]
816 ["branch"]
817
817
818 Test localdate(date, tz) function:
818 Test localdate(date, tz) function:
819
819
820 $ TZ=JST-09 hg log -r0 -T '{date|localdate|isodate}\n'
820 $ TZ=JST-09 hg log -r0 -T '{date|localdate|isodate}\n'
821 1970-01-01 09:00 +0900
821 1970-01-01 09:00 +0900
822 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "UTC")|isodate}\n'
822 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "UTC")|isodate}\n'
823 1970-01-01 00:00 +0000
823 1970-01-01 00:00 +0000
824 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "blahUTC")|isodate}\n'
824 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "blahUTC")|isodate}\n'
825 hg: parse error: localdate expects a timezone
825 hg: parse error: localdate expects a timezone
826 [255]
826 [255]
827 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "+0200")|isodate}\n'
827 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "+0200")|isodate}\n'
828 1970-01-01 02:00 +0200
828 1970-01-01 02:00 +0200
829 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "0")|isodate}\n'
829 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "0")|isodate}\n'
830 1970-01-01 00:00 +0000
830 1970-01-01 00:00 +0000
831 $ TZ=JST-09 hg log -r0 -T '{localdate(date, 0)|isodate}\n'
831 $ TZ=JST-09 hg log -r0 -T '{localdate(date, 0)|isodate}\n'
832 1970-01-01 00:00 +0000
832 1970-01-01 00:00 +0000
833 $ hg log -r0 -T '{localdate(date, "invalid")|isodate}\n'
833 $ hg log -r0 -T '{localdate(date, "invalid")|isodate}\n'
834 hg: parse error: localdate expects a timezone
834 hg: parse error: localdate expects a timezone
835 [255]
835 [255]
836 $ hg log -r0 -T '{localdate(date, date)|isodate}\n'
836 $ hg log -r0 -T '{localdate(date, date)|isodate}\n'
837 hg: parse error: localdate expects a timezone
837 hg: parse error: localdate expects a timezone
838 [255]
838 [255]
839
839
840 Test shortest(node) function:
840 Test shortest(node) function:
841
841
842 $ echo b > b
842 $ echo b > b
843 $ hg ci -qAm b
843 $ hg ci -qAm b
844 $ hg log --template '{shortest(node)}\n'
844 $ hg log --template '{shortest(node)}\n'
845 e777
845 e777
846 bcc7
846 bcc7
847 f776
847 f776
848 $ hg log --template '{shortest(node, 10)}\n'
848 $ hg log --template '{shortest(node, 10)}\n'
849 e777603221
849 e777603221
850 bcc7ff960b
850 bcc7ff960b
851 f7769ec2ab
851 f7769ec2ab
852 $ hg log --template '{shortest(node, 1)}\n' -r null
852 $ hg log --template '{shortest(node, 1)}\n' -r null
853 00
853 00
854 $ hg log --template '{node|shortest}\n' -l1
854 $ hg log --template '{node|shortest}\n' -l1
855 e777
855 e777
856
856
857 $ hg log -r 0 -T '{shortest(node, "1{"0"}")}\n'
857 $ hg log -r 0 -T '{shortest(node, "1{"0"}")}\n'
858 f7769ec2ab
858 f7769ec2ab
859 $ hg log -r 0 -T '{shortest(node, "not an int")}\n'
859 $ hg log -r 0 -T '{shortest(node, "not an int")}\n'
860 hg: parse error: shortest() expects an integer minlength
860 hg: parse error: shortest() expects an integer minlength
861 [255]
861 [255]
862
862
863 $ hg log -r 'wdir()' -T '{node|shortest}\n'
863 $ hg log -r 'wdir()' -T '{node|shortest}\n'
864 ffff
864 ffff
865
865
866 $ hg log --template '{shortest("f")}\n' -l1
866 $ hg log --template '{shortest("f")}\n' -l1
867 f
867 f
868
868
869 $ hg log --template '{shortest("0123456789012345678901234567890123456789")}\n' -l1
869 $ hg log --template '{shortest("0123456789012345678901234567890123456789")}\n' -l1
870 0123456789012345678901234567890123456789
870 0123456789012345678901234567890123456789
871
871
872 $ hg log --template '{shortest("01234567890123456789012345678901234567890123456789")}\n' -l1
872 $ hg log --template '{shortest("01234567890123456789012345678901234567890123456789")}\n' -l1
873 01234567890123456789012345678901234567890123456789
873 01234567890123456789012345678901234567890123456789
874
874
875 $ hg log --template '{shortest("not a hex string")}\n' -l1
875 $ hg log --template '{shortest("not a hex string")}\n' -l1
876 not a hex string
876 not a hex string
877
877
878 $ hg log --template '{shortest("not a hex string, but it'\''s 40 bytes long")}\n' -l1
878 $ hg log --template '{shortest("not a hex string, but it'\''s 40 bytes long")}\n' -l1
879 not a hex string, but it's 40 bytes long
879 not a hex string, but it's 40 bytes long
880
880
881 $ hg log --template '{shortest("ffffffffffffffffffffffffffffffffffffffff")}\n' -l1
881 $ hg log --template '{shortest("ffffffffffffffffffffffffffffffffffffffff")}\n' -l1
882 ffff
882 ffff
883
883
884 $ hg log --template '{shortest("fffffff")}\n' -l1
884 $ hg log --template '{shortest("fffffff")}\n' -l1
885 ffff
885 ffff
886
886
887 $ hg log --template '{shortest("ff")}\n' -l1
887 $ hg log --template '{shortest("ff")}\n' -l1
888 ffff
888 ffff
889
889
890 $ cd ..
890 $ cd ..
891
891
892 Test shortest(node) with the repo having short hash collision:
892 Test shortest(node) with the repo having short hash collision:
893
893
894 $ hg init hashcollision
894 $ hg init hashcollision
895 $ cd hashcollision
895 $ cd hashcollision
896 $ cat <<EOF >> .hg/hgrc
896 $ cat <<EOF >> .hg/hgrc
897 > [experimental]
897 > [experimental]
898 > evolution.createmarkers=True
898 > evolution.createmarkers=True
899 > EOF
899 > EOF
900 $ echo 0 > a
900 $ echo 0 > a
901 $ hg ci -qAm 0
901 $ hg ci -qAm 0
902 $ for i in 17 129 248 242 480 580 617 1057 2857 4025; do
902 $ for i in 17 129 248 242 480 580 617 1057 2857 4025; do
903 > hg up -q 0
903 > hg up -q 0
904 > echo $i > a
904 > echo $i > a
905 > hg ci -qm $i
905 > hg ci -qm $i
906 > done
906 > done
907 $ hg up -q null
907 $ hg up -q null
908 $ hg log -r0: -T '{rev}:{node}\n'
908 $ hg log -r0: -T '{rev}:{node}\n'
909 0:b4e73ffab476aa0ee32ed81ca51e07169844bc6a
909 0:b4e73ffab476aa0ee32ed81ca51e07169844bc6a
910 1:11424df6dc1dd4ea255eae2b58eaca7831973bbc
910 1:11424df6dc1dd4ea255eae2b58eaca7831973bbc
911 2:11407b3f1b9c3e76a79c1ec5373924df096f0499
911 2:11407b3f1b9c3e76a79c1ec5373924df096f0499
912 3:11dd92fe0f39dfdaacdaa5f3997edc533875cfc4
912 3:11dd92fe0f39dfdaacdaa5f3997edc533875cfc4
913 4:10776689e627b465361ad5c296a20a487e153ca4
913 4:10776689e627b465361ad5c296a20a487e153ca4
914 5:a00be79088084cb3aff086ab799f8790e01a976b
914 5:a00be79088084cb3aff086ab799f8790e01a976b
915 6:a0b0acd79b4498d0052993d35a6a748dd51d13e6
915 6:a0b0acd79b4498d0052993d35a6a748dd51d13e6
916 7:a0457b3450b8e1b778f1163b31a435802987fe5d
916 7:a0457b3450b8e1b778f1163b31a435802987fe5d
917 8:c56256a09cd28e5764f32e8e2810d0f01e2e357a
917 8:c56256a09cd28e5764f32e8e2810d0f01e2e357a
918 9:c5623987d205cd6d9d8389bfc40fff9dbb670b48
918 9:c5623987d205cd6d9d8389bfc40fff9dbb670b48
919 10:c562ddd9c94164376c20b86b0b4991636a3bf84f
919 10:c562ddd9c94164376c20b86b0b4991636a3bf84f
920 $ hg debugobsolete a00be79088084cb3aff086ab799f8790e01a976b
920 $ hg debugobsolete a00be79088084cb3aff086ab799f8790e01a976b
921 obsoleted 1 changesets
921 obsoleted 1 changesets
922 $ hg debugobsolete c5623987d205cd6d9d8389bfc40fff9dbb670b48
922 $ hg debugobsolete c5623987d205cd6d9d8389bfc40fff9dbb670b48
923 obsoleted 1 changesets
923 obsoleted 1 changesets
924 $ hg debugobsolete c562ddd9c94164376c20b86b0b4991636a3bf84f
924 $ hg debugobsolete c562ddd9c94164376c20b86b0b4991636a3bf84f
925 obsoleted 1 changesets
925 obsoleted 1 changesets
926
926
927 nodes starting with '11' (we don't have the revision number '11' though)
927 nodes starting with '11' (we don't have the revision number '11' though)
928
928
929 $ hg log -r 1:3 -T '{rev}:{shortest(node, 0)}\n'
929 $ hg log -r 1:3 -T '{rev}:{shortest(node, 0)}\n'
930 1:1142
930 1:1142
931 2:1140
931 2:1140
932 3:11d
932 3:11d
933
933
934 '5:a00' is hidden, but still we have two nodes starting with 'a0'
934 '5:a00' is hidden, but still we have two nodes starting with 'a0'
935
935
936 $ hg log -r 6:7 -T '{rev}:{shortest(node, 0)}\n'
936 $ hg log -r 6:7 -T '{rev}:{shortest(node, 0)}\n'
937 6:a0b
937 6:a0b
938 7:a04
938 7:a04
939
939
940 node '10' conflicts with the revision number '10' even if it is hidden
940 node '10' conflicts with the revision number '10' even if it is hidden
941 (we could exclude hidden revision numbers, but currently we don't)
941 (we could exclude hidden revision numbers, but currently we don't)
942
942
943 $ hg log -r 4 -T '{rev}:{shortest(node, 0)}\n'
943 $ hg log -r 4 -T '{rev}:{shortest(node, 0)}\n'
944 4:107
944 4:107
945 $ hg log -r 4 -T '{rev}:{shortest(node, 0)}\n' --hidden
945 $ hg log -r 4 -T '{rev}:{shortest(node, 0)}\n' --hidden
946 4:107
946 4:107
947
947
948 $ hg --config experimental.revisions.prefixhexnode=yes log -r 4 -T '{rev}:{shortest(node, 0)}\n'
948 $ hg --config experimental.revisions.prefixhexnode=yes log -r 4 -T '{rev}:{shortest(node, 0)}\n'
949 4:x10
949 4:x10
950 $ hg --config experimental.revisions.prefixhexnode=yes log -r 4 -T '{rev}:{shortest(node, 0)}\n' --hidden
950 $ hg --config experimental.revisions.prefixhexnode=yes log -r 4 -T '{rev}:{shortest(node, 0)}\n' --hidden
951 4:x10
951 4:x10
952
952
953 node 'c562' should be unique if the other 'c562' nodes are hidden
953 node 'c562' should be unique if the other 'c562' nodes are hidden
954 (but we don't try the slow path to filter out hidden nodes for now)
954 (but we don't try the slow path to filter out hidden nodes for now)
955
955
956 $ hg log -r 8 -T '{rev}:{node|shortest}\n'
956 $ hg log -r 8 -T '{rev}:{node|shortest}\n'
957 8:c5625
957 8:c5625
958 $ hg log -r 8:10 -T '{rev}:{node|shortest}\n' --hidden
958 $ hg log -r 8:10 -T '{rev}:{node|shortest}\n' --hidden
959 8:c5625
959 8:c5625
960 9:c5623
960 9:c5623
961 10:c562d
961 10:c562d
962
962
963 $ cd ..
963 $ cd ..
964
964
965 Test prefixhexnode when the first character of the hash is 0.
965 Test prefixhexnode when the first character of the hash is 0.
966 $ hg init hashcollision2
966 $ hg init hashcollision2
967 $ cd hashcollision2
967 $ cd hashcollision2
968 $ cat <<EOF >> .hg/hgrc
968 $ cat <<EOF >> .hg/hgrc
969 > [experimental]
969 > [experimental]
970 > evolution.createmarkers=True
970 > evolution.createmarkers=True
971 > EOF
971 > EOF
972 $ echo 0 > a
972 $ echo 0 > a
973 $ hg ci -qAm 0
973 $ hg ci -qAm 0
974 $ echo 21 > a
974 $ echo 21 > a
975 $ hg ci -qm 21
975 $ hg ci -qm 21
976 $ hg up -q null
976 $ hg up -q null
977 $ hg log -r0: -T '{rev}:{node}\n'
977 $ hg log -r0: -T '{rev}:{node}\n'
978 0:b4e73ffab476aa0ee32ed81ca51e07169844bc6a
978 0:b4e73ffab476aa0ee32ed81ca51e07169844bc6a
979 1:0cf177ba2b1dc3862a00fb81715fec90950201be
979 1:0cf177ba2b1dc3862a00fb81715fec90950201be
980
980
981 we need the 'x' prefix to ensure we aren't colliding with rev0. We identify
981 we need the 'x' prefix to ensure we aren't colliding with rev0. We identify
982 the collision with nullid if we aren't using disambiguatewithin, so we need to set
982 the collision with nullid if we aren't using disambiguatewithin, so we need to set
983 that as well.
983 that as well.
984 $ hg --config experimental.revisions.disambiguatewithin='descendants(0)' \
984 $ hg --config experimental.revisions.disambiguatewithin='descendants(0)' \
985 > --config experimental.revisions.prefixhexnode=yes \
985 > --config experimental.revisions.prefixhexnode=yes \
986 > log -r 1 -T '{rev}:{shortest(node, 0)}\n'
986 > log -r 1 -T '{rev}:{shortest(node, 0)}\n'
987 1:x0
987 1:x0
988
988
989 $ hg debugobsolete 0cf177ba2b1dc3862a00fb81715fec90950201be
989 $ hg debugobsolete 0cf177ba2b1dc3862a00fb81715fec90950201be
990 obsoleted 1 changesets
990 obsoleted 1 changesets
991 $ hg up -q 0
991 $ hg up -q 0
992 $ echo 61 > a
992 $ echo 61 > a
993 $ hg ci -m 61
993 $ hg ci -m 61
994 $ hg log -r0: -T '{rev}:{node}\n'
994 $ hg log -r0: -T '{rev}:{node}\n'
995 0:b4e73ffab476aa0ee32ed81ca51e07169844bc6a
995 0:b4e73ffab476aa0ee32ed81ca51e07169844bc6a
996 2:01384dde84b3a511ae0835f35ac40bd806c99bb8
996 2:01384dde84b3a511ae0835f35ac40bd806c99bb8
997
997
998 we still have the 'x' prefix because '0' is still the shortest prefix, since
998 we still have the 'x' prefix because '0' is still the shortest prefix, since
999 rev1's '0c' is hidden.
999 rev1's '0c' is hidden.
1000 $ hg --config experimental.revisions.disambiguatewithin=0:-1-0 \
1000 $ hg --config experimental.revisions.disambiguatewithin=0:-1-0 \
1001 > --config experimental.revisions.prefixhexnode=yes \
1001 > --config experimental.revisions.prefixhexnode=yes \
1002 > log -r 0:-1-0 -T '{rev}:{shortest(node, 0)}\n'
1002 > log -r 0:-1-0 -T '{rev}:{shortest(node, 0)}\n'
1003 2:x0
1003 2:x0
1004
1004
1005 we don't have the 'x' prefix on 2 because '01' is not a synonym for rev1.
1005 we don't have the 'x' prefix on 2 because '01' is not a synonym for rev1.
1006 $ hg --config experimental.revisions.disambiguatewithin=0:-1-0 \
1006 $ hg --config experimental.revisions.disambiguatewithin=0:-1-0 \
1007 > --config experimental.revisions.prefixhexnode=yes \
1007 > --config experimental.revisions.prefixhexnode=yes \
1008 > log -r 0:-1-0 -T '{rev}:{shortest(node, 0)}\n' --hidden
1008 > log -r 0:-1-0 -T '{rev}:{shortest(node, 0)}\n' --hidden
1009 1:0c
1009 1:0c
1010 2:01
1010 2:01
1011
1011
1012 $ cd ..
1012 $ cd ..
1013
1013
1014 Test pad function
1014 Test pad function
1015
1015
1016 $ cd r
1016 $ cd r
1017
1017
1018 $ hg log --template '{pad(rev, 20)} {author|user}\n'
1018 $ hg log --template '{pad(rev, 20)} {author|user}\n'
1019 2 test
1019 2 test
1020 1 {node|short}
1020 1 {node|short}
1021 0 test
1021 0 test
1022
1022
1023 $ hg log --template '{pad(rev, 20, " ", True)} {author|user}\n'
1023 $ hg log --template '{pad(rev, 20, " ", True)} {author|user}\n'
1024 2 test
1024 2 test
1025 1 {node|short}
1025 1 {node|short}
1026 0 test
1026 0 test
1027
1027
1028 $ hg log --template '{pad(rev, 20, "-", False)} {author|user}\n'
1028 $ hg log --template '{pad(rev, 20, "-", False)} {author|user}\n'
1029 2------------------- test
1029 2------------------- test
1030 1------------------- {node|short}
1030 1------------------- {node|short}
1031 0------------------- test
1031 0------------------- test
1032
1032
1033 $ hg log --template '{pad(author, 5, "-", False, True)}\n'
1033 $ hg log --template '{pad(author, 5, "-", False, True)}\n'
1034 test-
1034 test-
1035 {node
1035 {node
1036 test-
1036 test-
1037 $ hg log --template '{pad(author, 5, "-", True, True)}\n'
1037 $ hg log --template '{pad(author, 5, "-", True, True)}\n'
1038 -test
1038 -test
1039 hort}
1039 hort}
1040 -test
1040 -test
1041
1041
1042 Test template string in pad function
1042 Test template string in pad function
1043
1043
1044 $ hg log -r 0 -T '{pad("\{{rev}}", 10)} {author|user}\n'
1044 $ hg log -r 0 -T '{pad("\{{rev}}", 10)} {author|user}\n'
1045 {0} test
1045 {0} test
1046
1046
1047 $ hg log -r 0 -T '{pad(r"\{rev}", 10)} {author|user}\n'
1047 $ hg log -r 0 -T '{pad(r"\{rev}", 10)} {author|user}\n'
1048 \{rev} test
1048 \{rev} test
1049
1049
1050 Test width argument passed to pad function
1050 Test width argument passed to pad function
1051
1051
1052 $ hg log -r 0 -T '{pad(rev, "1{"0"}")} {author|user}\n'
1052 $ hg log -r 0 -T '{pad(rev, "1{"0"}")} {author|user}\n'
1053 0 test
1053 0 test
1054 $ hg log -r 0 -T '{pad(rev, "not an int")}\n'
1054 $ hg log -r 0 -T '{pad(rev, "not an int")}\n'
1055 hg: parse error: pad() expects an integer width
1055 hg: parse error: pad() expects an integer width
1056 [255]
1056 [255]
1057
1057
1058 Test invalid fillchar passed to pad function
1058 Test invalid fillchar passed to pad function
1059
1059
1060 $ hg log -r 0 -T '{pad(rev, 10, "")}\n'
1060 $ hg log -r 0 -T '{pad(rev, 10, "")}\n'
1061 hg: parse error: pad() expects a single fill character
1061 hg: parse error: pad() expects a single fill character
1062 [255]
1062 [255]
1063 $ hg log -r 0 -T '{pad(rev, 10, "--")}\n'
1063 $ hg log -r 0 -T '{pad(rev, 10, "--")}\n'
1064 hg: parse error: pad() expects a single fill character
1064 hg: parse error: pad() expects a single fill character
1065 [255]
1065 [255]
1066
1066
1067 Test boolean argument passed to pad function
1067 Test boolean argument passed to pad function
1068
1068
1069 no crash
1069 no crash
1070
1070
1071 $ hg log -r 0 -T '{pad(rev, 10, "-", "f{"oo"}")}\n'
1071 $ hg log -r 0 -T '{pad(rev, 10, "-", "f{"oo"}")}\n'
1072 ---------0
1072 ---------0
1073
1073
1074 string/literal
1074 string/literal
1075
1075
1076 $ hg log -r 0 -T '{pad(rev, 10, "-", "false")}\n'
1076 $ hg log -r 0 -T '{pad(rev, 10, "-", "false")}\n'
1077 ---------0
1077 ---------0
1078 $ hg log -r 0 -T '{pad(rev, 10, "-", false)}\n'
1078 $ hg log -r 0 -T '{pad(rev, 10, "-", false)}\n'
1079 0---------
1079 0---------
1080 $ hg log -r 0 -T '{pad(rev, 10, "-", "")}\n'
1080 $ hg log -r 0 -T '{pad(rev, 10, "-", "")}\n'
1081 0---------
1081 0---------
1082
1082
1083 unknown keyword is evaluated to ''
1083 unknown keyword is evaluated to ''
1084
1084
1085 $ hg log -r 0 -T '{pad(rev, 10, "-", unknownkeyword)}\n'
1085 $ hg log -r 0 -T '{pad(rev, 10, "-", unknownkeyword)}\n'
1086 0---------
1086 0---------
1087
1087
1088 Test separate function
1088 Test separate function
1089
1089
1090 $ hg log -r 0 -T '{separate("-", "", "a", "b", "", "", "c", "")}\n'
1090 $ hg log -r 0 -T '{separate("-", "", "a", "b", "", "", "c", "")}\n'
1091 a-b-c
1091 a-b-c
1092 $ hg log -r 0 -T '{separate(" ", "{rev}:{node|short}", author|user, branch)}\n'
1092 $ hg log -r 0 -T '{separate(" ", "{rev}:{node|short}", author|user, branch)}\n'
1093 0:f7769ec2ab97 test default
1093 0:f7769ec2ab97 test default
1094 $ hg log -r 0 --color=always -T '{separate(" ", "a", label(red, "b"), "c", label(red, ""), "d")}\n'
1094 $ hg log -r 0 --color=always -T '{separate(" ", "a", label(red, "b"), "c", label(red, ""), "d")}\n'
1095 a \x1b[0;31mb\x1b[0m c d (esc)
1095 a \x1b[0;31mb\x1b[0m c d (esc)
1096
1096
1097 Test boolean expression/literal passed to if function
1097 Test boolean expression/literal passed to if function
1098
1098
1099 $ hg log -r 0 -T '{if(rev, "rev 0 is True")}\n'
1099 $ hg log -r 0 -T '{if(rev, "rev 0 is True")}\n'
1100 rev 0 is True
1100 rev 0 is True
1101 $ hg log -r 0 -T '{if(0, "literal 0 is True as well")}\n'
1101 $ hg log -r 0 -T '{if(0, "literal 0 is True as well")}\n'
1102 literal 0 is True as well
1102 literal 0 is True as well
1103 $ hg log -r 0 -T '{if(min(revset(r"0")), "0 of hybriditem is also True")}\n'
1103 $ hg log -r 0 -T '{if(min(revset(r"0")), "0 of hybriditem is also True")}\n'
1104 0 of hybriditem is also True
1104 0 of hybriditem is also True
1105 $ hg log -r 0 -T '{if("", "", "empty string is False")}\n'
1105 $ hg log -r 0 -T '{if("", "", "empty string is False")}\n'
1106 empty string is False
1106 empty string is False
1107 $ hg log -r 0 -T '{if(revset(r"0 - 0"), "", "empty list is False")}\n'
1107 $ hg log -r 0 -T '{if(revset(r"0 - 0"), "", "empty list is False")}\n'
1108 empty list is False
1108 empty list is False
1109 $ hg log -r 0 -T '{if(revset(r"0"), "non-empty list is True")}\n'
1109 $ hg log -r 0 -T '{if(revset(r"0"), "non-empty list is True")}\n'
1110 non-empty list is True
1110 non-empty list is True
1111 $ hg log -r 0 -T '{if(revset(r"0") % "", "list of empty strings is True")}\n'
1111 $ hg log -r 0 -T '{if(revset(r"0") % "", "list of empty strings is True")}\n'
1112 list of empty strings is True
1112 list of empty strings is True
1113 $ hg log -r 0 -T '{if(true, "true is True")}\n'
1113 $ hg log -r 0 -T '{if(true, "true is True")}\n'
1114 true is True
1114 true is True
1115 $ hg log -r 0 -T '{if(false, "", "false is False")}\n'
1115 $ hg log -r 0 -T '{if(false, "", "false is False")}\n'
1116 false is False
1116 false is False
1117 $ hg log -r 0 -T '{if("false", "non-empty string is True")}\n'
1117 $ hg log -r 0 -T '{if("false", "non-empty string is True")}\n'
1118 non-empty string is True
1118 non-empty string is True
1119
1119
1120 Test ifcontains function
1120 Test ifcontains function
1121
1121
1122 $ hg log --template '{rev} {ifcontains(rev, "2 two 0", "is in the string", "is not")}\n'
1122 $ hg log --template '{rev} {ifcontains(rev, "2 two 0", "is in the string", "is not")}\n'
1123 2 is in the string
1123 2 is in the string
1124 1 is not
1124 1 is not
1125 0 is in the string
1125 0 is in the string
1126
1126
1127 $ hg log -T '{rev} {ifcontains(rev, "2 two{" 0"}", "is in the string", "is not")}\n'
1127 $ hg log -T '{rev} {ifcontains(rev, "2 two{" 0"}", "is in the string", "is not")}\n'
1128 2 is in the string
1128 2 is in the string
1129 1 is not
1129 1 is not
1130 0 is in the string
1130 0 is in the string
1131
1131
1132 $ hg log --template '{rev} {ifcontains("a", file_adds, "added a", "did not add a")}\n'
1132 $ hg log --template '{rev} {ifcontains("a", file_adds, "added a", "did not add a")}\n'
1133 2 did not add a
1133 2 did not add a
1134 1 did not add a
1134 1 did not add a
1135 0 added a
1135 0 added a
1136
1136
1137 $ hg log --debug -T '{rev}{ifcontains(1, parents, " is parent of 1")}\n'
1137 $ hg log --debug -T '{rev}{ifcontains(1, parents, " is parent of 1")}\n'
1138 2 is parent of 1
1138 2 is parent of 1
1139 1
1139 1
1140 0
1140 0
1141
1141
1142 $ hg log -l1 -T '{ifcontains("branch", extras, "t", "f")}\n'
1142 $ hg log -l1 -T '{ifcontains("branch", extras, "t", "f")}\n'
1143 t
1143 t
1144 $ hg log -l1 -T '{ifcontains("branch", extras % "{key}", "t", "f")}\n'
1144 $ hg log -l1 -T '{ifcontains("branch", extras % "{key}", "t", "f")}\n'
1145 t
1145 t
1146 $ hg log -l1 -T '{ifcontains("branc", extras % "{key}", "t", "f")}\n'
1146 $ hg log -l1 -T '{ifcontains("branc", extras % "{key}", "t", "f")}\n'
1147 f
1147 f
1148 $ hg log -l1 -T '{ifcontains("branc", stringify(extras % "{key}"), "t", "f")}\n'
1148 $ hg log -l1 -T '{ifcontains("branc", stringify(extras % "{key}"), "t", "f")}\n'
1149 t
1149 t
1150
1150
1151 Test revset function
1151 Test revset function
1152
1152
1153 $ hg log --template '{rev} {ifcontains(rev, revset("."), "current rev", "not current rev")}\n'
1153 $ hg log --template '{rev} {ifcontains(rev, revset("."), "current rev", "not current rev")}\n'
1154 2 current rev
1154 2 current rev
1155 1 not current rev
1155 1 not current rev
1156 0 not current rev
1156 0 not current rev
1157
1157
1158 $ hg log --template '{rev} {ifcontains(rev, revset(". + .^"), "match rev", "not match rev")}\n'
1158 $ hg log --template '{rev} {ifcontains(rev, revset(". + .^"), "match rev", "not match rev")}\n'
1159 2 match rev
1159 2 match rev
1160 1 match rev
1160 1 match rev
1161 0 not match rev
1161 0 not match rev
1162
1162
1163 $ hg log -T '{ifcontains(desc, revset(":"), "", "type not match")}\n' -l1
1163 $ hg log -T '{ifcontains(desc, revset(":"), "", "type not match")}\n' -l1
1164 type not match
1164 type not match
1165
1165
1166 $ hg log --template '{rev} Parents: {revset("parents(%s)", rev)}\n'
1166 $ hg log --template '{rev} Parents: {revset("parents(%s)", rev)}\n'
1167 2 Parents: 1
1167 2 Parents: 1
1168 1 Parents: 0
1168 1 Parents: 0
1169 0 Parents:
1169 0 Parents:
1170
1170
1171 $ cat >> .hg/hgrc <<EOF
1171 $ cat >> .hg/hgrc <<EOF
1172 > [revsetalias]
1172 > [revsetalias]
1173 > myparents(\$1) = parents(\$1)
1173 > myparents(\$1) = parents(\$1)
1174 > EOF
1174 > EOF
1175 $ hg log --template '{rev} Parents: {revset("myparents(%s)", rev)}\n'
1175 $ hg log --template '{rev} Parents: {revset("myparents(%s)", rev)}\n'
1176 2 Parents: 1
1176 2 Parents: 1
1177 1 Parents: 0
1177 1 Parents: 0
1178 0 Parents:
1178 0 Parents:
1179
1179
1180 $ hg log --template 'Rev: {rev}\n{revset("::%s", rev) % "Ancestor: {revision}\n"}\n'
1180 $ hg log --template 'Rev: {rev}\n{revset("::%s", rev) % "Ancestor: {revision}\n"}\n'
1181 Rev: 2
1181 Rev: 2
1182 Ancestor: 0
1182 Ancestor: 0
1183 Ancestor: 1
1183 Ancestor: 1
1184 Ancestor: 2
1184 Ancestor: 2
1185
1185
1186 Rev: 1
1186 Rev: 1
1187 Ancestor: 0
1187 Ancestor: 0
1188 Ancestor: 1
1188 Ancestor: 1
1189
1189
1190 Rev: 0
1190 Rev: 0
1191 Ancestor: 0
1191 Ancestor: 0
1192
1192
1193 $ hg log --template '{revset("TIP"|lower)}\n' -l1
1193 $ hg log --template '{revset("TIP"|lower)}\n' -l1
1194 2
1194 2
1195
1195
1196 $ hg log -T '{revset("%s", "t{"ip"}")}\n' -l1
1196 $ hg log -T '{revset("%s", "t{"ip"}")}\n' -l1
1197 2
1197 2
1198
1198
1199 a list template is evaluated for each item of revset/parents
1199 a list template is evaluated for each item of revset/parents
1200
1200
1201 $ hg log -T '{rev} p: {revset("p1(%s)", rev) % "{rev}:{node|short}"}\n'
1201 $ hg log -T '{rev} p: {revset("p1(%s)", rev) % "{rev}:{node|short}"}\n'
1202 2 p: 1:bcc7ff960b8e
1202 2 p: 1:bcc7ff960b8e
1203 1 p: 0:f7769ec2ab97
1203 1 p: 0:f7769ec2ab97
1204 0 p:
1204 0 p:
1205
1205
1206 $ hg log --debug -T '{rev} p:{parents % " {rev}:{node|short}"}\n'
1206 $ hg log --debug -T '{rev} p:{parents % " {rev}:{node|short}"}\n'
1207 2 p: 1:bcc7ff960b8e -1:000000000000
1207 2 p: 1:bcc7ff960b8e -1:000000000000
1208 1 p: 0:f7769ec2ab97 -1:000000000000
1208 1 p: 0:f7769ec2ab97 -1:000000000000
1209 0 p: -1:000000000000 -1:000000000000
1209 0 p: -1:000000000000 -1:000000000000
1210
1210
1211 therefore, 'revcache' should be recreated for each rev
1211 therefore, 'revcache' should be recreated for each rev
1212
1212
1213 $ hg log -T '{rev} {file_adds}\np {revset("p1(%s)", rev) % "{file_adds}"}\n'
1213 $ hg log -T '{rev} {file_adds}\np {revset("p1(%s)", rev) % "{file_adds}"}\n'
1214 2 aa b
1214 2 aa b
1215 p
1215 p
1216 1
1216 1
1217 p a
1217 p a
1218 0 a
1218 0 a
1219 p
1219 p
1220
1220
1221 $ hg log --debug -T '{rev} {file_adds}\np {parents % "{file_adds}"}\n'
1221 $ hg log --debug -T '{rev} {file_adds}\np {parents % "{file_adds}"}\n'
1222 2 aa b
1222 2 aa b
1223 p
1223 p
1224 1
1224 1
1225 p a
1225 p a
1226 0 a
1226 0 a
1227 p
1227 p
1228
1228
1229 a revset item must be evaluated as an integer revision, not an offset from tip
1229 a revset item must be evaluated as an integer revision, not an offset from tip
1230
1230
1231 $ hg log -l 1 -T '{revset("null") % "{rev}:{node|short}"}\n'
1231 $ hg log -l 1 -T '{revset("null") % "{rev}:{node|short}"}\n'
1232 -1:000000000000
1232 -1:000000000000
1233 $ hg log -l 1 -T '{revset("%s", "null") % "{rev}:{node|short}"}\n'
1233 $ hg log -l 1 -T '{revset("%s", "null") % "{rev}:{node|short}"}\n'
1234 -1:000000000000
1234 -1:000000000000
1235
1235
1236 join() should pick '{rev}' from revset items:
1236 join() should pick '{rev}' from revset items:
1237
1237
1238 $ hg log -R ../a -T '{join(revset("parents(%d)", rev), ", ")}\n' -r6
1238 $ hg log -R ../a -T '{join(revset("parents(%d)", rev), ", ")}\n' -r6
1239 4, 5
1239 4, 5
1240
1240
1241 on the other hand, parents are formatted as '{rev}:{node|formatnode}' by
1241 on the other hand, parents are formatted as '{rev}:{node|formatnode}' by
1242 default. join() should agree with the default formatting:
1242 default. join() should agree with the default formatting:
1243
1243
1244 $ hg log -R ../a -T '{join(parents, ", ")}\n' -r6
1244 $ hg log -R ../a -T '{join(parents, ", ")}\n' -r6
1245 5:13207e5a10d9, 4:bbe44766e73d
1245 5:13207e5a10d9, 4:bbe44766e73d
1246
1246
1247 $ hg log -R ../a -T '{join(parents, ",\n")}\n' -r6 --debug
1247 $ hg log -R ../a -T '{join(parents, ",\n")}\n' -r6 --debug
1248 5:13207e5a10d9fd28ec424934298e176197f2c67f,
1248 5:13207e5a10d9fd28ec424934298e176197f2c67f,
1249 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74
1249 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74
1250
1250
1251 Invalid arguments passed to revset()
1251 Invalid arguments passed to revset()
1252
1252
1253 $ hg log -T '{revset("%whatever", 0)}\n'
1253 $ hg log -T '{revset("%whatever", 0)}\n'
1254 hg: parse error: unexpected revspec format character w
1254 hg: parse error: unexpected revspec format character w
1255 [255]
1255 [255]
1256 $ hg log -T '{revset("%lwhatever", files)}\n'
1256 $ hg log -T '{revset("%lwhatever", files)}\n'
1257 hg: parse error: unexpected revspec format character w
1257 hg: parse error: unexpected revspec format character w
1258 [255]
1258 [255]
1259 $ hg log -T '{revset("%s %s", 0)}\n'
1259 $ hg log -T '{revset("%s %s", 0)}\n'
1260 hg: parse error: missing argument for revspec
1260 hg: parse error: missing argument for revspec
1261 [255]
1261 [255]
1262 $ hg log -T '{revset("", 0)}\n'
1262 $ hg log -T '{revset("", 0)}\n'
1263 hg: parse error: too many revspec arguments specified
1263 hg: parse error: too many revspec arguments specified
1264 [255]
1264 [255]
1265 $ hg log -T '{revset("%s", 0, 1)}\n'
1265 $ hg log -T '{revset("%s", 0, 1)}\n'
1266 hg: parse error: too many revspec arguments specified
1266 hg: parse error: too many revspec arguments specified
1267 [255]
1267 [255]
1268 $ hg log -T '{revset("%", 0)}\n'
1268 $ hg log -T '{revset("%", 0)}\n'
1269 hg: parse error: incomplete revspec format character
1269 hg: parse error: incomplete revspec format character
1270 [255]
1270 [255]
1271 $ hg log -T '{revset("%l", 0)}\n'
1271 $ hg log -T '{revset("%l", 0)}\n'
1272 hg: parse error: incomplete revspec format character
1272 hg: parse error: incomplete revspec format character
1273 [255]
1273 [255]
1274 $ hg log -T '{revset("%d", 'foo')}\n'
1274 $ hg log -T '{revset("%d", 'foo')}\n'
1275 hg: parse error: invalid argument for revspec
1275 hg: parse error: invalid argument for revspec
1276 [255]
1276 [255]
1277 $ hg log -T '{revset("%ld", files)}\n'
1277 $ hg log -T '{revset("%ld", files)}\n'
1278 hg: parse error: invalid argument for revspec
1278 hg: parse error: invalid argument for revspec
1279 [255]
1279 [255]
1280 $ hg log -T '{revset("%ls", 0)}\n'
1280 $ hg log -T '{revset("%ls", 0)}\n'
1281 hg: parse error: invalid argument for revspec
1281 hg: parse error: invalid argument for revspec
1282 [255]
1282 [255]
1283 $ hg log -T '{revset("%b", 'foo')}\n'
1283 $ hg log -T '{revset("%b", 'foo')}\n'
1284 hg: parse error: invalid argument for revspec
1284 hg: parse error: invalid argument for revspec
1285 [255]
1285 [255]
1286 $ hg log -T '{revset("%lb", files)}\n'
1286 $ hg log -T '{revset("%lb", files)}\n'
1287 hg: parse error: invalid argument for revspec
1287 hg: parse error: invalid argument for revspec
1288 [255]
1288 [255]
1289 $ hg log -T '{revset("%r", 0)}\n'
1289 $ hg log -T '{revset("%r", 0)}\n'
1290 hg: parse error: invalid argument for revspec
1290 hg: parse error: invalid argument for revspec
1291 [255]
1291 [255]
1292
1292
1293 Test files function
1293 Test files function
1294
1294
1295 $ hg log -T "{rev}\n{join(files('*'), '\n')}\n"
1295 $ hg log -T "{rev}\n{join(files('*'), '\n')}\n"
1296 2
1296 2
1297 a
1297 a
1298 aa
1298 aa
1299 b
1299 b
1300 1
1300 1
1301 a
1301 a
1302 0
1302 0
1303 a
1303 a
1304
1304
1305 $ hg log -T "{rev}\n{join(files('aa'), '\n')}\n"
1305 $ hg log -T "{rev}\n{join(files('aa'), '\n')}\n"
1306 2
1306 2
1307 aa
1307 aa
1308 1
1308 1
1309
1309
1310 0
1310 0
1311
1311
1312
1312
1313 $ hg log -l1 -T "{files('aa') % '{file}\n'}"
1313 $ hg log -l1 -T "{files('aa') % '{file}\n'}"
1314 aa
1314 aa
1315 $ hg log -l1 -T "{files('aa') % '{path}\n'}"
1315 $ hg log -l1 -T "{files('aa') % '{path}\n'}"
1316 aa
1316 aa
1317
1317
1318 $ hg rm a
1318 $ hg rm a
1319 $ hg log -r "wdir()" -T "{rev}\n{join(files('*'), '\n')}\n"
1319 $ hg log -r "wdir()" -T "{rev}\n{join(files('*'), '\n')}\n"
1320 2147483647
1320 2147483647
1321 aa
1321 aa
1322 b
1322 b
1323 $ hg revert a
1323 $ hg revert a
1324
1324
1325 Test relpath function
1325 Test relpath function
1326
1326
1327 $ hg log -r0 -T '{files % "{file|relpath}\n"}'
1327 $ hg log -r0 -T '{files % "{file|relpath}\n"}'
1328 a
1328 a
1329 $ cd ..
1329 $ cd ..
1330 $ hg log -R r -r0 -T '{files % "{file|relpath}\n"}'
1330 $ hg log -R r -r0 -T '{files % "{file|relpath}\n"}'
1331 r/a
1331 r/a
1332
1332
1333 Test stringify on sub expressions
1333 Test stringify on sub expressions
1334
1334
1335 $ hg log -R a -r 8 --template '{join(files, if("1", if("1", ", ")))}\n'
1335 $ hg log -R a -r 8 --template '{join(files, if("1", if("1", ", ")))}\n'
1336 fourth, second, third
1336 fourth, second, third
1337 $ hg log -R a -r 8 --template '{strip(if("1", if("1", "-abc-")), if("1", if("1", "-")))}\n'
1337 $ hg log -R a -r 8 --template '{strip(if("1", if("1", "-abc-")), if("1", if("1", "-")))}\n'
1338 abc
1338 abc
1339
1339
1340 Test splitlines
1340 Test splitlines
1341
1341
1342 $ hg log -Gv -R a --template "{splitlines(desc) % 'foo {line}\n'}"
1342 $ hg log -Gv -R a --template "{splitlines(desc) % 'foo {line}\n'}"
1343 @ foo Modify, add, remove, rename
1343 @ foo Modify, add, remove, rename
1344 |
1344 |
1345 o foo future
1345 o foo future
1346 |
1346 |
1347 o foo third
1347 o foo third
1348 |
1348 |
1349 o foo second
1349 o foo second
1350
1350
1351 o foo merge
1351 o foo merge
1352 |\
1352 |\
1353 | o foo new head
1353 | o foo new head
1354 | |
1354 | |
1355 o | foo new branch
1355 o | foo new branch
1356 |/
1356 |/
1357 o foo no user, no domain
1357 o foo no user, no domain
1358 |
1358 |
1359 o foo no person
1359 o foo no person
1360 |
1360 |
1361 o foo other 1
1361 o foo other 1
1362 | foo other 2
1362 | foo other 2
1363 | foo
1363 | foo
1364 | foo other 3
1364 | foo other 3
1365 o foo line 1
1365 o foo line 1
1366 foo line 2
1366 foo line 2
1367
1367
1368 $ hg log -R a -r0 -T '{desc|splitlines}\n'
1368 $ hg log -R a -r0 -T '{desc|splitlines}\n'
1369 line 1 line 2
1369 line 1 line 2
1370 $ hg log -R a -r0 -T '{join(desc|splitlines, "|")}\n'
1370 $ hg log -R a -r0 -T '{join(desc|splitlines, "|")}\n'
1371 line 1|line 2
1371 line 1|line 2
1372
1372
1373 Test startswith
1373 Test startswith
1374 $ hg log -Gv -R a --template "{startswith(desc)}"
1374 $ hg log -Gv -R a --template "{startswith(desc)}"
1375 hg: parse error: startswith expects two arguments
1375 hg: parse error: startswith expects two arguments
1376 [255]
1376 [255]
1377
1377
1378 $ hg log -Gv -R a --template "{startswith('line', desc)}"
1378 $ hg log -Gv -R a --template "{startswith('line', desc)}"
1379 @
1379 @
1380 |
1380 |
1381 o
1381 o
1382 |
1382 |
1383 o
1383 o
1384 |
1384 |
1385 o
1385 o
1386
1386
1387 o
1387 o
1388 |\
1388 |\
1389 | o
1389 | o
1390 | |
1390 | |
1391 o |
1391 o |
1392 |/
1392 |/
1393 o
1393 o
1394 |
1394 |
1395 o
1395 o
1396 |
1396 |
1397 o
1397 o
1398 |
1398 |
1399 o line 1
1399 o line 1
1400 line 2
1400 line 2
1401
1401
1402 Test word function (including index out of bounds graceful failure)
1402 Test word function (including index out of bounds graceful failure)
1403
1403
1404 $ hg log -Gv -R a --template "{word('1', desc)}"
1404 $ hg log -Gv -R a --template "{word('1', desc)}"
1405 @ add,
1405 @ add,
1406 |
1406 |
1407 o
1407 o
1408 |
1408 |
1409 o
1409 o
1410 |
1410 |
1411 o
1411 o
1412
1412
1413 o
1413 o
1414 |\
1414 |\
1415 | o head
1415 | o head
1416 | |
1416 | |
1417 o | branch
1417 o | branch
1418 |/
1418 |/
1419 o user,
1419 o user,
1420 |
1420 |
1421 o person
1421 o person
1422 |
1422 |
1423 o 1
1423 o 1
1424 |
1424 |
1425 o 1
1425 o 1
1426
1426
1427
1427
1428 Test word third parameter used as splitter
1428 Test word third parameter used as splitter
1429
1429
1430 $ hg log -Gv -R a --template "{word('0', desc, 'o')}"
1430 $ hg log -Gv -R a --template "{word('0', desc, 'o')}"
1431 @ M
1431 @ M
1432 |
1432 |
1433 o future
1433 o future
1434 |
1434 |
1435 o third
1435 o third
1436 |
1436 |
1437 o sec
1437 o sec
1438
1438
1439 o merge
1439 o merge
1440 |\
1440 |\
1441 | o new head
1441 | o new head
1442 | |
1442 | |
1443 o | new branch
1443 o | new branch
1444 |/
1444 |/
1445 o n
1445 o n
1446 |
1446 |
1447 o n
1447 o n
1448 |
1448 |
1449 o
1449 o
1450 |
1450 |
1451 o line 1
1451 o line 1
1452 line 2
1452 line 2
1453
1453
1454 Test word error messages for not enough and too many arguments
1454 Test word error messages for not enough and too many arguments
1455
1455
1456 $ hg log -Gv -R a --template "{word('0')}"
1456 $ hg log -Gv -R a --template "{word('0')}"
1457 hg: parse error: word expects two or three arguments, got 1
1457 hg: parse error: word expects two or three arguments, got 1
1458 [255]
1458 [255]
1459
1459
1460 $ hg log -Gv -R a --template "{word('0', desc, 'o', 'h', 'b', 'o', 'y')}"
1460 $ hg log -Gv -R a --template "{word('0', desc, 'o', 'h', 'b', 'o', 'y')}"
1461 hg: parse error: word expects two or three arguments, got 7
1461 hg: parse error: word expects two or three arguments, got 7
1462 [255]
1462 [255]
1463
1463
1464 Test word for integer literal
1464 Test word for integer literal
1465
1465
1466 $ hg log -R a --template "{word(2, desc)}\n" -r0
1466 $ hg log -R a --template "{word(2, desc)}\n" -r0
1467 line
1467 line
1468
1468
1469 Test word for invalid numbers
1469 Test word for invalid numbers
1470
1470
1471 $ hg log -Gv -R a --template "{word('a', desc)}"
1471 $ hg log -Gv -R a --template "{word('a', desc)}"
1472 hg: parse error: word expects an integer index
1472 hg: parse error: word expects an integer index
1473 [255]
1473 [255]
1474
1474
1475 Test word for out of range
1475 Test word for out of range
1476
1476
1477 $ hg log -R a --template "{word(10000, desc)}"
1477 $ hg log -R a --template "{word(10000, desc)}"
1478 $ hg log -R a --template "{word(-10000, desc)}"
1478 $ hg log -R a --template "{word(-10000, desc)}"
1479
1479
1480 Test indent and not adding to empty lines
1480 Test indent and not adding to empty lines
1481
1481
1482 $ hg log -T "-----\n{indent(desc, '>> ', ' > ')}\n" -r 0:1 -R a
1482 $ hg log -T "-----\n{indent(desc, '>> ', ' > ')}\n" -r 0:1 -R a
1483 -----
1483 -----
1484 > line 1
1484 > line 1
1485 >> line 2
1485 >> line 2
1486 -----
1486 -----
1487 > other 1
1487 > other 1
1488 >> other 2
1488 >> other 2
1489
1489
1490 >> other 3
1490 >> other 3
1491
1491
1492 Test with non-strings like dates
1492 Test with non-strings like dates
1493
1493
1494 $ hg log -T "{indent(date, ' ')}\n" -r 2:3 -R a
1494 $ hg log -T "{indent(date, ' ')}\n" -r 2:3 -R a
1495 1200000.00
1495 1200000.00
1496 1300000.00
1496 1300000.00
1497
1497
1498 Test cbor filter:
1498 Test cbor filter:
1499
1499
1500 $ cat <<'EOF' > "$TESTTMP/decodecbor.py"
1500 $ cat <<'EOF' > "$TESTTMP/decodecbor.py"
1501 > from __future__ import absolute_import
1501 > from __future__ import absolute_import
1502 > from mercurial import pycompat
1502 > from mercurial import (
1503 > dispatch,
1504 > pycompat,
1505 > )
1503 > from mercurial.utils import (
1506 > from mercurial.utils import (
1504 > cborutil,
1507 > cborutil,
1505 > stringutil,
1508 > stringutil,
1506 > )
1509 > )
1510 > dispatch.initstdio()
1507 > items = cborutil.decodeall(pycompat.stdin.read())
1511 > items = cborutil.decodeall(pycompat.stdin.read())
1508 > pycompat.stdout.write(stringutil.pprint(items, indent=1) + b'\n')
1512 > pycompat.stdout.write(stringutil.pprint(items, indent=1) + b'\n')
1509 > EOF
1513 > EOF
1510
1514
1511 $ hg log -T "{rev|cbor}" -R a -l2 | "$PYTHON" "$TESTTMP/decodecbor.py"
1515 $ hg log -T "{rev|cbor}" -R a -l2 | "$PYTHON" "$TESTTMP/decodecbor.py"
1512 [
1516 [
1513 10,
1517 10,
1514 9
1518 9
1515 ]
1519 ]
1516
1520
1517 $ hg log -T "{extras|cbor}" -R a -l1 | "$PYTHON" "$TESTTMP/decodecbor.py"
1521 $ hg log -T "{extras|cbor}" -R a -l1 | "$PYTHON" "$TESTTMP/decodecbor.py"
1518 [
1522 [
1519 {
1523 {
1520 'branch': 'default'
1524 'branch': 'default'
1521 }
1525 }
1522 ]
1526 ]
1523
1527
1524 json filter should escape HTML tags so that the output can be embedded in hgweb:
1528 json filter should escape HTML tags so that the output can be embedded in hgweb:
1525
1529
1526 $ hg log -T "{'<foo@example.org>'|json}\n" -R a -l1
1530 $ hg log -T "{'<foo@example.org>'|json}\n" -R a -l1
1527 "\u003cfoo@example.org\u003e"
1531 "\u003cfoo@example.org\u003e"
1528
1532
1529 Set up repository for non-ascii encoding tests:
1533 Set up repository for non-ascii encoding tests:
1530
1534
1531 $ hg init nonascii
1535 $ hg init nonascii
1532 $ cd nonascii
1536 $ cd nonascii
1533 $ "$PYTHON" <<EOF
1537 $ "$PYTHON" <<EOF
1534 > open('latin1', 'wb').write(b'\xe9')
1538 > open('latin1', 'wb').write(b'\xe9')
1535 > open('utf-8', 'wb').write(b'\xc3\xa9')
1539 > open('utf-8', 'wb').write(b'\xc3\xa9')
1536 > EOF
1540 > EOF
1537 $ HGENCODING=utf-8 hg branch -q `cat utf-8`
1541 $ HGENCODING=utf-8 hg branch -q `cat utf-8`
1538 $ HGENCODING=utf-8 hg ci -qAm "non-ascii branch: `cat utf-8`" utf-8
1542 $ HGENCODING=utf-8 hg ci -qAm "non-ascii branch: `cat utf-8`" utf-8
1539
1543
1540 json filter should try round-trip conversion to utf-8:
1544 json filter should try round-trip conversion to utf-8:
1541
1545
1542 $ HGENCODING=ascii hg log -T "{branch|json}\n" -r0
1546 $ HGENCODING=ascii hg log -T "{branch|json}\n" -r0
1543 "\u00e9"
1547 "\u00e9"
1544 $ HGENCODING=ascii hg log -T "{desc|json}\n" -r0
1548 $ HGENCODING=ascii hg log -T "{desc|json}\n" -r0
1545 "non-ascii branch: \u00e9"
1549 "non-ascii branch: \u00e9"
1546
1550
1547 json filter should take input as utf-8 if it was converted from utf-8:
1551 json filter should take input as utf-8 if it was converted from utf-8:
1548
1552
1549 $ HGENCODING=latin-1 hg log -T "{branch|json}\n" -r0
1553 $ HGENCODING=latin-1 hg log -T "{branch|json}\n" -r0
1550 "\u00e9"
1554 "\u00e9"
1551 $ HGENCODING=latin-1 hg log -T "{desc|json}\n" -r0
1555 $ HGENCODING=latin-1 hg log -T "{desc|json}\n" -r0
1552 "non-ascii branch: \u00e9"
1556 "non-ascii branch: \u00e9"
1553
1557
1554 json filter takes input as utf-8b:
1558 json filter takes input as utf-8b:
1555
1559
1556 $ HGENCODING=ascii hg log -T "{'`cat utf-8`'|json}\n" -l1
1560 $ HGENCODING=ascii hg log -T "{'`cat utf-8`'|json}\n" -l1
1557 "\u00e9"
1561 "\u00e9"
1558 $ HGENCODING=ascii hg log -T "{'`cat latin1`'|json}\n" -l1
1562 $ HGENCODING=ascii hg log -T "{'`cat latin1`'|json}\n" -l1
1559 "\udce9"
1563 "\udce9"
1560
1564
1561 utf8 filter:
1565 utf8 filter:
1562
1566
1563 $ HGENCODING=ascii hg log -T "round-trip: {branch|utf8|hex}\n" -r0
1567 $ HGENCODING=ascii hg log -T "round-trip: {branch|utf8|hex}\n" -r0
1564 round-trip: c3a9
1568 round-trip: c3a9
1565 $ HGENCODING=latin1 hg log -T "decoded: {'`cat latin1`'|utf8|hex}\n" -l1
1569 $ HGENCODING=latin1 hg log -T "decoded: {'`cat latin1`'|utf8|hex}\n" -l1
1566 decoded: c3a9
1570 decoded: c3a9
1567 $ HGENCODING=ascii hg log -T "replaced: {'`cat latin1`'|utf8|hex}\n" -l1
1571 $ HGENCODING=ascii hg log -T "replaced: {'`cat latin1`'|utf8|hex}\n" -l1
1568 abort: decoding near * (glob)
1572 abort: decoding near * (glob)
1569 [255]
1573 [255]
1570 $ hg log -T "coerced to string: {rev|utf8}\n" -r0
1574 $ hg log -T "coerced to string: {rev|utf8}\n" -r0
1571 coerced to string: 0
1575 coerced to string: 0
1572
1576
1573 pad width:
1577 pad width:
1574
1578
1575 $ HGENCODING=utf-8 hg debugtemplate "{pad('`cat utf-8`', 2, '-')}\n"
1579 $ HGENCODING=utf-8 hg debugtemplate "{pad('`cat utf-8`', 2, '-')}\n"
1576 \xc3\xa9- (esc)
1580 \xc3\xa9- (esc)
1577
1581
1578 read config options:
1582 read config options:
1579
1583
1580 $ hg log -T "{config('templateconfig', 'knob', 'foo')}\n"
1584 $ hg log -T "{config('templateconfig', 'knob', 'foo')}\n"
1581 foo
1585 foo
1582 $ hg log -T "{config('templateconfig', 'knob', 'foo')}\n" \
1586 $ hg log -T "{config('templateconfig', 'knob', 'foo')}\n" \
1583 > --config templateconfig.knob=bar
1587 > --config templateconfig.knob=bar
1584 bar
1588 bar
1585 $ hg log -T "{configbool('templateconfig', 'knob', True)}\n"
1589 $ hg log -T "{configbool('templateconfig', 'knob', True)}\n"
1586 True
1590 True
1587 $ hg log -T "{configbool('templateconfig', 'knob', True)}\n" \
1591 $ hg log -T "{configbool('templateconfig', 'knob', True)}\n" \
1588 > --config templateconfig.knob=0
1592 > --config templateconfig.knob=0
1589 False
1593 False
1590 $ hg log -T "{configint('templateconfig', 'knob', 123)}\n"
1594 $ hg log -T "{configint('templateconfig', 'knob', 123)}\n"
1591 123
1595 123
1592 $ hg log -T "{configint('templateconfig', 'knob', 123)}\n" \
1596 $ hg log -T "{configint('templateconfig', 'knob', 123)}\n" \
1593 > --config templateconfig.knob=456
1597 > --config templateconfig.knob=456
1594 456
1598 456
1595 $ hg log -T "{config('templateconfig', 'knob')}\n"
1599 $ hg log -T "{config('templateconfig', 'knob')}\n"
1596 devel-warn: config item requires an explicit default value: 'templateconfig.knob' at: * (glob)
1600 devel-warn: config item requires an explicit default value: 'templateconfig.knob' at: * (glob)
1597
1601
1598 $ hg log -T "{configbool('ui', 'interactive')}\n"
1602 $ hg log -T "{configbool('ui', 'interactive')}\n"
1599 False
1603 False
1600 $ hg log -T "{configbool('ui', 'interactive')}\n" --config ui.interactive=1
1604 $ hg log -T "{configbool('ui', 'interactive')}\n" --config ui.interactive=1
1601 True
1605 True
1602 $ hg log -T "{config('templateconfig', 'knob', if(true, 'foo', 'bar'))}\n"
1606 $ hg log -T "{config('templateconfig', 'knob', if(true, 'foo', 'bar'))}\n"
1603 foo
1607 foo
1604
1608
1605 $ cd ..
1609 $ cd ..
@@ -1,1824 +1,1828 b''
1 Test template map files and styles
1 Test template map files and styles
2 ==================================
2 ==================================
3
3
4 $ hg init a
4 $ hg init a
5 $ cd a
5 $ cd a
6 $ echo a > a
6 $ echo a > a
7 $ hg add a
7 $ hg add a
8 $ echo line 1 > b
8 $ echo line 1 > b
9 $ echo line 2 >> b
9 $ echo line 2 >> b
10 $ hg commit -l b -d '1000000 0' -u 'User Name <user@hostname>'
10 $ hg commit -l b -d '1000000 0' -u 'User Name <user@hostname>'
11
11
12 $ hg add b
12 $ hg add b
13 $ echo other 1 > c
13 $ echo other 1 > c
14 $ echo other 2 >> c
14 $ echo other 2 >> c
15 $ echo >> c
15 $ echo >> c
16 $ echo other 3 >> c
16 $ echo other 3 >> c
17 $ hg commit -l c -d '1100000 0' -u 'A. N. Other <other@place>'
17 $ hg commit -l c -d '1100000 0' -u 'A. N. Other <other@place>'
18
18
19 $ hg add c
19 $ hg add c
20 $ hg commit -m 'no person' -d '1200000 0' -u 'other@place'
20 $ hg commit -m 'no person' -d '1200000 0' -u 'other@place'
21 $ echo c >> c
21 $ echo c >> c
22 $ hg commit -m 'no user, no domain' -d '1300000 0' -u 'person'
22 $ hg commit -m 'no user, no domain' -d '1300000 0' -u 'person'
23
23
24 $ echo foo > .hg/branch
24 $ echo foo > .hg/branch
25 $ hg commit -m 'new branch' -d '1400000 0' -u 'person'
25 $ hg commit -m 'new branch' -d '1400000 0' -u 'person'
26
26
27 $ hg co -q 3
27 $ hg co -q 3
28 $ echo other 4 >> d
28 $ echo other 4 >> d
29 $ hg add d
29 $ hg add d
30 $ hg commit -m 'new head' -d '1500000 0' -u 'person'
30 $ hg commit -m 'new head' -d '1500000 0' -u 'person'
31
31
32 $ hg merge -q foo
32 $ hg merge -q foo
33 $ hg commit -m 'merge' -d '1500001 0' -u 'person'
33 $ hg commit -m 'merge' -d '1500001 0' -u 'person'
34
34
35 Second branch starting at nullrev:
35 Second branch starting at nullrev:
36
36
37 $ hg update null
37 $ hg update null
38 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
38 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
39 $ echo second > second
39 $ echo second > second
40 $ hg add second
40 $ hg add second
41 $ hg commit -m second -d '1000000 0' -u 'User Name <user@hostname>'
41 $ hg commit -m second -d '1000000 0' -u 'User Name <user@hostname>'
42 created new head
42 created new head
43
43
44 $ echo third > third
44 $ echo third > third
45 $ hg add third
45 $ hg add third
46 $ hg mv second fourth
46 $ hg mv second fourth
47 $ hg commit -m third -d "2020-01-01 10:01"
47 $ hg commit -m third -d "2020-01-01 10:01"
48
48
49 Make sure user/global hgrc does not affect tests
49 Make sure user/global hgrc does not affect tests
50
50
51 $ echo '[ui]' > .hg/hgrc
51 $ echo '[ui]' > .hg/hgrc
52 $ echo 'logtemplate =' >> .hg/hgrc
52 $ echo 'logtemplate =' >> .hg/hgrc
53 $ echo 'style =' >> .hg/hgrc
53 $ echo 'style =' >> .hg/hgrc
54
54
55 Add some simple styles to settings
55 Add some simple styles to settings
56
56
57 $ cat <<'EOF' >> .hg/hgrc
57 $ cat <<'EOF' >> .hg/hgrc
58 > [templates]
58 > [templates]
59 > simple = "{rev}\n"
59 > simple = "{rev}\n"
60 > simple2 = {rev}\n
60 > simple2 = {rev}\n
61 > rev = "should not precede {rev} keyword\n"
61 > rev = "should not precede {rev} keyword\n"
62 > EOF
62 > EOF
63
63
64 $ hg log -l1 -Tsimple
64 $ hg log -l1 -Tsimple
65 8
65 8
66 $ hg log -l1 -Tsimple2
66 $ hg log -l1 -Tsimple2
67 8
67 8
68 $ hg log -l1 -Trev
68 $ hg log -l1 -Trev
69 should not precede 8 keyword
69 should not precede 8 keyword
70 $ hg log -l1 -T '{simple}'
70 $ hg log -l1 -T '{simple}'
71 8
71 8
72
72
73 Map file shouldn't see user templates:
73 Map file shouldn't see user templates:
74
74
75 $ cat <<EOF > tmpl
75 $ cat <<EOF > tmpl
76 > changeset = 'nothing expanded:{simple}\n'
76 > changeset = 'nothing expanded:{simple}\n'
77 > EOF
77 > EOF
78 $ hg log -l1 --style ./tmpl
78 $ hg log -l1 --style ./tmpl
79 nothing expanded:
79 nothing expanded:
80
80
81 Test templates and style maps in files:
81 Test templates and style maps in files:
82
82
83 $ echo "{rev}" > tmpl
83 $ echo "{rev}" > tmpl
84 $ hg log -l1 -T./tmpl
84 $ hg log -l1 -T./tmpl
85 8
85 8
86 $ hg log -l1 -Tblah/blah
86 $ hg log -l1 -Tblah/blah
87 blah/blah (no-eol)
87 blah/blah (no-eol)
88
88
89 $ printf 'changeset = "{rev}\\n"\n' > map-simple
89 $ printf 'changeset = "{rev}\\n"\n' > map-simple
90 $ hg log -l1 -T./map-simple
90 $ hg log -l1 -T./map-simple
91 8
91 8
92
92
93 a map file may have [templates] and [templatealias] sections:
93 a map file may have [templates] and [templatealias] sections:
94
94
95 $ cat <<'EOF' > map-simple
95 $ cat <<'EOF' > map-simple
96 > [templates]
96 > [templates]
97 > changeset = "{a}\n"
97 > changeset = "{a}\n"
98 > [templatealias]
98 > [templatealias]
99 > a = rev
99 > a = rev
100 > EOF
100 > EOF
101 $ hg log -l1 -T./map-simple
101 $ hg log -l1 -T./map-simple
102 8
102 8
103
103
104 so it can be included in hgrc
104 so it can be included in hgrc
105
105
106 $ cat <<EOF > myhgrc
106 $ cat <<EOF > myhgrc
107 > %include $HGRCPATH
107 > %include $HGRCPATH
108 > %include map-simple
108 > %include map-simple
109 > [templates]
109 > [templates]
110 > foo = "{changeset}"
110 > foo = "{changeset}"
111 > EOF
111 > EOF
112 $ HGRCPATH=./myhgrc hg log -l1 -Tfoo
112 $ HGRCPATH=./myhgrc hg log -l1 -Tfoo
113 8
113 8
114 $ HGRCPATH=./myhgrc hg log -l1 -T'{a}\n'
114 $ HGRCPATH=./myhgrc hg log -l1 -T'{a}\n'
115 8
115 8
116
116
117 Test template map inheritance
117 Test template map inheritance
118
118
119 $ echo "__base__ = map-cmdline.default" > map-simple
119 $ echo "__base__ = map-cmdline.default" > map-simple
120 $ printf 'cset = "changeset: ***{rev}***\\n"\n' >> map-simple
120 $ printf 'cset = "changeset: ***{rev}***\\n"\n' >> map-simple
121 $ hg log -l1 -T./map-simple
121 $ hg log -l1 -T./map-simple
122 changeset: ***8***
122 changeset: ***8***
123 tag: tip
123 tag: tip
124 user: test
124 user: test
125 date: Wed Jan 01 10:01:00 2020 +0000
125 date: Wed Jan 01 10:01:00 2020 +0000
126 summary: third
126 summary: third
127
127
128
128
129 Test docheader, docfooter and separator in template map
129 Test docheader, docfooter and separator in template map
130
130
131 $ cat <<'EOF' > map-myjson
131 $ cat <<'EOF' > map-myjson
132 > docheader = '\{\n'
132 > docheader = '\{\n'
133 > docfooter = '\n}\n'
133 > docfooter = '\n}\n'
134 > separator = ',\n'
134 > separator = ',\n'
135 > changeset = ' {dict(rev, node|short)|json}'
135 > changeset = ' {dict(rev, node|short)|json}'
136 > EOF
136 > EOF
137 $ hg log -l2 -T./map-myjson
137 $ hg log -l2 -T./map-myjson
138 {
138 {
139 {"node": "95c24699272e", "rev": 8},
139 {"node": "95c24699272e", "rev": 8},
140 {"node": "29114dbae42b", "rev": 7}
140 {"node": "29114dbae42b", "rev": 7}
141 }
141 }
142
142
143 Test docheader, docfooter and separator in [templates] section
143 Test docheader, docfooter and separator in [templates] section
144
144
145 $ cat <<'EOF' >> .hg/hgrc
145 $ cat <<'EOF' >> .hg/hgrc
146 > [templates]
146 > [templates]
147 > myjson = ' {dict(rev, node|short)|json}'
147 > myjson = ' {dict(rev, node|short)|json}'
148 > myjson:docheader = '\{\n'
148 > myjson:docheader = '\{\n'
149 > myjson:docfooter = '\n}\n'
149 > myjson:docfooter = '\n}\n'
150 > myjson:separator = ',\n'
150 > myjson:separator = ',\n'
151 > :docheader = 'should not be selected as a docheader for literal templates\n'
151 > :docheader = 'should not be selected as a docheader for literal templates\n'
152 > EOF
152 > EOF
153 $ hg log -l2 -Tmyjson
153 $ hg log -l2 -Tmyjson
154 {
154 {
155 {"node": "95c24699272e", "rev": 8},
155 {"node": "95c24699272e", "rev": 8},
156 {"node": "29114dbae42b", "rev": 7}
156 {"node": "29114dbae42b", "rev": 7}
157 }
157 }
158 $ hg log -l1 -T'{rev}\n'
158 $ hg log -l1 -T'{rev}\n'
159 8
159 8
160
160
161 Template should precede style option
161 Template should precede style option
162
162
163 $ hg log -l1 --style default -T '{rev}\n'
163 $ hg log -l1 --style default -T '{rev}\n'
164 8
164 8
165
165
166 Add a commit with empty description, to ensure that the templates
166 Add a commit with empty description, to ensure that the templates
167 below will omit the description line.
167 below will omit the description line.
168
168
169 $ echo c >> c
169 $ echo c >> c
170 $ hg add c
170 $ hg add c
171 $ hg commit -qm ' '
171 $ hg commit -qm ' '
172
172
173 Default style is like normal output. Phases style should be the same
173 Default style is like normal output. Phases style should be the same
174 as default style, except for extra phase lines.
174 as default style, except for extra phase lines.
175
175
176 $ hg log > log.out
176 $ hg log > log.out
177 $ hg log --style default > style.out
177 $ hg log --style default > style.out
178 $ cmp log.out style.out || diff -u log.out style.out
178 $ cmp log.out style.out || diff -u log.out style.out
179 $ hg log -T phases > phases.out
179 $ hg log -T phases > phases.out
180 $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@'
180 $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@'
181 +phase: draft
181 +phase: draft
182 +phase: draft
182 +phase: draft
183 +phase: draft
183 +phase: draft
184 +phase: draft
184 +phase: draft
185 +phase: draft
185 +phase: draft
186 +phase: draft
186 +phase: draft
187 +phase: draft
187 +phase: draft
188 +phase: draft
188 +phase: draft
189 +phase: draft
189 +phase: draft
190 +phase: draft
190 +phase: draft
191
191
192 $ hg log -v > log.out
192 $ hg log -v > log.out
193 $ hg log -v --style default > style.out
193 $ hg log -v --style default > style.out
194 $ cmp log.out style.out || diff -u log.out style.out
194 $ cmp log.out style.out || diff -u log.out style.out
195 $ hg log -v -T phases > phases.out
195 $ hg log -v -T phases > phases.out
196 $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@'
196 $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@'
197 +phase: draft
197 +phase: draft
198 +phase: draft
198 +phase: draft
199 +phase: draft
199 +phase: draft
200 +phase: draft
200 +phase: draft
201 +phase: draft
201 +phase: draft
202 +phase: draft
202 +phase: draft
203 +phase: draft
203 +phase: draft
204 +phase: draft
204 +phase: draft
205 +phase: draft
205 +phase: draft
206 +phase: draft
206 +phase: draft
207
207
208 $ hg log -q > log.out
208 $ hg log -q > log.out
209 $ hg log -q --style default > style.out
209 $ hg log -q --style default > style.out
210 $ cmp log.out style.out || diff -u log.out style.out
210 $ cmp log.out style.out || diff -u log.out style.out
211 $ hg log -q -T phases > phases.out
211 $ hg log -q -T phases > phases.out
212 $ cmp log.out phases.out || diff -u log.out phases.out
212 $ cmp log.out phases.out || diff -u log.out phases.out
213
213
214 $ hg log --debug > log.out
214 $ hg log --debug > log.out
215 $ hg log --debug --style default > style.out
215 $ hg log --debug --style default > style.out
216 $ cmp log.out style.out || diff -u log.out style.out
216 $ cmp log.out style.out || diff -u log.out style.out
217 $ hg log --debug -T phases > phases.out
217 $ hg log --debug -T phases > phases.out
218 $ cmp log.out phases.out || diff -u log.out phases.out
218 $ cmp log.out phases.out || diff -u log.out phases.out
219
219
220 Default style of working-directory revision should also be the same (but
220 Default style of working-directory revision should also be the same (but
221 date may change while running tests):
221 date may change while running tests):
222
222
223 $ hg log -r 'wdir()' | sed 's|^date:.*|date:|' > log.out
223 $ hg log -r 'wdir()' | sed 's|^date:.*|date:|' > log.out
224 $ hg log -r 'wdir()' --style default | sed 's|^date:.*|date:|' > style.out
224 $ hg log -r 'wdir()' --style default | sed 's|^date:.*|date:|' > style.out
225 $ cmp log.out style.out || diff -u log.out style.out
225 $ cmp log.out style.out || diff -u log.out style.out
226
226
227 $ hg log -r 'wdir()' -v | sed 's|^date:.*|date:|' > log.out
227 $ hg log -r 'wdir()' -v | sed 's|^date:.*|date:|' > log.out
228 $ hg log -r 'wdir()' -v --style default | sed 's|^date:.*|date:|' > style.out
228 $ hg log -r 'wdir()' -v --style default | sed 's|^date:.*|date:|' > style.out
229 $ cmp log.out style.out || diff -u log.out style.out
229 $ cmp log.out style.out || diff -u log.out style.out
230
230
231 $ hg log -r 'wdir()' -q > log.out
231 $ hg log -r 'wdir()' -q > log.out
232 $ hg log -r 'wdir()' -q --style default > style.out
232 $ hg log -r 'wdir()' -q --style default > style.out
233 $ cmp log.out style.out || diff -u log.out style.out
233 $ cmp log.out style.out || diff -u log.out style.out
234
234
235 $ hg log -r 'wdir()' --debug | sed 's|^date:.*|date:|' > log.out
235 $ hg log -r 'wdir()' --debug | sed 's|^date:.*|date:|' > log.out
236 $ hg log -r 'wdir()' --debug --style default \
236 $ hg log -r 'wdir()' --debug --style default \
237 > | sed 's|^date:.*|date:|' > style.out
237 > | sed 's|^date:.*|date:|' > style.out
238 $ cmp log.out style.out || diff -u log.out style.out
238 $ cmp log.out style.out || diff -u log.out style.out
239
239
240 Default style should also preserve color information (issue2866):
240 Default style should also preserve color information (issue2866):
241
241
242 $ cp $HGRCPATH $HGRCPATH-bak
242 $ cp $HGRCPATH $HGRCPATH-bak
243 $ cat <<EOF >> $HGRCPATH
243 $ cat <<EOF >> $HGRCPATH
244 > [extensions]
244 > [extensions]
245 > color=
245 > color=
246 > EOF
246 > EOF
247
247
248 $ hg --color=debug log > log.out
248 $ hg --color=debug log > log.out
249 $ hg --color=debug log --style default > style.out
249 $ hg --color=debug log --style default > style.out
250 $ cmp log.out style.out || diff -u log.out style.out
250 $ cmp log.out style.out || diff -u log.out style.out
251 $ hg --color=debug log -T phases > phases.out
251 $ hg --color=debug log -T phases > phases.out
252 $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@'
252 $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@'
253 +[log.phase|phase: draft]
253 +[log.phase|phase: draft]
254 +[log.phase|phase: draft]
254 +[log.phase|phase: draft]
255 +[log.phase|phase: draft]
255 +[log.phase|phase: draft]
256 +[log.phase|phase: draft]
256 +[log.phase|phase: draft]
257 +[log.phase|phase: draft]
257 +[log.phase|phase: draft]
258 +[log.phase|phase: draft]
258 +[log.phase|phase: draft]
259 +[log.phase|phase: draft]
259 +[log.phase|phase: draft]
260 +[log.phase|phase: draft]
260 +[log.phase|phase: draft]
261 +[log.phase|phase: draft]
261 +[log.phase|phase: draft]
262 +[log.phase|phase: draft]
262 +[log.phase|phase: draft]
263
263
264 $ hg --color=debug -v log > log.out
264 $ hg --color=debug -v log > log.out
265 $ hg --color=debug -v log --style default > style.out
265 $ hg --color=debug -v log --style default > style.out
266 $ cmp log.out style.out || diff -u log.out style.out
266 $ cmp log.out style.out || diff -u log.out style.out
267 $ hg --color=debug -v log -T phases > phases.out
267 $ hg --color=debug -v log -T phases > phases.out
268 $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@'
268 $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@'
269 +[log.phase|phase: draft]
269 +[log.phase|phase: draft]
270 +[log.phase|phase: draft]
270 +[log.phase|phase: draft]
271 +[log.phase|phase: draft]
271 +[log.phase|phase: draft]
272 +[log.phase|phase: draft]
272 +[log.phase|phase: draft]
273 +[log.phase|phase: draft]
273 +[log.phase|phase: draft]
274 +[log.phase|phase: draft]
274 +[log.phase|phase: draft]
275 +[log.phase|phase: draft]
275 +[log.phase|phase: draft]
276 +[log.phase|phase: draft]
276 +[log.phase|phase: draft]
277 +[log.phase|phase: draft]
277 +[log.phase|phase: draft]
278 +[log.phase|phase: draft]
278 +[log.phase|phase: draft]
279
279
280 $ hg --color=debug -q log > log.out
280 $ hg --color=debug -q log > log.out
281 $ hg --color=debug -q log --style default > style.out
281 $ hg --color=debug -q log --style default > style.out
282 $ cmp log.out style.out || diff -u log.out style.out
282 $ cmp log.out style.out || diff -u log.out style.out
283 $ hg --color=debug -q log -T phases > phases.out
283 $ hg --color=debug -q log -T phases > phases.out
284 $ cmp log.out phases.out || diff -u log.out phases.out
284 $ cmp log.out phases.out || diff -u log.out phases.out
285
285
286 $ hg --color=debug --debug log > log.out
286 $ hg --color=debug --debug log > log.out
287 $ hg --color=debug --debug log --style default > style.out
287 $ hg --color=debug --debug log --style default > style.out
288 $ cmp log.out style.out || diff -u log.out style.out
288 $ cmp log.out style.out || diff -u log.out style.out
289 $ hg --color=debug --debug log -T phases > phases.out
289 $ hg --color=debug --debug log -T phases > phases.out
290 $ cmp log.out phases.out || diff -u log.out phases.out
290 $ cmp log.out phases.out || diff -u log.out phases.out
291
291
292 $ mv $HGRCPATH-bak $HGRCPATH
292 $ mv $HGRCPATH-bak $HGRCPATH
293
293
294 Remove commit with empty commit message, so as to not pollute further
294 Remove commit with empty commit message, so as to not pollute further
295 tests.
295 tests.
296
296
297 $ hg --config extensions.strip= strip -q .
297 $ hg --config extensions.strip= strip -q .
298
298
299 Revision with no copies (used to print a traceback):
299 Revision with no copies (used to print a traceback):
300
300
301 $ hg tip -v --template '\n'
301 $ hg tip -v --template '\n'
302
302
303
303
304 Compact style works:
304 Compact style works:
305
305
306 $ hg log -Tcompact
306 $ hg log -Tcompact
307 8[tip] 95c24699272e 2020-01-01 10:01 +0000 test
307 8[tip] 95c24699272e 2020-01-01 10:01 +0000 test
308 third
308 third
309
309
310 7:-1 29114dbae42b 1970-01-12 13:46 +0000 user
310 7:-1 29114dbae42b 1970-01-12 13:46 +0000 user
311 second
311 second
312
312
313 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person
313 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person
314 merge
314 merge
315
315
316 5:3 13207e5a10d9 1970-01-18 08:40 +0000 person
316 5:3 13207e5a10d9 1970-01-18 08:40 +0000 person
317 new head
317 new head
318
318
319 4 bbe44766e73d 1970-01-17 04:53 +0000 person
319 4 bbe44766e73d 1970-01-17 04:53 +0000 person
320 new branch
320 new branch
321
321
322 3 10e46f2dcbf4 1970-01-16 01:06 +0000 person
322 3 10e46f2dcbf4 1970-01-16 01:06 +0000 person
323 no user, no domain
323 no user, no domain
324
324
325 2 97054abb4ab8 1970-01-14 21:20 +0000 other
325 2 97054abb4ab8 1970-01-14 21:20 +0000 other
326 no person
326 no person
327
327
328 1 b608e9d1a3f0 1970-01-13 17:33 +0000 other
328 1 b608e9d1a3f0 1970-01-13 17:33 +0000 other
329 other 1
329 other 1
330
330
331 0 1e4e1b8f71e0 1970-01-12 13:46 +0000 user
331 0 1e4e1b8f71e0 1970-01-12 13:46 +0000 user
332 line 1
332 line 1
333
333
334
334
335 $ hg log -v --style compact
335 $ hg log -v --style compact
336 8[tip] 95c24699272e 2020-01-01 10:01 +0000 test
336 8[tip] 95c24699272e 2020-01-01 10:01 +0000 test
337 third
337 third
338
338
339 7:-1 29114dbae42b 1970-01-12 13:46 +0000 User Name <user@hostname>
339 7:-1 29114dbae42b 1970-01-12 13:46 +0000 User Name <user@hostname>
340 second
340 second
341
341
342 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person
342 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person
343 merge
343 merge
344
344
345 5:3 13207e5a10d9 1970-01-18 08:40 +0000 person
345 5:3 13207e5a10d9 1970-01-18 08:40 +0000 person
346 new head
346 new head
347
347
348 4 bbe44766e73d 1970-01-17 04:53 +0000 person
348 4 bbe44766e73d 1970-01-17 04:53 +0000 person
349 new branch
349 new branch
350
350
351 3 10e46f2dcbf4 1970-01-16 01:06 +0000 person
351 3 10e46f2dcbf4 1970-01-16 01:06 +0000 person
352 no user, no domain
352 no user, no domain
353
353
354 2 97054abb4ab8 1970-01-14 21:20 +0000 other@place
354 2 97054abb4ab8 1970-01-14 21:20 +0000 other@place
355 no person
355 no person
356
356
357 1 b608e9d1a3f0 1970-01-13 17:33 +0000 A. N. Other <other@place>
357 1 b608e9d1a3f0 1970-01-13 17:33 +0000 A. N. Other <other@place>
358 other 1
358 other 1
359 other 2
359 other 2
360
360
361 other 3
361 other 3
362
362
363 0 1e4e1b8f71e0 1970-01-12 13:46 +0000 User Name <user@hostname>
363 0 1e4e1b8f71e0 1970-01-12 13:46 +0000 User Name <user@hostname>
364 line 1
364 line 1
365 line 2
365 line 2
366
366
367
367
368 $ hg log --debug --style compact
368 $ hg log --debug --style compact
369 8[tip]:7,-1 95c24699272e 2020-01-01 10:01 +0000 test
369 8[tip]:7,-1 95c24699272e 2020-01-01 10:01 +0000 test
370 third
370 third
371
371
372 7:-1,-1 29114dbae42b 1970-01-12 13:46 +0000 User Name <user@hostname>
372 7:-1,-1 29114dbae42b 1970-01-12 13:46 +0000 User Name <user@hostname>
373 second
373 second
374
374
375 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person
375 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person
376 merge
376 merge
377
377
378 5:3,-1 13207e5a10d9 1970-01-18 08:40 +0000 person
378 5:3,-1 13207e5a10d9 1970-01-18 08:40 +0000 person
379 new head
379 new head
380
380
381 4:3,-1 bbe44766e73d 1970-01-17 04:53 +0000 person
381 4:3,-1 bbe44766e73d 1970-01-17 04:53 +0000 person
382 new branch
382 new branch
383
383
384 3:2,-1 10e46f2dcbf4 1970-01-16 01:06 +0000 person
384 3:2,-1 10e46f2dcbf4 1970-01-16 01:06 +0000 person
385 no user, no domain
385 no user, no domain
386
386
387 2:1,-1 97054abb4ab8 1970-01-14 21:20 +0000 other@place
387 2:1,-1 97054abb4ab8 1970-01-14 21:20 +0000 other@place
388 no person
388 no person
389
389
390 1:0,-1 b608e9d1a3f0 1970-01-13 17:33 +0000 A. N. Other <other@place>
390 1:0,-1 b608e9d1a3f0 1970-01-13 17:33 +0000 A. N. Other <other@place>
391 other 1
391 other 1
392 other 2
392 other 2
393
393
394 other 3
394 other 3
395
395
396 0:-1,-1 1e4e1b8f71e0 1970-01-12 13:46 +0000 User Name <user@hostname>
396 0:-1,-1 1e4e1b8f71e0 1970-01-12 13:46 +0000 User Name <user@hostname>
397 line 1
397 line 1
398 line 2
398 line 2
399
399
400
400
401 Test xml styles:
401 Test xml styles:
402
402
403 $ hg log --style xml -r 'not all()'
403 $ hg log --style xml -r 'not all()'
404 <?xml version="1.0"?>
404 <?xml version="1.0"?>
405 <log>
405 <log>
406 </log>
406 </log>
407
407
408 $ hg log --style xml
408 $ hg log --style xml
409 <?xml version="1.0"?>
409 <?xml version="1.0"?>
410 <log>
410 <log>
411 <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
411 <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
412 <tag>tip</tag>
412 <tag>tip</tag>
413 <author email="test">test</author>
413 <author email="test">test</author>
414 <date>2020-01-01T10:01:00+00:00</date>
414 <date>2020-01-01T10:01:00+00:00</date>
415 <msg xml:space="preserve">third</msg>
415 <msg xml:space="preserve">third</msg>
416 </logentry>
416 </logentry>
417 <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
417 <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
418 <parent revision="-1" node="0000000000000000000000000000000000000000" />
418 <parent revision="-1" node="0000000000000000000000000000000000000000" />
419 <author email="user@hostname">User Name</author>
419 <author email="user@hostname">User Name</author>
420 <date>1970-01-12T13:46:40+00:00</date>
420 <date>1970-01-12T13:46:40+00:00</date>
421 <msg xml:space="preserve">second</msg>
421 <msg xml:space="preserve">second</msg>
422 </logentry>
422 </logentry>
423 <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b">
423 <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b">
424 <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
424 <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
425 <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" />
425 <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" />
426 <author email="person">person</author>
426 <author email="person">person</author>
427 <date>1970-01-18T08:40:01+00:00</date>
427 <date>1970-01-18T08:40:01+00:00</date>
428 <msg xml:space="preserve">merge</msg>
428 <msg xml:space="preserve">merge</msg>
429 </logentry>
429 </logentry>
430 <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
430 <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
431 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
431 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
432 <author email="person">person</author>
432 <author email="person">person</author>
433 <date>1970-01-18T08:40:00+00:00</date>
433 <date>1970-01-18T08:40:00+00:00</date>
434 <msg xml:space="preserve">new head</msg>
434 <msg xml:space="preserve">new head</msg>
435 </logentry>
435 </logentry>
436 <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74">
436 <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74">
437 <branch>foo</branch>
437 <branch>foo</branch>
438 <author email="person">person</author>
438 <author email="person">person</author>
439 <date>1970-01-17T04:53:20+00:00</date>
439 <date>1970-01-17T04:53:20+00:00</date>
440 <msg xml:space="preserve">new branch</msg>
440 <msg xml:space="preserve">new branch</msg>
441 </logentry>
441 </logentry>
442 <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
442 <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
443 <author email="person">person</author>
443 <author email="person">person</author>
444 <date>1970-01-16T01:06:40+00:00</date>
444 <date>1970-01-16T01:06:40+00:00</date>
445 <msg xml:space="preserve">no user, no domain</msg>
445 <msg xml:space="preserve">no user, no domain</msg>
446 </logentry>
446 </logentry>
447 <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
447 <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
448 <author email="other@place">other</author>
448 <author email="other@place">other</author>
449 <date>1970-01-14T21:20:00+00:00</date>
449 <date>1970-01-14T21:20:00+00:00</date>
450 <msg xml:space="preserve">no person</msg>
450 <msg xml:space="preserve">no person</msg>
451 </logentry>
451 </logentry>
452 <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
452 <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
453 <author email="other@place">A. N. Other</author>
453 <author email="other@place">A. N. Other</author>
454 <date>1970-01-13T17:33:20+00:00</date>
454 <date>1970-01-13T17:33:20+00:00</date>
455 <msg xml:space="preserve">other 1
455 <msg xml:space="preserve">other 1
456 other 2
456 other 2
457
457
458 other 3</msg>
458 other 3</msg>
459 </logentry>
459 </logentry>
460 <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
460 <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
461 <author email="user@hostname">User Name</author>
461 <author email="user@hostname">User Name</author>
462 <date>1970-01-12T13:46:40+00:00</date>
462 <date>1970-01-12T13:46:40+00:00</date>
463 <msg xml:space="preserve">line 1
463 <msg xml:space="preserve">line 1
464 line 2</msg>
464 line 2</msg>
465 </logentry>
465 </logentry>
466 </log>
466 </log>
467
467
468 $ hg log -v --style xml
468 $ hg log -v --style xml
469 <?xml version="1.0"?>
469 <?xml version="1.0"?>
470 <log>
470 <log>
471 <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
471 <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
472 <tag>tip</tag>
472 <tag>tip</tag>
473 <author email="test">test</author>
473 <author email="test">test</author>
474 <date>2020-01-01T10:01:00+00:00</date>
474 <date>2020-01-01T10:01:00+00:00</date>
475 <msg xml:space="preserve">third</msg>
475 <msg xml:space="preserve">third</msg>
476 <paths>
476 <paths>
477 <path action="A">fourth</path>
477 <path action="A">fourth</path>
478 <path action="A">third</path>
478 <path action="A">third</path>
479 <path action="R">second</path>
479 <path action="R">second</path>
480 </paths>
480 </paths>
481 <copies>
481 <copies>
482 <copy source="second">fourth</copy>
482 <copy source="second">fourth</copy>
483 </copies>
483 </copies>
484 </logentry>
484 </logentry>
485 <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
485 <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
486 <parent revision="-1" node="0000000000000000000000000000000000000000" />
486 <parent revision="-1" node="0000000000000000000000000000000000000000" />
487 <author email="user@hostname">User Name</author>
487 <author email="user@hostname">User Name</author>
488 <date>1970-01-12T13:46:40+00:00</date>
488 <date>1970-01-12T13:46:40+00:00</date>
489 <msg xml:space="preserve">second</msg>
489 <msg xml:space="preserve">second</msg>
490 <paths>
490 <paths>
491 <path action="A">second</path>
491 <path action="A">second</path>
492 </paths>
492 </paths>
493 </logentry>
493 </logentry>
494 <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b">
494 <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b">
495 <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
495 <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
496 <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" />
496 <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" />
497 <author email="person">person</author>
497 <author email="person">person</author>
498 <date>1970-01-18T08:40:01+00:00</date>
498 <date>1970-01-18T08:40:01+00:00</date>
499 <msg xml:space="preserve">merge</msg>
499 <msg xml:space="preserve">merge</msg>
500 <paths>
500 <paths>
501 </paths>
501 </paths>
502 </logentry>
502 </logentry>
503 <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
503 <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
504 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
504 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
505 <author email="person">person</author>
505 <author email="person">person</author>
506 <date>1970-01-18T08:40:00+00:00</date>
506 <date>1970-01-18T08:40:00+00:00</date>
507 <msg xml:space="preserve">new head</msg>
507 <msg xml:space="preserve">new head</msg>
508 <paths>
508 <paths>
509 <path action="A">d</path>
509 <path action="A">d</path>
510 </paths>
510 </paths>
511 </logentry>
511 </logentry>
512 <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74">
512 <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74">
513 <branch>foo</branch>
513 <branch>foo</branch>
514 <author email="person">person</author>
514 <author email="person">person</author>
515 <date>1970-01-17T04:53:20+00:00</date>
515 <date>1970-01-17T04:53:20+00:00</date>
516 <msg xml:space="preserve">new branch</msg>
516 <msg xml:space="preserve">new branch</msg>
517 <paths>
517 <paths>
518 </paths>
518 </paths>
519 </logentry>
519 </logentry>
520 <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
520 <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
521 <author email="person">person</author>
521 <author email="person">person</author>
522 <date>1970-01-16T01:06:40+00:00</date>
522 <date>1970-01-16T01:06:40+00:00</date>
523 <msg xml:space="preserve">no user, no domain</msg>
523 <msg xml:space="preserve">no user, no domain</msg>
524 <paths>
524 <paths>
525 <path action="M">c</path>
525 <path action="M">c</path>
526 </paths>
526 </paths>
527 </logentry>
527 </logentry>
528 <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
528 <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
529 <author email="other@place">other</author>
529 <author email="other@place">other</author>
530 <date>1970-01-14T21:20:00+00:00</date>
530 <date>1970-01-14T21:20:00+00:00</date>
531 <msg xml:space="preserve">no person</msg>
531 <msg xml:space="preserve">no person</msg>
532 <paths>
532 <paths>
533 <path action="A">c</path>
533 <path action="A">c</path>
534 </paths>
534 </paths>
535 </logentry>
535 </logentry>
536 <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
536 <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
537 <author email="other@place">A. N. Other</author>
537 <author email="other@place">A. N. Other</author>
538 <date>1970-01-13T17:33:20+00:00</date>
538 <date>1970-01-13T17:33:20+00:00</date>
539 <msg xml:space="preserve">other 1
539 <msg xml:space="preserve">other 1
540 other 2
540 other 2
541
541
542 other 3</msg>
542 other 3</msg>
543 <paths>
543 <paths>
544 <path action="A">b</path>
544 <path action="A">b</path>
545 </paths>
545 </paths>
546 </logentry>
546 </logentry>
547 <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
547 <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
548 <author email="user@hostname">User Name</author>
548 <author email="user@hostname">User Name</author>
549 <date>1970-01-12T13:46:40+00:00</date>
549 <date>1970-01-12T13:46:40+00:00</date>
550 <msg xml:space="preserve">line 1
550 <msg xml:space="preserve">line 1
551 line 2</msg>
551 line 2</msg>
552 <paths>
552 <paths>
553 <path action="A">a</path>
553 <path action="A">a</path>
554 </paths>
554 </paths>
555 </logentry>
555 </logentry>
556 </log>
556 </log>
557
557
558 $ hg log --debug --style xml
558 $ hg log --debug --style xml
559 <?xml version="1.0"?>
559 <?xml version="1.0"?>
560 <log>
560 <log>
561 <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
561 <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
562 <tag>tip</tag>
562 <tag>tip</tag>
563 <parent revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453" />
563 <parent revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453" />
564 <parent revision="-1" node="0000000000000000000000000000000000000000" />
564 <parent revision="-1" node="0000000000000000000000000000000000000000" />
565 <author email="test">test</author>
565 <author email="test">test</author>
566 <date>2020-01-01T10:01:00+00:00</date>
566 <date>2020-01-01T10:01:00+00:00</date>
567 <msg xml:space="preserve">third</msg>
567 <msg xml:space="preserve">third</msg>
568 <paths>
568 <paths>
569 <path action="A">fourth</path>
569 <path action="A">fourth</path>
570 <path action="A">third</path>
570 <path action="A">third</path>
571 <path action="R">second</path>
571 <path action="R">second</path>
572 </paths>
572 </paths>
573 <copies>
573 <copies>
574 <copy source="second">fourth</copy>
574 <copy source="second">fourth</copy>
575 </copies>
575 </copies>
576 <extra key="branch">default</extra>
576 <extra key="branch">default</extra>
577 </logentry>
577 </logentry>
578 <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
578 <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
579 <parent revision="-1" node="0000000000000000000000000000000000000000" />
579 <parent revision="-1" node="0000000000000000000000000000000000000000" />
580 <parent revision="-1" node="0000000000000000000000000000000000000000" />
580 <parent revision="-1" node="0000000000000000000000000000000000000000" />
581 <author email="user@hostname">User Name</author>
581 <author email="user@hostname">User Name</author>
582 <date>1970-01-12T13:46:40+00:00</date>
582 <date>1970-01-12T13:46:40+00:00</date>
583 <msg xml:space="preserve">second</msg>
583 <msg xml:space="preserve">second</msg>
584 <paths>
584 <paths>
585 <path action="A">second</path>
585 <path action="A">second</path>
586 </paths>
586 </paths>
587 <extra key="branch">default</extra>
587 <extra key="branch">default</extra>
588 </logentry>
588 </logentry>
589 <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b">
589 <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b">
590 <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
590 <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
591 <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" />
591 <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" />
592 <author email="person">person</author>
592 <author email="person">person</author>
593 <date>1970-01-18T08:40:01+00:00</date>
593 <date>1970-01-18T08:40:01+00:00</date>
594 <msg xml:space="preserve">merge</msg>
594 <msg xml:space="preserve">merge</msg>
595 <paths>
595 <paths>
596 </paths>
596 </paths>
597 <extra key="branch">default</extra>
597 <extra key="branch">default</extra>
598 </logentry>
598 </logentry>
599 <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
599 <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
600 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
600 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
601 <parent revision="-1" node="0000000000000000000000000000000000000000" />
601 <parent revision="-1" node="0000000000000000000000000000000000000000" />
602 <author email="person">person</author>
602 <author email="person">person</author>
603 <date>1970-01-18T08:40:00+00:00</date>
603 <date>1970-01-18T08:40:00+00:00</date>
604 <msg xml:space="preserve">new head</msg>
604 <msg xml:space="preserve">new head</msg>
605 <paths>
605 <paths>
606 <path action="A">d</path>
606 <path action="A">d</path>
607 </paths>
607 </paths>
608 <extra key="branch">default</extra>
608 <extra key="branch">default</extra>
609 </logentry>
609 </logentry>
610 <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74">
610 <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74">
611 <branch>foo</branch>
611 <branch>foo</branch>
612 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
612 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
613 <parent revision="-1" node="0000000000000000000000000000000000000000" />
613 <parent revision="-1" node="0000000000000000000000000000000000000000" />
614 <author email="person">person</author>
614 <author email="person">person</author>
615 <date>1970-01-17T04:53:20+00:00</date>
615 <date>1970-01-17T04:53:20+00:00</date>
616 <msg xml:space="preserve">new branch</msg>
616 <msg xml:space="preserve">new branch</msg>
617 <paths>
617 <paths>
618 </paths>
618 </paths>
619 <extra key="branch">foo</extra>
619 <extra key="branch">foo</extra>
620 </logentry>
620 </logentry>
621 <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
621 <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
622 <parent revision="2" node="97054abb4ab824450e9164180baf491ae0078465" />
622 <parent revision="2" node="97054abb4ab824450e9164180baf491ae0078465" />
623 <parent revision="-1" node="0000000000000000000000000000000000000000" />
623 <parent revision="-1" node="0000000000000000000000000000000000000000" />
624 <author email="person">person</author>
624 <author email="person">person</author>
625 <date>1970-01-16T01:06:40+00:00</date>
625 <date>1970-01-16T01:06:40+00:00</date>
626 <msg xml:space="preserve">no user, no domain</msg>
626 <msg xml:space="preserve">no user, no domain</msg>
627 <paths>
627 <paths>
628 <path action="M">c</path>
628 <path action="M">c</path>
629 </paths>
629 </paths>
630 <extra key="branch">default</extra>
630 <extra key="branch">default</extra>
631 </logentry>
631 </logentry>
632 <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
632 <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
633 <parent revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965" />
633 <parent revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965" />
634 <parent revision="-1" node="0000000000000000000000000000000000000000" />
634 <parent revision="-1" node="0000000000000000000000000000000000000000" />
635 <author email="other@place">other</author>
635 <author email="other@place">other</author>
636 <date>1970-01-14T21:20:00+00:00</date>
636 <date>1970-01-14T21:20:00+00:00</date>
637 <msg xml:space="preserve">no person</msg>
637 <msg xml:space="preserve">no person</msg>
638 <paths>
638 <paths>
639 <path action="A">c</path>
639 <path action="A">c</path>
640 </paths>
640 </paths>
641 <extra key="branch">default</extra>
641 <extra key="branch">default</extra>
642 </logentry>
642 </logentry>
643 <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
643 <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
644 <parent revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f" />
644 <parent revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f" />
645 <parent revision="-1" node="0000000000000000000000000000000000000000" />
645 <parent revision="-1" node="0000000000000000000000000000000000000000" />
646 <author email="other@place">A. N. Other</author>
646 <author email="other@place">A. N. Other</author>
647 <date>1970-01-13T17:33:20+00:00</date>
647 <date>1970-01-13T17:33:20+00:00</date>
648 <msg xml:space="preserve">other 1
648 <msg xml:space="preserve">other 1
649 other 2
649 other 2
650
650
651 other 3</msg>
651 other 3</msg>
652 <paths>
652 <paths>
653 <path action="A">b</path>
653 <path action="A">b</path>
654 </paths>
654 </paths>
655 <extra key="branch">default</extra>
655 <extra key="branch">default</extra>
656 </logentry>
656 </logentry>
657 <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
657 <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
658 <parent revision="-1" node="0000000000000000000000000000000000000000" />
658 <parent revision="-1" node="0000000000000000000000000000000000000000" />
659 <parent revision="-1" node="0000000000000000000000000000000000000000" />
659 <parent revision="-1" node="0000000000000000000000000000000000000000" />
660 <author email="user@hostname">User Name</author>
660 <author email="user@hostname">User Name</author>
661 <date>1970-01-12T13:46:40+00:00</date>
661 <date>1970-01-12T13:46:40+00:00</date>
662 <msg xml:space="preserve">line 1
662 <msg xml:space="preserve">line 1
663 line 2</msg>
663 line 2</msg>
664 <paths>
664 <paths>
665 <path action="A">a</path>
665 <path action="A">a</path>
666 </paths>
666 </paths>
667 <extra key="branch">default</extra>
667 <extra key="branch">default</extra>
668 </logentry>
668 </logentry>
669 </log>
669 </log>
670
670
671
671
672 test CBOR style:
672 test CBOR style:
673
673
674 $ cat <<'EOF' > "$TESTTMP/decodecborarray.py"
674 $ cat <<'EOF' > "$TESTTMP/decodecborarray.py"
675 > from __future__ import absolute_import
675 > from __future__ import absolute_import
676 > from mercurial import pycompat
676 > from mercurial import (
677 > dispatch,
678 > pycompat,
679 > )
677 > from mercurial.utils import (
680 > from mercurial.utils import (
678 > cborutil,
681 > cborutil,
679 > stringutil,
682 > stringutil,
680 > )
683 > )
684 > dispatch.initstdio()
681 > data = pycompat.stdin.read()
685 > data = pycompat.stdin.read()
682 > # our CBOR decoder doesn't support parsing indefinite-length arrays,
686 > # our CBOR decoder doesn't support parsing indefinite-length arrays,
683 > # but the log output is indefinite stream by nature.
687 > # but the log output is indefinite stream by nature.
684 > assert data[:1] == cborutil.BEGIN_INDEFINITE_ARRAY
688 > assert data[:1] == cborutil.BEGIN_INDEFINITE_ARRAY
685 > assert data[-1:] == cborutil.BREAK
689 > assert data[-1:] == cborutil.BREAK
686 > items = cborutil.decodeall(data[1:-1])
690 > items = cborutil.decodeall(data[1:-1])
687 > pycompat.stdout.write(stringutil.pprint(items, indent=1) + b'\n')
691 > pycompat.stdout.write(stringutil.pprint(items, indent=1) + b'\n')
688 > EOF
692 > EOF
689
693
690 $ hg log -k nosuch -Tcbor | "$PYTHON" "$TESTTMP/decodecborarray.py"
694 $ hg log -k nosuch -Tcbor | "$PYTHON" "$TESTTMP/decodecborarray.py"
691 []
695 []
692
696
693 $ hg log -qr0:1 -Tcbor | "$PYTHON" "$TESTTMP/decodecborarray.py"
697 $ hg log -qr0:1 -Tcbor | "$PYTHON" "$TESTTMP/decodecborarray.py"
694 [
698 [
695 {
699 {
696 'node': '1e4e1b8f71e05681d422154f5421e385fec3454f',
700 'node': '1e4e1b8f71e05681d422154f5421e385fec3454f',
697 'rev': 0
701 'rev': 0
698 },
702 },
699 {
703 {
700 'node': 'b608e9d1a3f0273ccf70fb85fd6866b3482bf965',
704 'node': 'b608e9d1a3f0273ccf70fb85fd6866b3482bf965',
701 'rev': 1
705 'rev': 1
702 }
706 }
703 ]
707 ]
704
708
705 $ hg log -vpr . -Tcbor --stat | "$PYTHON" "$TESTTMP/decodecborarray.py"
709 $ hg log -vpr . -Tcbor --stat | "$PYTHON" "$TESTTMP/decodecborarray.py"
706 [
710 [
707 {
711 {
708 'bookmarks': [],
712 'bookmarks': [],
709 'branch': 'default',
713 'branch': 'default',
710 'date': [
714 'date': [
711 1577872860,
715 1577872860,
712 0
716 0
713 ],
717 ],
714 'desc': 'third',
718 'desc': 'third',
715 'diff': 'diff -r 29114dbae42b -r 95c24699272e fourth\n--- /dev/null\tThu Jan 01 00:00:00 1970 +0000\n+++ b/fourth\tWed Jan 01 10:01:00 2020 +0000\n@@ -0,0 +1,1 @@\n+second\ndiff -r 29114dbae42b -r 95c24699272e second\n--- a/second\tMon Jan 12 13:46:40 1970 +0000\n+++ /dev/null\tThu Jan 01 00:00:00 1970 +0000\n@@ -1,1 +0,0 @@\n-second\ndiff -r 29114dbae42b -r 95c24699272e third\n--- /dev/null\tThu Jan 01 00:00:00 1970 +0000\n+++ b/third\tWed Jan 01 10:01:00 2020 +0000\n@@ -0,0 +1,1 @@\n+third\n',
719 'diff': 'diff -r 29114dbae42b -r 95c24699272e fourth\n--- /dev/null\tThu Jan 01 00:00:00 1970 +0000\n+++ b/fourth\tWed Jan 01 10:01:00 2020 +0000\n@@ -0,0 +1,1 @@\n+second\ndiff -r 29114dbae42b -r 95c24699272e second\n--- a/second\tMon Jan 12 13:46:40 1970 +0000\n+++ /dev/null\tThu Jan 01 00:00:00 1970 +0000\n@@ -1,1 +0,0 @@\n-second\ndiff -r 29114dbae42b -r 95c24699272e third\n--- /dev/null\tThu Jan 01 00:00:00 1970 +0000\n+++ b/third\tWed Jan 01 10:01:00 2020 +0000\n@@ -0,0 +1,1 @@\n+third\n',
716 'diffstat': ' fourth | 1 +\n second | 1 -\n third | 1 +\n 3 files changed, 2 insertions(+), 1 deletions(-)\n',
720 'diffstat': ' fourth | 1 +\n second | 1 -\n third | 1 +\n 3 files changed, 2 insertions(+), 1 deletions(-)\n',
717 'files': [
721 'files': [
718 'fourth',
722 'fourth',
719 'second',
723 'second',
720 'third'
724 'third'
721 ],
725 ],
722 'node': '95c24699272ef57d062b8bccc32c878bf841784a',
726 'node': '95c24699272ef57d062b8bccc32c878bf841784a',
723 'parents': [
727 'parents': [
724 '29114dbae42b9f078cf2714dbe3a86bba8ec7453'
728 '29114dbae42b9f078cf2714dbe3a86bba8ec7453'
725 ],
729 ],
726 'phase': 'draft',
730 'phase': 'draft',
727 'rev': 8,
731 'rev': 8,
728 'tags': [
732 'tags': [
729 'tip'
733 'tip'
730 ],
734 ],
731 'user': 'test'
735 'user': 'test'
732 }
736 }
733 ]
737 ]
734
738
735
739
736 Test JSON style:
740 Test JSON style:
737
741
738 $ hg log -k nosuch -Tjson
742 $ hg log -k nosuch -Tjson
739 [
743 [
740 ]
744 ]
741
745
742 $ hg log -qr . -Tjson
746 $ hg log -qr . -Tjson
743 [
747 [
744 {
748 {
745 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
749 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
746 "rev": 8
750 "rev": 8
747 }
751 }
748 ]
752 ]
749
753
750 $ hg log -vpr . -Tjson --stat
754 $ hg log -vpr . -Tjson --stat
751 [
755 [
752 {
756 {
753 "bookmarks": [],
757 "bookmarks": [],
754 "branch": "default",
758 "branch": "default",
755 "date": [1577872860, 0],
759 "date": [1577872860, 0],
756 "desc": "third",
760 "desc": "third",
757 "diff": "diff -r 29114dbae42b -r 95c24699272e fourth\n--- /dev/null\tThu Jan 01 00:00:00 1970 +0000\n+++ b/fourth\tWed Jan 01 10:01:00 2020 +0000\n@@ -0,0 +1,1 @@\n+second\ndiff -r 29114dbae42b -r 95c24699272e second\n--- a/second\tMon Jan 12 13:46:40 1970 +0000\n+++ /dev/null\tThu Jan 01 00:00:00 1970 +0000\n@@ -1,1 +0,0 @@\n-second\ndiff -r 29114dbae42b -r 95c24699272e third\n--- /dev/null\tThu Jan 01 00:00:00 1970 +0000\n+++ b/third\tWed Jan 01 10:01:00 2020 +0000\n@@ -0,0 +1,1 @@\n+third\n",
761 "diff": "diff -r 29114dbae42b -r 95c24699272e fourth\n--- /dev/null\tThu Jan 01 00:00:00 1970 +0000\n+++ b/fourth\tWed Jan 01 10:01:00 2020 +0000\n@@ -0,0 +1,1 @@\n+second\ndiff -r 29114dbae42b -r 95c24699272e second\n--- a/second\tMon Jan 12 13:46:40 1970 +0000\n+++ /dev/null\tThu Jan 01 00:00:00 1970 +0000\n@@ -1,1 +0,0 @@\n-second\ndiff -r 29114dbae42b -r 95c24699272e third\n--- /dev/null\tThu Jan 01 00:00:00 1970 +0000\n+++ b/third\tWed Jan 01 10:01:00 2020 +0000\n@@ -0,0 +1,1 @@\n+third\n",
758 "diffstat": " fourth | 1 +\n second | 1 -\n third | 1 +\n 3 files changed, 2 insertions(+), 1 deletions(-)\n",
762 "diffstat": " fourth | 1 +\n second | 1 -\n third | 1 +\n 3 files changed, 2 insertions(+), 1 deletions(-)\n",
759 "files": ["fourth", "second", "third"],
763 "files": ["fourth", "second", "third"],
760 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
764 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
761 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
765 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
762 "phase": "draft",
766 "phase": "draft",
763 "rev": 8,
767 "rev": 8,
764 "tags": ["tip"],
768 "tags": ["tip"],
765 "user": "test"
769 "user": "test"
766 }
770 }
767 ]
771 ]
768
772
769 honor --git but not format-breaking diffopts
773 honor --git but not format-breaking diffopts
770 $ hg --config diff.noprefix=True log --git -vpr . -Tjson
774 $ hg --config diff.noprefix=True log --git -vpr . -Tjson
771 [
775 [
772 {
776 {
773 "bookmarks": [],
777 "bookmarks": [],
774 "branch": "default",
778 "branch": "default",
775 "date": [1577872860, 0],
779 "date": [1577872860, 0],
776 "desc": "third",
780 "desc": "third",
777 "diff": "diff --git a/second b/fourth\nrename from second\nrename to fourth\ndiff --git a/third b/third\nnew file mode 100644\n--- /dev/null\n+++ b/third\n@@ -0,0 +1,1 @@\n+third\n",
781 "diff": "diff --git a/second b/fourth\nrename from second\nrename to fourth\ndiff --git a/third b/third\nnew file mode 100644\n--- /dev/null\n+++ b/third\n@@ -0,0 +1,1 @@\n+third\n",
778 "files": ["fourth", "second", "third"],
782 "files": ["fourth", "second", "third"],
779 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
783 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
780 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
784 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
781 "phase": "draft",
785 "phase": "draft",
782 "rev": 8,
786 "rev": 8,
783 "tags": ["tip"],
787 "tags": ["tip"],
784 "user": "test"
788 "user": "test"
785 }
789 }
786 ]
790 ]
787
791
788 $ hg log -T json
792 $ hg log -T json
789 [
793 [
790 {
794 {
791 "bookmarks": [],
795 "bookmarks": [],
792 "branch": "default",
796 "branch": "default",
793 "date": [1577872860, 0],
797 "date": [1577872860, 0],
794 "desc": "third",
798 "desc": "third",
795 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
799 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
796 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
800 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
797 "phase": "draft",
801 "phase": "draft",
798 "rev": 8,
802 "rev": 8,
799 "tags": ["tip"],
803 "tags": ["tip"],
800 "user": "test"
804 "user": "test"
801 },
805 },
802 {
806 {
803 "bookmarks": [],
807 "bookmarks": [],
804 "branch": "default",
808 "branch": "default",
805 "date": [1000000, 0],
809 "date": [1000000, 0],
806 "desc": "second",
810 "desc": "second",
807 "node": "29114dbae42b9f078cf2714dbe3a86bba8ec7453",
811 "node": "29114dbae42b9f078cf2714dbe3a86bba8ec7453",
808 "parents": ["0000000000000000000000000000000000000000"],
812 "parents": ["0000000000000000000000000000000000000000"],
809 "phase": "draft",
813 "phase": "draft",
810 "rev": 7,
814 "rev": 7,
811 "tags": [],
815 "tags": [],
812 "user": "User Name <user@hostname>"
816 "user": "User Name <user@hostname>"
813 },
817 },
814 {
818 {
815 "bookmarks": [],
819 "bookmarks": [],
816 "branch": "default",
820 "branch": "default",
817 "date": [1500001, 0],
821 "date": [1500001, 0],
818 "desc": "merge",
822 "desc": "merge",
819 "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b",
823 "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b",
820 "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"],
824 "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"],
821 "phase": "draft",
825 "phase": "draft",
822 "rev": 6,
826 "rev": 6,
823 "tags": [],
827 "tags": [],
824 "user": "person"
828 "user": "person"
825 },
829 },
826 {
830 {
827 "bookmarks": [],
831 "bookmarks": [],
828 "branch": "default",
832 "branch": "default",
829 "date": [1500000, 0],
833 "date": [1500000, 0],
830 "desc": "new head",
834 "desc": "new head",
831 "node": "13207e5a10d9fd28ec424934298e176197f2c67f",
835 "node": "13207e5a10d9fd28ec424934298e176197f2c67f",
832 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
836 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
833 "phase": "draft",
837 "phase": "draft",
834 "rev": 5,
838 "rev": 5,
835 "tags": [],
839 "tags": [],
836 "user": "person"
840 "user": "person"
837 },
841 },
838 {
842 {
839 "bookmarks": [],
843 "bookmarks": [],
840 "branch": "foo",
844 "branch": "foo",
841 "date": [1400000, 0],
845 "date": [1400000, 0],
842 "desc": "new branch",
846 "desc": "new branch",
843 "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74",
847 "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74",
844 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
848 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
845 "phase": "draft",
849 "phase": "draft",
846 "rev": 4,
850 "rev": 4,
847 "tags": [],
851 "tags": [],
848 "user": "person"
852 "user": "person"
849 },
853 },
850 {
854 {
851 "bookmarks": [],
855 "bookmarks": [],
852 "branch": "default",
856 "branch": "default",
853 "date": [1300000, 0],
857 "date": [1300000, 0],
854 "desc": "no user, no domain",
858 "desc": "no user, no domain",
855 "node": "10e46f2dcbf4823578cf180f33ecf0b957964c47",
859 "node": "10e46f2dcbf4823578cf180f33ecf0b957964c47",
856 "parents": ["97054abb4ab824450e9164180baf491ae0078465"],
860 "parents": ["97054abb4ab824450e9164180baf491ae0078465"],
857 "phase": "draft",
861 "phase": "draft",
858 "rev": 3,
862 "rev": 3,
859 "tags": [],
863 "tags": [],
860 "user": "person"
864 "user": "person"
861 },
865 },
862 {
866 {
863 "bookmarks": [],
867 "bookmarks": [],
864 "branch": "default",
868 "branch": "default",
865 "date": [1200000, 0],
869 "date": [1200000, 0],
866 "desc": "no person",
870 "desc": "no person",
867 "node": "97054abb4ab824450e9164180baf491ae0078465",
871 "node": "97054abb4ab824450e9164180baf491ae0078465",
868 "parents": ["b608e9d1a3f0273ccf70fb85fd6866b3482bf965"],
872 "parents": ["b608e9d1a3f0273ccf70fb85fd6866b3482bf965"],
869 "phase": "draft",
873 "phase": "draft",
870 "rev": 2,
874 "rev": 2,
871 "tags": [],
875 "tags": [],
872 "user": "other@place"
876 "user": "other@place"
873 },
877 },
874 {
878 {
875 "bookmarks": [],
879 "bookmarks": [],
876 "branch": "default",
880 "branch": "default",
877 "date": [1100000, 0],
881 "date": [1100000, 0],
878 "desc": "other 1\nother 2\n\nother 3",
882 "desc": "other 1\nother 2\n\nother 3",
879 "node": "b608e9d1a3f0273ccf70fb85fd6866b3482bf965",
883 "node": "b608e9d1a3f0273ccf70fb85fd6866b3482bf965",
880 "parents": ["1e4e1b8f71e05681d422154f5421e385fec3454f"],
884 "parents": ["1e4e1b8f71e05681d422154f5421e385fec3454f"],
881 "phase": "draft",
885 "phase": "draft",
882 "rev": 1,
886 "rev": 1,
883 "tags": [],
887 "tags": [],
884 "user": "A. N. Other <other@place>"
888 "user": "A. N. Other <other@place>"
885 },
889 },
886 {
890 {
887 "bookmarks": [],
891 "bookmarks": [],
888 "branch": "default",
892 "branch": "default",
889 "date": [1000000, 0],
893 "date": [1000000, 0],
890 "desc": "line 1\nline 2",
894 "desc": "line 1\nline 2",
891 "node": "1e4e1b8f71e05681d422154f5421e385fec3454f",
895 "node": "1e4e1b8f71e05681d422154f5421e385fec3454f",
892 "parents": ["0000000000000000000000000000000000000000"],
896 "parents": ["0000000000000000000000000000000000000000"],
893 "phase": "draft",
897 "phase": "draft",
894 "rev": 0,
898 "rev": 0,
895 "tags": [],
899 "tags": [],
896 "user": "User Name <user@hostname>"
900 "user": "User Name <user@hostname>"
897 }
901 }
898 ]
902 ]
899
903
900 $ hg heads -v -Tjson
904 $ hg heads -v -Tjson
901 [
905 [
902 {
906 {
903 "bookmarks": [],
907 "bookmarks": [],
904 "branch": "default",
908 "branch": "default",
905 "date": [1577872860, 0],
909 "date": [1577872860, 0],
906 "desc": "third",
910 "desc": "third",
907 "files": ["fourth", "second", "third"],
911 "files": ["fourth", "second", "third"],
908 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
912 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
909 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
913 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
910 "phase": "draft",
914 "phase": "draft",
911 "rev": 8,
915 "rev": 8,
912 "tags": ["tip"],
916 "tags": ["tip"],
913 "user": "test"
917 "user": "test"
914 },
918 },
915 {
919 {
916 "bookmarks": [],
920 "bookmarks": [],
917 "branch": "default",
921 "branch": "default",
918 "date": [1500001, 0],
922 "date": [1500001, 0],
919 "desc": "merge",
923 "desc": "merge",
920 "files": [],
924 "files": [],
921 "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b",
925 "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b",
922 "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"],
926 "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"],
923 "phase": "draft",
927 "phase": "draft",
924 "rev": 6,
928 "rev": 6,
925 "tags": [],
929 "tags": [],
926 "user": "person"
930 "user": "person"
927 },
931 },
928 {
932 {
929 "bookmarks": [],
933 "bookmarks": [],
930 "branch": "foo",
934 "branch": "foo",
931 "date": [1400000, 0],
935 "date": [1400000, 0],
932 "desc": "new branch",
936 "desc": "new branch",
933 "files": [],
937 "files": [],
934 "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74",
938 "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74",
935 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
939 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
936 "phase": "draft",
940 "phase": "draft",
937 "rev": 4,
941 "rev": 4,
938 "tags": [],
942 "tags": [],
939 "user": "person"
943 "user": "person"
940 }
944 }
941 ]
945 ]
942
946
943 $ hg log --debug -Tjson
947 $ hg log --debug -Tjson
944 [
948 [
945 {
949 {
946 "added": ["fourth", "third"],
950 "added": ["fourth", "third"],
947 "bookmarks": [],
951 "bookmarks": [],
948 "branch": "default",
952 "branch": "default",
949 "date": [1577872860, 0],
953 "date": [1577872860, 0],
950 "desc": "third",
954 "desc": "third",
951 "extra": {"branch": "default"},
955 "extra": {"branch": "default"},
952 "manifest": "94961b75a2da554b4df6fb599e5bfc7d48de0c64",
956 "manifest": "94961b75a2da554b4df6fb599e5bfc7d48de0c64",
953 "modified": [],
957 "modified": [],
954 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
958 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
955 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
959 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
956 "phase": "draft",
960 "phase": "draft",
957 "removed": ["second"],
961 "removed": ["second"],
958 "rev": 8,
962 "rev": 8,
959 "tags": ["tip"],
963 "tags": ["tip"],
960 "user": "test"
964 "user": "test"
961 },
965 },
962 {
966 {
963 "added": ["second"],
967 "added": ["second"],
964 "bookmarks": [],
968 "bookmarks": [],
965 "branch": "default",
969 "branch": "default",
966 "date": [1000000, 0],
970 "date": [1000000, 0],
967 "desc": "second",
971 "desc": "second",
968 "extra": {"branch": "default"},
972 "extra": {"branch": "default"},
969 "manifest": "f2dbc354b94e5ec0b4f10680ee0cee816101d0bf",
973 "manifest": "f2dbc354b94e5ec0b4f10680ee0cee816101d0bf",
970 "modified": [],
974 "modified": [],
971 "node": "29114dbae42b9f078cf2714dbe3a86bba8ec7453",
975 "node": "29114dbae42b9f078cf2714dbe3a86bba8ec7453",
972 "parents": ["0000000000000000000000000000000000000000"],
976 "parents": ["0000000000000000000000000000000000000000"],
973 "phase": "draft",
977 "phase": "draft",
974 "removed": [],
978 "removed": [],
975 "rev": 7,
979 "rev": 7,
976 "tags": [],
980 "tags": [],
977 "user": "User Name <user@hostname>"
981 "user": "User Name <user@hostname>"
978 },
982 },
979 {
983 {
980 "added": [],
984 "added": [],
981 "bookmarks": [],
985 "bookmarks": [],
982 "branch": "default",
986 "branch": "default",
983 "date": [1500001, 0],
987 "date": [1500001, 0],
984 "desc": "merge",
988 "desc": "merge",
985 "extra": {"branch": "default"},
989 "extra": {"branch": "default"},
986 "manifest": "4dc3def4f9b4c6e8de820f6ee74737f91e96a216",
990 "manifest": "4dc3def4f9b4c6e8de820f6ee74737f91e96a216",
987 "modified": [],
991 "modified": [],
988 "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b",
992 "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b",
989 "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"],
993 "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"],
990 "phase": "draft",
994 "phase": "draft",
991 "removed": [],
995 "removed": [],
992 "rev": 6,
996 "rev": 6,
993 "tags": [],
997 "tags": [],
994 "user": "person"
998 "user": "person"
995 },
999 },
996 {
1000 {
997 "added": ["d"],
1001 "added": ["d"],
998 "bookmarks": [],
1002 "bookmarks": [],
999 "branch": "default",
1003 "branch": "default",
1000 "date": [1500000, 0],
1004 "date": [1500000, 0],
1001 "desc": "new head",
1005 "desc": "new head",
1002 "extra": {"branch": "default"},
1006 "extra": {"branch": "default"},
1003 "manifest": "4dc3def4f9b4c6e8de820f6ee74737f91e96a216",
1007 "manifest": "4dc3def4f9b4c6e8de820f6ee74737f91e96a216",
1004 "modified": [],
1008 "modified": [],
1005 "node": "13207e5a10d9fd28ec424934298e176197f2c67f",
1009 "node": "13207e5a10d9fd28ec424934298e176197f2c67f",
1006 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
1010 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
1007 "phase": "draft",
1011 "phase": "draft",
1008 "removed": [],
1012 "removed": [],
1009 "rev": 5,
1013 "rev": 5,
1010 "tags": [],
1014 "tags": [],
1011 "user": "person"
1015 "user": "person"
1012 },
1016 },
1013 {
1017 {
1014 "added": [],
1018 "added": [],
1015 "bookmarks": [],
1019 "bookmarks": [],
1016 "branch": "foo",
1020 "branch": "foo",
1017 "date": [1400000, 0],
1021 "date": [1400000, 0],
1018 "desc": "new branch",
1022 "desc": "new branch",
1019 "extra": {"branch": "foo"},
1023 "extra": {"branch": "foo"},
1020 "manifest": "cb5a1327723bada42f117e4c55a303246eaf9ccc",
1024 "manifest": "cb5a1327723bada42f117e4c55a303246eaf9ccc",
1021 "modified": [],
1025 "modified": [],
1022 "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74",
1026 "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74",
1023 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
1027 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
1024 "phase": "draft",
1028 "phase": "draft",
1025 "removed": [],
1029 "removed": [],
1026 "rev": 4,
1030 "rev": 4,
1027 "tags": [],
1031 "tags": [],
1028 "user": "person"
1032 "user": "person"
1029 },
1033 },
1030 {
1034 {
1031 "added": [],
1035 "added": [],
1032 "bookmarks": [],
1036 "bookmarks": [],
1033 "branch": "default",
1037 "branch": "default",
1034 "date": [1300000, 0],
1038 "date": [1300000, 0],
1035 "desc": "no user, no domain",
1039 "desc": "no user, no domain",
1036 "extra": {"branch": "default"},
1040 "extra": {"branch": "default"},
1037 "manifest": "cb5a1327723bada42f117e4c55a303246eaf9ccc",
1041 "manifest": "cb5a1327723bada42f117e4c55a303246eaf9ccc",
1038 "modified": ["c"],
1042 "modified": ["c"],
1039 "node": "10e46f2dcbf4823578cf180f33ecf0b957964c47",
1043 "node": "10e46f2dcbf4823578cf180f33ecf0b957964c47",
1040 "parents": ["97054abb4ab824450e9164180baf491ae0078465"],
1044 "parents": ["97054abb4ab824450e9164180baf491ae0078465"],
1041 "phase": "draft",
1045 "phase": "draft",
1042 "removed": [],
1046 "removed": [],
1043 "rev": 3,
1047 "rev": 3,
1044 "tags": [],
1048 "tags": [],
1045 "user": "person"
1049 "user": "person"
1046 },
1050 },
1047 {
1051 {
1048 "added": ["c"],
1052 "added": ["c"],
1049 "bookmarks": [],
1053 "bookmarks": [],
1050 "branch": "default",
1054 "branch": "default",
1051 "date": [1200000, 0],
1055 "date": [1200000, 0],
1052 "desc": "no person",
1056 "desc": "no person",
1053 "extra": {"branch": "default"},
1057 "extra": {"branch": "default"},
1054 "manifest": "6e0e82995c35d0d57a52aca8da4e56139e06b4b1",
1058 "manifest": "6e0e82995c35d0d57a52aca8da4e56139e06b4b1",
1055 "modified": [],
1059 "modified": [],
1056 "node": "97054abb4ab824450e9164180baf491ae0078465",
1060 "node": "97054abb4ab824450e9164180baf491ae0078465",
1057 "parents": ["b608e9d1a3f0273ccf70fb85fd6866b3482bf965"],
1061 "parents": ["b608e9d1a3f0273ccf70fb85fd6866b3482bf965"],
1058 "phase": "draft",
1062 "phase": "draft",
1059 "removed": [],
1063 "removed": [],
1060 "rev": 2,
1064 "rev": 2,
1061 "tags": [],
1065 "tags": [],
1062 "user": "other@place"
1066 "user": "other@place"
1063 },
1067 },
1064 {
1068 {
1065 "added": ["b"],
1069 "added": ["b"],
1066 "bookmarks": [],
1070 "bookmarks": [],
1067 "branch": "default",
1071 "branch": "default",
1068 "date": [1100000, 0],
1072 "date": [1100000, 0],
1069 "desc": "other 1\nother 2\n\nother 3",
1073 "desc": "other 1\nother 2\n\nother 3",
1070 "extra": {"branch": "default"},
1074 "extra": {"branch": "default"},
1071 "manifest": "4e8d705b1e53e3f9375e0e60dc7b525d8211fe55",
1075 "manifest": "4e8d705b1e53e3f9375e0e60dc7b525d8211fe55",
1072 "modified": [],
1076 "modified": [],
1073 "node": "b608e9d1a3f0273ccf70fb85fd6866b3482bf965",
1077 "node": "b608e9d1a3f0273ccf70fb85fd6866b3482bf965",
1074 "parents": ["1e4e1b8f71e05681d422154f5421e385fec3454f"],
1078 "parents": ["1e4e1b8f71e05681d422154f5421e385fec3454f"],
1075 "phase": "draft",
1079 "phase": "draft",
1076 "removed": [],
1080 "removed": [],
1077 "rev": 1,
1081 "rev": 1,
1078 "tags": [],
1082 "tags": [],
1079 "user": "A. N. Other <other@place>"
1083 "user": "A. N. Other <other@place>"
1080 },
1084 },
1081 {
1085 {
1082 "added": ["a"],
1086 "added": ["a"],
1083 "bookmarks": [],
1087 "bookmarks": [],
1084 "branch": "default",
1088 "branch": "default",
1085 "date": [1000000, 0],
1089 "date": [1000000, 0],
1086 "desc": "line 1\nline 2",
1090 "desc": "line 1\nline 2",
1087 "extra": {"branch": "default"},
1091 "extra": {"branch": "default"},
1088 "manifest": "a0c8bcbbb45c63b90b70ad007bf38961f64f2af0",
1092 "manifest": "a0c8bcbbb45c63b90b70ad007bf38961f64f2af0",
1089 "modified": [],
1093 "modified": [],
1090 "node": "1e4e1b8f71e05681d422154f5421e385fec3454f",
1094 "node": "1e4e1b8f71e05681d422154f5421e385fec3454f",
1091 "parents": ["0000000000000000000000000000000000000000"],
1095 "parents": ["0000000000000000000000000000000000000000"],
1092 "phase": "draft",
1096 "phase": "draft",
1093 "removed": [],
1097 "removed": [],
1094 "rev": 0,
1098 "rev": 0,
1095 "tags": [],
1099 "tags": [],
1096 "user": "User Name <user@hostname>"
1100 "user": "User Name <user@hostname>"
1097 }
1101 }
1098 ]
1102 ]
1099
1103
1100 Error if style not readable:
1104 Error if style not readable:
1101
1105
1102 #if unix-permissions no-root
1106 #if unix-permissions no-root
1103 $ touch q
1107 $ touch q
1104 $ chmod 0 q
1108 $ chmod 0 q
1105 $ hg log --style ./q
1109 $ hg log --style ./q
1106 abort: Permission denied: './q'
1110 abort: Permission denied: './q'
1107 [255]
1111 [255]
1108 #endif
1112 #endif
1109
1113
1110 Error if no style:
1114 Error if no style:
1111
1115
1112 $ hg log --style notexist
1116 $ hg log --style notexist
1113 abort: style 'notexist' not found
1117 abort: style 'notexist' not found
1114 (available styles: bisect, changelog, compact, default, phases, show, status, xml)
1118 (available styles: bisect, changelog, compact, default, phases, show, status, xml)
1115 [255]
1119 [255]
1116
1120
1117 $ hg log -T list
1121 $ hg log -T list
1118 available styles: bisect, changelog, compact, default, phases, show, status, xml
1122 available styles: bisect, changelog, compact, default, phases, show, status, xml
1119 abort: specify a template
1123 abort: specify a template
1120 [255]
1124 [255]
1121
1125
1122 Error if style missing key:
1126 Error if style missing key:
1123
1127
1124 $ echo 'q = q' > t
1128 $ echo 'q = q' > t
1125 $ hg log --style ./t
1129 $ hg log --style ./t
1126 abort: "changeset" not in template map
1130 abort: "changeset" not in template map
1127 [255]
1131 [255]
1128
1132
1129 Error if style missing value:
1133 Error if style missing value:
1130
1134
1131 $ echo 'changeset =' > t
1135 $ echo 'changeset =' > t
1132 $ hg log --style t
1136 $ hg log --style t
1133 hg: parse error at t:1: missing value
1137 hg: parse error at t:1: missing value
1134 [255]
1138 [255]
1135
1139
1136 Error if include fails:
1140 Error if include fails:
1137
1141
1138 $ echo 'changeset = q' >> t
1142 $ echo 'changeset = q' >> t
1139 #if unix-permissions no-root
1143 #if unix-permissions no-root
1140 $ hg log --style ./t
1144 $ hg log --style ./t
1141 abort: template file ./q: Permission denied
1145 abort: template file ./q: Permission denied
1142 [255]
1146 [255]
1143 $ rm -f q
1147 $ rm -f q
1144 #endif
1148 #endif
1145
1149
1146 Include works:
1150 Include works:
1147
1151
1148 $ echo '{rev}' > q
1152 $ echo '{rev}' > q
1149 $ hg log --style ./t
1153 $ hg log --style ./t
1150 8
1154 8
1151 7
1155 7
1152 6
1156 6
1153 5
1157 5
1154 4
1158 4
1155 3
1159 3
1156 2
1160 2
1157 1
1161 1
1158 0
1162 0
1159
1163
1160 $ hg phase -r 5 --public
1164 $ hg phase -r 5 --public
1161 $ hg phase -r 7 --secret --force
1165 $ hg phase -r 7 --secret --force
1162
1166
1163 Missing non-standard names give no error (backward compatibility):
1167 Missing non-standard names give no error (backward compatibility):
1164
1168
1165 $ echo "changeset = '{c}'" > t
1169 $ echo "changeset = '{c}'" > t
1166 $ hg log --style ./t
1170 $ hg log --style ./t
1167
1171
1168 Defining non-standard name works:
1172 Defining non-standard name works:
1169
1173
1170 $ cat <<EOF > t
1174 $ cat <<EOF > t
1171 > changeset = '{c}'
1175 > changeset = '{c}'
1172 > c = q
1176 > c = q
1173 > EOF
1177 > EOF
1174 $ hg log --style ./t
1178 $ hg log --style ./t
1175 8
1179 8
1176 7
1180 7
1177 6
1181 6
1178 5
1182 5
1179 4
1183 4
1180 3
1184 3
1181 2
1185 2
1182 1
1186 1
1183 0
1187 0
1184
1188
1185 ui.style works:
1189 ui.style works:
1186
1190
1187 $ echo '[ui]' > .hg/hgrc
1191 $ echo '[ui]' > .hg/hgrc
1188 $ echo 'style = t' >> .hg/hgrc
1192 $ echo 'style = t' >> .hg/hgrc
1189 $ hg log
1193 $ hg log
1190 8
1194 8
1191 7
1195 7
1192 6
1196 6
1193 5
1197 5
1194 4
1198 4
1195 3
1199 3
1196 2
1200 2
1197 1
1201 1
1198 0
1202 0
1199
1203
1200 Issue338:
1204 Issue338:
1201
1205
1202 $ hg log --style=changelog > changelog
1206 $ hg log --style=changelog > changelog
1203
1207
1204 $ cat changelog
1208 $ cat changelog
1205 2020-01-01 test <test>
1209 2020-01-01 test <test>
1206
1210
1207 * fourth, second, third:
1211 * fourth, second, third:
1208 third
1212 third
1209 [95c24699272e] [tip]
1213 [95c24699272e] [tip]
1210
1214
1211 1970-01-12 User Name <user@hostname>
1215 1970-01-12 User Name <user@hostname>
1212
1216
1213 * second:
1217 * second:
1214 second
1218 second
1215 [29114dbae42b]
1219 [29114dbae42b]
1216
1220
1217 1970-01-18 person <person>
1221 1970-01-18 person <person>
1218
1222
1219 * merge
1223 * merge
1220 [d41e714fe50d]
1224 [d41e714fe50d]
1221
1225
1222 * d:
1226 * d:
1223 new head
1227 new head
1224 [13207e5a10d9]
1228 [13207e5a10d9]
1225
1229
1226 1970-01-17 person <person>
1230 1970-01-17 person <person>
1227
1231
1228 * new branch
1232 * new branch
1229 [bbe44766e73d] <foo>
1233 [bbe44766e73d] <foo>
1230
1234
1231 1970-01-16 person <person>
1235 1970-01-16 person <person>
1232
1236
1233 * c:
1237 * c:
1234 no user, no domain
1238 no user, no domain
1235 [10e46f2dcbf4]
1239 [10e46f2dcbf4]
1236
1240
1237 1970-01-14 other <other@place>
1241 1970-01-14 other <other@place>
1238
1242
1239 * c:
1243 * c:
1240 no person
1244 no person
1241 [97054abb4ab8]
1245 [97054abb4ab8]
1242
1246
1243 1970-01-13 A. N. Other <other@place>
1247 1970-01-13 A. N. Other <other@place>
1244
1248
1245 * b:
1249 * b:
1246 other 1 other 2
1250 other 1 other 2
1247
1251
1248 other 3
1252 other 3
1249 [b608e9d1a3f0]
1253 [b608e9d1a3f0]
1250
1254
1251 1970-01-12 User Name <user@hostname>
1255 1970-01-12 User Name <user@hostname>
1252
1256
1253 * a:
1257 * a:
1254 line 1 line 2
1258 line 1 line 2
1255 [1e4e1b8f71e0]
1259 [1e4e1b8f71e0]
1256
1260
1257
1261
1258 Issue2130: xml output for 'hg heads' is malformed
1262 Issue2130: xml output for 'hg heads' is malformed
1259
1263
1260 $ hg heads --style changelog
1264 $ hg heads --style changelog
1261 2020-01-01 test <test>
1265 2020-01-01 test <test>
1262
1266
1263 * fourth, second, third:
1267 * fourth, second, third:
1264 third
1268 third
1265 [95c24699272e] [tip]
1269 [95c24699272e] [tip]
1266
1270
1267 1970-01-18 person <person>
1271 1970-01-18 person <person>
1268
1272
1269 * merge
1273 * merge
1270 [d41e714fe50d]
1274 [d41e714fe50d]
1271
1275
1272 1970-01-17 person <person>
1276 1970-01-17 person <person>
1273
1277
1274 * new branch
1278 * new branch
1275 [bbe44766e73d] <foo>
1279 [bbe44766e73d] <foo>
1276
1280
1277
1281
1278 Add a dummy commit to make up for the instability of the above:
1282 Add a dummy commit to make up for the instability of the above:
1279
1283
1280 $ echo a > a
1284 $ echo a > a
1281 $ hg add a
1285 $ hg add a
1282 $ hg ci -m future
1286 $ hg ci -m future
1283
1287
1284 Add a commit that does all possible modifications at once
1288 Add a commit that does all possible modifications at once
1285
1289
1286 $ echo modify >> third
1290 $ echo modify >> third
1287 $ touch b
1291 $ touch b
1288 $ hg add b
1292 $ hg add b
1289 $ hg mv fourth fifth
1293 $ hg mv fourth fifth
1290 $ hg rm a
1294 $ hg rm a
1291 $ hg ci -m "Modify, add, remove, rename"
1295 $ hg ci -m "Modify, add, remove, rename"
1292
1296
1293 Check the status template
1297 Check the status template
1294
1298
1295 $ cat <<EOF >> $HGRCPATH
1299 $ cat <<EOF >> $HGRCPATH
1296 > [extensions]
1300 > [extensions]
1297 > color=
1301 > color=
1298 > EOF
1302 > EOF
1299
1303
1300 $ hg log -T status -r 10
1304 $ hg log -T status -r 10
1301 changeset: 10:0f9759ec227a
1305 changeset: 10:0f9759ec227a
1302 tag: tip
1306 tag: tip
1303 user: test
1307 user: test
1304 date: Thu Jan 01 00:00:00 1970 +0000
1308 date: Thu Jan 01 00:00:00 1970 +0000
1305 summary: Modify, add, remove, rename
1309 summary: Modify, add, remove, rename
1306 files:
1310 files:
1307 M third
1311 M third
1308 A b
1312 A b
1309 A fifth
1313 A fifth
1310 R a
1314 R a
1311 R fourth
1315 R fourth
1312
1316
1313 $ hg log -T status -C -r 10
1317 $ hg log -T status -C -r 10
1314 changeset: 10:0f9759ec227a
1318 changeset: 10:0f9759ec227a
1315 tag: tip
1319 tag: tip
1316 user: test
1320 user: test
1317 date: Thu Jan 01 00:00:00 1970 +0000
1321 date: Thu Jan 01 00:00:00 1970 +0000
1318 summary: Modify, add, remove, rename
1322 summary: Modify, add, remove, rename
1319 files:
1323 files:
1320 M third
1324 M third
1321 A b
1325 A b
1322 A fifth
1326 A fifth
1323 fourth
1327 fourth
1324 R a
1328 R a
1325 R fourth
1329 R fourth
1326
1330
1327 $ hg log -T status -C -r 10 -v
1331 $ hg log -T status -C -r 10 -v
1328 changeset: 10:0f9759ec227a
1332 changeset: 10:0f9759ec227a
1329 tag: tip
1333 tag: tip
1330 user: test
1334 user: test
1331 date: Thu Jan 01 00:00:00 1970 +0000
1335 date: Thu Jan 01 00:00:00 1970 +0000
1332 description:
1336 description:
1333 Modify, add, remove, rename
1337 Modify, add, remove, rename
1334
1338
1335 files:
1339 files:
1336 M third
1340 M third
1337 A b
1341 A b
1338 A fifth
1342 A fifth
1339 fourth
1343 fourth
1340 R a
1344 R a
1341 R fourth
1345 R fourth
1342
1346
1343 $ hg log -T status -C -r 10 --debug
1347 $ hg log -T status -C -r 10 --debug
1344 changeset: 10:0f9759ec227a4859c2014a345cd8a859022b7c6c
1348 changeset: 10:0f9759ec227a4859c2014a345cd8a859022b7c6c
1345 tag: tip
1349 tag: tip
1346 phase: secret
1350 phase: secret
1347 parent: 9:bf9dfba36635106d6a73ccc01e28b762da60e066
1351 parent: 9:bf9dfba36635106d6a73ccc01e28b762da60e066
1348 parent: -1:0000000000000000000000000000000000000000
1352 parent: -1:0000000000000000000000000000000000000000
1349 manifest: 8:89dd546f2de0a9d6d664f58d86097eb97baba567
1353 manifest: 8:89dd546f2de0a9d6d664f58d86097eb97baba567
1350 user: test
1354 user: test
1351 date: Thu Jan 01 00:00:00 1970 +0000
1355 date: Thu Jan 01 00:00:00 1970 +0000
1352 extra: branch=default
1356 extra: branch=default
1353 description:
1357 description:
1354 Modify, add, remove, rename
1358 Modify, add, remove, rename
1355
1359
1356 files:
1360 files:
1357 M third
1361 M third
1358 A b
1362 A b
1359 A fifth
1363 A fifth
1360 fourth
1364 fourth
1361 R a
1365 R a
1362 R fourth
1366 R fourth
1363
1367
1364 $ hg log -T status -C -r 10 --quiet
1368 $ hg log -T status -C -r 10 --quiet
1365 10:0f9759ec227a
1369 10:0f9759ec227a
1366 $ hg --color=debug log -T status -r 10
1370 $ hg --color=debug log -T status -r 10
1367 [log.changeset changeset.secret|changeset: 10:0f9759ec227a]
1371 [log.changeset changeset.secret|changeset: 10:0f9759ec227a]
1368 [log.tag|tag: tip]
1372 [log.tag|tag: tip]
1369 [log.user|user: test]
1373 [log.user|user: test]
1370 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
1374 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
1371 [log.summary|summary: Modify, add, remove, rename]
1375 [log.summary|summary: Modify, add, remove, rename]
1372 [ui.note log.files|files:]
1376 [ui.note log.files|files:]
1373 [status.modified|M third]
1377 [status.modified|M third]
1374 [status.added|A b]
1378 [status.added|A b]
1375 [status.added|A fifth]
1379 [status.added|A fifth]
1376 [status.removed|R a]
1380 [status.removed|R a]
1377 [status.removed|R fourth]
1381 [status.removed|R fourth]
1378
1382
1379 $ hg --color=debug log -T status -C -r 10
1383 $ hg --color=debug log -T status -C -r 10
1380 [log.changeset changeset.secret|changeset: 10:0f9759ec227a]
1384 [log.changeset changeset.secret|changeset: 10:0f9759ec227a]
1381 [log.tag|tag: tip]
1385 [log.tag|tag: tip]
1382 [log.user|user: test]
1386 [log.user|user: test]
1383 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
1387 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
1384 [log.summary|summary: Modify, add, remove, rename]
1388 [log.summary|summary: Modify, add, remove, rename]
1385 [ui.note log.files|files:]
1389 [ui.note log.files|files:]
1386 [status.modified|M third]
1390 [status.modified|M third]
1387 [status.added|A b]
1391 [status.added|A b]
1388 [status.added|A fifth]
1392 [status.added|A fifth]
1389 [status.copied| fourth]
1393 [status.copied| fourth]
1390 [status.removed|R a]
1394 [status.removed|R a]
1391 [status.removed|R fourth]
1395 [status.removed|R fourth]
1392
1396
1393 $ hg --color=debug log -T status -C -r 10 -v
1397 $ hg --color=debug log -T status -C -r 10 -v
1394 [log.changeset changeset.secret|changeset: 10:0f9759ec227a]
1398 [log.changeset changeset.secret|changeset: 10:0f9759ec227a]
1395 [log.tag|tag: tip]
1399 [log.tag|tag: tip]
1396 [log.user|user: test]
1400 [log.user|user: test]
1397 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
1401 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
1398 [ui.note log.description|description:]
1402 [ui.note log.description|description:]
1399 [ui.note log.description|Modify, add, remove, rename]
1403 [ui.note log.description|Modify, add, remove, rename]
1400
1404
1401 [ui.note log.files|files:]
1405 [ui.note log.files|files:]
1402 [status.modified|M third]
1406 [status.modified|M third]
1403 [status.added|A b]
1407 [status.added|A b]
1404 [status.added|A fifth]
1408 [status.added|A fifth]
1405 [status.copied| fourth]
1409 [status.copied| fourth]
1406 [status.removed|R a]
1410 [status.removed|R a]
1407 [status.removed|R fourth]
1411 [status.removed|R fourth]
1408
1412
1409 $ hg --color=debug log -T status -C -r 10 --debug
1413 $ hg --color=debug log -T status -C -r 10 --debug
1410 [log.changeset changeset.secret|changeset: 10:0f9759ec227a4859c2014a345cd8a859022b7c6c]
1414 [log.changeset changeset.secret|changeset: 10:0f9759ec227a4859c2014a345cd8a859022b7c6c]
1411 [log.tag|tag: tip]
1415 [log.tag|tag: tip]
1412 [log.phase|phase: secret]
1416 [log.phase|phase: secret]
1413 [log.parent changeset.secret|parent: 9:bf9dfba36635106d6a73ccc01e28b762da60e066]
1417 [log.parent changeset.secret|parent: 9:bf9dfba36635106d6a73ccc01e28b762da60e066]
1414 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
1418 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
1415 [ui.debug log.manifest|manifest: 8:89dd546f2de0a9d6d664f58d86097eb97baba567]
1419 [ui.debug log.manifest|manifest: 8:89dd546f2de0a9d6d664f58d86097eb97baba567]
1416 [log.user|user: test]
1420 [log.user|user: test]
1417 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
1421 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
1418 [ui.debug log.extra|extra: branch=default]
1422 [ui.debug log.extra|extra: branch=default]
1419 [ui.note log.description|description:]
1423 [ui.note log.description|description:]
1420 [ui.note log.description|Modify, add, remove, rename]
1424 [ui.note log.description|Modify, add, remove, rename]
1421
1425
1422 [ui.note log.files|files:]
1426 [ui.note log.files|files:]
1423 [status.modified|M third]
1427 [status.modified|M third]
1424 [status.added|A b]
1428 [status.added|A b]
1425 [status.added|A fifth]
1429 [status.added|A fifth]
1426 [status.copied| fourth]
1430 [status.copied| fourth]
1427 [status.removed|R a]
1431 [status.removed|R a]
1428 [status.removed|R fourth]
1432 [status.removed|R fourth]
1429
1433
1430 $ hg --color=debug log -T status -C -r 10 --quiet
1434 $ hg --color=debug log -T status -C -r 10 --quiet
1431 [log.node|10:0f9759ec227a]
1435 [log.node|10:0f9759ec227a]
1432
1436
1433 Check the bisect template
1437 Check the bisect template
1434
1438
1435 $ hg bisect -g 1
1439 $ hg bisect -g 1
1436 $ hg bisect -b 3 --noupdate
1440 $ hg bisect -b 3 --noupdate
1437 Testing changeset 2:97054abb4ab8 (2 changesets remaining, ~1 tests)
1441 Testing changeset 2:97054abb4ab8 (2 changesets remaining, ~1 tests)
1438 $ hg log -T bisect -r 0:4
1442 $ hg log -T bisect -r 0:4
1439 changeset: 0:1e4e1b8f71e0
1443 changeset: 0:1e4e1b8f71e0
1440 bisect: good (implicit)
1444 bisect: good (implicit)
1441 user: User Name <user@hostname>
1445 user: User Name <user@hostname>
1442 date: Mon Jan 12 13:46:40 1970 +0000
1446 date: Mon Jan 12 13:46:40 1970 +0000
1443 summary: line 1
1447 summary: line 1
1444
1448
1445 changeset: 1:b608e9d1a3f0
1449 changeset: 1:b608e9d1a3f0
1446 bisect: good
1450 bisect: good
1447 user: A. N. Other <other@place>
1451 user: A. N. Other <other@place>
1448 date: Tue Jan 13 17:33:20 1970 +0000
1452 date: Tue Jan 13 17:33:20 1970 +0000
1449 summary: other 1
1453 summary: other 1
1450
1454
1451 changeset: 2:97054abb4ab8
1455 changeset: 2:97054abb4ab8
1452 bisect: untested
1456 bisect: untested
1453 user: other@place
1457 user: other@place
1454 date: Wed Jan 14 21:20:00 1970 +0000
1458 date: Wed Jan 14 21:20:00 1970 +0000
1455 summary: no person
1459 summary: no person
1456
1460
1457 changeset: 3:10e46f2dcbf4
1461 changeset: 3:10e46f2dcbf4
1458 bisect: bad
1462 bisect: bad
1459 user: person
1463 user: person
1460 date: Fri Jan 16 01:06:40 1970 +0000
1464 date: Fri Jan 16 01:06:40 1970 +0000
1461 summary: no user, no domain
1465 summary: no user, no domain
1462
1466
1463 changeset: 4:bbe44766e73d
1467 changeset: 4:bbe44766e73d
1464 bisect: bad (implicit)
1468 bisect: bad (implicit)
1465 branch: foo
1469 branch: foo
1466 user: person
1470 user: person
1467 date: Sat Jan 17 04:53:20 1970 +0000
1471 date: Sat Jan 17 04:53:20 1970 +0000
1468 summary: new branch
1472 summary: new branch
1469
1473
1470 $ hg log --debug -T bisect -r 0:4
1474 $ hg log --debug -T bisect -r 0:4
1471 changeset: 0:1e4e1b8f71e05681d422154f5421e385fec3454f
1475 changeset: 0:1e4e1b8f71e05681d422154f5421e385fec3454f
1472 bisect: good (implicit)
1476 bisect: good (implicit)
1473 phase: public
1477 phase: public
1474 parent: -1:0000000000000000000000000000000000000000
1478 parent: -1:0000000000000000000000000000000000000000
1475 parent: -1:0000000000000000000000000000000000000000
1479 parent: -1:0000000000000000000000000000000000000000
1476 manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
1480 manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
1477 user: User Name <user@hostname>
1481 user: User Name <user@hostname>
1478 date: Mon Jan 12 13:46:40 1970 +0000
1482 date: Mon Jan 12 13:46:40 1970 +0000
1479 files+: a
1483 files+: a
1480 extra: branch=default
1484 extra: branch=default
1481 description:
1485 description:
1482 line 1
1486 line 1
1483 line 2
1487 line 2
1484
1488
1485
1489
1486 changeset: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1490 changeset: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1487 bisect: good
1491 bisect: good
1488 phase: public
1492 phase: public
1489 parent: 0:1e4e1b8f71e05681d422154f5421e385fec3454f
1493 parent: 0:1e4e1b8f71e05681d422154f5421e385fec3454f
1490 parent: -1:0000000000000000000000000000000000000000
1494 parent: -1:0000000000000000000000000000000000000000
1491 manifest: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55
1495 manifest: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55
1492 user: A. N. Other <other@place>
1496 user: A. N. Other <other@place>
1493 date: Tue Jan 13 17:33:20 1970 +0000
1497 date: Tue Jan 13 17:33:20 1970 +0000
1494 files+: b
1498 files+: b
1495 extra: branch=default
1499 extra: branch=default
1496 description:
1500 description:
1497 other 1
1501 other 1
1498 other 2
1502 other 2
1499
1503
1500 other 3
1504 other 3
1501
1505
1502
1506
1503 changeset: 2:97054abb4ab824450e9164180baf491ae0078465
1507 changeset: 2:97054abb4ab824450e9164180baf491ae0078465
1504 bisect: untested
1508 bisect: untested
1505 phase: public
1509 phase: public
1506 parent: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1510 parent: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965
1507 parent: -1:0000000000000000000000000000000000000000
1511 parent: -1:0000000000000000000000000000000000000000
1508 manifest: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1
1512 manifest: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1
1509 user: other@place
1513 user: other@place
1510 date: Wed Jan 14 21:20:00 1970 +0000
1514 date: Wed Jan 14 21:20:00 1970 +0000
1511 files+: c
1515 files+: c
1512 extra: branch=default
1516 extra: branch=default
1513 description:
1517 description:
1514 no person
1518 no person
1515
1519
1516
1520
1517 changeset: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47
1521 changeset: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47
1518 bisect: bad
1522 bisect: bad
1519 phase: public
1523 phase: public
1520 parent: 2:97054abb4ab824450e9164180baf491ae0078465
1524 parent: 2:97054abb4ab824450e9164180baf491ae0078465
1521 parent: -1:0000000000000000000000000000000000000000
1525 parent: -1:0000000000000000000000000000000000000000
1522 manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
1526 manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
1523 user: person
1527 user: person
1524 date: Fri Jan 16 01:06:40 1970 +0000
1528 date: Fri Jan 16 01:06:40 1970 +0000
1525 files: c
1529 files: c
1526 extra: branch=default
1530 extra: branch=default
1527 description:
1531 description:
1528 no user, no domain
1532 no user, no domain
1529
1533
1530
1534
1531 changeset: 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74
1535 changeset: 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74
1532 bisect: bad (implicit)
1536 bisect: bad (implicit)
1533 branch: foo
1537 branch: foo
1534 phase: draft
1538 phase: draft
1535 parent: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47
1539 parent: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47
1536 parent: -1:0000000000000000000000000000000000000000
1540 parent: -1:0000000000000000000000000000000000000000
1537 manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
1541 manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
1538 user: person
1542 user: person
1539 date: Sat Jan 17 04:53:20 1970 +0000
1543 date: Sat Jan 17 04:53:20 1970 +0000
1540 extra: branch=foo
1544 extra: branch=foo
1541 description:
1545 description:
1542 new branch
1546 new branch
1543
1547
1544
1548
1545 $ hg log -v -T bisect -r 0:4
1549 $ hg log -v -T bisect -r 0:4
1546 changeset: 0:1e4e1b8f71e0
1550 changeset: 0:1e4e1b8f71e0
1547 bisect: good (implicit)
1551 bisect: good (implicit)
1548 user: User Name <user@hostname>
1552 user: User Name <user@hostname>
1549 date: Mon Jan 12 13:46:40 1970 +0000
1553 date: Mon Jan 12 13:46:40 1970 +0000
1550 files: a
1554 files: a
1551 description:
1555 description:
1552 line 1
1556 line 1
1553 line 2
1557 line 2
1554
1558
1555
1559
1556 changeset: 1:b608e9d1a3f0
1560 changeset: 1:b608e9d1a3f0
1557 bisect: good
1561 bisect: good
1558 user: A. N. Other <other@place>
1562 user: A. N. Other <other@place>
1559 date: Tue Jan 13 17:33:20 1970 +0000
1563 date: Tue Jan 13 17:33:20 1970 +0000
1560 files: b
1564 files: b
1561 description:
1565 description:
1562 other 1
1566 other 1
1563 other 2
1567 other 2
1564
1568
1565 other 3
1569 other 3
1566
1570
1567
1571
1568 changeset: 2:97054abb4ab8
1572 changeset: 2:97054abb4ab8
1569 bisect: untested
1573 bisect: untested
1570 user: other@place
1574 user: other@place
1571 date: Wed Jan 14 21:20:00 1970 +0000
1575 date: Wed Jan 14 21:20:00 1970 +0000
1572 files: c
1576 files: c
1573 description:
1577 description:
1574 no person
1578 no person
1575
1579
1576
1580
1577 changeset: 3:10e46f2dcbf4
1581 changeset: 3:10e46f2dcbf4
1578 bisect: bad
1582 bisect: bad
1579 user: person
1583 user: person
1580 date: Fri Jan 16 01:06:40 1970 +0000
1584 date: Fri Jan 16 01:06:40 1970 +0000
1581 files: c
1585 files: c
1582 description:
1586 description:
1583 no user, no domain
1587 no user, no domain
1584
1588
1585
1589
1586 changeset: 4:bbe44766e73d
1590 changeset: 4:bbe44766e73d
1587 bisect: bad (implicit)
1591 bisect: bad (implicit)
1588 branch: foo
1592 branch: foo
1589 user: person
1593 user: person
1590 date: Sat Jan 17 04:53:20 1970 +0000
1594 date: Sat Jan 17 04:53:20 1970 +0000
1591 description:
1595 description:
1592 new branch
1596 new branch
1593
1597
1594
1598
1595 $ hg --color=debug log -T bisect -r 0:4
1599 $ hg --color=debug log -T bisect -r 0:4
1596 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e0]
1600 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e0]
1597 [log.bisect bisect.good|bisect: good (implicit)]
1601 [log.bisect bisect.good|bisect: good (implicit)]
1598 [log.user|user: User Name <user@hostname>]
1602 [log.user|user: User Name <user@hostname>]
1599 [log.date|date: Mon Jan 12 13:46:40 1970 +0000]
1603 [log.date|date: Mon Jan 12 13:46:40 1970 +0000]
1600 [log.summary|summary: line 1]
1604 [log.summary|summary: line 1]
1601
1605
1602 [log.changeset changeset.public|changeset: 1:b608e9d1a3f0]
1606 [log.changeset changeset.public|changeset: 1:b608e9d1a3f0]
1603 [log.bisect bisect.good|bisect: good]
1607 [log.bisect bisect.good|bisect: good]
1604 [log.user|user: A. N. Other <other@place>]
1608 [log.user|user: A. N. Other <other@place>]
1605 [log.date|date: Tue Jan 13 17:33:20 1970 +0000]
1609 [log.date|date: Tue Jan 13 17:33:20 1970 +0000]
1606 [log.summary|summary: other 1]
1610 [log.summary|summary: other 1]
1607
1611
1608 [log.changeset changeset.public|changeset: 2:97054abb4ab8]
1612 [log.changeset changeset.public|changeset: 2:97054abb4ab8]
1609 [log.bisect bisect.untested|bisect: untested]
1613 [log.bisect bisect.untested|bisect: untested]
1610 [log.user|user: other@place]
1614 [log.user|user: other@place]
1611 [log.date|date: Wed Jan 14 21:20:00 1970 +0000]
1615 [log.date|date: Wed Jan 14 21:20:00 1970 +0000]
1612 [log.summary|summary: no person]
1616 [log.summary|summary: no person]
1613
1617
1614 [log.changeset changeset.public|changeset: 3:10e46f2dcbf4]
1618 [log.changeset changeset.public|changeset: 3:10e46f2dcbf4]
1615 [log.bisect bisect.bad|bisect: bad]
1619 [log.bisect bisect.bad|bisect: bad]
1616 [log.user|user: person]
1620 [log.user|user: person]
1617 [log.date|date: Fri Jan 16 01:06:40 1970 +0000]
1621 [log.date|date: Fri Jan 16 01:06:40 1970 +0000]
1618 [log.summary|summary: no user, no domain]
1622 [log.summary|summary: no user, no domain]
1619
1623
1620 [log.changeset changeset.draft|changeset: 4:bbe44766e73d]
1624 [log.changeset changeset.draft|changeset: 4:bbe44766e73d]
1621 [log.bisect bisect.bad|bisect: bad (implicit)]
1625 [log.bisect bisect.bad|bisect: bad (implicit)]
1622 [log.branch|branch: foo]
1626 [log.branch|branch: foo]
1623 [log.user|user: person]
1627 [log.user|user: person]
1624 [log.date|date: Sat Jan 17 04:53:20 1970 +0000]
1628 [log.date|date: Sat Jan 17 04:53:20 1970 +0000]
1625 [log.summary|summary: new branch]
1629 [log.summary|summary: new branch]
1626
1630
1627 $ hg --color=debug log --debug -T bisect -r 0:4
1631 $ hg --color=debug log --debug -T bisect -r 0:4
1628 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e05681d422154f5421e385fec3454f]
1632 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e05681d422154f5421e385fec3454f]
1629 [log.bisect bisect.good|bisect: good (implicit)]
1633 [log.bisect bisect.good|bisect: good (implicit)]
1630 [log.phase|phase: public]
1634 [log.phase|phase: public]
1631 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
1635 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
1632 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
1636 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
1633 [ui.debug log.manifest|manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0]
1637 [ui.debug log.manifest|manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0]
1634 [log.user|user: User Name <user@hostname>]
1638 [log.user|user: User Name <user@hostname>]
1635 [log.date|date: Mon Jan 12 13:46:40 1970 +0000]
1639 [log.date|date: Mon Jan 12 13:46:40 1970 +0000]
1636 [ui.debug log.files|files+: a]
1640 [ui.debug log.files|files+: a]
1637 [ui.debug log.extra|extra: branch=default]
1641 [ui.debug log.extra|extra: branch=default]
1638 [ui.note log.description|description:]
1642 [ui.note log.description|description:]
1639 [ui.note log.description|line 1
1643 [ui.note log.description|line 1
1640 line 2]
1644 line 2]
1641
1645
1642
1646
1643 [log.changeset changeset.public|changeset: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965]
1647 [log.changeset changeset.public|changeset: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965]
1644 [log.bisect bisect.good|bisect: good]
1648 [log.bisect bisect.good|bisect: good]
1645 [log.phase|phase: public]
1649 [log.phase|phase: public]
1646 [log.parent changeset.public|parent: 0:1e4e1b8f71e05681d422154f5421e385fec3454f]
1650 [log.parent changeset.public|parent: 0:1e4e1b8f71e05681d422154f5421e385fec3454f]
1647 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
1651 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
1648 [ui.debug log.manifest|manifest: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55]
1652 [ui.debug log.manifest|manifest: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55]
1649 [log.user|user: A. N. Other <other@place>]
1653 [log.user|user: A. N. Other <other@place>]
1650 [log.date|date: Tue Jan 13 17:33:20 1970 +0000]
1654 [log.date|date: Tue Jan 13 17:33:20 1970 +0000]
1651 [ui.debug log.files|files+: b]
1655 [ui.debug log.files|files+: b]
1652 [ui.debug log.extra|extra: branch=default]
1656 [ui.debug log.extra|extra: branch=default]
1653 [ui.note log.description|description:]
1657 [ui.note log.description|description:]
1654 [ui.note log.description|other 1
1658 [ui.note log.description|other 1
1655 other 2
1659 other 2
1656
1660
1657 other 3]
1661 other 3]
1658
1662
1659
1663
1660 [log.changeset changeset.public|changeset: 2:97054abb4ab824450e9164180baf491ae0078465]
1664 [log.changeset changeset.public|changeset: 2:97054abb4ab824450e9164180baf491ae0078465]
1661 [log.bisect bisect.untested|bisect: untested]
1665 [log.bisect bisect.untested|bisect: untested]
1662 [log.phase|phase: public]
1666 [log.phase|phase: public]
1663 [log.parent changeset.public|parent: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965]
1667 [log.parent changeset.public|parent: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965]
1664 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
1668 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
1665 [ui.debug log.manifest|manifest: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1]
1669 [ui.debug log.manifest|manifest: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1]
1666 [log.user|user: other@place]
1670 [log.user|user: other@place]
1667 [log.date|date: Wed Jan 14 21:20:00 1970 +0000]
1671 [log.date|date: Wed Jan 14 21:20:00 1970 +0000]
1668 [ui.debug log.files|files+: c]
1672 [ui.debug log.files|files+: c]
1669 [ui.debug log.extra|extra: branch=default]
1673 [ui.debug log.extra|extra: branch=default]
1670 [ui.note log.description|description:]
1674 [ui.note log.description|description:]
1671 [ui.note log.description|no person]
1675 [ui.note log.description|no person]
1672
1676
1673
1677
1674 [log.changeset changeset.public|changeset: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47]
1678 [log.changeset changeset.public|changeset: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47]
1675 [log.bisect bisect.bad|bisect: bad]
1679 [log.bisect bisect.bad|bisect: bad]
1676 [log.phase|phase: public]
1680 [log.phase|phase: public]
1677 [log.parent changeset.public|parent: 2:97054abb4ab824450e9164180baf491ae0078465]
1681 [log.parent changeset.public|parent: 2:97054abb4ab824450e9164180baf491ae0078465]
1678 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
1682 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
1679 [ui.debug log.manifest|manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc]
1683 [ui.debug log.manifest|manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc]
1680 [log.user|user: person]
1684 [log.user|user: person]
1681 [log.date|date: Fri Jan 16 01:06:40 1970 +0000]
1685 [log.date|date: Fri Jan 16 01:06:40 1970 +0000]
1682 [ui.debug log.files|files: c]
1686 [ui.debug log.files|files: c]
1683 [ui.debug log.extra|extra: branch=default]
1687 [ui.debug log.extra|extra: branch=default]
1684 [ui.note log.description|description:]
1688 [ui.note log.description|description:]
1685 [ui.note log.description|no user, no domain]
1689 [ui.note log.description|no user, no domain]
1686
1690
1687
1691
1688 [log.changeset changeset.draft|changeset: 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74]
1692 [log.changeset changeset.draft|changeset: 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74]
1689 [log.bisect bisect.bad|bisect: bad (implicit)]
1693 [log.bisect bisect.bad|bisect: bad (implicit)]
1690 [log.branch|branch: foo]
1694 [log.branch|branch: foo]
1691 [log.phase|phase: draft]
1695 [log.phase|phase: draft]
1692 [log.parent changeset.public|parent: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47]
1696 [log.parent changeset.public|parent: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47]
1693 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
1697 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
1694 [ui.debug log.manifest|manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc]
1698 [ui.debug log.manifest|manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc]
1695 [log.user|user: person]
1699 [log.user|user: person]
1696 [log.date|date: Sat Jan 17 04:53:20 1970 +0000]
1700 [log.date|date: Sat Jan 17 04:53:20 1970 +0000]
1697 [ui.debug log.extra|extra: branch=foo]
1701 [ui.debug log.extra|extra: branch=foo]
1698 [ui.note log.description|description:]
1702 [ui.note log.description|description:]
1699 [ui.note log.description|new branch]
1703 [ui.note log.description|new branch]
1700
1704
1701
1705
1702 $ hg --color=debug log -v -T bisect -r 0:4
1706 $ hg --color=debug log -v -T bisect -r 0:4
1703 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e0]
1707 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e0]
1704 [log.bisect bisect.good|bisect: good (implicit)]
1708 [log.bisect bisect.good|bisect: good (implicit)]
1705 [log.user|user: User Name <user@hostname>]
1709 [log.user|user: User Name <user@hostname>]
1706 [log.date|date: Mon Jan 12 13:46:40 1970 +0000]
1710 [log.date|date: Mon Jan 12 13:46:40 1970 +0000]
1707 [ui.note log.files|files: a]
1711 [ui.note log.files|files: a]
1708 [ui.note log.description|description:]
1712 [ui.note log.description|description:]
1709 [ui.note log.description|line 1
1713 [ui.note log.description|line 1
1710 line 2]
1714 line 2]
1711
1715
1712
1716
1713 [log.changeset changeset.public|changeset: 1:b608e9d1a3f0]
1717 [log.changeset changeset.public|changeset: 1:b608e9d1a3f0]
1714 [log.bisect bisect.good|bisect: good]
1718 [log.bisect bisect.good|bisect: good]
1715 [log.user|user: A. N. Other <other@place>]
1719 [log.user|user: A. N. Other <other@place>]
1716 [log.date|date: Tue Jan 13 17:33:20 1970 +0000]
1720 [log.date|date: Tue Jan 13 17:33:20 1970 +0000]
1717 [ui.note log.files|files: b]
1721 [ui.note log.files|files: b]
1718 [ui.note log.description|description:]
1722 [ui.note log.description|description:]
1719 [ui.note log.description|other 1
1723 [ui.note log.description|other 1
1720 other 2
1724 other 2
1721
1725
1722 other 3]
1726 other 3]
1723
1727
1724
1728
1725 [log.changeset changeset.public|changeset: 2:97054abb4ab8]
1729 [log.changeset changeset.public|changeset: 2:97054abb4ab8]
1726 [log.bisect bisect.untested|bisect: untested]
1730 [log.bisect bisect.untested|bisect: untested]
1727 [log.user|user: other@place]
1731 [log.user|user: other@place]
1728 [log.date|date: Wed Jan 14 21:20:00 1970 +0000]
1732 [log.date|date: Wed Jan 14 21:20:00 1970 +0000]
1729 [ui.note log.files|files: c]
1733 [ui.note log.files|files: c]
1730 [ui.note log.description|description:]
1734 [ui.note log.description|description:]
1731 [ui.note log.description|no person]
1735 [ui.note log.description|no person]
1732
1736
1733
1737
1734 [log.changeset changeset.public|changeset: 3:10e46f2dcbf4]
1738 [log.changeset changeset.public|changeset: 3:10e46f2dcbf4]
1735 [log.bisect bisect.bad|bisect: bad]
1739 [log.bisect bisect.bad|bisect: bad]
1736 [log.user|user: person]
1740 [log.user|user: person]
1737 [log.date|date: Fri Jan 16 01:06:40 1970 +0000]
1741 [log.date|date: Fri Jan 16 01:06:40 1970 +0000]
1738 [ui.note log.files|files: c]
1742 [ui.note log.files|files: c]
1739 [ui.note log.description|description:]
1743 [ui.note log.description|description:]
1740 [ui.note log.description|no user, no domain]
1744 [ui.note log.description|no user, no domain]
1741
1745
1742
1746
1743 [log.changeset changeset.draft|changeset: 4:bbe44766e73d]
1747 [log.changeset changeset.draft|changeset: 4:bbe44766e73d]
1744 [log.bisect bisect.bad|bisect: bad (implicit)]
1748 [log.bisect bisect.bad|bisect: bad (implicit)]
1745 [log.branch|branch: foo]
1749 [log.branch|branch: foo]
1746 [log.user|user: person]
1750 [log.user|user: person]
1747 [log.date|date: Sat Jan 17 04:53:20 1970 +0000]
1751 [log.date|date: Sat Jan 17 04:53:20 1970 +0000]
1748 [ui.note log.description|description:]
1752 [ui.note log.description|description:]
1749 [ui.note log.description|new branch]
1753 [ui.note log.description|new branch]
1750
1754
1751
1755
1752 $ hg bisect --reset
1756 $ hg bisect --reset
1753
1757
1754 $ cd ..
1758 $ cd ..
1755
1759
1756 Set up latesttag repository:
1760 Set up latesttag repository:
1757
1761
1758 $ hg init latesttag
1762 $ hg init latesttag
1759 $ cd latesttag
1763 $ cd latesttag
1760
1764
1761 $ echo a > file
1765 $ echo a > file
1762 $ hg ci -Am a -d '0 0'
1766 $ hg ci -Am a -d '0 0'
1763 adding file
1767 adding file
1764
1768
1765 $ echo b >> file
1769 $ echo b >> file
1766 $ hg ci -m b -d '1 0'
1770 $ hg ci -m b -d '1 0'
1767
1771
1768 $ echo c >> head1
1772 $ echo c >> head1
1769 $ hg ci -Am h1c -d '2 0'
1773 $ hg ci -Am h1c -d '2 0'
1770 adding head1
1774 adding head1
1771
1775
1772 $ hg update -q 1
1776 $ hg update -q 1
1773 $ echo d >> head2
1777 $ echo d >> head2
1774 $ hg ci -Am h2d -d '3 0'
1778 $ hg ci -Am h2d -d '3 0'
1775 adding head2
1779 adding head2
1776 created new head
1780 created new head
1777
1781
1778 $ echo e >> head2
1782 $ echo e >> head2
1779 $ hg ci -m h2e -d '4 0'
1783 $ hg ci -m h2e -d '4 0'
1780
1784
1781 $ hg merge -q
1785 $ hg merge -q
1782 $ hg ci -m merge -d '5 -3600'
1786 $ hg ci -m merge -d '5 -3600'
1783
1787
1784 $ hg tag -r 1 -m t1 -d '6 0' t1
1788 $ hg tag -r 1 -m t1 -d '6 0' t1
1785 $ hg tag -r 2 -m t2 -d '7 0' t2
1789 $ hg tag -r 2 -m t2 -d '7 0' t2
1786 $ hg tag -r 3 -m t3 -d '8 0' t3
1790 $ hg tag -r 3 -m t3 -d '8 0' t3
1787 $ hg tag -r 4 -m t4 -d '4 0' t4 # older than t2, but should not matter
1791 $ hg tag -r 4 -m t4 -d '4 0' t4 # older than t2, but should not matter
1788 $ hg tag -r 5 -m t5 -d '9 0' t5
1792 $ hg tag -r 5 -m t5 -d '9 0' t5
1789 $ hg tag -r 3 -m at3 -d '10 0' at3
1793 $ hg tag -r 3 -m at3 -d '10 0' at3
1790
1794
1791 $ cd ..
1795 $ cd ..
1792
1796
1793 Style path expansion: issue1948 - ui.style option doesn't work on OSX
1797 Style path expansion: issue1948 - ui.style option doesn't work on OSX
1794 if it is a relative path
1798 if it is a relative path
1795
1799
1796 $ mkdir -p home/styles
1800 $ mkdir -p home/styles
1797
1801
1798 $ cat > home/styles/teststyle <<EOF
1802 $ cat > home/styles/teststyle <<EOF
1799 > changeset = 'test {rev}:{node|short}\n'
1803 > changeset = 'test {rev}:{node|short}\n'
1800 > EOF
1804 > EOF
1801
1805
1802 $ HOME=`pwd`/home; export HOME
1806 $ HOME=`pwd`/home; export HOME
1803
1807
1804 $ cat > latesttag/.hg/hgrc <<EOF
1808 $ cat > latesttag/.hg/hgrc <<EOF
1805 > [ui]
1809 > [ui]
1806 > style = ~/styles/teststyle
1810 > style = ~/styles/teststyle
1807 > EOF
1811 > EOF
1808
1812
1809 $ hg -R latesttag tip
1813 $ hg -R latesttag tip
1810 test 11:97e5943b523a
1814 test 11:97e5943b523a
1811
1815
1812 Test recursive showlist template (issue1989):
1816 Test recursive showlist template (issue1989):
1813
1817
1814 $ cat > style1989 <<EOF
1818 $ cat > style1989 <<EOF
1815 > changeset = '{file_mods}{manifest}{extras}'
1819 > changeset = '{file_mods}{manifest}{extras}'
1816 > file_mod = 'M|{author|person}\n'
1820 > file_mod = 'M|{author|person}\n'
1817 > manifest = '{rev},{author}\n'
1821 > manifest = '{rev},{author}\n'
1818 > extra = '{key}: {author}\n'
1822 > extra = '{key}: {author}\n'
1819 > EOF
1823 > EOF
1820
1824
1821 $ hg -R latesttag log -r tip --style=style1989
1825 $ hg -R latesttag log -r tip --style=style1989
1822 M|test
1826 M|test
1823 11,
1827 11,
1824 branch: test
1828 branch: test
General Comments 0
You need to be logged in to leave comments. Login now