Changeset - 031152a540c5
[Not reviewed]
default
0 1 0
Marcin Kuzminski - 15 years ago 2010-07-14 18:15:37
marcin@python-works.com
Bugfix for empty diff
1 file changed with 2 insertions and 0 deletions:
0 comments (0 inline, 0 general)
pylons_app/controllers/files.py
Show inline comments
 
@@ -173,24 +173,26 @@ class FilesController(BaseController):
 
            response.content_type = 'text/plain'
 
            response.content_disposition = 'attachment; filename=%s' \
 
                                                    % diff_name             
 
            return diff.raw_diff()
 
        
 
        elif c.action == 'raw':
 
            c.cur_diff = '<pre class="raw">%s</pre>' % h.escape(diff.raw_diff())
 
        elif c.action == 'diff':
 
            c.cur_diff = diff.as_html()
 
        else:
 
            #default option
 
            c.cur_diff = diff.as_html()
 
        
 
        if not c.cur_diff: c.no_changes = True    
 
        return render('files/file_diff.html')
 
    
 
    def _get_history(self, repo, node, f_path):
 
        from vcs.nodes import NodeKind
 
        if not node.kind is NodeKind.FILE:
 
            return []
 
        changesets = node.history
 
        hist_l = []
 
        for chs in changesets:
 
            n_desc = 'r%s:%s' % (chs.revision, chs._short)
 
            hist_l.append((chs._short, n_desc,))
 
        return hist_l
0 comments (0 inline, 0 general)