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 21 insertions and 5 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/graphmod.py
Show inline comments
 
@@ -146,8 +146,9 @@ def _colored(repo, dag):
 
                edges.append((ecol, nextrow.index(ep), colors[ep]))
 
            elif ep == rev:
 
                for p in dagparents:
 
                    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
 
@@ -660,12 +660,15 @@ class BaseChangeset(object):
 
        data['author'] = {'name': self.author_name, 'email': self.author_email}
 
        data['added'] = [node.path for node in self.added]
 
        data['changed'] = [node.path for node in self.changed]
 
        data['removed'] = [node.path for node in self.removed]
 
        return data
 

	
 
    @LazyProperty
 
    def closesbranch(self):
 
        return False
 

	
 
class BaseWorkdir(object):
 
    """
 
    Working directory representation of single repository.
 

	
 
    :attribute: repository: repository object of working directory
kallithea/lib/vcs/backends/hg/changeset.py
Show inline comments
 
@@ -35,12 +35,16 @@ class MercurialChangeset(BaseChangeset):
 

	
 
    @LazyProperty
 
    def branch(self):
 
        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())
 

	
 
    @LazyProperty
 
    def message(self):
 
        return safe_unicode(self._ctx.description())
kallithea/public/js/graph.js
Show inline comments
 
@@ -33,12 +33,14 @@ function BranchRenderer(canvas_id, conte
 
	this.ctx = this.canvas.getContext('2d');
 
	this.ctx.strokeStyle = 'rgb(0, 0, 0)';
 
	this.ctx.fillStyle = 'rgb(0, 0, 0)';
 
	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;
 
		var red = (colors[color][0] * fg) || bg;
 
		var green = (colors[color][1] * fg) || bg;
 
		var blue = (colors[color][2] * fg) || bg;
 
@@ -83,12 +85,13 @@ function BranchRenderer(canvas_id, conte
 
			var	next = document.getElementById("chg_"+(idx+1));
 
			var extra = 0;
 
			
 
			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;
 

	
 
			for (var j in in_l) {
 
				line = in_l[j];
 
@@ -153,20 +156,25 @@ function BranchRenderer(canvas_id, conte
 
				this.ctx.stroke();
 
			}
 
			
 
			column = node[0];
 
			color = node[1];
 
			
 
			radius = this.dot_radius;
 

	
 
			x = base_x - box_size * column;
 
		
 
			this.setColor(color, 0.25, 0.75);
 
			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.setColor(color, 0.25, 0.75);
 
			this.ctx.arc(x, rowY, radius, 0, Math.PI * 2, true);
 
				this.ctx.arc(x, rowY, this.dot_radius, 0, Math.PI * 2, true);
 
			this.ctx.fill();
 
			}
 
			
 
			idx++;
 
		}
 
				
 
	}
 

	
0 comments (0 inline, 0 general)