mercurial/context.py
changeset 33726 ab0c55c2ad9a
parent 33689 9c27a2891b75
child 33727 f163edb45c47
equal deleted inserted replaced
33725:86ea201eaeb9 33726:ab0c55c2ad9a
   224     def troubled(self):
   224     def troubled(self):
   225         """True if the changeset is either unstable, bumped or divergent"""
   225         """True if the changeset is either unstable, bumped or divergent"""
   226         return self.unstable() or self.bumped() or self.divergent()
   226         return self.unstable() or self.bumped() or self.divergent()
   227 
   227 
   228     def troubles(self):
   228     def troubles(self):
   229         """return the list of troubles affecting this changesets.
   229         """Keep the old version around in order to avoid breaking extensions
   230 
   230         about different return values.
   231         Troubles are returned as strings. possible values are:
   231         """
       
   232         msg = ("'context.troubles' is deprecated, "
       
   233                "use 'context.instabilities'")
       
   234         self._repo.ui.deprecwarn(msg, '4.4')
       
   235 
       
   236         troubles = []
       
   237         if self.unstable():
       
   238             troubles.append('orphan')
       
   239         if self.bumped():
       
   240             troubles.append('bumped')
       
   241         if self.divergent():
       
   242             troubles.append('divergent')
       
   243         return troubles
       
   244 
       
   245     def instabilities(self):
       
   246         """return the list of instabilities affecting this changeset.
       
   247 
       
   248         Instabilities are returned as strings. possible values are:
   232         - orphan,
   249         - orphan,
   233         - phase-divergent,
   250         - phase-divergent,
   234         - content-divergent.
   251         - content-divergent.
   235         """
   252         """
   236         troubles = []
   253         instabilities = []
   237         if self.unstable():
   254         if self.unstable():
   238             troubles.append('orphan')
   255             instabilities.append('orphan')
   239         if self.bumped():
   256         if self.bumped():
   240             troubles.append('phase-divergent')
   257             instabilities.append('phase-divergent')
   241         if self.divergent():
   258         if self.divergent():
   242             troubles.append('content-divergent')
   259             instabilities.append('content-divergent')
   243         return troubles
   260         return instabilities
   244 
   261 
   245     def parents(self):
   262     def parents(self):
   246         """return contexts for each parent changeset"""
   263         """return contexts for each parent changeset"""
   247         return self._parents
   264         return self._parents
   248 
   265