Changeset - b3dd9cc3a035
[Not reviewed]
default
0 4 0
Mads Kiilerich - 11 years ago 2014-07-18 18:44:54
madski@unity3d.com
graph: show branch close markers
4 files changed with 23 insertions and 7 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/graphmod.py
Show inline comments
 
@@ -149,5 +149,6 @@ def _colored(repo, dag):
 
                    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
kallithea/lib/vcs/backends/base.py
Show inline comments
 
@@ -663,6 +663,9 @@ class BaseChangeset(object):
 
        data['removed'] = [node.path for node in self.removed]
 
        return data
 

	
 
    @LazyProperty
 
    def closesbranch(self):
 
        return False
 

	
 
class BaseWorkdir(object):
 
    """
kallithea/lib/vcs/backends/hg/changeset.py
Show inline comments
 
@@ -38,6 +38,10 @@ class MercurialChangeset(BaseChangeset):
 
        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())
 

	
kallithea/public/js/graph.js
Show inline comments
 
@@ -36,6 +36,8 @@ function BranchRenderer(canvas_id, conte
 
	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 @@ function BranchRenderer(canvas_id, conte
 
			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 @@ function BranchRenderer(canvas_id, conte
 
			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++;
 
		}
 
				
0 comments (0 inline, 0 general)