# HG changeset patch # User Marcin Kuzminski # Date 2011-02-14 15:43:57 # Node ID f3402cb92fdf0790116e30751dad0d3be83f475d # Parent 6ec53c16c74439cabcaf13521ae60918f0bce888 changed raw and download diffs to gitdiff diff --git a/rhodecode/controllers/files.py b/rhodecode/controllers/files.py --- a/rhodecode/controllers/files.py +++ b/rhodecode/controllers/files.py @@ -207,10 +207,10 @@ class FilesController(BaseController): return redirect(url('files_home', repo_name=c.repo_name, f_path=f_path)) - f_udiff = differ.get_udiff(node1, node2) - diff = differ.DiffProcessor(f_udiff) if c.action == 'download': + diff = differ.DiffProcessor(differ.get_gitdiff(node1, node2)) + diff_name = '%s_vs_%s.diff' % (diff1, diff2) response.content_type = 'text/plain' response.content_disposition = 'attachment; filename=%s' \ @@ -218,10 +218,13 @@ class FilesController(BaseController): return diff.raw_diff() elif c.action == 'raw': + diff = differ.DiffProcessor(differ.get_gitdiff(node1, node2)) response.content_type = 'text/plain' return diff.raw_diff() elif c.action == 'diff': + diff = differ.DiffProcessor(differ.get_udiff(node1, node2)) + if node1.size > self.cut_off_limit or node2.size > self.cut_off_limit: c.cur_diff = _('Diff is to big to display') elif node1.is_binary or node2.is_binary: @@ -229,6 +232,7 @@ class FilesController(BaseController): else: c.cur_diff = diff.as_html() else: + diff = differ.DiffProcessor(differ.get_udiff(node1, node2)) #default option if node1.size > self.cut_off_limit or node2.size > self.cut_off_limit: c.cur_diff = _('Diff is to big to display')