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