Uploaded image for project: 'Subversion'
  1. Subversion
  2. SVN-2499

mailer.py: configurable subject line in email notifications

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • ---
    • 1.10-consider
    • tools

    Description

      This short patch will allow to embed the log message into the subject line
      of email notifications.  The original format consisting of a prefix, revision
      number and the affected repository directories will be retained if the
      subject_format parameter is not defined.
      
      A further improvement could be made separating the repos_dirs template into 2
      templates for the revision number and the affected directories.  This would
      require moving few lines of the existing code around.
      
      Modified: scripts/mailer/mailer.conf
      ==============================================================================
      --- scripts/mailer/mailer.conf	(original)
      +++ scripts/mailer/mailer.conf	Sun Feb 12 07:29:37 2006
      @@ -142,6 +142,10 @@
       # whitespace in the command, then ### something ###
       diff = /usr/bin/diff -u -L %(label_from)s -L %(label_to)s %(from)s %(to)s
       
      +# The format of the subject line.  May include %(subject_prefix)s, 
      +# %(repos_dirs)s and %(repos_log)s.
      +# subject_format = %(subject_prefix)s %(repos_log)s
      +
       # The default prefix for the Subject: header for commits
       commit_subject_prefix =
       
      
      Modified: scripts/mailer/mailer.py
      ==============================================================================
      --- scripts/mailer/mailer.py	(original)
      +++ scripts/mailer/mailer.py	Sun Feb 12 07:29:37 2006
      @@ -130,6 +130,21 @@
           else:
             subject = self.subject
       
      +    subject_prefix = prefix or ''
      +    repos_dirs = self.subject or ''
      +    repos_log = self.repos.get_rev_prop(svn.core.SVN_PROP_REVISION_LOG) or ''
      +    interpolation = { 
      +        'subject_prefix': subject_prefix, 
      +        'repos_dirs': repos_dirs, 
      +        'repos_log': repos_log 
      +    }
      +    params.update(interpolation)
      +    formatted_subject = self.cfg.get('subject_format', group, params)
      +    if formatted_subject:
      +      subject = formatted_subject
      +
      +    subject = subject.strip()
      +
           try:
             truncate_subject = int(
                 self.cfg.get('truncate-subject', group, params))
      

      Original issue reported by ilgiz

      Attachments

        1. 1_mailer-config-body2.txt
          28 kB
          Subversion Importer

        Activity

          People

            Unassigned Unassigned
            subversion-importer Subversion Importer
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: