# HG changeset patch # User Mads Kiilerich # Date 1405701894 -7200 # Node ID b3dd9cc3a035369776122668971390eff559e02b # Parent 493f5f62be1898276596ee248c74bf0c7f2de548 graph: show branch close markers diff -r 493f5f62be18 -r b3dd9cc3a035 kallithea/lib/graphmod.py --- a/kallithea/lib/graphmod.py Mon Dec 23 11:27:35 2013 +0200 +++ b/kallithea/lib/graphmod.py Fri Jul 18 18:44:54 2014 +0200 @@ -149,5 +149,6 @@ edges.append((ecol, nextrow.index(p), colors[p])) # Yield and move on - yield ((col, color), edges) + closing = int(repo[rev].closesbranch) + yield ((col, color), edges, closing) row = nextrow diff -r 493f5f62be18 -r b3dd9cc3a035 kallithea/lib/vcs/backends/base.py --- a/kallithea/lib/vcs/backends/base.py Mon Dec 23 11:27:35 2013 +0200 +++ b/kallithea/lib/vcs/backends/base.py Fri Jul 18 18:44:54 2014 +0200 @@ -663,6 +663,9 @@ data['removed'] = [node.path for node in self.removed] return data + @LazyProperty + def closesbranch(self): + return False class BaseWorkdir(object): """ diff -r 493f5f62be18 -r b3dd9cc3a035 kallithea/lib/vcs/backends/hg/changeset.py --- a/kallithea/lib/vcs/backends/hg/changeset.py Mon Dec 23 11:27:35 2013 +0200 +++ b/kallithea/lib/vcs/backends/hg/changeset.py Fri Jul 18 18:44:54 2014 +0200 @@ -38,6 +38,10 @@ return safe_unicode(self._ctx.branch()) @LazyProperty + def closesbranch(self): + return self._ctx.closesbranch() + + @LazyProperty def bookmarks(self): return map(safe_unicode, self._ctx.bookmarks()) diff -r 493f5f62be18 -r b3dd9cc3a035 kallithea/public/js/graph.js --- a/kallithea/public/js/graph.js Mon Dec 23 11:27:35 2013 +0200 +++ b/kallithea/public/js/graph.js Fri Jul 18 18:44:54 2014 +0200 @@ -36,6 +36,8 @@ this.cur = [0, 0]; this.line_width = 2.0; this.dot_radius = 3.5; + this.close_x = 1.5 * this.dot_radius; + this.close_y = 0.5 * this.dot_radius; this.calcColor = function(color, bg, fg) { color %= colors.length; @@ -86,6 +88,7 @@ cur = data[i]; node = cur[0]; in_l = cur[1]; + closing = cur[2]; var rowY = row.offsetTop + row.offsetHeight/2 - rela.offsetTop; var nextY = (next == null) ? rowY + row.offsetHeight/2 : next.offsetTop + next.offsetHeight/2 - rela.offsetTop; @@ -156,15 +159,20 @@ column = node[0]; color = node[1]; - radius = this.dot_radius; - x = base_x - box_size * column; - this.ctx.beginPath(); this.setColor(color, 0.25, 0.75); - this.ctx.arc(x, rowY, radius, 0, Math.PI * 2, true); - this.ctx.fill(); - + if (closing) + { + this.ctx.fillRect(x - this.close_x, rowY - this.close_y, 2*this.close_x, 2*this.close_y); + } + else + { + this.ctx.beginPath(); + this.ctx.arc(x, rowY, this.dot_radius, 0, Math.PI * 2, true); + this.ctx.fill(); + } + idx++; }