-
Notifications
You must be signed in to change notification settings - Fork 185
Support the suppress_if_match option from old svn-mailer #35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Humbedooh
wants to merge
1
commit into
apache:trunk
Choose a base branch
from
Humbedooh:humbedooh/svnmailer_suppress_if_match
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1384,6 +1384,7 @@ def _prep_maps(self): | |
|
||
def _prep_groups(self, groups, repos_dir, default_params): | ||
self._group_re = [ ] | ||
self._last_group_re = [ ] | ||
|
||
### does it arrive as an abspath? | ||
repos_dir = os.path.abspath(repos_dir) | ||
|
@@ -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), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix function argument indentation, please. |
||
None, | ||
self._default_params, | ||
None)) | ||
None, | ||
False)) | ||
except AttributeError: | ||
# there is no self.defaults.for_paths | ||
pass | ||
|
||
self._group_re = self._group_re + self._last_group_re | ||
|
||
def which_groups(self, path, logmsg): | ||
"Return the path's associated groups." | ||
groups = [] | ||
for group, pattern, exclude_pattern, repos_params, search_logmsg_re in self._group_re: | ||
seen = False | ||
for group, pattern, exclude_pattern, repos_params, search_logmsg_re, ignore in self._group_re: | ||
if ignore and seen: | ||
continue | ||
match = pattern.match(path) | ||
if match: | ||
if exclude_pattern and exclude_pattern.match(path): | ||
continue | ||
seen = True | ||
params = repos_params.copy() | ||
params.update(match.groupdict()) | ||
|
||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugh, this is not nice. Remove the
if
.Also, what guarantee is there that the true-value of
suppress_if_match
can only beyes
? All I see is a new config option used in the code. Needs updated documentation inmailer.conf.example
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Belay that suggested code change, I'm blind. The docco request stands, though.