Changeset - 86f22a1fe48c
[Not reviewed]
default
0 1 0
Mads Kiilerich - 6 years ago 2020-03-26 17:35:43
mads@kiilerich.com
Grafted from: 30893bd17e7b
py3: vcs should return successors and predecessors short hashes as strings
1 file changed with 4 insertions and 7 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/vcs/backends/hg/changeset.py
Show inline comments
 
@@ -67,34 +67,31 @@ class MercurialChangeset(BaseChangeset):
 
    @LazyProperty
 
    def phase(self):
 
        if(self._ctx.phase() == 1):
 
            return 'Draft'
 
        elif(self._ctx.phase() == 2):
 
            return 'Secret'
 
        else:
 
            return ''
 

	
 
    @LazyProperty
 
    def successors(self):
 
        successors = mercurial.obsutil.successorssets(self._ctx._repo, self._ctx.node(), closest=True)
 
        if successors:
 
            # flatten the list here handles both divergent (len > 1)
 
            # and the usual case (len = 1)
 
            successors = [mercurial.node.hex(n)[:12] for sub in successors for n in sub if n != self._ctx.node()]
 

	
 
        return successors
 
        # flatten the list here handles both divergent (len > 1)
 
        # and the usual case (len = 1)
 
        return [safe_str(mercurial.node.hex(n)[:12]) for sub in successors for n in sub if n != self._ctx.node()]
 

	
 
    @LazyProperty
 
    def predecessors(self):
 
        return [mercurial.node.hex(n)[:12] for n in mercurial.obsutil.closestpredecessors(self._ctx._repo, self._ctx.node())]
 
        return [safe_str(mercurial.node.hex(n)[:12]) for n in mercurial.obsutil.closestpredecessors(self._ctx._repo, self._ctx.node())]
 

	
 
    @LazyProperty
 
    def bookmarks(self):
 
        return [safe_str(bookmark) for bookmark in self._ctx.bookmarks()]
 

	
 
    @LazyProperty
 
    def message(self):
 
        return safe_str(self._ctx.description())
 

	
 
    @LazyProperty
 
    def committer(self):
 
        return safe_str(self.author)
0 comments (0 inline, 0 general)