Mercurial > public > mercurial-scm > hg
diff mercurial/templatekw.py @ 31699:568c4e7437b2
templatekw: add an "obsolete" keyword
Definition is the same as the one in evolve extension.
author | Denis Laxalde <denis@laxalde.org> |
---|---|
date | Sat, 25 Mar 2017 10:34:11 +0100 |
parents | 52dabcc49968 |
children | e6eb86b154c5 |
line wrap: on
line diff
--- a/mercurial/templatekw.py Sat Mar 25 09:39:07 2017 +0100 +++ b/mercurial/templatekw.py Sat Mar 25 10:34:11 2017 +0100 @@ -514,6 +514,14 @@ """ return ctx.hex() +@templatekeyword('obsolete') +def showobsolete(repo, ctx, templ, **args): + """String. Whether the changeset is obsolete. + """ + if ctx.obsolete(): + return 'obsolete' + return '' + @templatekeyword('p1rev') def showp1rev(repo, ctx, templ, **args): """Integer. The repository-local revision number of the changeset's