comparison mercurial/cmdutil.py @ 33726:ab0c55c2ad9a

context: rename troubles into instabilities Rename troubles context method into instabilities. Copy the old troubles method and add a deprecation warning. This way extensions calling troubles will see the deprecation warning but will not break due to new return values. The renaming is done according to https://www.mercurial-scm.org/wiki/CEDVocabulary. Differential Revision: https://phab.mercurial-scm.org/D238
author Boris Feld <boris.feld@octobus.net>
date Wed, 02 Aug 2017 18:34:39 +0200
parents 93422d0068f8
children 52c5ff856b49
comparison
equal deleted inserted replaced
33725:86ea201eaeb9 33726:ab0c55c2ad9a
1464 labels = ['log.changeset', 'changeset.%s' % ctx.phasestr()] 1464 labels = ['log.changeset', 'changeset.%s' % ctx.phasestr()]
1465 if ctx.obsolete(): 1465 if ctx.obsolete():
1466 labels.append('changeset.obsolete') 1466 labels.append('changeset.obsolete')
1467 if ctx.troubled(): 1467 if ctx.troubled():
1468 labels.append('changeset.troubled') 1468 labels.append('changeset.troubled')
1469 for trouble in ctx.troubles(): 1469 for instability in ctx.instabilities():
1470 labels.append('trouble.%s' % trouble) 1470 labels.append('trouble.%s' % instability)
1471 return ' '.join(labels) 1471 return ' '.join(labels)
1472 1472
1473 class changeset_printer(object): 1473 class changeset_printer(object):
1474 '''show changeset information when templating not requested.''' 1474 '''show changeset information when templating not requested.'''
1475 1475
1577 self.ui.write(_("date: %s\n") % date, 1577 self.ui.write(_("date: %s\n") % date,
1578 label='log.date') 1578 label='log.date')
1579 1579
1580 if ctx.troubled(): 1580 if ctx.troubled():
1581 # i18n: column positioning for "hg log" 1581 # i18n: column positioning for "hg log"
1582 self.ui.write(_("instability: %s\n") % ', '.join(ctx.troubles()), 1582 instabilities = ctx.instabilities()
1583 self.ui.write(_("instability: %s\n") % ', '.join(instabilities),
1583 label='log.trouble') 1584 label='log.trouble')
1584 1585
1585 self._exthook(ctx) 1586 self._exthook(ctx)
1586 1587
1587 if self.ui.debugflag: 1588 if self.ui.debugflag: