# HG changeset patch # User Pierre-Yves.David@ens-lyon.org # Date 2012-06-05 23:56:58 # Node ID 75f4180509a473db613e3af569fa8cfc641b5152 # Parent 28ed1c4511ce03768f70b10b6389ec5f8a453426 obsolete: function and method to access some obsolete data An `obsolete` boolean property is added to changeset context. Function to get obsolete marker object from a changeset context are added to the obsolete module. diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -230,6 +230,10 @@ class changectx(object): for d in self._repo.changelog.descendants([self._rev]): yield changectx(self._repo, d) + def obsolete(self): + """True if the changeset is obsolete""" + return self.node() in self._repo.obsstore.obsoleted + def _fileinfo(self, path): if '_manifest' in self.__dict__: try: diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py --- a/mercurial/obsolete.py +++ b/mercurial/obsolete.py @@ -267,3 +267,13 @@ def allmarkers(repo): for markerdata in repo.obsstore: yield marker(repo, markerdata) +def precursormarkers(ctx): + """obsolete marker making this changeset obsolete""" + for data in ctx._repo.obsstore.precursors.get(ctx.node(), ()): + yield marker(ctx._repo, data) + +def successormarkers(ctx): + """obsolete marker marking this changeset as a successors""" + for data in ctx._repo.obsstore.successors.get(ctx.node(), ()): + yield marker(ctx._repo, data) +