You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Stefan Wimmer <sw...@gx.nl> on 2004/10/07 10:18:43 UTC

mailer.py: Problem with substitution

Hi all, 

let me describe the situation: I have 1 repository for projects with a lot
of sub-projects and I'd like to be able to show the sub-project name in
the subject of the commit mails. But I get error messages if I try to use the
substitution functionality from mailer.conf :(

-> Projectspath: /subversion/projects/projects/<subprojects>

-> hooks/post-commit:
/subversion/admin/projects-mailer.py commit "$REPOS" "$REV"
subversion/admin/projects-mailer.conf >> $REPOS/hooks/debug.log 2>&1 &

-> admin/projects-mailer.conf:
[projects]
for_repos = /subversion/projects/projects
for_path = (?P<PROJECT>[^/]*)($|/)
commit_subject_prefix = [%(PROJECT)s]

-> hooks/debug.log:
Traceback (most recent call last):
  File "/subversion/admin/projects-mailer.py", line 754, in ?
    author, propname)
  File "/usr/local/lib/svn-python/svn/core.py", line 33, in run_app
    return apply(func, (pool,) + args, kw)
  File "/subversion/admin/projects-mailer.py", line 49, in main
    messenger.generate()
  File "/subversion/admin/projects-mailer.py", line 318, in generate
    self.output.start(group, params)
  File "/subversion/admin/projects-mailer.py", line 174, in start
    self.write(self.mail_headers(group, params))
  File "/subversion/admin/projects-mailer.py", line 67, in mail_headers
    prefix = self.cfg.get(self.prefix_param, group, params)
  File "/subversion/admin/projects-mailer.py", line 631, in get
    return getattr(sub, option) % params
KeyError: PROJECT

I use svn, version 1.1.0 (r11180) with the mailer.py included in this
release. I tried also the mailer.py from 1.0.1 and the latest
trunk-version without success.

Thanks in advance
Stefan


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: mailer.py: Problem with substitution

Posted by Stefan Wimmer <sw...@gx.nl>.
Sorry - copy&paste didn't work that well :(

My excuses for that
Stefan


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: mailer.py: Problem with substitution

Posted by Stefan Wimmer <sw...@gx.nl>.
* C. Michael Pilato <cm...@collab.net> [2004-10-12 18:37]:
>> let me describe the situation: I have 1 repository for projects             
                                                                               
                            
>> with a lot of sub-projects and I'd like to be able to show the              
                                                                               
                            
>> sub-project name in the subject of the commit mails. But I get              
                                                                               
                            
>> error messages if I try to use the substitution functionality from          
                                                                               
                            
>> mailer.conf :(                                                              
                                                                               
                            
>                                                                              
                                                                               
                            
> Sorry, I meant to respond to your mail earlier.  The solution is that        
                                                                               
                            
> you need to use individual sections in mailer.conf for each of your          
                                                                               
                            
> projects, not a pattern-matching attempt.                                    
                                                                               
                            
>                                                                              
                                                                               
                            
> Were I you, I'd made a per-repository mailer.conf file.  This file           
                                                                               
                            
> would have all the default values setup appropriately for all the            
                                                                               
                            
> projects in the repository.  Then, for each project, you have a              
                                                                               
                            
> section for overriding the repository:                                       
                                                                               
                            
>                                                                              
                                                                               
                            
>    [defaults]                                                                
                                                                               
                            
>    for_repos = /subversion/projects/projects                                 
                                                                               
                            
>    ...                                                                       
                                                                               
                            
>                                                                              
                                                                               
                            
>    [project1]                                                                
                                                                               
                            
>    for_path = project1                                                       
                                                                               
                            
>    commit_subject_prefix = [project1]                                        
                                                                               
                            
>                                                                              
                                                                               
                            
>    [project2]                                                                
                                                                               
                            
>    for_path = project2                                                       
                                                                               
                            
>    commit_subject_prefix = [project2]                                        
                                                                               
                            
>                                                                              
                                                                               
                            
>    ...                                                                       
                                                                               
                            

Hello Michael,

many thanks for your response :)

If I understand you right this means that I can't use sort of an automatic
proces for using specific subjects depending on the path of the commited
item :(

The idea was to use only 1 big repository for all projects and enable
the developers to add their new projects in the root of the repository
and let the mailer.conf do the automagical assignment of the correct
subject without needing to add new entries in the mailer.conf every time
a new project is added ...

No go though :(

But thanks for your advice
Stefan



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: mailer.py: Problem with substitution

Posted by "C. Michael Pilato" <cm...@collab.net>.
Stefan Wimmer <sw...@gx.nl> writes:

> The idea was to use only 1 big repository for all projects and enable 
> the developers to add their new projects in the root of the repository 
> and let the mailer.conf do the automagical assignment of the correct 
> subject without needing to add new entries in the mailer.conf every time 
> a new project is added ...
> 
> No go though :(

Where's your spine, man!?

Whip up a post-commit hook script that runs *before* the mailer.  This
script examines the new revision, and if any new directories were
created in the root directory, appends the appropriate block to the
end of mailer.conf.  :-)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: mailer.py: Problem with substitution

Posted by "C. Michael Pilato" <cm...@collab.net>.
Stefan Wimmer <sw...@gx.nl> writes:

> Stefan Wimmer <swimmer <at> gx.nl> writes:
> > Hi all, 
> > 
> > let me describe the situation: I have 1 repository for projects
> > with a lot of sub-projects and I'd like to be able to show the
> > sub-project name in the subject of the commit mails. But I get
> > error messages if I try to use the substitution functionality from
> > mailer.conf :(
> 
> 
> Is there no solution for this problem? Please help me because I have
> to make a decision how I organize my projects ...

Sorry, I meant to respond to your mail earlier.  The solution is that
you need to use individual sections in mailer.conf for each of your
projects, not a pattern-matching attempt.

Were I you, I'd made a per-repository mailer.conf file.  This file
would have all the default values setup appropriately for all the
projects in the repository.  Then, for each project, you have a
section for overriding the repository:

   [defaults]
   for_repos = /subversion/projects/projects
   ...

   [project1]
   for_path = project1
   commit_subject_prefix = [project1]

   [project2]
   for_path = project2
   commit_subject_prefix = [project2]
 
   ...

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: mailer.py: Problem with substitution

Posted by Stefan Wimmer <sw...@gx.nl>.
Stefan Wimmer <swimmer <at> gx.nl> writes:
> Hi all, 
> 
> let me describe the situation: I have 1 repository for projects with a lot
> of sub-projects and I'd like to be able to show the sub-project name in
> the subject of the commit mails. But I get error messages if I try to use the
> substitution functionality from mailer.conf :(


Is there no solution for this problem? Please help me because I have to make a
decision how I organize my projects ...

Best regards
Stefan




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org