From 3f7b7eb6a9e80caa02781243d2b8148cce636dbc Mon Sep 17 00:00:00 2001 From: Boris Feld Date: Wed, 2 Aug 2017 19:02:48 +0200 Subject: [PATCH] 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 --- mercurial/context.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/mercurial/context.py b/mercurial/context.py index dbb20a3d2f..c79433c227 100644 --- a/mercurial/context.py +++ b/mercurial/context.py @@ -221,6 +221,12 @@ class basectx(object): 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 @@ class basectx(object): 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 @@ class basectx(object): troubles.append('orphan') if self.bumped(): troubles.append('bumped') - if self.divergent(): + if self.contentdivergent(): troubles.append('divergent') return troubles @@ -261,7 +267,7 @@ class basectx(object): instabilities.append('orphan') if self.bumped(): instabilities.append('phase-divergent') - if self.divergent(): + if self.contentdivergent(): instabilities.append('content-divergent') return instabilities