# HG changeset patch # User Matt Harbison # Date 1556419516 14400 # Node ID a4fde4e3e7638b6cc1860f4748f7db567fde9bcc # Parent c9798965b1f4d9a4cb69c03f1d528413fbd61975 templatekw: add `instabilities` alias for `troubles` Per https://www.mercurial-scm.org/wiki/CEDVocabulary diff -r c9798965b1f4 -r a4fde4e3e763 hgext3rd/evolve/templatekw.py --- a/hgext3rd/evolve/templatekw.py Sat Apr 27 22:59:48 2019 -0400 +++ b/hgext3rd/evolve/templatekw.py Sat Apr 27 22:45:16 2019 -0400 @@ -24,17 +24,32 @@ ### template keywords if util.safehasattr(templatekw, 'compatlist'): + @eh.templatekeyword('instabilities', requires=set(['ctx', 'templ'])) + def showinstabilities(context, mapping): + """List of strings. Evolution instabilities affecting the changeset + (zero or more of "orphan", "content-divergent" or "phase-divergent").""" + ctx = context.resource(mapping, 'ctx') + return templatekw.compatlist(context, mapping, 'instability', + ctx.instabilities(), + plural='instabilities') + @eh.templatekeyword('troubles', requires=set(['ctx', 'templ'])) - def showtroubles(context, mapping): + def showtroubles(context, mapping): # legacy name for instabilities ctx = context.resource(mapping, 'ctx') return templatekw.compatlist(context, mapping, 'trouble', ctx.instabilities(), plural='troubles') else: # older template API in hg < 4.6 + @eh.templatekeyword('instabilities') + def showinstabilities(**args): + """List of strings. Evolution instabilities affecting the changeset + (zero or more of "orphan", "content-divergent" or "phase-divergent").""" + ctx = args['ctx'] + return templatekw.showlist('instability', ctx.instabilities(), args, + plural='instabilities') + @eh.templatekeyword('troubles') def showtroubles(**args): - """List of strings. Evolution troubles affecting the changeset - (zero or more of "unstable", "divergent" or "bumped").""" ctx = args['ctx'] return templatekw.showlist('trouble', ctx.instabilities(), args, plural='troubles') diff -r c9798965b1f4 -r a4fde4e3e763 tests/test-evolve-content-divergent-basic.t --- a/tests/test-evolve-content-divergent-basic.t Sat Apr 27 22:59:48 2019 -0400 +++ b/tests/test-evolve-content-divergent-basic.t Sat Apr 27 22:45:16 2019 -0400 @@ -20,7 +20,7 @@ > git = 1 > unified = 0 > [ui] - > logtemplate = {rev}:{node|short}@{branch}({phase}) {desc|firstline} [{troubles}]\n + > logtemplate = {rev}:{node|short}@{branch}({phase}) {desc|firstline} [{instabilities}]\n > [extensions] > EOF $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/" >> $HGRCPATH diff -r c9798965b1f4 -r a4fde4e3e763 tests/test-evolve-content-divergent-corner-cases.t --- a/tests/test-evolve-content-divergent-corner-cases.t Sat Apr 27 22:59:48 2019 -0400 +++ b/tests/test-evolve-content-divergent-corner-cases.t Sat Apr 27 22:45:16 2019 -0400 @@ -20,7 +20,7 @@ > git = 1 > unified = 0 > [ui] - > logtemplate = {rev}:{node|short}@{branch}({phase}) {desc|firstline} [{troubles}]\n + > logtemplate = {rev}:{node|short}@{branch}({phase}) {desc|firstline} [{instabilities}]\n > [extensions] > EOF $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/" >> $HGRCPATH diff -r c9798965b1f4 -r a4fde4e3e763 tests/test-evolve-content-divergent-meta.t --- a/tests/test-evolve-content-divergent-meta.t Sat Apr 27 22:59:48 2019 -0400 +++ b/tests/test-evolve-content-divergent-meta.t Sat Apr 27 22:45:16 2019 -0400 @@ -9,7 +9,7 @@ $ cat >> $HGRCPATH < [alias] - > glog = log -GT "{rev}:{node|short} {desc|firstline}\n {phase} {troubles}\n\n" + > glog = log -GT "{rev}:{node|short} {desc|firstline}\n {phase} {instabilities}\n\n" > [phases] > publish = False > [extensions] diff -r c9798965b1f4 -r a4fde4e3e763 tests/test-evolve-public-content-divergent-corner-cases.t --- a/tests/test-evolve-public-content-divergent-corner-cases.t Sat Apr 27 22:59:48 2019 -0400 +++ b/tests/test-evolve-public-content-divergent-corner-cases.t Sat Apr 27 22:45:16 2019 -0400 @@ -9,7 +9,7 @@ ===== $ cat >> $HGRCPATH < [alias] - > glog = log -GT "{rev}:{node|short} {desc|firstline}\n {phase} {troubles}\n\n" + > glog = log -GT "{rev}:{node|short} {desc|firstline}\n {phase} {instabilities}\n\n" > [phases] > publish = False > [extensions] diff -r c9798965b1f4 -r a4fde4e3e763 tests/test-evolve-public-content-divergent-discard.t --- a/tests/test-evolve-public-content-divergent-discard.t Sat Apr 27 22:59:48 2019 -0400 +++ b/tests/test-evolve-public-content-divergent-discard.t Sat Apr 27 22:45:16 2019 -0400 @@ -14,7 +14,7 @@ ===== $ cat >> $HGRCPATH < [alias] - > glog = log -GT "{rev}:{node|short} {desc|firstline}\n {phase} {troubles}\n\n" + > glog = log -GT "{rev}:{node|short} {desc|firstline}\n {phase} {instabilities}\n\n" > [phases] > publish = False > [extensions] diff -r c9798965b1f4 -r a4fde4e3e763 tests/test-evolve-public-content-divergent-main.t --- a/tests/test-evolve-public-content-divergent-main.t Sat Apr 27 22:59:48 2019 -0400 +++ b/tests/test-evolve-public-content-divergent-main.t Sat Apr 27 22:45:16 2019 -0400 @@ -12,7 +12,7 @@ ===== $ cat >> $HGRCPATH < [alias] - > glog = log -GT "{rev}:{node|short} {desc|firstline}\n {phase} {troubles}\n\n" + > glog = log -GT "{rev}:{node|short} {desc|firstline}\n {phase} {instabilities}\n\n" > [phases] > publish = False > [extensions] diff -r c9798965b1f4 -r a4fde4e3e763 tests/test-evolve.t --- a/tests/test-evolve.t Sat Apr 27 22:59:48 2019 -0400 +++ b/tests/test-evolve.t Sat Apr 27 22:45:16 2019 -0400 @@ -441,7 +441,7 @@ (ninja test for the {trouble} template: - $ hg log -G --template '{rev} {troubles}\n' + $ hg log -G --template '{rev} {instabilities}\n' @ 10 | | * 9 orphan