[llvm-commits] CVS: CVSROOT/commit-diffs.pl

Misha Brukman brukman at cs.uiuc.edu
Fri Aug 1 16:07:05 PDT 2003


Changes in directory CVSROOT:

commit-diffs.pl updated: 1.40 -> 1.41

---
Log message:

Display the branch name in the email subject line.


---
Diffs of the changes:

Index: CVSROOT/commit-diffs.pl
diff -u CVSROOT/commit-diffs.pl:1.40 CVSROOT/commit-diffs.pl:1.41
--- CVSROOT/commit-diffs.pl:1.40	Fri Aug  1 15:32:32 2003
+++ CVSROOT/commit-diffs.pl	Fri Aug  1 16:05:55 2003
@@ -76,16 +76,15 @@
   }
 }
 
-if ($DEBUG) {
-  print "changedir: $changedir\n";
-}
+print "changedir: $changedir\n" if $DEBUG;
 
 my @loginfodata = <STDIN>;
 #print "loginfo: ". join("\n--\n", @loginfodata) if $DEBUG;
 
-# Pick up the committer's log message from the loginfo we received
+# Pick up the committer's log message and branch from the loginfo we received
 my @logmessage;
 my $islogmessage = 0;
+my $branch = "";
 
 foreach $s (@loginfodata) {
   if ($islogmessage) {
@@ -96,6 +95,9 @@
   if ($s =~ /^Log Message:/) {
     $islogmessage = 1;
     next;
+  } else if ($s =~ /^.+Tag:/) {
+    $branch = $s;
+    $branch =~ s/^.+Tag: (\s+)/$1/;
   }
 }
 
@@ -103,10 +105,10 @@
 
 my $msg = "\n\nChanges in directory $changedir:\n\n";
 my $diffs = "";
-my $subject = "$changedir/";
+my $filePath = "$changedir/";
 
 foreach $m (@changeItems) {
-  $subject .= "$m->{'filename'} ";
+  $filePath .= "$m->{'filename'} ";
   if ($m->{'type'} eq 'add') {
     $msg .= "$m->{'filename'} added (r$m->{'newrev'})\n";
     $diffs .= `cvs -Qf rdiff -r0 -r$m->{'newrev'} $changedir/$m->{'filename'} 2> /dev/null` . "\n\n";
@@ -124,11 +126,18 @@
 print TEMP $msg;
 close TEMP;
 
+# Include the branch, if applicable, into the subject line of the email
+my $emailSubject = "";
+if ($branch ne "") {
+  $emailSubject = "[$branch]";
+}
+$emailSubject .= " CVS: $filePath";
+
 # The mail sending program is called `mailx' on Solaris, but `mail' on
 # everything else.
 if ((uname())[0] eq "SunOS") {
-  system("mailx -s 'CVS: $subject' $target < $TEMPFILE");
+  system("mailx -s '$emailSubject' $target < $TEMPFILE");
 } else {
-  system("mail -s 'CVS: $subject' $target < $TEMPFILE");
+  system("mail -s '$emailSubject' $target < $TEMPFILE");
 }
 unlink "$TEMPFILE";





More information about the llvm-commits mailing list