# HG changeset patch # User Pierre-Yves David # Date 1402614601 25200 # Node ID 9ff6d9240f165155d0614209f5f358d235543588 # Parent 35492ab5b33b81177511e9621e56f25ec9c9b0c1 template: add a troubles keyword This keyword list all evolution troubles that affect a changeset. Evolution troubles can be "unstable", "divergent" and "bumped". diff -r 35492ab5b33b -r 9ff6d9240f16 hgext/evolve.py --- a/hgext/evolve.py Tue Jun 03 14:29:24 2014 -0700 +++ b/hgext/evolve.py Thu Jun 12 16:10:01 2014 -0700 @@ -525,6 +525,13 @@ return 'unstable' return 'stable' +@eh.templatekw('troubles') +def showtroubles(repo, ctx, **args): + """:troubles: List of strings. Evolution troubles affecting the changeset + (zero or more of "unstable", "divergent" or "bumped").""" + return templatekw.showlist('trouble', ctx.troubles(), plural='troubles', + **args) + ##################################################################### ### Various trouble warning ### ##################################################################### diff -r 35492ab5b33b -r 9ff6d9240f16 tests/test-evolve.t --- a/tests/test-evolve.t Tue Jun 03 14:29:24 2014 -0700 +++ b/tests/test-evolve.t Thu Jun 12 16:10:01 2014 -0700 @@ -341,6 +341,27 @@ $ hg commit --amend -m 'dansk!' 2 new unstable changesets +(ninja test for the {trouble} template: + + $ hg log -G --template '{rev} {troubles}\n' + @ 13 + | + | o 11 unstable + | | + | o 10 unstable + | | + | x 9 + |/ + o 7 + | + o 6 + | + o 0 + + + +(/ninja) + $ hg evolve --all --traceback move:[10] dansk 2! atop:[13] dansk!