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