mirror of
https://github.com/facebook/sapling.git
synced 2025-01-07 14:10:42 +03:00
template: rename troubles templatekw into instabilities
Rename troubles template keyword into instabilities and add a deprecation warning on templatekw. Update default mapfile and test files to use the new template keyword. The renaming is done according to https://www.mercurial-scm.org/wiki/CEDVocabulary. Differential Revision: https://phab.mercurial-scm.org/D237
This commit is contained in:
parent
18ab4e2c56
commit
52010996a6
@ -765,9 +765,21 @@ def termwidth(repo, ctx, templ, **args):
|
||||
return repo.ui.termwidth()
|
||||
|
||||
@templatekeyword('troubles')
|
||||
def showtroubles(**args):
|
||||
def showtroubles(repo, **args):
|
||||
"""List of strings. Evolution troubles affecting the changeset.
|
||||
|
||||
(DEPRECATED)
|
||||
"""
|
||||
msg = ("'troubles' is deprecated, "
|
||||
"use 'instabilities'")
|
||||
repo.ui.deprecwarn(msg, '4.4')
|
||||
|
||||
return showinstabilities(repo=repo, **args)
|
||||
|
||||
@templatekeyword('instabilities')
|
||||
def showinstabilities(**args):
|
||||
"""List of strings. Evolution instabilities affecting the changeset.
|
||||
|
||||
(EXPERIMENTAL)
|
||||
"""
|
||||
args = pycompat.byteskwargs(args)
|
||||
|
@ -29,7 +29,7 @@ lfile_copies_switch = '{if(file_copies_switch,
|
||||
|
||||
# General templates
|
||||
_trouble_label = 'trouble.{trouble}'
|
||||
_troubles_labels = '{if(troubles, "changeset.troubled {troubles%_trouble_label}")}'
|
||||
_troubles_labels = '{if(instabilities, "changeset.troubled {instabilities%_trouble_label}")}'
|
||||
_obsolete_label = '{if(obsolete, "changeset.obsolete")}'
|
||||
_cset_labels = '{separate(" ", "log.changeset", "changeset.{phase}", "{_obsolete_label}", "{_troubles_labels}")}'
|
||||
cset = '{label("{_cset_labels}",
|
||||
@ -68,8 +68,8 @@ summary = '{if(desc|strip, "{label('log.summary',
|
||||
ldate = '{label("log.date",
|
||||
"date: {date|date}")}\n'
|
||||
|
||||
ltroubles = '{if(troubles, "{label('log.trouble',
|
||||
'trouble: {join(troubles, ", ")}')}\n")}'
|
||||
ltroubles = '{if(instabilities, "{label('log.trouble',
|
||||
'instability: {join(instabilities, ", ")}')}\n")}'
|
||||
|
||||
extra = '{label("ui.debug log.extra",
|
||||
"extra: {key}={value|stringescape}")}\n'
|
||||
|
@ -670,7 +670,7 @@ Use scmutil.cleanupnodes API to create divergence
|
||||
|
||||
$ rm .hg/localtags
|
||||
$ hg cleanup --config extensions.t=$TESTTMP/scmutilcleanup.py
|
||||
$ hg log -G -T '{rev}:{node|short} {desc} {troubles}' -r 'sort(all(), topo)'
|
||||
$ hg log -G -T '{rev}:{node|short} {desc} {instabilities}' -r 'sort(all(), topo)'
|
||||
@ 5:1a2a9b5b0030 B2 content-divergent
|
||||
|
|
||||
| o 4:70d5a63ca112 B4 content-divergent
|
||||
|
@ -3,7 +3,7 @@
|
||||
> # public changeset are not obsolete
|
||||
> publish=false
|
||||
> [ui]
|
||||
> logtemplate="{rev}:{node|short} ({phase}{if(obsolete, ' *{obsolete}*')}{if(troubles, ' {troubles}')}) [{tags} {bookmarks}] {desc|firstline}\n"
|
||||
> logtemplate="{rev}:{node|short} ({phase}{if(obsolete, ' *{obsolete}*')}{if(instabilities, ' {instabilities}')}) [{tags} {bookmarks}] {desc|firstline}\n"
|
||||
> EOF
|
||||
$ mkcommit() {
|
||||
> echo "$1" > "$1"
|
||||
@ -934,7 +934,7 @@ test the default cmdline template
|
||||
changeset: 7:50c51b361e60
|
||||
user: test
|
||||
date: Thu Jan 01 00:00:00 1970 +0000
|
||||
trouble: orphan, phase-divergent
|
||||
instability: orphan, phase-divergent
|
||||
summary: add babar
|
||||
|
||||
$ hg log -T default -r 'obsolete()'
|
||||
|
@ -10,7 +10,7 @@
|
||||
> def process(self, t, map):
|
||||
> tmpl = self.loader(t)
|
||||
> for k, v in map.iteritems():
|
||||
> if k in ('templ', 'ctx', 'repo', 'revcache', 'cache'):
|
||||
> if k in ('templ', 'ctx', 'repo', 'revcache', 'cache', 'troubles'):
|
||||
> continue
|
||||
> if hasattr(v, '__call__'):
|
||||
> v = v(**map)
|
||||
|
Loading…
Reference in New Issue
Block a user