If it helps, here's a last try:
- wrapped the 3 long lines to 80 columns
- PEP8 fixes (only on these 3 lines), such as removed space after "{",
before ":", before "}"
The only PEP8 violation that remain on these lines is "continuation
line under-indented for visual indent"
I don't know how to format best, please do as you see fit.
Cheers,
Janos
On Sun, Jan 27, 2013 at 3:43 PM, Daniel Shahaf <[email protected]> wrote:
>> Index: tools/hook-scripts/mailer/mailer.py
>> ===================================================================
>> --- tools/hook-scripts/mailer/mailer.py (revision 1438886)
>> +++ tools/hook-scripts/mailer/mailer.py (working copy)
>> @@ -98,7 +98,7 @@ def main(pool, cmd, config_fname, repos_dir, cmd_a
>> if cmd == 'commit':
>> revision = int(cmd_args[0])
>> repos = Repository(repos_dir, revision, pool)
>> - cfg = Config(config_fname, repos, { 'author' : repos.author })
>> + cfg = Config(config_fname, repos, { 'author' : repos.author, 'repodir'
>> : os.path.basename(repos.repos_dir) })
>
> My only comment is that these lines should be wrapped to 80 columns.
>
> I'll hold off on committing, though, to let others have a look too.
>
> Thanks for the patch,
>
> Daniel
--
Janos Gyerik
http://www.janosgyerik.com/
https://twitter.com/janosgyerik/
Index: tools/hook-scripts/mailer/mailer.py
===================================================================
--- tools/hook-scripts/mailer/mailer.py (revision 1438886)
+++ tools/hook-scripts/mailer/mailer.py (working copy)
@@ -98,7 +98,8 @@ def main(pool, cmd, config_fname, repos_dir, cmd_a
if cmd == 'commit':
revision = int(cmd_args[0])
repos = Repository(repos_dir, revision, pool)
- cfg = Config(config_fname, repos, { 'author' : repos.author })
+ cfg = Config(config_fname, repos, {'author': repos.author,
+ 'repodir': os.path.basename(repos.repos_dir)})
messenger = Commit(pool, cfg, repos)
elif cmd == 'propchange' or cmd == 'propchange2':
revision = int(cmd_args[0])
@@ -108,14 +109,16 @@ def main(pool, cmd, config_fname, repos_dir, cmd_a
repos = Repository(repos_dir, revision, pool)
# Override the repos revision author with the author of the propchange
repos.author = author
- cfg = Config(config_fname, repos, { 'author' : author })
+ cfg = Config(config_fname, repos, {'author': author,
+ 'repodir': os.path.basename(repos.repos_dir)})
messenger = PropChange(pool, cfg, repos, author, propname, action)
elif cmd == 'lock' or cmd == 'unlock':
author = cmd_args[0]
repos = Repository(repos_dir, 0, pool) ### any old revision will do
# Override the repos revision author with the author of the lock/unlock
repos.author = author
- cfg = Config(config_fname, repos, { 'author' : author })
+ cfg = Config(config_fname, repos, {'author': author,
+ 'repodir': os.path.basename(repos.repos_dir)})
messenger = Lock(pool, cfg, repos, author, cmd == 'lock')
else:
raise UnknownSubcommand(cmd)
Index: tools/hook-scripts/mailer/mailer.conf.example
===================================================================
--- tools/hook-scripts/mailer/mailer.conf.example (revision 1438886)
+++ tools/hook-scripts/mailer/mailer.conf.example (working copy)
@@ -146,7 +146,16 @@
#
# from_addr = %(author)[email protected]
#
+# The substitution variable "repodir" is provided, and is set to
+# the directory name of the repository. This can be useful to set
+# a custom subject that can be re-used in multiple repositories:
#
+# commit_subject_prefix = [svn-%(repodir)s]
+#
+# For example if the repository is at /path/to/repo/project-x then
+# the subject of commit emails will be prefixed with [svn-project-x]
+#
+#
# SUMMARY
#
# While mailer.py will work to minimize the number of mail messages