changeset 8306:86f22a1fe48c

py3: vcs should return successors and predecessors short hashes as strings
author Mads Kiilerich <mads@kiilerich.com>
date Thu, 26 Mar 2020 17:35:43 +0100
parents 6056c0e8244f
children e965ff6f8cb3
files kallithea/lib/vcs/backends/hg/changeset.py
diffstat 1 files changed, 4 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- 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):