Patchwork D240: context: rename divergent into contentdivergent

login
register
mail settings
Submitter phabricator
Date Aug. 7, 2017, 10:08 a.m.
Message ID <differential-rev-PHID-DREV-7rc7v66cqzmt5nru6noz-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/22701/
State Superseded
Headers show

Comments

phabricator - Aug. 7, 2017, 10:08 a.m.
lothiraldan created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/context.py

CHANGE DETAILS




To: lothiraldan, #hg-reviewers
Cc: mercurial-devel
phabricator - Aug. 8, 2017, 4:39 a.m.
indygreg requested changes to this revision.
indygreg added inline comments.
This revision now requires changes to proceed.

INLINE COMMENTS

> context.py:227
> +        self._repo.ui.deprecwarn(msg, '4.4')
> +        return self.orphan()
> +

This should be `self.contentdivergent()` no?

REPOSITORY
  rHG Mercurial

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

To: lothiraldan, #hg-reviewers, indygreg
Cc: indygreg, mercurial-devel
phabricator - Aug. 8, 2017, 9:09 a.m.
lothiraldan added inline comments.

INLINE COMMENTS

> indygreg wrote in context.py:227
> This should be `self.contentdivergent()` no?

Damn it you are right, good catch!

REPOSITORY
  rHG Mercurial

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

To: lothiraldan, #hg-reviewers, indygreg
Cc: indygreg, mercurial-devel
phabricator - Aug. 8, 2017, 9:37 a.m.
lothiraldan added inline comments.

INLINE COMMENTS

> lothiraldan wrote in context.py:227
> Damn it you are right, good catch!

Sorry for the tone of my comment, I was only angry against myself, I thought I have fixed this code too many times due to merge conflicts.

REPOSITORY
  rHG Mercurial

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

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.orphan()
+
+    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