diff --git a/kallithea/lib/vcs/backends/hg/changeset.py b/kallithea/lib/vcs/backends/hg/changeset.py --- a/kallithea/lib/vcs/backends/hg/changeset.py +++ b/kallithea/lib/vcs/backends/hg/changeset.py @@ -16,6 +16,7 @@ from kallithea.lib.vcs.utils.lazy import from kallithea.lib.vcs.utils.paths import get_dirs_for_path from kallithea.lib.vcs.utils.hgcompat import archival, hex +from mercurial import obsolete class MercurialChangeset(BaseChangeset): """ @@ -47,6 +48,16 @@ class MercurialChangeset(BaseChangeset): return self._ctx.obsolete() @LazyProperty + def successors(self): + successors = obsolete.successorssets(self._ctx._repo, self._ctx.node()) + if successors: + # flatten the list here handles both divergent (len > 1) + # and the usual case (len = 1) + successors = [hex(n)[:12] for sub in successors for n in sub if n != self._ctx.node()] + + return successors + + @LazyProperty def bookmarks(self): return map(safe_unicode, self._ctx.bookmarks())