comparison tests/test-command-template.t @ 29624:1a129dd05b7d stable

templatekw: fix join format of parents keyword (issue5292) Since the default joinfmt() can't process a dict of multiple keywords, we need a dedicated joinfmt for showparents(). Unlike revset(), parents are formatted as '{rev}:{node|formatnode}' by default. We copy the default formatting just like showextras() and showfilecopies() do.
author Yuya Nishihara <yuya@tcha.org>
date Fri, 22 Jul 2016 22:12:12 +0900
parents 33bf8bd8c5b9
children 84ef4517de03
comparison
equal deleted inserted replaced
29623:33bf8bd8c5b9 29624:1a129dd05b7d
3436 join() should pick '{rev}' from revset items: 3436 join() should pick '{rev}' from revset items:
3437 3437
3438 $ hg log -R ../a -T '{join(revset("parents(%d)", rev), ", ")}\n' -r6 3438 $ hg log -R ../a -T '{join(revset("parents(%d)", rev), ", ")}\n' -r6
3439 4, 5 3439 4, 5
3440 3440
3441 on the other hand, parents are formatted as '{rev}:{node|formatnode}' by
3442 default. join() should agree with the default formatting:
3443
3444 $ hg log -R ../a -T '{join(parents, ", ")}\n' -r6
3445 5:13207e5a10d9, 4:bbe44766e73d
3446
3447 $ hg log -R ../a -T '{join(parents, ",\n")}\n' -r6 --debug
3448 5:13207e5a10d9fd28ec424934298e176197f2c67f,
3449 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74
3450
3441 Test active bookmark templating 3451 Test active bookmark templating
3442 3452
3443 $ hg book foo 3453 $ hg book foo
3444 $ hg book bar 3454 $ hg book bar
3445 $ hg log --template "{rev} {bookmarks % '{bookmark}{ifeq(bookmark, active, \"*\")} '}\n" 3455 $ hg log --template "{rev} {bookmarks % '{bookmark}{ifeq(bookmark, active, \"*\")} '}\n"