Show More
@@ -207,10 +207,10 b' class FilesController(BaseController):' | |||||
207 | return redirect(url('files_home', |
|
207 | return redirect(url('files_home', | |
208 | repo_name=c.repo_name, f_path=f_path)) |
|
208 | repo_name=c.repo_name, f_path=f_path)) | |
209 |
|
209 | |||
210 | f_udiff = differ.get_udiff(node1, node2) |
|
|||
211 | diff = differ.DiffProcessor(f_udiff) |
|
|||
212 |
|
210 | |||
213 | if c.action == 'download': |
|
211 | if c.action == 'download': | |
|
212 | diff = differ.DiffProcessor(differ.get_gitdiff(node1, node2)) | |||
|
213 | ||||
214 | diff_name = '%s_vs_%s.diff' % (diff1, diff2) |
|
214 | diff_name = '%s_vs_%s.diff' % (diff1, diff2) | |
215 | response.content_type = 'text/plain' |
|
215 | response.content_type = 'text/plain' | |
216 | response.content_disposition = 'attachment; filename=%s' \ |
|
216 | response.content_disposition = 'attachment; filename=%s' \ | |
@@ -218,10 +218,13 b' class FilesController(BaseController):' | |||||
218 | return diff.raw_diff() |
|
218 | return diff.raw_diff() | |
219 |
|
219 | |||
220 | elif c.action == 'raw': |
|
220 | elif c.action == 'raw': | |
|
221 | diff = differ.DiffProcessor(differ.get_gitdiff(node1, node2)) | |||
221 | response.content_type = 'text/plain' |
|
222 | response.content_type = 'text/plain' | |
222 | return diff.raw_diff() |
|
223 | return diff.raw_diff() | |
223 |
|
224 | |||
224 | elif c.action == 'diff': |
|
225 | elif c.action == 'diff': | |
|
226 | diff = differ.DiffProcessor(differ.get_udiff(node1, node2)) | |||
|
227 | ||||
225 | if node1.size > self.cut_off_limit or node2.size > self.cut_off_limit: |
|
228 | if node1.size > self.cut_off_limit or node2.size > self.cut_off_limit: | |
226 | c.cur_diff = _('Diff is to big to display') |
|
229 | c.cur_diff = _('Diff is to big to display') | |
227 | elif node1.is_binary or node2.is_binary: |
|
230 | elif node1.is_binary or node2.is_binary: | |
@@ -229,6 +232,7 b' class FilesController(BaseController):' | |||||
229 | else: |
|
232 | else: | |
230 | c.cur_diff = diff.as_html() |
|
233 | c.cur_diff = diff.as_html() | |
231 | else: |
|
234 | else: | |
|
235 | diff = differ.DiffProcessor(differ.get_udiff(node1, node2)) | |||
232 | #default option |
|
236 | #default option | |
233 | if node1.size > self.cut_off_limit or node2.size > self.cut_off_limit: |
|
237 | if node1.size > self.cut_off_limit or node2.size > self.cut_off_limit: | |
234 | c.cur_diff = _('Diff is to big to display') |
|
238 | c.cur_diff = _('Diff is to big to display') |
General Comments 0
You need to be logged in to leave comments.
Login now