Show More
@@ -208,6 +208,17 b' def showchildren(**args):' | |||||
208 | childrevs = ['%d:%s' % (cctx, cctx) for cctx in ctx.children()] |
|
208 | childrevs = ['%d:%s' % (cctx, cctx) for cctx in ctx.children()] | |
209 | return showlist('children', childrevs, element='child', **args) |
|
209 | return showlist('children', childrevs, element='child', **args) | |
210 |
|
210 | |||
|
211 | def showcurrentbookmark(**args): | |||
|
212 | """:currentbookmark: String. The active bookmark, if it is | |||
|
213 | associated with the changeset""" | |||
|
214 | import bookmarks as bookmarks # to avoid circular import issues | |||
|
215 | repo = args['repo'] | |||
|
216 | if bookmarks.iscurrent(repo): | |||
|
217 | current = repo._bookmarkcurrent | |||
|
218 | if current in args['ctx'].bookmarks(): | |||
|
219 | return current | |||
|
220 | return '' | |||
|
221 | ||||
211 | def showdate(repo, ctx, templ, **args): |
|
222 | def showdate(repo, ctx, templ, **args): | |
212 | """:date: Date information. The date when the changeset was committed.""" |
|
223 | """:date: Date information. The date when the changeset was committed.""" | |
213 | return ctx.date() |
|
224 | return ctx.date() | |
@@ -364,6 +375,7 b' keywords = {' | |||||
364 | 'branches': showbranches, |
|
375 | 'branches': showbranches, | |
365 | 'bookmarks': showbookmarks, |
|
376 | 'bookmarks': showbookmarks, | |
366 | 'children': showchildren, |
|
377 | 'children': showchildren, | |
|
378 | 'currentbookmark': showcurrentbookmark, | |||
367 | 'date': showdate, |
|
379 | 'date': showdate, | |
368 | 'desc': showdescription, |
|
380 | 'desc': showdescription, | |
369 | 'diffstat': showdiffstat, |
|
381 | 'diffstat': showdiffstat, |
@@ -1850,6 +1850,15 b' Test current bookmark templating' | |||||
1850 | 2 bar* foo |
|
1850 | 2 bar* foo | |
1851 | 1 |
|
1851 | 1 | |
1852 | 0 |
|
1852 | 0 | |
|
1853 | $ hg log --template "{rev} {currentbookmark}\n" | |||
|
1854 | 2 bar | |||
|
1855 | 1 | |||
|
1856 | 0 | |||
|
1857 | $ hg bookmarks --inactive bar | |||
|
1858 | $ hg log --template "{rev} {currentbookmark}\n" | |||
|
1859 | 2 | |||
|
1860 | 1 | |||
|
1861 | 0 | |||
1853 |
|
1862 | |||
1854 | Test stringify on sub expressions |
|
1863 | Test stringify on sub expressions | |
1855 |
|
1864 |
General Comments 0
You need to be logged in to leave comments.
Login now