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

Misha Brukman brukman at cs.uiuc.edu
Thu Apr 10 16:26:01 PDT 2003


Changes in directory CVSROOT:

commit-diffs.pl updated: 1.31 -> 1.32

---
Log message:

* Display contents of new-ly added files (ie. diff with /dev/null :)
* Converted tabs to spaces.


---
Diffs of the changes:

Index: CVSROOT/commit-diffs.pl
diff -u CVSROOT/commit-diffs.pl:1.31 CVSROOT/commit-diffs.pl:1.32
--- CVSROOT/commit-diffs.pl:1.31	Tue Oct  1 18:06:18 2002
+++ CVSROOT/commit-diffs.pl	Thu Apr 10 16:25:08 2003
@@ -14,13 +14,10 @@
 # The mail sent includes change summary, log message and a unidiff
 # about the changes.
 
-# The original author of this script is Jouni Heikniemi
-# <jouni at heikniemi.net> Feel free to do whatever you wish with this.
-# The home page of this script is
-# <http://www.heikniemi.net/kirj/cvsntmail-en.html>.
-
-#
-# This script was hacked by Misha & Chris to work under unix
+# Original author: Jouni Heikniemi <jouni at heikniemi.net>
+# This script was improved by Misha & Chris:
+# * Hacked to work under Unix
+# * ...?
 #
 
 ######################################################################
@@ -30,19 +27,19 @@
 # those to a hash and returns a ref to it.
 
 sub createChangeItem($) { #($)
-	my @arr = split(',', shift);
-	my %change;
-	$change{'filename'} = $arr[0];
-	$change{'oldrev'} = $arr[1];
-	$change{'newrev'} = $arr[2];
-	if ($arr[1] eq 'NONE') {
-		$change{'type'} = 'add';
-	} elsif ($arr[2] eq 'NONE') {
-		$change{'type'} = 'rm';
-	} else {
-		$change{'type'} = 'c';
-	}
-	return \%change;
+  my @arr = split(',', shift);
+  my %change;
+  $change{'filename'} = $arr[0];
+  $change{'oldrev'} = $arr[1];
+  $change{'newrev'} = $arr[2];
+  if ($arr[1] eq 'NONE') {
+    $change{'type'} = 'add';
+  } elsif ($arr[2] eq 'NONE') {
+    $change{'type'} = 'rm';
+  } else {
+    $change{'type'} = 'c';
+  }
+  return \%change;
 }
 
 ## Main code:
@@ -91,15 +88,15 @@
 my $islogmessage = 0;
 
 foreach $s (@loginfodata) {
-	if ($islogmessage) {
-		@logmessage = (@logmessage, $s);
-		next;
-	}
-
-	if ($s =~ /^Log Message:/) {
-		$islogmessage = 1;
-		next;
-	}
+  if ($islogmessage) {
+    @logmessage = (@logmessage, $s);
+    next;
+  }
+
+  if ($s =~ /^Log Message:/) {
+    $islogmessage = 1;
+    next;
+  }
 }
 
 # Format the output
@@ -109,15 +106,16 @@
 my $subject = "$changedir/";
 
 foreach $m (@changeItems) {
-	$subject .= "$m->{'filename'} ";
-	if ($m->{'type'} eq 'add') {
-		$msg .= "$m->{'filename'} added (r$m->{'newrev'})\n";
-	} elsif ($m->{'type'} eq 'rm') {
-		$msg .= "$m->{'filename'} (r$m->{'oldrev'}) removed\n";
-	} else {
-		$msg .= "$m->{'filename'} updated: $m->{'oldrev'} -> $m->{'newrev'}\n";
-		$diffs .= `cvs -Qf rdiff -u -r $m->{'oldrev'} -r $m->{'newrev'} $changedir/$m->{'filename'} 2> /dev/null` . "\n\n";
-	}
+  $subject .= "$m->{'filename'} ";
+  if ($m->{'type'} eq 'add') {
+    $msg .= "$m->{'filename'} added (r$m->{'newrev'})\n";
+    $diffs .= `cat $changedir/$m->{'filename'}; 2> /dev/null` . "\n\n";
+  } elsif ($m->{'type'} eq 'rm') {
+    $msg .= "$m->{'filename'} (r$m->{'oldrev'}) removed\n";
+  } else {
+    $msg .= "$m->{'filename'} updated: $m->{'oldrev'} -> $m->{'newrev'}\n";
+    $diffs .= `cvs -Qf rdiff -u -r $m->{'oldrev'} -r $m->{'newrev'} $changedir/$m->{'filename'} 2> /dev/null` . "\n\n";
+  }
 }
 $msg .= "\n---\nLog message:\n\n" . join('', at logmessage);
 $msg .= "\n---\nDiffs of the changes:\n\n" . $diffs;





More information about the llvm-commits mailing list