# HG changeset patch # User Sean Farley # Date 1406666807 18000 # Node ID 78907d9989d6615a2c40ff9a7707b457d0fa7e71 # Parent 8737030a955056f728c580431461bfe7254a1651 changeset: add precursors method for hg backend diff -r 8737030a9550 -r 78907d9989d6 kallithea/lib/vcs/backends/hg/changeset.py --- a/kallithea/lib/vcs/backends/hg/changeset.py Tue Jul 29 16:15:50 2014 -0500 +++ b/kallithea/lib/vcs/backends/hg/changeset.py Tue Jul 29 15:46:47 2014 -0500 @@ -58,6 +58,16 @@ return successors @LazyProperty + def precursors(self): + precursors = set() + nm = self._ctx._repo.changelog.nodemap + for p in self._ctx._repo.obsstore.precursors.get(self._ctx.node(), ()): + pr = nm.get(p[0]) + if pr is not None: + precursors.add(hex(p[0])[:12]) + return precursors + + @LazyProperty def bookmarks(self): return map(safe_unicode, self._ctx.bookmarks())