Patchwork D240: context: rename divergent into contentdivergent

login
register
mail settings
Submitter phabricator
Date Aug. 8, 2017, 9:33 a.m.
Message ID <975baf6d091a4542f763b6732af19ba0@localhost.localdomain>
Download mbox | patch
Permalink /patch/22741/
State Not Applicable
Headers show

Comments

phabricator - Aug. 8, 2017, 9:33 a.m.
lothiraldan updated this revision to Diff 621.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D240?vs=585&id=621

REVISION DETAIL
  https://phab.mercurial-scm.org/D240

AFFECTED FILES
  mercurial/context.py

CHANGE DETAILS




To: lothiraldan, #hg-reviewers, indygreg
Cc: indygreg, mercurial-devel

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -221,15 +221,21 @@ 
         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.
         """
         return self.rev() in obsmod.getrevs(self._repo, 'divergent')
 
     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