Show More
@@ -119,6 +119,16 def _showlist(name, values, plural=None, | |||
|
119 | 119 | if endname in templ: |
|
120 | 120 | yield templ(endname, **args) |
|
121 | 121 | |
|
122 | def _formatrevnode(ctx): | |
|
123 | """Format changeset as '{rev}:{node|formatnode}', which is the default | |
|
124 | template provided by cmdutil.changeset_templater""" | |
|
125 | repo = ctx.repo() | |
|
126 | if repo.ui.debugflag: | |
|
127 | hexnode = ctx.hex() | |
|
128 | else: | |
|
129 | hexnode = ctx.hex()[:12] | |
|
130 | return '%d:%s' % (scmutil.intrev(ctx.rev()), hexnode) | |
|
131 | ||
|
122 | 132 | def getfiles(repo, ctx, revcache): |
|
123 | 133 | if 'files' not in revcache: |
|
124 | 134 | revcache['files'] = repo.status(ctx.p1(), ctx)[:3] |
@@ -523,7 +533,8 def showparents(**args): | |||
|
523 | 533 | ('phase', p.phasestr())] |
|
524 | 534 | for p in pctxs] |
|
525 | 535 | f = _showlist('parent', parents, **args) |
|
526 |
return _hybrid(f, prevs, lambda x: {'ctx': repo[int(x)], 'revcache': {}} |
|
|
536 | return _hybrid(f, prevs, lambda x: {'ctx': repo[int(x)], 'revcache': {}}, | |
|
537 | lambda d: _formatrevnode(d['ctx'])) | |
|
527 | 538 | |
|
528 | 539 | @templatekeyword('phase') |
|
529 | 540 | def showphase(repo, ctx, templ, **args): |
@@ -3438,6 +3438,16 join() should pick '{rev}' from revset i | |||
|
3438 | 3438 | $ hg log -R ../a -T '{join(revset("parents(%d)", rev), ", ")}\n' -r6 |
|
3439 | 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 | 3451 | Test active bookmark templating |
|
3442 | 3452 | |
|
3443 | 3453 | $ hg book foo |
General Comments 0
You need to be logged in to leave comments.
Login now