context: rename divergent into contentdivergent
Rename divergent context method into contentdivergent and add a deprecation
warning on divergent.
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/D240
--- a/mercurial/context.py Wed Aug 02 18:50:32 2017 +0200
+++ b/mercurial/context.py Wed Aug 02 19:02:48 2017 +0200
@@ -221,6 +221,12 @@
return self.rev() in obsmod.getrevs(self._repo, 'bumped')
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
Only non-public and non-obsolete changesets may be divergent.
@@ -229,7 +235,7 @@
def troubled(self):
"""True if the changeset is either unstable, bumped or divergent"""
- return self.orphan() or self.bumped() or self.divergent()
+ return self.orphan() or self.bumped() or self.contentdivergent()
def troubles(self):
"""Keep the old version around in order to avoid breaking extensions
@@ -244,7 +250,7 @@
troubles.append('orphan')
if self.bumped():
troubles.append('bumped')
- if self.divergent():
+ if self.contentdivergent():
troubles.append('divergent')
return troubles
@@ -261,7 +267,7 @@
instabilities.append('orphan')
if self.bumped():
instabilities.append('phase-divergent')
- if self.divergent():
+ if self.contentdivergent():
instabilities.append('content-divergent')
return instabilities