Changeset - 25d77aef2729
[Not reviewed]
beta
0 3 0
Marcin Kuzminski - 13 years ago 2012-11-17 17:14:02
marcin@python-works.com
Optimized look of compare view of changesets.
Added cut off limit for compare view
3 files changed with 18 insertions and 4 deletions:
0 comments (0 inline, 0 general)
rhodecode/controllers/compare.py
Show inline comments
 
@@ -41,6 +41,7 @@ from rhodecode.model.db import Repositor
 
from rhodecode.model.pull_request import PullRequestModel
 
from webob.exc import HTTPBadRequest
 
from rhodecode.lib.utils2 import str2bool
 
from rhodecode.lib.diffs import LimitedDiffContainer
 

	
 
log = logging.getLogger(__name__)
 

	
 
@@ -88,6 +89,7 @@ class CompareController(BaseRepoControll
 
        other_ref = (other_ref_type, other_ref)
 
        other_repo = request.GET.get('repo', org_repo)
 
        bundle_compare = str2bool(request.GET.get('bundle', True))
 
        c.fulldiff = fulldiff = request.GET.get('fulldiff')
 

	
 
        c.swap_url = h.url('compare_url', repo_name=other_repo,
 
              org_ref_type=other_ref[0], org_ref=other_ref[1],
 
@@ -138,9 +140,15 @@ class CompareController(BaseRepoControll
 

	
 
        _diff = diffs.differ(other_repo, other_ref, org_repo, org_ref,
 
                             discovery_data, bundle_compare=bundle_compare)
 
        diff_processor = diffs.DiffProcessor(_diff, format='gitdiff')
 
        diff_limit = self.cut_off_limit if not fulldiff else None
 
        diff_processor = diffs.DiffProcessor(_diff, format='gitdiff',
 
                                             diff_limit=diff_limit)
 
        _parsed = diff_processor.prepare()
 

	
 
        c.limited_diff = False
 
        if isinstance(_parsed, LimitedDiffContainer):
 
            c.limited_diff = True
 

	
 
        c.files = []
 
        c.changes = {}
 

	
rhodecode/templates/compare/compare_cs.html
Show inline comments
 
@@ -18,10 +18,11 @@
 
        %endif
 
        </td>
 
        <td><div class="author">${h.person(cs.author)}</div></td>
 
        <td><span class="tooltip" title="${h.age(cs.date)}">${cs.date}</span></td>
 
        <td><div class="message">${h.urlify_commit(h.wrap_paragraphs(cs.message),c.repo_name)}</div></td>
 
        <td><span class="tooltip" title="${h.tooltip(h.age(cs.date))}">${cs.date}</span></td>
 
        <td><div class="message tooltip" title="${h.tooltip(cs.message)}" style="white-space:normal">${h.urlify_commit(h.shorter(cs.message, 60),c.repo_name)}</div></td>
 
        </tr>
 
    %endfor
 

	
 
  %endif
 
  </table>
 
</div>
rhodecode/templates/compare/compare_diff.html
Show inline comments
 
@@ -47,6 +47,9 @@
 
                  </div>
 
              %endfor
 
            </div>
 
            % if c.limited_diff:
 
              <h5>${_('Changeset was too big and was cut off...')}</h5>
 
            % endif            
 
        </div>
 
    </div>
 

	
 
@@ -55,7 +58,9 @@
 
    %for fid, change, f, stat in c.files:
 
      ${diff_block.diff_block_simple([c.changes[fid]])}
 
    %endfor
 

	
 
    % if c.limited_diff:
 
      <h4>${_('Changeset was too big and was cut off...')}</h4>
 
    % endif
 
     <script type="text/javascript">
 

	
 
      YUE.onDOMReady(function(){
0 comments (0 inline, 0 general)