Mercurial > kallithea
changeset 4348:b3dd9cc3a035
graph: show branch close markers
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Fri, 18 Jul 2014 18:44:54 +0200 |
parents | 493f5f62be18 |
children | f2194318b462 |
files | kallithea/lib/graphmod.py kallithea/lib/vcs/backends/base.py kallithea/lib/vcs/backends/hg/changeset.py kallithea/public/js/graph.js |
diffstat | 4 files changed, 23 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- 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
--- 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): """
--- 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())
--- 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++; }