##// END OF EJS Templates
fixed bug when diff command was different than available options
marcink -
r337:fa3835d3 default
parent child Browse files
Show More
@@ -140,7 +140,7 b' class FilesController(BaseController):'
140 hg_model = HgModel()
140 hg_model = HgModel()
141 diff1 = request.GET.get('diff1')
141 diff1 = request.GET.get('diff1')
142 diff2 = request.GET.get('diff2')
142 diff2 = request.GET.get('diff2')
143 c.action = action = request.GET.get('diff')
143 c.action = request.GET.get('diff')
144 c.no_changes = diff1 == diff2
144 c.no_changes = diff1 == diff2
145 c.f_path = f_path
145 c.f_path = f_path
146 c.repo = hg_model.get_repo(c.repo_name)
146 c.repo = hg_model.get_repo(c.repo_name)
@@ -168,18 +168,20 b' class FilesController(BaseController):'
168
168
169 diff = differ.DiffProcessor(f_udiff)
169 diff = differ.DiffProcessor(f_udiff)
170
170
171 if action == 'download':
171 if c.action == 'download':
172 diff_name = '%s_vs_%s.diff' % (diff1, diff2)
172 diff_name = '%s_vs_%s.diff' % (diff1, diff2)
173 response.content_type = 'text/plain'
173 response.content_type = 'text/plain'
174 response.content_disposition = 'attachment; filename=%s' \
174 response.content_disposition = 'attachment; filename=%s' \
175 % diff_name
175 % diff_name
176 return diff.raw_diff()
176 return diff.raw_diff()
177
177
178 elif action == 'raw':
178 elif c.action == 'raw':
179 c.cur_diff = '<pre class="raw">%s</pre>' % h.escape(diff.raw_diff())
179 c.cur_diff = '<pre class="raw">%s</pre>' % h.escape(diff.raw_diff())
180 elif action == 'diff':
180 elif c.action == 'diff':
181 c.cur_diff = diff.as_html()
181 c.cur_diff = diff.as_html()
182
182 else:
183 #default option
184 c.cur_diff = diff.as_html()
183 return render('files/file_diff.html')
185 return render('files/file_diff.html')
184
186
185 def _get_history(self, repo, node, f_path):
187 def _get_history(self, repo, node, f_path):
General Comments 0
You need to be logged in to leave comments. Login now