##// END OF EJS Templates
tests: make {date|age} template output independent of the current date
Steven Brown -
r15839:43317af3 default
parent child Browse files
Show More
@@ -1,1362 +1,1372
1 1 $ "$TESTDIR/hghave" unix-permissions || exit 80
2 2
3 3 $ hg init a
4 4 $ cd a
5 5 $ echo a > a
6 6 $ hg add a
7 7 $ echo line 1 > b
8 8 $ echo line 2 >> b
9 9 $ hg commit -l b -d '1000000 0' -u 'User Name <user@hostname>'
10 10
11 11 $ hg add b
12 12 $ echo other 1 > c
13 13 $ echo other 2 >> c
14 14 $ echo >> c
15 15 $ echo other 3 >> c
16 16 $ hg commit -l c -d '1100000 0' -u 'A. N. Other <other@place>'
17 17
18 18 $ hg add c
19 19 $ hg commit -m 'no person' -d '1200000 0' -u 'other@place'
20 20 $ echo c >> c
21 21 $ hg commit -m 'no user, no domain' -d '1300000 0' -u 'person'
22 22
23 23 $ echo foo > .hg/branch
24 24 $ hg commit -m 'new branch' -d '1400000 0' -u 'person'
25 25
26 26 $ hg co -q 3
27 27 $ echo other 4 >> d
28 28 $ hg add d
29 29 $ hg commit -m 'new head' -d '1500000 0' -u 'person'
30 30
31 31 $ hg merge -q foo
32 32 $ hg commit -m 'merge' -d '1500001 0' -u 'person'
33 33
34 34 Second branch starting at nullrev:
35 35
36 36 $ hg update null
37 37 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
38 38 $ echo second > second
39 39 $ hg add second
40 40 $ hg commit -m second -d '1000000 0' -u 'User Name <user@hostname>'
41 41 created new head
42 42
43 43 $ echo third > third
44 44 $ hg add third
45 45 $ hg mv second fourth
46 46 $ hg commit -m third -d "2020-01-01 10:01"
47 47
48 48 Make sure user/global hgrc does not affect tests
49 49
50 50 $ echo '[ui]' > .hg/hgrc
51 51 $ echo 'logtemplate =' >> .hg/hgrc
52 52 $ echo 'style =' >> .hg/hgrc
53 53
54 54 Default style is like normal output:
55 55
56 56 $ hg log > log.out
57 57 $ hg log --style default > style.out
58 58 $ cmp log.out style.out || diff -u log.out style.out
59 59
60 60 $ hg log -v > log.out
61 61 $ hg log -v --style default > style.out
62 62 $ cmp log.out style.out || diff -u log.out style.out
63 63
64 64 $ hg log --debug > log.out
65 65 $ hg log --debug --style default > style.out
66 66 $ cmp log.out style.out || diff -u log.out style.out
67 67
68 68 Revision with no copies (used to print a traceback):
69 69
70 70 $ hg tip -v --template '\n'
71 71
72 72
73 73 Compact style works:
74 74
75 75 $ hg log --style compact
76 76 8[tip] 95c24699272e 2020-01-01 10:01 +0000 test
77 77 third
78 78
79 79 7:-1 29114dbae42b 1970-01-12 13:46 +0000 user
80 80 second
81 81
82 82 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person
83 83 merge
84 84
85 85 5:3 13207e5a10d9 1970-01-18 08:40 +0000 person
86 86 new head
87 87
88 88 4 bbe44766e73d 1970-01-17 04:53 +0000 person
89 89 new branch
90 90
91 91 3 10e46f2dcbf4 1970-01-16 01:06 +0000 person
92 92 no user, no domain
93 93
94 94 2 97054abb4ab8 1970-01-14 21:20 +0000 other
95 95 no person
96 96
97 97 1 b608e9d1a3f0 1970-01-13 17:33 +0000 other
98 98 other 1
99 99
100 100 0 1e4e1b8f71e0 1970-01-12 13:46 +0000 user
101 101 line 1
102 102
103 103
104 104 $ hg log -v --style compact
105 105 8[tip] 95c24699272e 2020-01-01 10:01 +0000 test
106 106 third
107 107
108 108 7:-1 29114dbae42b 1970-01-12 13:46 +0000 User Name <user@hostname>
109 109 second
110 110
111 111 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person
112 112 merge
113 113
114 114 5:3 13207e5a10d9 1970-01-18 08:40 +0000 person
115 115 new head
116 116
117 117 4 bbe44766e73d 1970-01-17 04:53 +0000 person
118 118 new branch
119 119
120 120 3 10e46f2dcbf4 1970-01-16 01:06 +0000 person
121 121 no user, no domain
122 122
123 123 2 97054abb4ab8 1970-01-14 21:20 +0000 other@place
124 124 no person
125 125
126 126 1 b608e9d1a3f0 1970-01-13 17:33 +0000 A. N. Other <other@place>
127 127 other 1
128 128 other 2
129 129
130 130 other 3
131 131
132 132 0 1e4e1b8f71e0 1970-01-12 13:46 +0000 User Name <user@hostname>
133 133 line 1
134 134 line 2
135 135
136 136
137 137 $ hg log --debug --style compact
138 138 8[tip]:7,-1 95c24699272e 2020-01-01 10:01 +0000 test
139 139 third
140 140
141 141 7:-1,-1 29114dbae42b 1970-01-12 13:46 +0000 User Name <user@hostname>
142 142 second
143 143
144 144 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person
145 145 merge
146 146
147 147 5:3,-1 13207e5a10d9 1970-01-18 08:40 +0000 person
148 148 new head
149 149
150 150 4:3,-1 bbe44766e73d 1970-01-17 04:53 +0000 person
151 151 new branch
152 152
153 153 3:2,-1 10e46f2dcbf4 1970-01-16 01:06 +0000 person
154 154 no user, no domain
155 155
156 156 2:1,-1 97054abb4ab8 1970-01-14 21:20 +0000 other@place
157 157 no person
158 158
159 159 1:0,-1 b608e9d1a3f0 1970-01-13 17:33 +0000 A. N. Other <other@place>
160 160 other 1
161 161 other 2
162 162
163 163 other 3
164 164
165 165 0:-1,-1 1e4e1b8f71e0 1970-01-12 13:46 +0000 User Name <user@hostname>
166 166 line 1
167 167 line 2
168 168
169 169
170 170 Test xml styles:
171 171
172 172 $ hg log --style xml
173 173 <?xml version="1.0"?>
174 174 <log>
175 175 <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
176 176 <tag>tip</tag>
177 177 <author email="test">test</author>
178 178 <date>2020-01-01T10:01:00+00:00</date>
179 179 <msg xml:space="preserve">third</msg>
180 180 </logentry>
181 181 <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
182 182 <parent revision="-1" node="0000000000000000000000000000000000000000" />
183 183 <author email="user@hostname">User Name</author>
184 184 <date>1970-01-12T13:46:40+00:00</date>
185 185 <msg xml:space="preserve">second</msg>
186 186 </logentry>
187 187 <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b">
188 188 <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
189 189 <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" />
190 190 <author email="person">person</author>
191 191 <date>1970-01-18T08:40:01+00:00</date>
192 192 <msg xml:space="preserve">merge</msg>
193 193 </logentry>
194 194 <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
195 195 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
196 196 <author email="person">person</author>
197 197 <date>1970-01-18T08:40:00+00:00</date>
198 198 <msg xml:space="preserve">new head</msg>
199 199 </logentry>
200 200 <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74">
201 201 <branch>foo</branch>
202 202 <author email="person">person</author>
203 203 <date>1970-01-17T04:53:20+00:00</date>
204 204 <msg xml:space="preserve">new branch</msg>
205 205 </logentry>
206 206 <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
207 207 <author email="person">person</author>
208 208 <date>1970-01-16T01:06:40+00:00</date>
209 209 <msg xml:space="preserve">no user, no domain</msg>
210 210 </logentry>
211 211 <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
212 212 <author email="other@place">other</author>
213 213 <date>1970-01-14T21:20:00+00:00</date>
214 214 <msg xml:space="preserve">no person</msg>
215 215 </logentry>
216 216 <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
217 217 <author email="other@place">A. N. Other</author>
218 218 <date>1970-01-13T17:33:20+00:00</date>
219 219 <msg xml:space="preserve">other 1
220 220 other 2
221 221
222 222 other 3</msg>
223 223 </logentry>
224 224 <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
225 225 <author email="user@hostname">User Name</author>
226 226 <date>1970-01-12T13:46:40+00:00</date>
227 227 <msg xml:space="preserve">line 1
228 228 line 2</msg>
229 229 </logentry>
230 230 </log>
231 231
232 232 $ hg log -v --style xml
233 233 <?xml version="1.0"?>
234 234 <log>
235 235 <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
236 236 <tag>tip</tag>
237 237 <author email="test">test</author>
238 238 <date>2020-01-01T10:01:00+00:00</date>
239 239 <msg xml:space="preserve">third</msg>
240 240 <paths>
241 241 <path action="A">fourth</path>
242 242 <path action="A">third</path>
243 243 <path action="R">second</path>
244 244 </paths>
245 245 <copies>
246 246 <copy source="second">fourth</copy>
247 247 </copies>
248 248 </logentry>
249 249 <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
250 250 <parent revision="-1" node="0000000000000000000000000000000000000000" />
251 251 <author email="user@hostname">User Name</author>
252 252 <date>1970-01-12T13:46:40+00:00</date>
253 253 <msg xml:space="preserve">second</msg>
254 254 <paths>
255 255 <path action="A">second</path>
256 256 </paths>
257 257 </logentry>
258 258 <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b">
259 259 <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
260 260 <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" />
261 261 <author email="person">person</author>
262 262 <date>1970-01-18T08:40:01+00:00</date>
263 263 <msg xml:space="preserve">merge</msg>
264 264 <paths>
265 265 </paths>
266 266 </logentry>
267 267 <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
268 268 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
269 269 <author email="person">person</author>
270 270 <date>1970-01-18T08:40:00+00:00</date>
271 271 <msg xml:space="preserve">new head</msg>
272 272 <paths>
273 273 <path action="A">d</path>
274 274 </paths>
275 275 </logentry>
276 276 <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74">
277 277 <branch>foo</branch>
278 278 <author email="person">person</author>
279 279 <date>1970-01-17T04:53:20+00:00</date>
280 280 <msg xml:space="preserve">new branch</msg>
281 281 <paths>
282 282 </paths>
283 283 </logentry>
284 284 <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
285 285 <author email="person">person</author>
286 286 <date>1970-01-16T01:06:40+00:00</date>
287 287 <msg xml:space="preserve">no user, no domain</msg>
288 288 <paths>
289 289 <path action="M">c</path>
290 290 </paths>
291 291 </logentry>
292 292 <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
293 293 <author email="other@place">other</author>
294 294 <date>1970-01-14T21:20:00+00:00</date>
295 295 <msg xml:space="preserve">no person</msg>
296 296 <paths>
297 297 <path action="A">c</path>
298 298 </paths>
299 299 </logentry>
300 300 <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
301 301 <author email="other@place">A. N. Other</author>
302 302 <date>1970-01-13T17:33:20+00:00</date>
303 303 <msg xml:space="preserve">other 1
304 304 other 2
305 305
306 306 other 3</msg>
307 307 <paths>
308 308 <path action="A">b</path>
309 309 </paths>
310 310 </logentry>
311 311 <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
312 312 <author email="user@hostname">User Name</author>
313 313 <date>1970-01-12T13:46:40+00:00</date>
314 314 <msg xml:space="preserve">line 1
315 315 line 2</msg>
316 316 <paths>
317 317 <path action="A">a</path>
318 318 </paths>
319 319 </logentry>
320 320 </log>
321 321
322 322 $ hg log --debug --style xml
323 323 <?xml version="1.0"?>
324 324 <log>
325 325 <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
326 326 <tag>tip</tag>
327 327 <parent revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453" />
328 328 <parent revision="-1" node="0000000000000000000000000000000000000000" />
329 329 <author email="test">test</author>
330 330 <date>2020-01-01T10:01:00+00:00</date>
331 331 <msg xml:space="preserve">third</msg>
332 332 <paths>
333 333 <path action="A">fourth</path>
334 334 <path action="A">third</path>
335 335 <path action="R">second</path>
336 336 </paths>
337 337 <copies>
338 338 <copy source="second">fourth</copy>
339 339 </copies>
340 340 <extra key="branch">default</extra>
341 341 </logentry>
342 342 <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
343 343 <parent revision="-1" node="0000000000000000000000000000000000000000" />
344 344 <parent revision="-1" node="0000000000000000000000000000000000000000" />
345 345 <author email="user@hostname">User Name</author>
346 346 <date>1970-01-12T13:46:40+00:00</date>
347 347 <msg xml:space="preserve">second</msg>
348 348 <paths>
349 349 <path action="A">second</path>
350 350 </paths>
351 351 <extra key="branch">default</extra>
352 352 </logentry>
353 353 <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b">
354 354 <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
355 355 <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" />
356 356 <author email="person">person</author>
357 357 <date>1970-01-18T08:40:01+00:00</date>
358 358 <msg xml:space="preserve">merge</msg>
359 359 <paths>
360 360 </paths>
361 361 <extra key="branch">default</extra>
362 362 </logentry>
363 363 <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
364 364 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
365 365 <parent revision="-1" node="0000000000000000000000000000000000000000" />
366 366 <author email="person">person</author>
367 367 <date>1970-01-18T08:40:00+00:00</date>
368 368 <msg xml:space="preserve">new head</msg>
369 369 <paths>
370 370 <path action="A">d</path>
371 371 </paths>
372 372 <extra key="branch">default</extra>
373 373 </logentry>
374 374 <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74">
375 375 <branch>foo</branch>
376 376 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
377 377 <parent revision="-1" node="0000000000000000000000000000000000000000" />
378 378 <author email="person">person</author>
379 379 <date>1970-01-17T04:53:20+00:00</date>
380 380 <msg xml:space="preserve">new branch</msg>
381 381 <paths>
382 382 </paths>
383 383 <extra key="branch">foo</extra>
384 384 </logentry>
385 385 <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
386 386 <parent revision="2" node="97054abb4ab824450e9164180baf491ae0078465" />
387 387 <parent revision="-1" node="0000000000000000000000000000000000000000" />
388 388 <author email="person">person</author>
389 389 <date>1970-01-16T01:06:40+00:00</date>
390 390 <msg xml:space="preserve">no user, no domain</msg>
391 391 <paths>
392 392 <path action="M">c</path>
393 393 </paths>
394 394 <extra key="branch">default</extra>
395 395 </logentry>
396 396 <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
397 397 <parent revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965" />
398 398 <parent revision="-1" node="0000000000000000000000000000000000000000" />
399 399 <author email="other@place">other</author>
400 400 <date>1970-01-14T21:20:00+00:00</date>
401 401 <msg xml:space="preserve">no person</msg>
402 402 <paths>
403 403 <path action="A">c</path>
404 404 </paths>
405 405 <extra key="branch">default</extra>
406 406 </logentry>
407 407 <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
408 408 <parent revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f" />
409 409 <parent revision="-1" node="0000000000000000000000000000000000000000" />
410 410 <author email="other@place">A. N. Other</author>
411 411 <date>1970-01-13T17:33:20+00:00</date>
412 412 <msg xml:space="preserve">other 1
413 413 other 2
414 414
415 415 other 3</msg>
416 416 <paths>
417 417 <path action="A">b</path>
418 418 </paths>
419 419 <extra key="branch">default</extra>
420 420 </logentry>
421 421 <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
422 422 <parent revision="-1" node="0000000000000000000000000000000000000000" />
423 423 <parent revision="-1" node="0000000000000000000000000000000000000000" />
424 424 <author email="user@hostname">User Name</author>
425 425 <date>1970-01-12T13:46:40+00:00</date>
426 426 <msg xml:space="preserve">line 1
427 427 line 2</msg>
428 428 <paths>
429 429 <path action="A">a</path>
430 430 </paths>
431 431 <extra key="branch">default</extra>
432 432 </logentry>
433 433 </log>
434 434
435 435
436 436 Error if style not readable:
437 437
438 438 $ touch q
439 439 $ chmod 0 q
440 440 $ hg log --style ./q
441 441 abort: Permission denied: ./q
442 442 [255]
443 443
444 444 Error if no style:
445 445
446 446 $ hg log --style notexist
447 447 abort: style not found: notexist
448 448 [255]
449 449
450 450 Error if style missing key:
451 451
452 452 $ echo 'q = q' > t
453 453 $ hg log --style ./t
454 454 abort: "changeset" not in template map
455 455 [255]
456 456
457 457 Error if include fails:
458 458
459 459 $ echo 'changeset = q' >> t
460 460 $ hg log --style ./t
461 461 abort: template file ./q: Permission denied
462 462 [255]
463 463
464 464 Include works:
465 465
466 466 $ rm q
467 467 $ echo '{rev}' > q
468 468 $ hg log --style ./t
469 469 8
470 470 7
471 471 6
472 472 5
473 473 4
474 474 3
475 475 2
476 476 1
477 477 0
478 478
479 479 ui.style works:
480 480
481 481 $ echo '[ui]' > .hg/hgrc
482 482 $ echo 'style = t' >> .hg/hgrc
483 483 $ hg log
484 484 8
485 485 7
486 486 6
487 487 5
488 488 4
489 489 3
490 490 2
491 491 1
492 492 0
493 493
494 494
495 495 Issue338:
496 496
497 497 $ hg log --style=changelog > changelog
498 498
499 499 $ cat changelog
500 500 2020-01-01 test <test>
501 501
502 502 * fourth, second, third:
503 503 third
504 504 [95c24699272e] [tip]
505 505
506 506 1970-01-12 User Name <user@hostname>
507 507
508 508 * second:
509 509 second
510 510 [29114dbae42b]
511 511
512 512 1970-01-18 person <person>
513 513
514 514 * merge
515 515 [d41e714fe50d]
516 516
517 517 * d:
518 518 new head
519 519 [13207e5a10d9]
520 520
521 521 1970-01-17 person <person>
522 522
523 523 * new branch
524 524 [bbe44766e73d] <foo>
525 525
526 526 1970-01-16 person <person>
527 527
528 528 * c:
529 529 no user, no domain
530 530 [10e46f2dcbf4]
531 531
532 532 1970-01-14 other <other@place>
533 533
534 534 * c:
535 535 no person
536 536 [97054abb4ab8]
537 537
538 538 1970-01-13 A. N. Other <other@place>
539 539
540 540 * b:
541 541 other 1 other 2
542 542
543 543 other 3
544 544 [b608e9d1a3f0]
545 545
546 546 1970-01-12 User Name <user@hostname>
547 547
548 548 * a:
549 549 line 1 line 2
550 550 [1e4e1b8f71e0]
551 551
552 552
553 553 Issue2130: xml output for 'hg heads' is malformed
554 554
555 555 $ hg heads --style changelog
556 556 2020-01-01 test <test>
557 557
558 558 * fourth, second, third:
559 559 third
560 560 [95c24699272e] [tip]
561 561
562 562 1970-01-18 person <person>
563 563
564 564 * merge
565 565 [d41e714fe50d]
566 566
567 567 1970-01-17 person <person>
568 568
569 569 * new branch
570 570 [bbe44766e73d] <foo>
571 571
572 572
573 573 Keys work:
574 574
575 575 $ for key in author branch branches date desc file_adds file_dels file_mods \
576 576 > file_copies file_copies_switch files \
577 577 > manifest node parents rev tags diffstat extras; do
578 578 > for mode in '' --verbose --debug; do
579 579 > hg log $mode --template "$key$mode: {$key}\n"
580 580 > done
581 581 > done
582 582 author: test
583 583 author: User Name <user@hostname>
584 584 author: person
585 585 author: person
586 586 author: person
587 587 author: person
588 588 author: other@place
589 589 author: A. N. Other <other@place>
590 590 author: User Name <user@hostname>
591 591 author--verbose: test
592 592 author--verbose: User Name <user@hostname>
593 593 author--verbose: person
594 594 author--verbose: person
595 595 author--verbose: person
596 596 author--verbose: person
597 597 author--verbose: other@place
598 598 author--verbose: A. N. Other <other@place>
599 599 author--verbose: User Name <user@hostname>
600 600 author--debug: test
601 601 author--debug: User Name <user@hostname>
602 602 author--debug: person
603 603 author--debug: person
604 604 author--debug: person
605 605 author--debug: person
606 606 author--debug: other@place
607 607 author--debug: A. N. Other <other@place>
608 608 author--debug: User Name <user@hostname>
609 609 branch: default
610 610 branch: default
611 611 branch: default
612 612 branch: default
613 613 branch: foo
614 614 branch: default
615 615 branch: default
616 616 branch: default
617 617 branch: default
618 618 branch--verbose: default
619 619 branch--verbose: default
620 620 branch--verbose: default
621 621 branch--verbose: default
622 622 branch--verbose: foo
623 623 branch--verbose: default
624 624 branch--verbose: default
625 625 branch--verbose: default
626 626 branch--verbose: default
627 627 branch--debug: default
628 628 branch--debug: default
629 629 branch--debug: default
630 630 branch--debug: default
631 631 branch--debug: foo
632 632 branch--debug: default
633 633 branch--debug: default
634 634 branch--debug: default
635 635 branch--debug: default
636 636 branches:
637 637 branches:
638 638 branches:
639 639 branches:
640 640 branches: foo
641 641 branches:
642 642 branches:
643 643 branches:
644 644 branches:
645 645 branches--verbose:
646 646 branches--verbose:
647 647 branches--verbose:
648 648 branches--verbose:
649 649 branches--verbose: foo
650 650 branches--verbose:
651 651 branches--verbose:
652 652 branches--verbose:
653 653 branches--verbose:
654 654 branches--debug:
655 655 branches--debug:
656 656 branches--debug:
657 657 branches--debug:
658 658 branches--debug: foo
659 659 branches--debug:
660 660 branches--debug:
661 661 branches--debug:
662 662 branches--debug:
663 663 date: 1577872860.00
664 664 date: 1000000.00
665 665 date: 1500001.00
666 666 date: 1500000.00
667 667 date: 1400000.00
668 668 date: 1300000.00
669 669 date: 1200000.00
670 670 date: 1100000.00
671 671 date: 1000000.00
672 672 date--verbose: 1577872860.00
673 673 date--verbose: 1000000.00
674 674 date--verbose: 1500001.00
675 675 date--verbose: 1500000.00
676 676 date--verbose: 1400000.00
677 677 date--verbose: 1300000.00
678 678 date--verbose: 1200000.00
679 679 date--verbose: 1100000.00
680 680 date--verbose: 1000000.00
681 681 date--debug: 1577872860.00
682 682 date--debug: 1000000.00
683 683 date--debug: 1500001.00
684 684 date--debug: 1500000.00
685 685 date--debug: 1400000.00
686 686 date--debug: 1300000.00
687 687 date--debug: 1200000.00
688 688 date--debug: 1100000.00
689 689 date--debug: 1000000.00
690 690 desc: third
691 691 desc: second
692 692 desc: merge
693 693 desc: new head
694 694 desc: new branch
695 695 desc: no user, no domain
696 696 desc: no person
697 697 desc: other 1
698 698 other 2
699 699
700 700 other 3
701 701 desc: line 1
702 702 line 2
703 703 desc--verbose: third
704 704 desc--verbose: second
705 705 desc--verbose: merge
706 706 desc--verbose: new head
707 707 desc--verbose: new branch
708 708 desc--verbose: no user, no domain
709 709 desc--verbose: no person
710 710 desc--verbose: other 1
711 711 other 2
712 712
713 713 other 3
714 714 desc--verbose: line 1
715 715 line 2
716 716 desc--debug: third
717 717 desc--debug: second
718 718 desc--debug: merge
719 719 desc--debug: new head
720 720 desc--debug: new branch
721 721 desc--debug: no user, no domain
722 722 desc--debug: no person
723 723 desc--debug: other 1
724 724 other 2
725 725
726 726 other 3
727 727 desc--debug: line 1
728 728 line 2
729 729 file_adds: fourth third
730 730 file_adds: second
731 731 file_adds:
732 732 file_adds: d
733 733 file_adds:
734 734 file_adds:
735 735 file_adds: c
736 736 file_adds: b
737 737 file_adds: a
738 738 file_adds--verbose: fourth third
739 739 file_adds--verbose: second
740 740 file_adds--verbose:
741 741 file_adds--verbose: d
742 742 file_adds--verbose:
743 743 file_adds--verbose:
744 744 file_adds--verbose: c
745 745 file_adds--verbose: b
746 746 file_adds--verbose: a
747 747 file_adds--debug: fourth third
748 748 file_adds--debug: second
749 749 file_adds--debug:
750 750 file_adds--debug: d
751 751 file_adds--debug:
752 752 file_adds--debug:
753 753 file_adds--debug: c
754 754 file_adds--debug: b
755 755 file_adds--debug: a
756 756 file_dels: second
757 757 file_dels:
758 758 file_dels:
759 759 file_dels:
760 760 file_dels:
761 761 file_dels:
762 762 file_dels:
763 763 file_dels:
764 764 file_dels:
765 765 file_dels--verbose: second
766 766 file_dels--verbose:
767 767 file_dels--verbose:
768 768 file_dels--verbose:
769 769 file_dels--verbose:
770 770 file_dels--verbose:
771 771 file_dels--verbose:
772 772 file_dels--verbose:
773 773 file_dels--verbose:
774 774 file_dels--debug: second
775 775 file_dels--debug:
776 776 file_dels--debug:
777 777 file_dels--debug:
778 778 file_dels--debug:
779 779 file_dels--debug:
780 780 file_dels--debug:
781 781 file_dels--debug:
782 782 file_dels--debug:
783 783 file_mods:
784 784 file_mods:
785 785 file_mods:
786 786 file_mods:
787 787 file_mods:
788 788 file_mods: c
789 789 file_mods:
790 790 file_mods:
791 791 file_mods:
792 792 file_mods--verbose:
793 793 file_mods--verbose:
794 794 file_mods--verbose:
795 795 file_mods--verbose:
796 796 file_mods--verbose:
797 797 file_mods--verbose: c
798 798 file_mods--verbose:
799 799 file_mods--verbose:
800 800 file_mods--verbose:
801 801 file_mods--debug:
802 802 file_mods--debug:
803 803 file_mods--debug:
804 804 file_mods--debug:
805 805 file_mods--debug:
806 806 file_mods--debug: c
807 807 file_mods--debug:
808 808 file_mods--debug:
809 809 file_mods--debug:
810 810 file_copies: fourth (second)
811 811 file_copies:
812 812 file_copies:
813 813 file_copies:
814 814 file_copies:
815 815 file_copies:
816 816 file_copies:
817 817 file_copies:
818 818 file_copies:
819 819 file_copies--verbose: fourth (second)
820 820 file_copies--verbose:
821 821 file_copies--verbose:
822 822 file_copies--verbose:
823 823 file_copies--verbose:
824 824 file_copies--verbose:
825 825 file_copies--verbose:
826 826 file_copies--verbose:
827 827 file_copies--verbose:
828 828 file_copies--debug: fourth (second)
829 829 file_copies--debug:
830 830 file_copies--debug:
831 831 file_copies--debug:
832 832 file_copies--debug:
833 833 file_copies--debug:
834 834 file_copies--debug:
835 835 file_copies--debug:
836 836 file_copies--debug:
837 837 file_copies_switch:
838 838 file_copies_switch:
839 839 file_copies_switch:
840 840 file_copies_switch:
841 841 file_copies_switch:
842 842 file_copies_switch:
843 843 file_copies_switch:
844 844 file_copies_switch:
845 845 file_copies_switch:
846 846 file_copies_switch--verbose:
847 847 file_copies_switch--verbose:
848 848 file_copies_switch--verbose:
849 849 file_copies_switch--verbose:
850 850 file_copies_switch--verbose:
851 851 file_copies_switch--verbose:
852 852 file_copies_switch--verbose:
853 853 file_copies_switch--verbose:
854 854 file_copies_switch--verbose:
855 855 file_copies_switch--debug:
856 856 file_copies_switch--debug:
857 857 file_copies_switch--debug:
858 858 file_copies_switch--debug:
859 859 file_copies_switch--debug:
860 860 file_copies_switch--debug:
861 861 file_copies_switch--debug:
862 862 file_copies_switch--debug:
863 863 file_copies_switch--debug:
864 864 files: fourth second third
865 865 files: second
866 866 files:
867 867 files: d
868 868 files:
869 869 files: c
870 870 files: c
871 871 files: b
872 872 files: a
873 873 files--verbose: fourth second third
874 874 files--verbose: second
875 875 files--verbose:
876 876 files--verbose: d
877 877 files--verbose:
878 878 files--verbose: c
879 879 files--verbose: c
880 880 files--verbose: b
881 881 files--verbose: a
882 882 files--debug: fourth second third
883 883 files--debug: second
884 884 files--debug:
885 885 files--debug: d
886 886 files--debug:
887 887 files--debug: c
888 888 files--debug: c
889 889 files--debug: b
890 890 files--debug: a
891 891 manifest: 6:94961b75a2da
892 892 manifest: 5:f2dbc354b94e
893 893 manifest: 4:4dc3def4f9b4
894 894 manifest: 4:4dc3def4f9b4
895 895 manifest: 3:cb5a1327723b
896 896 manifest: 3:cb5a1327723b
897 897 manifest: 2:6e0e82995c35
898 898 manifest: 1:4e8d705b1e53
899 899 manifest: 0:a0c8bcbbb45c
900 900 manifest--verbose: 6:94961b75a2da
901 901 manifest--verbose: 5:f2dbc354b94e
902 902 manifest--verbose: 4:4dc3def4f9b4
903 903 manifest--verbose: 4:4dc3def4f9b4
904 904 manifest--verbose: 3:cb5a1327723b
905 905 manifest--verbose: 3:cb5a1327723b
906 906 manifest--verbose: 2:6e0e82995c35
907 907 manifest--verbose: 1:4e8d705b1e53
908 908 manifest--verbose: 0:a0c8bcbbb45c
909 909 manifest--debug: 6:94961b75a2da554b4df6fb599e5bfc7d48de0c64
910 910 manifest--debug: 5:f2dbc354b94e5ec0b4f10680ee0cee816101d0bf
911 911 manifest--debug: 4:4dc3def4f9b4c6e8de820f6ee74737f91e96a216
912 912 manifest--debug: 4:4dc3def4f9b4c6e8de820f6ee74737f91e96a216
913 913 manifest--debug: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
914 914 manifest--debug: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
915 915 manifest--debug: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1
916 916 manifest--debug: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55
917 917 manifest--debug: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
918 918 node: 95c24699272ef57d062b8bccc32c878bf841784a
919 919 node: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
920 920 node: d41e714fe50d9e4a5f11b4d595d543481b5f980b
921 921 node: 13207e5a10d9fd28ec424934298e176197f2c67f
922 922 node: bbe44766e73d5f11ed2177f1838de10c53ef3e74
923 923 node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
924 924 node: 97054abb4ab824450e9164180baf491ae0078465
925 925 node: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
926 926 node: 1e4e1b8f71e05681d422154f5421e385fec3454f
927 927 node--verbose: 95c24699272ef57d062b8bccc32c878bf841784a
928 928 node--verbose: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
929 929 node--verbose: d41e714fe50d9e4a5f11b4d595d543481b5f980b
930 930 node--verbose: 13207e5a10d9fd28ec424934298e176197f2c67f
931 931 node--verbose: bbe44766e73d5f11ed2177f1838de10c53ef3e74
932 932 node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47
933 933 node--verbose: 97054abb4ab824450e9164180baf491ae0078465
934 934 node--verbose: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
935 935 node--verbose: 1e4e1b8f71e05681d422154f5421e385fec3454f
936 936 node--debug: 95c24699272ef57d062b8bccc32c878bf841784a
937 937 node--debug: 29114dbae42b9f078cf2714dbe3a86bba8ec7453
938 938 node--debug: d41e714fe50d9e4a5f11b4d595d543481b5f980b
939 939 node--debug: 13207e5a10d9fd28ec424934298e176197f2c67f
940 940 node--debug: bbe44766e73d5f11ed2177f1838de10c53ef3e74
941 941 node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47
942 942 node--debug: 97054abb4ab824450e9164180baf491ae0078465
943 943 node--debug: b608e9d1a3f0273ccf70fb85fd6866b3482bf965
944 944 node--debug: 1e4e1b8f71e05681d422154f5421e385fec3454f
945 945 parents:
946 946 parents: -1:000000000000
947 947 parents: 5:13207e5a10d9 4:bbe44766e73d
948 948 parents: 3:10e46f2dcbf4
949 949 parents:
950 950 parents:
951 951 parents:
952 952 parents:
953 953 parents:
954 954 parents--verbose:
955 955 parents--verbose: -1:000000000000
956 956 parents--verbose: 5:13207e5a10d9 4:bbe44766e73d
957 957 parents--verbose: 3:10e46f2dcbf4
958 958 parents--verbose:
959 959 parents--verbose:
960 960 parents--verbose:
961 961 parents--verbose:
962 962 parents--verbose:
963 963 parents--debug: 7:29114dbae42b9f078cf2714dbe3a86bba8ec7453 -1:0000000000000000000000000000000000000000
964 964 parents--debug: -1:0000000000000000000000000000000000000000 -1:0000000000000000000000000000000000000000
965 965 parents--debug: 5:13207e5a10d9fd28ec424934298e176197f2c67f 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74
966 966 parents--debug: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47 -1:0000000000000000000000000000000000000000
967 967 parents--debug: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47 -1:0000000000000000000000000000000000000000
968 968 parents--debug: 2:97054abb4ab824450e9164180baf491ae0078465 -1:0000000000000000000000000000000000000000
969 969 parents--debug: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965 -1:0000000000000000000000000000000000000000
970 970 parents--debug: 0:1e4e1b8f71e05681d422154f5421e385fec3454f -1:0000000000000000000000000000000000000000
971 971 parents--debug: -1:0000000000000000000000000000000000000000 -1:0000000000000000000000000000000000000000
972 972 rev: 8
973 973 rev: 7
974 974 rev: 6
975 975 rev: 5
976 976 rev: 4
977 977 rev: 3
978 978 rev: 2
979 979 rev: 1
980 980 rev: 0
981 981 rev--verbose: 8
982 982 rev--verbose: 7
983 983 rev--verbose: 6
984 984 rev--verbose: 5
985 985 rev--verbose: 4
986 986 rev--verbose: 3
987 987 rev--verbose: 2
988 988 rev--verbose: 1
989 989 rev--verbose: 0
990 990 rev--debug: 8
991 991 rev--debug: 7
992 992 rev--debug: 6
993 993 rev--debug: 5
994 994 rev--debug: 4
995 995 rev--debug: 3
996 996 rev--debug: 2
997 997 rev--debug: 1
998 998 rev--debug: 0
999 999 tags: tip
1000 1000 tags:
1001 1001 tags:
1002 1002 tags:
1003 1003 tags:
1004 1004 tags:
1005 1005 tags:
1006 1006 tags:
1007 1007 tags:
1008 1008 tags--verbose: tip
1009 1009 tags--verbose:
1010 1010 tags--verbose:
1011 1011 tags--verbose:
1012 1012 tags--verbose:
1013 1013 tags--verbose:
1014 1014 tags--verbose:
1015 1015 tags--verbose:
1016 1016 tags--verbose:
1017 1017 tags--debug: tip
1018 1018 tags--debug:
1019 1019 tags--debug:
1020 1020 tags--debug:
1021 1021 tags--debug:
1022 1022 tags--debug:
1023 1023 tags--debug:
1024 1024 tags--debug:
1025 1025 tags--debug:
1026 1026 diffstat: 3: +2/-1
1027 1027 diffstat: 1: +1/-0
1028 1028 diffstat: 0: +0/-0
1029 1029 diffstat: 1: +1/-0
1030 1030 diffstat: 0: +0/-0
1031 1031 diffstat: 1: +1/-0
1032 1032 diffstat: 1: +4/-0
1033 1033 diffstat: 1: +2/-0
1034 1034 diffstat: 1: +1/-0
1035 1035 diffstat--verbose: 3: +2/-1
1036 1036 diffstat--verbose: 1: +1/-0
1037 1037 diffstat--verbose: 0: +0/-0
1038 1038 diffstat--verbose: 1: +1/-0
1039 1039 diffstat--verbose: 0: +0/-0
1040 1040 diffstat--verbose: 1: +1/-0
1041 1041 diffstat--verbose: 1: +4/-0
1042 1042 diffstat--verbose: 1: +2/-0
1043 1043 diffstat--verbose: 1: +1/-0
1044 1044 diffstat--debug: 3: +2/-1
1045 1045 diffstat--debug: 1: +1/-0
1046 1046 diffstat--debug: 0: +0/-0
1047 1047 diffstat--debug: 1: +1/-0
1048 1048 diffstat--debug: 0: +0/-0
1049 1049 diffstat--debug: 1: +1/-0
1050 1050 diffstat--debug: 1: +4/-0
1051 1051 diffstat--debug: 1: +2/-0
1052 1052 diffstat--debug: 1: +1/-0
1053 1053 extras: branch=default
1054 1054 extras: branch=default
1055 1055 extras: branch=default
1056 1056 extras: branch=default
1057 1057 extras: branch=foo
1058 1058 extras: branch=default
1059 1059 extras: branch=default
1060 1060 extras: branch=default
1061 1061 extras: branch=default
1062 1062 extras--verbose: branch=default
1063 1063 extras--verbose: branch=default
1064 1064 extras--verbose: branch=default
1065 1065 extras--verbose: branch=default
1066 1066 extras--verbose: branch=foo
1067 1067 extras--verbose: branch=default
1068 1068 extras--verbose: branch=default
1069 1069 extras--verbose: branch=default
1070 1070 extras--verbose: branch=default
1071 1071 extras--debug: branch=default
1072 1072 extras--debug: branch=default
1073 1073 extras--debug: branch=default
1074 1074 extras--debug: branch=default
1075 1075 extras--debug: branch=foo
1076 1076 extras--debug: branch=default
1077 1077 extras--debug: branch=default
1078 1078 extras--debug: branch=default
1079 1079 extras--debug: branch=default
1080 1080
1081 1081
1082 1082 Filters work:
1083 1083
1084 1084 $ hg log --template '{author|domain}\n'
1085 1085
1086 1086 hostname
1087 1087
1088 1088
1089 1089
1090 1090
1091 1091 place
1092 1092 place
1093 1093 hostname
1094 1094
1095 1095 $ hg log --template '{author|person}\n'
1096 1096 test
1097 1097 User Name
1098 1098 person
1099 1099 person
1100 1100 person
1101 1101 person
1102 1102 other
1103 1103 A. N. Other
1104 1104 User Name
1105 1105
1106 1106 $ hg log --template '{author|user}\n'
1107 1107 test
1108 1108 user
1109 1109 person
1110 1110 person
1111 1111 person
1112 1112 person
1113 1113 other
1114 1114 other
1115 1115 user
1116 1116
1117 $ hg log --template '{date|age}\n' > /dev/null || exit 1
1118
1119 $ hg log -l1 --template '{date|age}\n'
1120 7 years from now
1121 1117 $ hg log --template '{date|date}\n'
1122 1118 Wed Jan 01 10:01:00 2020 +0000
1123 1119 Mon Jan 12 13:46:40 1970 +0000
1124 1120 Sun Jan 18 08:40:01 1970 +0000
1125 1121 Sun Jan 18 08:40:00 1970 +0000
1126 1122 Sat Jan 17 04:53:20 1970 +0000
1127 1123 Fri Jan 16 01:06:40 1970 +0000
1128 1124 Wed Jan 14 21:20:00 1970 +0000
1129 1125 Tue Jan 13 17:33:20 1970 +0000
1130 1126 Mon Jan 12 13:46:40 1970 +0000
1131 1127
1132 1128 $ hg log --template '{date|isodate}\n'
1133 1129 2020-01-01 10:01 +0000
1134 1130 1970-01-12 13:46 +0000
1135 1131 1970-01-18 08:40 +0000
1136 1132 1970-01-18 08:40 +0000
1137 1133 1970-01-17 04:53 +0000
1138 1134 1970-01-16 01:06 +0000
1139 1135 1970-01-14 21:20 +0000
1140 1136 1970-01-13 17:33 +0000
1141 1137 1970-01-12 13:46 +0000
1142 1138
1143 1139 $ hg log --template '{date|isodatesec}\n'
1144 1140 2020-01-01 10:01:00 +0000
1145 1141 1970-01-12 13:46:40 +0000
1146 1142 1970-01-18 08:40:01 +0000
1147 1143 1970-01-18 08:40:00 +0000
1148 1144 1970-01-17 04:53:20 +0000
1149 1145 1970-01-16 01:06:40 +0000
1150 1146 1970-01-14 21:20:00 +0000
1151 1147 1970-01-13 17:33:20 +0000
1152 1148 1970-01-12 13:46:40 +0000
1153 1149
1154 1150 $ hg log --template '{date|rfc822date}\n'
1155 1151 Wed, 01 Jan 2020 10:01:00 +0000
1156 1152 Mon, 12 Jan 1970 13:46:40 +0000
1157 1153 Sun, 18 Jan 1970 08:40:01 +0000
1158 1154 Sun, 18 Jan 1970 08:40:00 +0000
1159 1155 Sat, 17 Jan 1970 04:53:20 +0000
1160 1156 Fri, 16 Jan 1970 01:06:40 +0000
1161 1157 Wed, 14 Jan 1970 21:20:00 +0000
1162 1158 Tue, 13 Jan 1970 17:33:20 +0000
1163 1159 Mon, 12 Jan 1970 13:46:40 +0000
1164 1160
1165 1161 $ hg log --template '{desc|firstline}\n'
1166 1162 third
1167 1163 second
1168 1164 merge
1169 1165 new head
1170 1166 new branch
1171 1167 no user, no domain
1172 1168 no person
1173 1169 other 1
1174 1170 line 1
1175 1171
1176 1172 $ hg log --template '{node|short}\n'
1177 1173 95c24699272e
1178 1174 29114dbae42b
1179 1175 d41e714fe50d
1180 1176 13207e5a10d9
1181 1177 bbe44766e73d
1182 1178 10e46f2dcbf4
1183 1179 97054abb4ab8
1184 1180 b608e9d1a3f0
1185 1181 1e4e1b8f71e0
1186 1182
1187 1183 $ hg log --template '<changeset author="{author|xmlescape}"/>\n'
1188 1184 <changeset author="test"/>
1189 1185 <changeset author="User Name &lt;user@hostname&gt;"/>
1190 1186 <changeset author="person"/>
1191 1187 <changeset author="person"/>
1192 1188 <changeset author="person"/>
1193 1189 <changeset author="person"/>
1194 1190 <changeset author="other@place"/>
1195 1191 <changeset author="A. N. Other &lt;other@place&gt;"/>
1196 1192 <changeset author="User Name &lt;user@hostname&gt;"/>
1197 1193
1198 1194 $ hg log --template '{rev}: {children}\n'
1199 1195 8:
1200 1196 7: 8:95c24699272e
1201 1197 6:
1202 1198 5: 6:d41e714fe50d
1203 1199 4: 6:d41e714fe50d
1204 1200 3: 4:bbe44766e73d 5:13207e5a10d9
1205 1201 2: 3:10e46f2dcbf4
1206 1202 1: 2:97054abb4ab8
1207 1203 0: 1:b608e9d1a3f0
1208 1204
1209 1205 Formatnode filter works:
1210 1206
1211 1207 $ hg -q log -r 0 --template '{node|formatnode}\n'
1212 1208 1e4e1b8f71e0
1213 1209
1214 1210 $ hg log -r 0 --template '{node|formatnode}\n'
1215 1211 1e4e1b8f71e0
1216 1212
1217 1213 $ hg -v log -r 0 --template '{node|formatnode}\n'
1218 1214 1e4e1b8f71e0
1219 1215
1220 1216 $ hg --debug log -r 0 --template '{node|formatnode}\n'
1221 1217 1e4e1b8f71e05681d422154f5421e385fec3454f
1222 1218
1219 Age filter:
1220
1221 $ hg log --template '{date|age}\n' > /dev/null || exit 1
1222
1223 >>> from datetime import datetime
1224 >>> fp = open('a', 'w')
1225 >>> fp.write(str(datetime.now().year + 8) + '-01-01 00:00')
1226 >>> fp.close()
1227 $ hg add a
1228 $ hg commit -m future -d "`cat a`"
1229
1230 $ hg log -l1 --template '{date|age}\n'
1231 7 years from now
1232
1223 1233 Error on syntax:
1224 1234
1225 1235 $ echo 'x = "f' >> t
1226 1236 $ hg log
1227 1237 abort: t:3: unmatched quotes
1228 1238 [255]
1229 1239
1230 1240 $ cd ..
1231 1241
1232 1242
1233 1243 latesttag:
1234 1244
1235 1245 $ hg init latesttag
1236 1246 $ cd latesttag
1237 1247
1238 1248 $ echo a > file
1239 1249 $ hg ci -Am a -d '0 0'
1240 1250 adding file
1241 1251
1242 1252 $ echo b >> file
1243 1253 $ hg ci -m b -d '1 0'
1244 1254
1245 1255 $ echo c >> head1
1246 1256 $ hg ci -Am h1c -d '2 0'
1247 1257 adding head1
1248 1258
1249 1259 $ hg update -q 1
1250 1260 $ echo d >> head2
1251 1261 $ hg ci -Am h2d -d '3 0'
1252 1262 adding head2
1253 1263 created new head
1254 1264
1255 1265 $ echo e >> head2
1256 1266 $ hg ci -m h2e -d '4 0'
1257 1267
1258 1268 $ hg merge -q
1259 1269 $ hg ci -m merge -d '5 0'
1260 1270
1261 1271 No tag set:
1262 1272
1263 1273 $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
1264 1274 5: null+5
1265 1275 4: null+4
1266 1276 3: null+3
1267 1277 2: null+3
1268 1278 1: null+2
1269 1279 0: null+1
1270 1280
1271 1281 One common tag: longuest path wins:
1272 1282
1273 1283 $ hg tag -r 1 -m t1 -d '6 0' t1
1274 1284 $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
1275 1285 6: t1+4
1276 1286 5: t1+3
1277 1287 4: t1+2
1278 1288 3: t1+1
1279 1289 2: t1+1
1280 1290 1: t1+0
1281 1291 0: null+1
1282 1292
1283 1293 One ancestor tag: more recent wins:
1284 1294
1285 1295 $ hg tag -r 2 -m t2 -d '7 0' t2
1286 1296 $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
1287 1297 7: t2+3
1288 1298 6: t2+2
1289 1299 5: t2+1
1290 1300 4: t1+2
1291 1301 3: t1+1
1292 1302 2: t2+0
1293 1303 1: t1+0
1294 1304 0: null+1
1295 1305
1296 1306 Two branch tags: more recent wins:
1297 1307
1298 1308 $ hg tag -r 3 -m t3 -d '8 0' t3
1299 1309 $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
1300 1310 8: t3+5
1301 1311 7: t3+4
1302 1312 6: t3+3
1303 1313 5: t3+2
1304 1314 4: t3+1
1305 1315 3: t3+0
1306 1316 2: t2+0
1307 1317 1: t1+0
1308 1318 0: null+1
1309 1319
1310 1320 Merged tag overrides:
1311 1321
1312 1322 $ hg tag -r 5 -m t5 -d '9 0' t5
1313 1323 $ hg tag -r 3 -m at3 -d '10 0' at3
1314 1324 $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
1315 1325 10: t5+5
1316 1326 9: t5+4
1317 1327 8: t5+3
1318 1328 7: t5+2
1319 1329 6: t5+1
1320 1330 5: t5+0
1321 1331 4: at3:t3+1
1322 1332 3: at3:t3+0
1323 1333 2: t2+0
1324 1334 1: t1+0
1325 1335 0: null+1
1326 1336
1327 1337 $ cd ..
1328 1338
1329 1339
1330 1340 Style path expansion: issue1948 - ui.style option doesn't work on OSX
1331 1341 if it is a relative path
1332 1342
1333 1343 $ mkdir -p home/styles
1334 1344
1335 1345 $ cat > home/styles/teststyle <<EOF
1336 1346 > changeset = 'test {rev}:{node|short}\n'
1337 1347 > EOF
1338 1348
1339 1349 $ HOME=`pwd`/home; export HOME
1340 1350
1341 1351 $ cat > latesttag/.hg/hgrc <<EOF
1342 1352 > [ui]
1343 1353 > style = ~/styles/teststyle
1344 1354 > EOF
1345 1355
1346 1356 $ hg -R latesttag tip
1347 1357 test 10:dee8f28249af
1348 1358
1349 1359 Test recursive showlist template (issue1989):
1350 1360
1351 1361 $ cat > style1989 <<EOF
1352 1362 > changeset = '{file_mods}{manifest}{extras}'
1353 1363 > file_mod = 'M|{author|person}\n'
1354 1364 > manifest = '{rev},{author}\n'
1355 1365 > extra = '{key}: {author}\n'
1356 1366 > EOF
1357 1367
1358 1368 $ hg -R latesttag log -r tip --style=style1989
1359 1369 M|test
1360 1370 10,test
1361 1371 branch: test
1362 1372
General Comments 0
You need to be logged in to leave comments. Login now