Ticket #7807: suppress_file_diff.patch
| File suppress_file_diff.patch, 1.9 KB (added by anonymous, 4 years ago) |
|---|
-
trac/versioncontrol/web_ui/changeset.py
25 25 import re 26 26 from StringIO import StringIO 27 27 import time 28 from fnmatch import fnmatchcase 28 29 29 30 from genshi.builder import tag 30 31 31 from trac.config import Option, BoolOption, IntOption 32 from trac.config import Option, BoolOption, IntOption, ListOption 32 33 from trac.core import * 33 34 from trac.mimeview import Mimeview, is_binary, Context 34 35 from trac.perm import IPermissionRequestor … … 164 165 If this option is disabled, changeset messages will be rendered as 165 166 pre-formatted text.""") 166 167 168 suppress_file_diff = ListOption('changeset', 'suppress_file_diff', '', 169 """List of files for which no diffs should be displayed in the changesets. 170 Leave this option empty if users should see the diffs for all files 171 (under the constraints of options like max_diff_bytes and friends, 172 of course). Otherwise set it to a comma-separated list of names. 173 The list contains of glob patterns, i.e. "*" can be used as wildcard.""") 174 167 175 # INavigationContributor methods 168 176 169 177 def get_active_navigation_item(self, req): … … 507 515 The list is empty when no differences between comparable files 508 516 are detected, but the return value is None for non-comparable files. 509 517 """ 518 patterns = self.suppress_file_diff 519 if filter(None, [fnmatchcase(old_node.path, p) for p in patterns]): 520 return None 521 522 if filter(None, [fnmatchcase(new_node.path, p) for p in patterns]): 523 return None 524 510 525 old_content = old_node.get_content().read() 511 526 if is_binary(old_content): 512 527 return None
