Changeset - 78907d9989d6
[Not reviewed]
default
0 1 0
Sean Farley - 11 years ago 2014-07-29 22:46:47
sean.michael.farley@gmail.com
changeset: add precursors method for hg backend
1 file changed with 10 insertions and 0 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/vcs/backends/hg/changeset.py
Show inline comments
 
@@ -55,12 +55,22 @@ class MercurialChangeset(BaseChangeset):
 
            # 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 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())
 

	
 
    @LazyProperty
 
    def message(self):
 
        return safe_unicode(self._ctx.description())
0 comments (0 inline, 0 general)