[PATCH 8 of 9 V2] context: add a bumped attributes for changectx

pierre-yves.david at logilab.fr pierre-yves.david at logilab.fr
Mon Oct 15 07:46:22 CDT 2012


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at logilab.fr>
# Date 1350304661 -7200
# Node ID cee33960e42e7193e07ce6080ca6c2f27e9352e8
# Parent  327931aebaab5b274af5f8b7cab9a4204a8c0f4e
context: add a bumped attributes for 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
@@ -241,10 +241,17 @@ class changectx(object):
 
     def unstable(self):
         """True if the changeset is not obsolete but it's ancestor are"""
         return self.rev() in obsmod.getobscache(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.getobscache(self._repo, 'bumped')
+
     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