##// END OF EJS Templates
Added handling of ignore whitespace flag in changesets...
marcink -
r1752:f28dc032 beta
parent child Browse files
Show More
@@ -254,7 +254,7 b' class ReposController(BaseController):'
254 254 h.flash(_('deleted repository %s') % repo_name, category='success')
255 255 Session.commit()
256 256 except IntegrityError, e:
257 if e.message.find('repositories_fork_id_fkey'):
257 if e.message.find('repositories_fork_id_fkey') != -1:
258 258 log.error(traceback.format_exc())
259 259 h.flash(_('Cannot delete %s it still contains attached '
260 260 'forks') % repo_name,
@@ -162,7 +162,7 b' class ReposGroupsController(BaseControll'
162 162 h.flash(_('removed repos group %s' % gr.group_name), category='success')
163 163 #TODO: in future action_logger(, '', '', '', self.sa)
164 164 except IntegrityError, e:
165 if e.message.find('groups_group_parent_id_fkey'):
165 if e.message.find('groups_group_parent_id_fkey') != -1:
166 166 log.error(traceback.format_exc())
167 167 h.flash(_('Cannot delete this group it still contains '
168 168 'subgroups'),
@@ -59,7 +59,7 b' class ChangesetController(BaseRepoContro'
59 59 c.affected_files_cut_off = 60
60 60
61 61 def index(self, revision):
62
62 ignore_whitespace = request.GET.get('ignorews') == '1'
63 63 def wrap_to_table(str):
64 64
65 65 return '''<table class="code-difftable">
@@ -130,7 +130,8 b' class ChangesetController(BaseRepoContro'
130 130 # made
131 131 c.sum_added += node.size
132 132 if c.sum_added < self.cut_off_limit:
133 f_gitdiff = differ.get_gitdiff(filenode_old, node)
133 f_gitdiff = differ.get_gitdiff(filenode_old, node,
134 ignore_whitespace=ignore_whitespace)
134 135 d = differ.DiffProcessor(f_gitdiff, format='gitdiff')
135 136
136 137 st = d.stat()
@@ -168,7 +169,8 b' class ChangesetController(BaseRepoContro'
168 169 else:
169 170
170 171 if c.sum_removed < self.cut_off_limit:
171 f_gitdiff = differ.get_gitdiff(filenode_old, node)
172 f_gitdiff = differ.get_gitdiff(filenode_old, node,
173 ignore_whitespace=ignore_whitespace)
172 174 d = differ.DiffProcessor(f_gitdiff,
173 175 format='gitdiff')
174 176 st = d.stat()
@@ -219,6 +221,7 b' class ChangesetController(BaseRepoContro'
219 221 def raw_changeset(self, revision):
220 222
221 223 method = request.GET.get('diff', 'show')
224 ignore_whitespace = request.GET.get('ignorews') == '1'
222 225 try:
223 226 c.scm_type = c.rhodecode_repo.alias
224 227 c.changeset = c.rhodecode_repo.get_changeset(revision)
@@ -237,7 +240,8 b' class ChangesetController(BaseRepoContro'
237 240 if filenode_old.is_binary or node.is_binary:
238 241 diff = _('binary file') + '\n'
239 242 else:
240 f_gitdiff = differ.get_gitdiff(filenode_old, node)
243 f_gitdiff = differ.get_gitdiff(filenode_old, node,
244 ignore_whitespace=ignore_whitespace)
241 245 diff = differ.DiffProcessor(f_gitdiff,
242 246 format='gitdiff').raw_diff()
243 247
@@ -250,7 +254,8 b' class ChangesetController(BaseRepoContro'
250 254 if filenode_old.is_binary or node.is_binary:
251 255 diff = _('binary file')
252 256 else:
253 f_gitdiff = differ.get_gitdiff(filenode_old, node)
257 f_gitdiff = differ.get_gitdiff(filenode_old, node,
258 ignore_whitespace=ignore_whitespace)
254 259 diff = differ.DiffProcessor(f_gitdiff,
255 260 format='gitdiff').raw_diff()
256 261
@@ -404,6 +404,7 b' class FilesController(BaseRepoController'
404 404 @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
405 405 'repository.admin')
406 406 def diff(self, repo_name, f_path):
407 ignore_whitespace = request.GET.get('ignorews') == '1'
407 408 diff1 = request.GET.get('diff1')
408 409 diff2 = request.GET.get('diff2')
409 410 c.action = request.GET.get('diff')
@@ -430,8 +431,9 b' class FilesController(BaseRepoController'
430 431 repo_name=c.repo_name, f_path=f_path))
431 432
432 433 if c.action == 'download':
433 diff = differ.DiffProcessor(differ.get_gitdiff(node1, node2),
434 format='gitdiff')
434 _diff = differ.get_gitdiff(node1, node2,
435 ignore_whitespace=ignore_whitespace)
436 diff = differ.DiffProcessor(_diff,format='gitdiff')
435 437
436 438 diff_name = '%s_vs_%s.diff' % (diff1, diff2)
437 439 response.content_type = 'text/plain'
@@ -440,8 +442,9 b' class FilesController(BaseRepoController'
440 442 return diff.raw_diff()
441 443
442 444 elif c.action == 'raw':
443 diff = differ.DiffProcessor(differ.get_gitdiff(node1, node2),
444 format='gitdiff')
445 _diff = differ.get_gitdiff(node1, node2,
446 ignore_whitespace=ignore_whitespace)
447 diff = differ.DiffProcessor(_diff,format='gitdiff')
445 448 response.content_type = 'text/plain'
446 449 return diff.raw_diff()
447 450
@@ -453,8 +456,9 b' class FilesController(BaseRepoController'
453 456 c.cur_diff = ''
454 457 c.big_diff = True
455 458 else:
456 diff = differ.DiffProcessor(differ.get_gitdiff(node1, node2),
457 format='gitdiff')
459 _diff = differ.get_gitdiff(node1, node2,
460 ignore_whitespace=ignore_whitespace)
461 diff = differ.DiffProcessor(_diff,format='gitdiff')
458 462 c.cur_diff = diff.as_html()
459 463 else:
460 464
@@ -467,8 +471,9 b' class FilesController(BaseRepoController'
467 471 c.big_diff = True
468 472
469 473 else:
470 diff = differ.DiffProcessor(differ.get_gitdiff(node1, node2),
471 format='gitdiff')
474 _diff = differ.get_gitdiff(node1, node2,
475 ignore_whitespace=ignore_whitespace)
476 diff = differ.DiffProcessor(_diff,format='gitdiff')
472 477 c.cur_diff = diff.as_html()
473 478
474 479 if not c.cur_diff and not c.big_diff:
General Comments 0
You need to be logged in to leave comments. Login now