svn commit: r198821 - svnadmin/hooks/scripts

Simon L. Nielsen simon at FreeBSD.org
Mon Nov 2 20:37:50 UTC 2009


Author: simon
Date: Mon Nov  2 20:37:49 2009
New Revision: 198821
URL: http://svn.freebsd.org/changeset/base/198821

Log:
  Change the handling of directory property changes in the svn mailer
  script:
  
  - Removes all directories that have only prop-changes from the subject
    line (unless there are only prop-changes in the commit).
  - Move directory prop-changes to a separate category at the end of the
    change listing.
  
  This should hopefully reduce the problem mergeinfo in sys/contrib etc.
  "cluttering up" commit mails, and should also make it easier to spot
  when there is mergeinfo missing (or misplaced) in a MFC.
  
  Submitted by:	mlaier (also most of the commit message)
  Reviewed by:	peter (the general idea)

Modified:
  svnadmin/hooks/scripts/mailer.py
Directory Properties:

Modified: svnadmin/hooks/scripts/mailer.py
==============================================================================
--- svnadmin/hooks/scripts/mailer.py	Mon Nov  2 20:18:50 2009	(r198820)
+++ svnadmin/hooks/scripts/mailer.py	Mon Nov  2 20:37:49 2009	(r198821)
@@ -370,9 +370,14 @@ class Commit(Messenger):
 
     # figure out the changed directories
     dirs = { }
+    pdirs = { }
     for path, change in self.changelist:
       if change.item_kind == svn.core.svn_node_dir:
-        dirs[path] = None
+        # do not include dirs that have only prop changes
+        if change.prop_changes:
+          pdirs[path] = None
+        else:
+          dirs[path] = None
       else:
         idx = string.rfind(path, '/')
         if idx == -1:
@@ -380,7 +385,10 @@ class Commit(Messenger):
         else:
           dirs[path[:idx]] = None
 
-    dirlist = dirs.keys()
+    if len(dirs) == 0:
+      dirlist = pdirs.keys()
+    else:
+      dirlist = dirs.keys()
 
     commondir, dirlist = get_commondir(dirlist)
 
@@ -1029,6 +1037,7 @@ class TextCommitRenderer:
 
     w = self.output.write
     w(header + ':\n')
+    ps = ''
     for d in data_list:
       if d.is_dir:
         is_dir = '/'
@@ -1037,11 +1046,13 @@ class TextCommitRenderer:
       if d.props_changed:
         if d.text_changed:
           props = '   (contents, props changed)'
+          w('  %s%s%s\n' % (d.path, is_dir, props))
         else:
           props = '   (props changed)'
+          ps = ('%s  %s%s%s\n' % (ps, d.path, is_dir, props))
       else:
         props = ''
-      w('  %s%s%s\n' % (d.path, is_dir, props))
+        w('  %s%s%s\n' % (d.path, is_dir, props))
       if d.copied:
         if is_dir:
           text = ''
@@ -1051,6 +1062,7 @@ class TextCommitRenderer:
           text = ' unchanged'
         w('     - copied%s from r%d, %s%s\n'
           % (text, d.base_rev, d.base_path, is_dir))
+    w('Directory Properties:\n%s' % (ps))
 
   def _render_diffs(self, diffs, section_header):
     """Render diffs. Write the SECTION_HEADER if there are actually


More information about the svn-src-svnadmin mailing list