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

login
register
mail settings
Submitter Pierre-Yves David
Date Dec. 13, 2012, 2:51 p.m.
Message ID <9e67354122fb75431540.1355410312@crater1.logilab.fr>
Download mbox | patch
Permalink /patch/79/
State Accepted
Commit 03604f46d48a8380f63fd803662c8ba13d7ab27d
Headers show

Comments

Pierre-Yves David - Dec. 13, 2012, 2:51 p.m.
# 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.

Patch

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: