Changeset - 67d5afe2fa1a
[Not reviewed]
default
0 3 0
Mads Kiilerich - 12 years ago 2013-12-10 19:30:37
madski@unity3d.com
pull requests: show graph when creating PR
3 files changed with 18 insertions and 3 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/compare.py
Show inline comments
 
@@ -47,6 +47,8 @@ from kallithea.model.db import Repositor
 
from kallithea.lib.diffs import LimitedDiffContainer
 
from kallithea.controllers.changeset import anchor_url, _ignorews_url,\
 
    _context_url, get_line_ctx, get_ignore_ws
 
from kallithea.lib.graphmod import graph_data
 
from kallithea.lib.compat import json
 

	
 
log = logging.getLogger(__name__)
 

	
 
@@ -271,6 +273,12 @@ class CompareController(BaseRepoControll
 
        c.statuses = c.db_repo.statuses(
 
            [x.raw_id for x in c.cs_ranges])
 

	
 
        revs = [ctx.revision for ctx in reversed(c.cs_ranges)]
 
        c.jsdata = json.dumps(graph_data(c.other_repo.scm_instance, revs))
 

	
 
        c.statuses = c.db_repo.statuses([x.raw_id for x in
 
                                                   c.cs_ranges])
 

	
 
        if partial:
 
            return render('compare/compare_cs.html')
 
        if merge and c.ancestor:
kallithea/templates/compare/compare_cs.html
Show inline comments
 
@@ -17,7 +17,7 @@
 
    <div id="graph_content_pr" style="margin-left: 100px;">
 

	
 
    <table class="compare_view_commits noborder">
 
    %for cnt, cs in enumerate(c.cs_ranges):
 
    %for cnt, cs in enumerate(reversed(c.cs_ranges)):
 
        <tr id="chg_${cnt+1}">
 
        <td style="width:50px">
 
          %if cs.raw_id in c.statuses:
 
@@ -79,7 +79,9 @@
 
  %endif
 
</div>
 

	
 
%if not c.as_form:
 
%if c.as_form:
 
<div id="jsdata" style="display:none">${c.jsdata|n}</div>
 
%else:
 
<script type="text/javascript" src="${h.url('/js/graph.js')}"></script>
 
%endif
 

	
kallithea/templates/pullrequests/pullrequest.html
Show inline comments
 
@@ -137,6 +137,7 @@ ${self.repo_context_bar('showpullrequest
 

	
 
</div>
 

	
 
<script type="text/javascript" src="${h.url('/js/graph.js')}"></script>
 
<script type="text/javascript">
 
  var _USERS_AC_DATA = ${c.users_array|n};
 
  var _GROUPS_AC_DATA = ${c.user_groups_array|n};
 
@@ -202,7 +203,11 @@ ${self.repo_context_bar('showpullrequest
 
      }
 

	
 
      YUD.get('pull_request_overview').innerHTML = "${_('Loading ...')}";
 
      ypjax(url,'pull_request_overview');
 
      ypjax(url,'pull_request_overview', function(o){
 
          var jsdata = eval('('+YUD.get('jsdata').innerHTML+')');
 
          var r = new BranchRenderer('graph_canvas', 'graph_content_pr');
 
          r.render(jsdata,100);
 
      });
 
  }
 

	
 
  ## refresh automatically when something changes (org_repo can't change)
0 comments (0 inline, 0 general)