##// END OF EJS Templates
doc: document that labels must have a dot in them to have an effect...
Jordi Gutiérrez Hermoso -
r52283:92c77659 default
parent child Browse files
Show More
@@ -63,10 +63,11 b' Labels'
63 Text receives color effects depending on the labels that it has. Many
63 Text receives color effects depending on the labels that it has. Many
64 default Mercurial commands emit labelled text. You can also define
64 default Mercurial commands emit labelled text. You can also define
65 your own labels in templates using the label function, see :hg:`help
65 your own labels in templates using the label function, see :hg:`help
66 templates`. A single portion of text may have more than one label. In
66 templates`. In order to receive effects, labels must have a dot, such
67 that case, effects given to the last label will override any other
67 as `log.secret` or `branch.active`. A single portion of text may have
68 effects. This includes the special "none" effect, which nullifies
68 more than one label. In that case, effects given to the last label
69 other effects.
69 will override any other effects. This includes the special "none"
70 effect, which nullifies other effects.
70
71
71 Labels are normally invisible. In order to see these labels and their
72 Labels are normally invisible. In order to see these labels and their
72 position in the text, use the global --color=debug option. The same
73 position in the text, use the global --color=debug option. The same
@@ -439,9 +439,10 b' def join(context, mapping, args):'
439
439
440 @templatefunc(b'label(label, expr)', requires={b'ui'})
440 @templatefunc(b'label(label, expr)', requires={b'ui'})
441 def label(context, mapping, args):
441 def label(context, mapping, args):
442 """Apply a label to generated content. Content with
442 """Apply a label to generated content. Content with a label
443 a label applied can result in additional post-processing, such as
443 applied can result in additional post-processing, such as
444 automatic colorization."""
444 automatic colorization. In order to receive effects, labels must
445 have a dot, such as `log.secret` or `branch.active`."""
445 if len(args) != 2:
446 if len(args) != 2:
446 # i18n: "label" is a keyword
447 # i18n: "label" is a keyword
447 raise error.ParseError(_(b"label expects two arguments"))
448 raise error.ParseError(_(b"label expects two arguments"))
General Comments 0
You need to be logged in to leave comments. Login now