brainy commented on code in PR #35:
URL: https://github.com/apache/subversion/pull/35#discussion_r2278419037
##########
tools/hook-scripts/mailer/mailer.py:
##########
@@ -1442,32 +1443,48 @@ def repos_params(section_name, defaults):
search_logmsg_re = re.compile(search_logmsg)
else:
search_logmsg_re = None
-
- self._group_re.append((group,
- re.compile(for_paths),
- exclude_paths_re,
- params,
- search_logmsg_re))
+ suppress_if_match = getattr(sub, 'suppress_if_match', None)
+ if suppress_if_match == 'yes':
+ self._last_group_re.append((group,
+ re.compile(for_paths),
+ exclude_paths_re,
+ params,
+ search_logmsg_re,
+ True)) # Ignore if already matched
+ else:
+ self._group_re.append((group,
+ re.compile(for_paths),
+ exclude_paths_re,
+ params,
+ search_logmsg_re,
+ False))
Review Comment:
Ugh, this is not nice. Remove the `if`.
```
self._last_group_re.append((group,
re.compile(for_paths),
exclude_paths_re,
params,
search_logmsg_re,
# Ignore if already matched
suppress_if_match == 'yes'))
```
Also, what guarantee is there that the true-value of `suppress_if_match` can
only be `yes`? All I see is a new config option used in the code. Needs updated
documentation in `mailer.conf.example`.
##########
tools/hook-scripts/mailer/mailer.py:
##########
@@ -1442,32 +1443,48 @@ def repos_params(section_name, defaults):
search_logmsg_re = re.compile(search_logmsg)
else:
search_logmsg_re = None
-
- self._group_re.append((group,
- re.compile(for_paths),
- exclude_paths_re,
- params,
- search_logmsg_re))
+ suppress_if_match = getattr(sub, 'suppress_if_match', None)
+ if suppress_if_match == 'yes':
+ self._last_group_re.append((group,
+ re.compile(for_paths),
+ exclude_paths_re,
+ params,
+ search_logmsg_re,
+ True)) # Ignore if already matched
+ else:
+ self._group_re.append((group,
+ re.compile(for_paths),
+ exclude_paths_re,
+ params,
+ search_logmsg_re,
+ False))
# after all the groups are done, add in the default group
try:
- self._group_re.append((None,
+ self._last_group_re.append((None,
re.compile(self.defaults.for_paths),
Review Comment:
Fix function argument indentation, please.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]