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
This commit is contained in:
Boris Feld 2017-08-02 19:02:48 +02:00
parent f45b177d0b
commit 3f7b7eb6a9

View File

@ -221,6 +221,12 @@ class basectx(object):
return self.rev() in obsmod.getrevs(self._repo, 'bumped') return self.rev() in obsmod.getrevs(self._repo, 'bumped')
def divergent(self): 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 """Is a successors of a changeset with multiple possible successors set
Only non-public and non-obsolete changesets may be divergent. Only non-public and non-obsolete changesets may be divergent.
@ -229,7 +235,7 @@ class basectx(object):
def troubled(self): def troubled(self):
"""True if the changeset is either unstable, bumped or divergent""" """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): def troubles(self):
"""Keep the old version around in order to avoid breaking extensions """Keep the old version around in order to avoid breaking extensions
@ -244,7 +250,7 @@ class basectx(object):
troubles.append('orphan') troubles.append('orphan')
if self.bumped(): if self.bumped():
troubles.append('bumped') troubles.append('bumped')
if self.divergent(): if self.contentdivergent():
troubles.append('divergent') troubles.append('divergent')
return troubles return troubles
@ -261,7 +267,7 @@ class basectx(object):
instabilities.append('orphan') instabilities.append('orphan')
if self.bumped(): if self.bumped():
instabilities.append('phase-divergent') instabilities.append('phase-divergent')
if self.divergent(): if self.contentdivergent():
instabilities.append('content-divergent') instabilities.append('content-divergent')
return instabilities return instabilities