[PATCH 08 of 10 V4] context: add a `bumped` method to `changectx`

Pierre-Yves David pierre-yves.david at ens-lyon.org
Thu Oct 18 17:52:31 CDT 2012


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at logilab.fr>
# Date 1350600224 -7200
# Node ID 692654d6a957fa40d31e5726723da78a5f6f1965
# Parent  214836ce791dc88164426fe1d3ef272b74d929f5
context: add a `bumped` method to `changectx`

Same as `unstable()`, returns true if the changeset is bumped.

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -243,6 +243,13 @@
         """True if the changeset is not obsolete but it's ancestor are"""
         return self.rev() in obsmod.getrevs(self._repo, 'unstable')
 
+    def bumped(self):
+        """True if the changeset try to be a successor of a public changeset
+
+        Only non-public and non-obsolete changesets may be bumped.
+        """
+        return self.rev() in obsmod.getrevs(self._repo, 'bumped')
+
     def _fileinfo(self, path):
         if '_manifest' in self.__dict__:
             try:


More information about the Mercurial-devel mailing list