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