comparison mercurial/context.py @ 17832:82f1fe0308bd

context: add a `bumped` method to `changectx` Same as `unstable()`, returns true if the changeset is bumped.
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Fri, 19 Oct 2012 00:43:44 +0200
parents 3cc06457f15e
children aba3c161bcc6
comparison
equal deleted inserted replaced
17831:70b08df24fef 17832:82f1fe0308bd
241 241
242 def unstable(self): 242 def unstable(self):
243 """True if the changeset is not obsolete but it's ancestor are""" 243 """True if the changeset is not obsolete but it's ancestor are"""
244 return self.rev() in obsmod.getrevs(self._repo, 'unstable') 244 return self.rev() in obsmod.getrevs(self._repo, 'unstable')
245 245
246 def bumped(self):
247 """True if the changeset try to be a successor of a public changeset
248
249 Only non-public and non-obsolete changesets may be bumped.
250 """
251 return self.rev() in obsmod.getrevs(self._repo, 'bumped')
252
246 def _fileinfo(self, path): 253 def _fileinfo(self, path):
247 if '_manifest' in self.__dict__: 254 if '_manifest' in self.__dict__:
248 try: 255 try:
249 return self._manifest[path], self._manifest.flags(path) 256 return self._manifest[path], self._manifest.flags(path)
250 except KeyError: 257 except KeyError: