[PATCH 2 of 8] context: drop deprecated methods (API)
Matt Harbison
mharbison72 at gmail.com
Sat Feb 3 01:34:58 EST 2018
# HG changeset patch
# User Matt Harbison <matt_harbison at yahoo.com>
# Date 1517632050 18000
# Fri Feb 02 23:27:30 2018 -0500
# Node ID 76b26c09b25612513ae567b62473c634ce8c27cb
# Parent d293af8e5a4a48a38ff9103e129c1af5719081c1
context: drop deprecated methods (API)
.. api::
The following deprecated methods have been removed from context, with
replacements:
- unstable() -> orphan()
- bumped() -> phasedivergent()
- divergent() -> contentdivergent()
- troubled() -> isunstable()
- troubles() -> instabilities()
diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -206,22 +206,10 @@
"""True if the changeset is extinct"""
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, 'orphan')
- def bumped(self):
- msg = ("'context.bumped' is deprecated, "
- "use 'context.phasedivergent'")
- self._repo.ui.deprecwarn(msg, '4.4')
- return self.phasedivergent()
-
def phasedivergent(self):
"""True if the changeset try to be a successor of a public changeset
@@ -229,12 +217,6 @@
"""
return self.rev() in obsmod.getrevs(self._repo, 'phasedivergent')
- def divergent(self):
- msg = ("'context.divergent' is deprecated, "
- "use 'context.contentdivergent'")
- self._repo.ui.deprecwarn(msg, '4.4')
- return self.contentdivergent()
-
def contentdivergent(self):
"""Is a successors of a changeset with multiple possible successors set
@@ -242,33 +224,10 @@
"""
return self.rev() in obsmod.getrevs(self._repo, 'contentdivergent')
- def troubled(self):
- msg = ("'context.troubled' is deprecated, "
- "use 'context.isunstable'")
- self._repo.ui.deprecwarn(msg, '4.4')
- return self.isunstable()
-
def isunstable(self):
"""True if the changeset is either unstable, bumped or divergent"""
return self.orphan() or self.phasedivergent() or self.contentdivergent()
- def troubles(self):
- """Keep the old version around in order to avoid breaking extensions
- about different return values.
- """
- msg = ("'context.troubles' is deprecated, "
- "use 'context.instabilities'")
- self._repo.ui.deprecwarn(msg, '4.4')
-
- troubles = []
- if self.orphan():
- troubles.append('orphan')
- if self.phasedivergent():
- troubles.append('bumped')
- if self.contentdivergent():
- troubles.append('divergent')
- return troubles
-
def instabilities(self):
"""return the list of instabilities affecting this changeset.
More information about the Mercurial-devel
mailing list