Debian Codegraph @

tests/test-template-map.t

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