# HG changeset patch # User Mads Kiilerich # Date 1585240543 -3600 # Node ID 86f22a1fe48ca12d4dc540ce5edda95c655d5968 # Parent 6056c0e8244f511581bd00362c5014249d7d1c18 py3: vcs should return successors and predecessors short hashes as strings diff -r 6056c0e8244f -r 86f22a1fe48c kallithea/lib/vcs/backends/hg/changeset.py --- a/kallithea/lib/vcs/backends/hg/changeset.py Sun Mar 22 23:05:36 2020 +0100 +++ b/kallithea/lib/vcs/backends/hg/changeset.py Thu Mar 26 17:35:43 2020 +0100 @@ -76,16 +76,13 @@ @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):