changeset 33727:f163edb45c47

context: rename unstable into orphan Rename unstable context method into orphan and add a deprecation warning on unstable. Only update all callers to keep the patch straightforward. The renaming is done according to https://www.mercurial-scm.org/wiki/CEDVocabulary. Differential Revision: https://phab.mercurial-scm.org/D239
author Boris Feld <boris.feld@octobus.net>
date Wed, 02 Aug 2017 18:50:32 +0200
parents ab0c55c2ad9a
children 8b2d7684407b
files mercurial/context.py
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/context.py	Wed Aug 02 18:34:39 2017 +0200
+++ b/mercurial/context.py	Wed Aug 02 18:50:32 2017 +0200
@@ -204,6 +204,12 @@
         return self.rev() in obsmod.getrevs(self._repo, 'extinct')
 
     def unstable(self):
+        msg = ("'context.unstable' is deprecated, "
+               "use 'context.orphan'")
+        self._repo.ui.deprecwarn(msg, '4.4')
+        return self.orphan()
+
+    def orphan(self):
         """True if the changeset is not obsolete but it's ancestor are"""
         return self.rev() in obsmod.getrevs(self._repo, 'unstable')
 
@@ -223,7 +229,7 @@
 
     def troubled(self):
         """True if the changeset is either unstable, bumped or divergent"""
-        return self.unstable() or self.bumped() or self.divergent()
+        return self.orphan() or self.bumped() or self.divergent()
 
     def troubles(self):
         """Keep the old version around in order to avoid breaking extensions
@@ -234,7 +240,7 @@
         self._repo.ui.deprecwarn(msg, '4.4')
 
         troubles = []
-        if self.unstable():
+        if self.orphan():
             troubles.append('orphan')
         if self.bumped():
             troubles.append('bumped')
@@ -251,7 +257,7 @@
         - content-divergent.
         """
         instabilities = []
-        if self.unstable():
+        if self.orphan():
             instabilities.append('orphan')
         if self.bumped():
             instabilities.append('phase-divergent')