cvs-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Cvs-cvs] ccvs/contrib ChangeLog log_accum.pl


From: Derek Robert Price
Subject: [Cvs-cvs] ccvs/contrib ChangeLog log_accum.pl
Date: Wed, 17 May 2006 19:27:54 +0000

CVSROOT:        /cvsroot/cvs
Module name:    ccvs
Branch:         
Changes by:     Derek Robert Price <address@hidden>     06/05/17 19:27:54

Modified files:
        contrib        : ChangeLog log_accum.pl 

Log message:
        * log_accum.pl (write_file, append_file): Don't write empty lists.
        (read_logfile): Return undef rather than empty list.  Add debug print.
        (build_diff): Add debug prints and assertion.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/cvs/ccvs/contrib/ChangeLog.diff?tr1=1.196&tr2=1.197&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/cvs/ccvs/contrib/log_accum.pl.diff?tr1=1.32&tr2=1.33&r1=text&r2=text

Patches:
Index: ccvs/contrib/ChangeLog
diff -u ccvs/contrib/ChangeLog:1.196 ccvs/contrib/ChangeLog:1.197
--- ccvs/contrib/ChangeLog:1.196        Mon May 15 14:44:56 2006
+++ ccvs/contrib/ChangeLog      Wed May 17 19:27:54 2006
@@ -1,3 +1,9 @@
+2006-05-17  Derek Price  <address@hidden>
+
+       * log_accum.pl (write_file, append_file): Don't write empty lists.
+       (read_logfile): Return undef rather than empty list.  Add debug print.
+       (build_diff): Add debug prints and assertion.
+
 2006-05-15  Derek Price  <address@hidden>
 
        * log_accum.pl (set_defaults): Set diff defaults.
Index: ccvs/contrib/log_accum.pl
diff -u ccvs/contrib/log_accum.pl:1.32 ccvs/contrib/log_accum.pl:1.33
--- ccvs/contrib/log_accum.pl:1.32      Mon May 15 14:44:56 2006
+++ ccvs/contrib/log_accum.pl   Wed May 17 19:27:54 2006
@@ -985,11 +985,12 @@
     my ($filename) = @_;
     my @text;
 
-    open FILE, "<$filename" or return ();
+    open FILE, "<$filename" or return;
     while (<FILE>)
     {
-        chomp;
-        push @text, $_;
+       chomp;
+       print STDERR "read_logfile: read $_\n" if $debug;
+       push @text, $_;
     }
     close FILE;
     return @text;
@@ -1092,6 +1093,11 @@
     push @revs, read_logfile $changed_rev_file;
     push @revs, read_logfile $added_rev_file;
     push @revs, read_logfile $removed_rev_file;
+    print STDERR "build_diffs: files = ", join (":", @list), "\n" if $debug;
+    print STDERR "build_diffs: revs = ", join (":", @revs), "\n" if $debug;
+
+    # Assertion.
+    die "not enough revs for files" unless grep (m#[^/]$#, @list) == (@revs/2);
 
     # Find the "top" level of the server workspace and CD there.
     my $topdir = get_topdir @list;
@@ -1162,6 +1168,8 @@
 {
     my ($filename, @lines) = @_;
 
+    return unless @lines;
+
     open FILE, ">$filename" or die "Cannot open file $filename: $!";
     print FILE join ("\n", @lines), "\n";
     close FILE;
@@ -1173,6 +1181,8 @@
 {
     my ($filename, @lines) = @_;
 
+    return unless @lines;
+
     open FILE, ">>$filename" or die "Cannot open file $filename: $!";
     print FILE join ("\n", @lines), "\n";
     close FILE;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]