Mercurial > evolve
diff hgext3rd/evolve/templatekw.py @ 2489:84a8219a2f9a
template: add the obsfate template
Reuse _getobsoletefate and nextvisiblesuccessors to easily get the
obsolescence fate of any node. The limitation is that obsfate is as precise as
these two functions, which is not great for nextvisiblesuccessors.
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Fri, 26 May 2017 13:28:49 +0200 |
parents | 590da9c523ae |
children | 94f171534918 |
line wrap: on
line diff
--- a/hgext3rd/evolve/templatekw.py Fri May 26 13:18:26 2017 +0200 +++ b/hgext3rd/evolve/templatekw.py Fri May 26 13:28:49 2017 +0200 @@ -10,6 +10,7 @@ from . import ( exthelper, + obshistory ) from mercurial import ( @@ -96,6 +97,14 @@ return ', '.join(final) +@eh.templatekw("obsfate") +def showobsfate(repo, ctx, templ, **args): + if not ctx.obsolete(): + return '' + + successorssets = closestsuccessors(repo, ctx.node()) + return obshistory._getobsfate(successorssets) + # copy from mercurial.obsolete with a small change to stop at first known changeset. def directsuccessorssets(repo, initialnode, cache=None):