# HG changeset patch # User Mads Kiilerich # Date 2020-03-26 17:35:43 # Node ID 86f22a1fe48ca12d4dc540ce5edda95c655d5968 # Parent 6056c0e8244f511581bd00362c5014249d7d1c18 py3: vcs should return successors and predecessors short hashes as strings 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 @@ -76,16 +76,13 @@ class MercurialChangeset(BaseChangeset): @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):