[PATCH 5 of 6 V2] obsolete: add a divergent method on context

pierre-yves.david at logilab.fr pierre-yves.david at logilab.fr
Thu Dec 13 08:51:52 CST 2012


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at logilab.fr>
# Date 1355278849 -3600
# Node ID 9e67354122fb75431540389c35c50ba35690d9e2
# Parent  9c04c46919d1bef1e6daa813f3a59bd56a421608
obsolete: add a divergent method on context

The same we have `unstable` and `bumped`. Convenient method to access troubles
information in general may land later.

This get actual use and testing in the next changesets.

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -251,10 +251,17 @@ class changectx(object):
 
         Only non-public and non-obsolete changesets may be bumped.
         """
         return self.rev() in obsmod.getrevs(self._repo, 'bumped')
 
+    def divergent(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 _fileinfo(self, path):
         if '_manifest' in self.__dict__:
             try:
                 return self._manifest[path], self._manifest.flags(path)
             except KeyError:


More information about the Mercurial-devel mailing list