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