Show More
@@ -765,9 +765,21 b' def termwidth(repo, ctx, templ, **args):' | |||||
765 | return repo.ui.termwidth() |
|
765 | return repo.ui.termwidth() | |
766 |
|
766 | |||
767 | @templatekeyword('troubles') |
|
767 | @templatekeyword('troubles') | |
768 | def showtroubles(**args): |
|
768 | def showtroubles(repo, **args): | |
769 | """List of strings. Evolution troubles affecting the changeset. |
|
769 | """List of strings. Evolution troubles affecting the changeset. | |
770 |
|
770 | |||
|
771 | (DEPRECATED) | |||
|
772 | """ | |||
|
773 | msg = ("'troubles' is deprecated, " | |||
|
774 | "use 'instabilities'") | |||
|
775 | repo.ui.deprecwarn(msg, '4.4') | |||
|
776 | ||||
|
777 | return showinstabilities(repo=repo, **args) | |||
|
778 | ||||
|
779 | @templatekeyword('instabilities') | |||
|
780 | def showinstabilities(**args): | |||
|
781 | """List of strings. Evolution instabilities affecting the changeset. | |||
|
782 | ||||
771 | (EXPERIMENTAL) |
|
783 | (EXPERIMENTAL) | |
772 | """ |
|
784 | """ | |
773 | args = pycompat.byteskwargs(args) |
|
785 | args = pycompat.byteskwargs(args) |
@@ -29,7 +29,7 b" lfile_copies_switch = '{if(file_copies_s" | |||||
29 |
|
29 | |||
30 | # General templates |
|
30 | # General templates | |
31 | _trouble_label = 'trouble.{trouble}' |
|
31 | _trouble_label = 'trouble.{trouble}' | |
32 |
_troubles_labels = '{if( |
|
32 | _troubles_labels = '{if(instabilities, "changeset.troubled {instabilities%_trouble_label}")}' | |
33 | _obsolete_label = '{if(obsolete, "changeset.obsolete")}' |
|
33 | _obsolete_label = '{if(obsolete, "changeset.obsolete")}' | |
34 | _cset_labels = '{separate(" ", "log.changeset", "changeset.{phase}", "{_obsolete_label}", "{_troubles_labels}")}' |
|
34 | _cset_labels = '{separate(" ", "log.changeset", "changeset.{phase}", "{_obsolete_label}", "{_troubles_labels}")}' | |
35 | cset = '{label("{_cset_labels}", |
|
35 | cset = '{label("{_cset_labels}", | |
@@ -68,8 +68,8 b' summary = \'{if(desc|strip, "{label(\'log.' | |||||
68 | ldate = '{label("log.date", |
|
68 | ldate = '{label("log.date", | |
69 | "date: {date|date}")}\n' |
|
69 | "date: {date|date}")}\n' | |
70 |
|
70 | |||
71 |
ltroubles = '{if( |
|
71 | ltroubles = '{if(instabilities, "{label('log.trouble', | |
72 |
' |
|
72 | 'instability: {join(instabilities, ", ")}')}\n")}' | |
73 |
|
73 | |||
74 | extra = '{label("ui.debug log.extra", |
|
74 | extra = '{label("ui.debug log.extra", | |
75 | "extra: {key}={value|stringescape}")}\n' |
|
75 | "extra: {key}={value|stringescape}")}\n' |
@@ -670,7 +670,7 b' Use scmutil.cleanupnodes API to create d' | |||||
670 |
|
670 | |||
671 | $ rm .hg/localtags |
|
671 | $ rm .hg/localtags | |
672 | $ hg cleanup --config extensions.t=$TESTTMP/scmutilcleanup.py |
|
672 | $ hg cleanup --config extensions.t=$TESTTMP/scmutilcleanup.py | |
673 |
$ hg log -G -T '{rev}:{node|short} {desc} { |
|
673 | $ hg log -G -T '{rev}:{node|short} {desc} {instabilities}' -r 'sort(all(), topo)' | |
674 | @ 5:1a2a9b5b0030 B2 content-divergent |
|
674 | @ 5:1a2a9b5b0030 B2 content-divergent | |
675 | | |
|
675 | | | |
676 | | o 4:70d5a63ca112 B4 content-divergent |
|
676 | | o 4:70d5a63ca112 B4 content-divergent |
@@ -3,7 +3,7 b'' | |||||
3 | > # public changeset are not obsolete |
|
3 | > # public changeset are not obsolete | |
4 | > publish=false |
|
4 | > publish=false | |
5 | > [ui] |
|
5 | > [ui] | |
6 |
> logtemplate="{rev}:{node|short} ({phase}{if(obsolete, ' *{obsolete}*')}{if( |
|
6 | > logtemplate="{rev}:{node|short} ({phase}{if(obsolete, ' *{obsolete}*')}{if(instabilities, ' {instabilities}')}) [{tags} {bookmarks}] {desc|firstline}\n" | |
7 | > EOF |
|
7 | > EOF | |
8 | $ mkcommit() { |
|
8 | $ mkcommit() { | |
9 | > echo "$1" > "$1" |
|
9 | > echo "$1" > "$1" | |
@@ -934,7 +934,7 b' test the default cmdline template' | |||||
934 | changeset: 7:50c51b361e60 |
|
934 | changeset: 7:50c51b361e60 | |
935 | user: test |
|
935 | user: test | |
936 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
936 | date: Thu Jan 01 00:00:00 1970 +0000 | |
937 |
|
|
937 | instability: orphan, phase-divergent | |
938 | summary: add babar |
|
938 | summary: add babar | |
939 |
|
939 | |||
940 | $ hg log -T default -r 'obsolete()' |
|
940 | $ hg log -T default -r 'obsolete()' |
@@ -10,7 +10,7 b'' | |||||
10 | > def process(self, t, map): |
|
10 | > def process(self, t, map): | |
11 | > tmpl = self.loader(t) |
|
11 | > tmpl = self.loader(t) | |
12 | > for k, v in map.iteritems(): |
|
12 | > for k, v in map.iteritems(): | |
13 | > if k in ('templ', 'ctx', 'repo', 'revcache', 'cache'): |
|
13 | > if k in ('templ', 'ctx', 'repo', 'revcache', 'cache', 'troubles'): | |
14 | > continue |
|
14 | > continue | |
15 | > if hasattr(v, '__call__'): |
|
15 | > if hasattr(v, '__call__'): | |
16 | > v = v(**map) |
|
16 | > v = v(**map) |
General Comments 0
You need to be logged in to leave comments.
Login now