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