1 --- tools/hook-scripts/commit-email.pl 2004-06-14 22:29:22.000000000 +0200
2 +++ tools/hook-scripts/commit-email.pl 2005-10-30 22:39:22.942246752 +0100
5 my @log = map { "$_\n" } @svnlooklines;
7 -# Figure out what directories have changed using svnlook.
8 -my @dirschanged = &read_from_process($svnlook, 'dirs-changed', $repos,
11 -# Lose the trailing slash in the directory names if one exists, except
12 -# in the case of '/'.
14 -for (my $i=0; $i<@dirschanged; ++$i)
16 - if ($dirschanged[$i] eq '/')
22 - $dirschanged[$i] =~ s#^(.+)[/\\]$#$1#;
26 # Figure out what files have changed using svnlook.
27 @svnlooklines = &read_from_process($svnlook, 'changed', $repos, '-r', $rev);
29 # Parse the changed nodes.
35 foreach my $line (@svnlooklines)
42 + push(@fileschanged, $path);
52 # there's no point in collapsing the directories, and only if more
53 # than one directory was modified.
55 -if (!$rootchanged and @dirschanged > 1)
56 +if (!$rootchanged and @fileschanged > 1)
58 - my $firstline = shift @dirschanged;
59 + my $firstline = shift @fileschanged;
60 my @commonpieces = split('/', $firstline);
61 - foreach my $line (@dirschanged)
62 + foreach my $line (@fileschanged)
64 my @pieces = split('/', $line);
70 - unshift(@dirschanged, $firstline);
71 + unshift(@fileschanged, $firstline);
75 $commondir = join('/', @commonpieces);
76 - my @new_dirschanged;
77 - foreach my $dir (@dirschanged)
78 + my @new_fileschanged;
79 + foreach my $file (@fileschanged)
81 - if ($dir eq $commondir)
82 + if ($file eq "$commondir/")
89 - $dir =~ s#^$commondir/##;
90 + $file =~ s#^$commondir/##;
92 - push(@new_dirschanged, $dir);
93 + push(@new_fileschanged, $file);
95 - @dirschanged = @new_dirschanged;
96 + @fileschanged = @new_fileschanged;
99 -my $dirlist = join(' ', @dirschanged);
100 +my $filelist = join(' ', @fileschanged);
102 ######################################################################
103 # Assembly of log message.
106 my $match_re = $project->{match_re};
108 - foreach my $path (@dirschanged, @adds, @dels, @mods)
109 + foreach my $path (@adds, @dels, @mods)
111 if ($path =~ $match_re)
113 @@ -390,16 +380,20 @@
115 if ($commondir ne '')
117 - $subject = "r$rev - in $commondir: $dirlist";
118 + $subject = "r$rev - in $commondir: $filelist";
122 - $subject = "r$rev - $dirlist";
123 + $subject = "r$rev - $filelist";
125 if ($subject_prefix =~ /\w/)
127 $subject = "$subject_prefix $subject";
129 + if(length($subject) > 900)
131 + $subject = substr($subject, 0, 896) . " ...";
133 my $mail_from = $author;
135 if ($from_address =~ /\w/)