Changeset - 64cb9612f9aa
[Not reviewed]
beta
0 2 0
Marcin Kuzminski - 15 years ago 2011-04-23 14:23:13
marcin@python-works.com
Added show as raw into big diff
2 files changed with 10 insertions and 3 deletions:
0 comments (0 inline, 0 general)
rhodecode/controllers/files.py
Show inline comments
 
@@ -245,6 +245,7 @@ class FilesController(BaseRepoController
 
        c.action = request.GET.get('diff')
 
        c.no_changes = diff1 == diff2
 
        c.f_path = f_path
 
        c.big_diff = False
 

	
 
        try:
 
            if diff1 not in ['', None, 'None', '0' * 12, '0' * 40]:
 
@@ -286,7 +287,8 @@ class FilesController(BaseRepoController
 
                c.cur_diff = _('Binary file')
 
            elif node1.size > self.cut_off_limit or \
 
                    node2.size > self.cut_off_limit:
 
                c.cur_diff = _('Diff is too big to display')
 
                c.cur_diff = ''
 
                c.big_diff = True
 
            else:
 
                diff = differ.DiffProcessor(differ.get_gitdiff(node1, node2),
 
                                        format='gitdiff')
 
@@ -298,13 +300,15 @@ class FilesController(BaseRepoController
 
                c.cur_diff = _('Binary file')
 
            elif node1.size > self.cut_off_limit or \
 
                    node2.size > self.cut_off_limit:
 
                c.cur_diff = _('Diff is too big to display')
 
                c.cur_diff = ''
 
                c.big_diff = True
 

	
 
            else:
 
                diff = differ.DiffProcessor(differ.get_gitdiff(node1, node2),
 
                                        format='gitdiff')
 
                c.cur_diff = diff.as_html()
 

	
 
        if not c.cur_diff:
 
        if not c.cur_diff and not c.big_diff:
 
            c.no_changes = True
 
        return render('files/file_diff.html')
 

	
rhodecode/templates/files/file_diff.html
Show inline comments
 
@@ -38,6 +38,9 @@
 
			<div class="code-body">
 
		 			%if c.no_changes:
 
		            	${_('No changes')}
 
		            %elif c.big_diff:
 
		                ${_('Diff is to big to display')} ${h.link_to(_('raw diff'),
 
                           h.url.current(diff2=c.changeset_2.raw_id,diff1=c.changeset_1.raw_id,diff='raw'))}
 
		            %else:        
 
						${c.cur_diff|n}
 
		            %endif
0 comments (0 inline, 0 general)