summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorallen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac>2000-03-09 09:25:06 +0000
committerallen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac>2000-03-09 09:25:06 +0000
commitf350e8aeae3c80eb6ef554f2c7ce7f0b49af18cf (patch)
tree56d06070067f0118623e6629c93f80d676a9a4bb
parente8fc5e40f0a9a199b7447cbc79089ca951cf8c94 (diff)
Fixed cvsdiff to do what it was supposed to.
Note that cvsdiff tells you the difference between the file you have checked out and possibly edited, and the latest version in the repository ... it doesn't tell you what "cvs diff" would tell you (the changes you have made to the file you checked out). I will change the name if I can think of a better one, to make this difference clearer. git-svn-id: http://svn.cactuscode.org/flesh/trunk@1451 17b73243-c579-4c4c-a9d2-2d5706c11dac
-rw-r--r--lib/sbin/CVSStatus.pl45
1 files changed, 26 insertions, 19 deletions
diff --git a/lib/sbin/CVSStatus.pl b/lib/sbin/CVSStatus.pl
index 7b4ca9f1..d5fbfdad 100644
--- a/lib/sbin/CVSStatus.pl
+++ b/lib/sbin/CVSStatus.pl
@@ -11,33 +11,37 @@
&writeheader();
+$full = 0;
+
open (CS, "cvs status 2>&1 |");
$gotone = 0;
while (<CS>) {
- if (m/waiting for/) {
- print;
- }
- if (m/Examining/) {
+
+ if (m/============/ || m/Examining/) {
if ($gotone) {
- $dir =~ m:^\s*(/\w*/\w*):;
- $dir = $1;
- if ($dir ne $dir_old) {
- print "\n$dir\n";$dir_old=$dir;
- }
- write;
+ $module =~ m:^\s*(/\w*/\w*):;
+ $module = $1;
+ if ($module ne $module_old) {
+ print "\nRepository: $module\n";$module_old=$module;
+ }
# Get differences between versions
if ($case =~ /diff/i)
{
- print "\n\ncvs diff -r $rversion $thisdir/$file\n\n";
- open (DIFF, "cvs diff -r $rversion $thisdir/$file |");
+ print "\n\n*******************************************************************\n\ncvs diff -r $rversion $dir/$file\n\n";
+ write;
+ print "\n\n";
+ open (DIFF, "cvs diff -r $rversion $dir/$file |");
while (<DIFF>) {print;}
}
+ else
+ {
+ write;
+ }
}
$gotone = 0;
- $thisdir="";
+ $module="";
$file = "";
- $dir = "";
$status = "";
$version="";
$rversion="";
@@ -49,12 +53,12 @@ while (<CS>) {
$gotone = 1;
}
}
- if (m/Examining\s*(\S+)\s*$/) {$thisdir = $1;}
+ if (m/Examining\s*(\S+)\s*$/) {$dir = $1;}
if (m/Working revision:\s*(\S+)\s/) {$version = $1;}
if (m/Repository revision:\s*(\S+)\s+(\S+)/) {
- $rversion = $1; $dir = $2;
+ $rversion = $1; $module = $2;
}
-
+
}
exit;
@@ -66,8 +70,10 @@ $file, $status, $version, $rversion
sub writeheader
{
-local ($case);
-if ($case =~ "diff")
+my ($case) = @_;
+
+print "$case\n";
+if ($case =~ /diff/)
{
print <<EOF;
@@ -75,6 +81,7 @@ CVS Diff report
File Status Local/Remote ver
-------------------------------------------------------------------------------
+EOF
}
else
{