label: rename trouble.X into instability.X
authorBoris Feld <boris.feld@octobus.net>
Thu, 03 Aug 2017 15:30:41 +0200
changeset 33803 40739aef97f7
parent 33802 3821dfee2cfc
child 33804 db6b666ce1e6
label: rename trouble.X into instability.X The renaming is done according to https://www.mercurial-scm.org/wiki/CEDVocabulary. Differential Revision: https://phab.mercurial-scm.org/D258
mercurial/cmdutil.py
mercurial/templatekw.py
mercurial/templates/map-cmdline.default
tests/test-obsolete.t
--- a/mercurial/cmdutil.py	Thu Aug 03 14:32:50 2017 +0200
+++ b/mercurial/cmdutil.py	Thu Aug 03 15:30:41 2017 +0200
@@ -1573,7 +1573,7 @@
     if ctx.isunstable():
         labels.append('changeset.unstable')
         for instability in ctx.instabilities():
-            labels.append('trouble.%s' % instability)
+            labels.append('instability.%s' % instability)
     return ' '.join(labels)
 
 class changeset_printer(object):
--- a/mercurial/templatekw.py	Thu Aug 03 14:32:50 2017 +0200
+++ b/mercurial/templatekw.py	Thu Aug 03 15:30:41 2017 +0200
@@ -783,7 +783,7 @@
     (EXPERIMENTAL)
     """
     args = pycompat.byteskwargs(args)
-    return showlist('trouble', args['ctx'].instabilities(), args)
+    return showlist('instability', args['ctx'].instabilities(), args)
 
 # tell hggettext to extract docstrings from these functions:
 i18nfunctions = keywords.values()
--- a/mercurial/templates/map-cmdline.default	Thu Aug 03 14:32:50 2017 +0200
+++ b/mercurial/templates/map-cmdline.default	Thu Aug 03 15:30:41 2017 +0200
@@ -28,8 +28,8 @@
                                                % ' {name} ({source})'}\n"))}'
 
 # General templates
-_trouble_label = 'trouble.{trouble}'
-_troubles_labels = '{if(instabilities, "changeset.unstable {instabilities%_trouble_label}")}'
+_instability_label = 'instability.{instability}'
+_troubles_labels = '{if(instabilities, "changeset.unstable {instabilities%_instability_label}")}'
 _obsolete_label = '{if(obsolete, "changeset.obsolete")}'
 _cset_labels = '{separate(" ", "log.changeset", "changeset.{phase}", "{_obsolete_label}", "{_troubles_labels}")}'
 cset = '{label("{_cset_labels}",
--- a/tests/test-obsolete.t	Thu Aug 03 14:32:50 2017 +0200
+++ b/tests/test-obsolete.t	Thu Aug 03 15:30:41 2017 +0200
@@ -948,7 +948,7 @@
 test the obsolete labels
 
   $ hg log --config ui.logtemplate= --color=debug -r 'phasedivergent()'
-  [log.changeset changeset.draft changeset.unstable trouble.orphan trouble.phase-divergent|changeset:   7:50c51b361e60]
+  [log.changeset changeset.draft changeset.unstable instability.orphan instability.phase-divergent|changeset:   7:50c51b361e60]
   [log.user|user:        test]
   [log.date|date:        Thu Jan 01 00:00:00 1970 +0000]
   [log.trouble|instability: orphan, phase-divergent]
@@ -956,7 +956,7 @@
   
 
   $ hg log -T default -r 'phasedivergent()' --color=debug
-  [log.changeset changeset.draft changeset.unstable trouble.orphantrouble.phase-divergent|changeset:   7:50c51b361e60]
+  [log.changeset changeset.draft changeset.unstable instability.orphaninstability.phase-divergent|changeset:   7:50c51b361e60]
   [log.user|user:        test]
   [log.date|date:        Thu Jan 01 00:00:00 1970 +0000]
   [log.trouble|instability: orphan, phase-divergent]