You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by fu...@apache.org on 2023/12/11 03:59:44 UTC

svn commit: r1914518 - /subversion/trunk/tools/hook-scripts/mailer/mailer.py

Author: futatuki
Date: Mon Dec 11 03:59:44 2023
New Revision: 1914518

URL: http://svn.apache.org/viewvc?rev=1914518&view=rev
Log:
Fix inconsistency in path argment on Config.which_group()

Previously, we call Config.which_group() with path as bytes in
Commit.__init__() and with path as str in Lock.__init__() and
in PropChange.__init__(), but Config.which_group handled path
argment as bytes. To fix it we only use str as path argment on
Config.wich_group().

* tools/hook-scripts/mailer/mailer.py
  (Config.which_groups): Treat path as str.
  (Commit.__init__): convert bytes path into str before calling above.

Found by: Ruediger Pluem (rpluem {_AT_} apache.org)
Review by: dsahlberg

Modified:
    subversion/trunk/tools/hook-scripts/mailer/mailer.py

Modified: subversion/trunk/tools/hook-scripts/mailer/mailer.py
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/hook-scripts/mailer/mailer.py?rev=1914518&r1=1914517&r2=1914518&view=diff
==============================================================================
--- subversion/trunk/tools/hook-scripts/mailer/mailer.py (original)
+++ subversion/trunk/tools/hook-scripts/mailer/mailer.py Mon Dec 11 03:59:44 2023
@@ -488,7 +488,7 @@ class Commit(Messenger):
     # collect the set of groups and the unique sets of params for the options
     self.groups = { }
     for path, change in self.changelist:
-      for (group, params) in self.cfg.which_groups(path, log):
+      for (group, params) in self.cfg.which_groups(to_str(path), log):
         # turn the params into a hashable object and stash it away
         param_list = sorted(params.items())
         # collect the set of paths belonging to this group
@@ -1486,9 +1486,9 @@ class Config:
     "Return the path's associated groups."
     groups = []
     for group, pattern, exclude_pattern, repos_params, search_logmsg_re in self._group_re:
-      match = pattern.match(to_str(path))
+      match = pattern.match(path)
       if match:
-        if exclude_pattern and exclude_pattern.match(to_str(path)):
+        if exclude_pattern and exclude_pattern.match(path):
           continue
         params = repos_params.copy()
         params.update(match.groupdict())