summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--scripts/cvslastchange161
1 files changed, 150 insertions, 11 deletions
diff --git a/scripts/cvslastchange b/scripts/cvslastchange
index ca77297..4c0e37a 100644
--- a/scripts/cvslastchange
+++ b/scripts/cvslastchange
@@ -1,17 +1,150 @@
1#!/usr/bin/perl 1!/usr/bin/perl
2 2
3use File::Basename; 3use File::Basename;
4 4
5die "need a filename!" if (!length($ARGV[0])); 5sub usage()
6{
7 print "Usage:\n";
8 print " $0 [ <filename > | <filename> <rev> | \n" .
9 " M +<digits> -<digits> <filename <rev> ]\n";
10 print "\n";
11
12 exit 5;
13}
14
15my $filename;
16
17my $argc = scalar @ARGV;
18
19if ($argc > 0 and $argc < 3 ) {
20 $filename = $ARGV[0];
21 $cvsversion= dirname($0) . "/cvsversion";
22 $version=`$cvsversion $filename`;
23 chomp $version;
24 $version=$ARGV[1] if ($argc > 1 and $ARGV[1] =~ /^[\d\.]{3,}$/);
25} elsif ($argc == 5) {
26 $filename=$ARGV[3] if (-f $ARGV[3]);
27 $version=$ARGV[4] if ($ARGV[4] =~ /^[\d\.]{3,}$/);
28} else {
29 &usage();
30}
31
32die "$0: filename expected" if(!length($filename));
33die "$filename: $!\n" if (! -f $filename);
34
35my $vold = $version;
36my $vnew = $version;
37
38if ($version=~/^.*\.1$/) {
39 $vold = $1 if ($version=~/^(\d+\.\d+(?:\.\d+\.\d+)*)\.\d+\.1$/);
40}
41else {
42 if ($version=~/^(.*)\.([^.]*)$/) { $v1 = $1; $v2 = $2 }
43 $v2old = ${v2}-1;
44 $vold = $v1 . '.' . $v2old;
45}
46my $base = basename($filename);
47my $dir = dirname($filename);
48my $cmd = "cd $dir; cvs -f log -N -r$vnew $base";
49print "$cmd\n";
50system("$cmd");
51my $whitespace = "";
52$whitespace = "-b" unless (defined $ENV{"CVSLASTCHANGE_KEEP_WHITESPACE"});
53$cmd = "cd $dir; cvs -f diff -kk $whitespace -p -u -r$vold -r$vnew $base";
54print "$cmd\n";
55!/usr/bin/perl
56
57use File::Basename;
58
59sub usage()
60{
61 print "Usage:\n";
62 print " $0 [ <filename > | <filename> <rev> | \n" .
63 " M +<digits> -<digits> <filename <rev> ]\n";
64 print "\n";
65
66 exit 5;
67}
68
69my $filename;
70
71my $argc = scalar @ARGV;
72
73if ($argc > 0 and $argc < 3 ) {
74 $filename = $ARGV[0];
75 $cvsversion= dirname($0) . "/cvsversion";
76 $version=`$cvsversion $filename`;
77 chomp $version;
78 $version=$ARGV[1] if ($argc > 1 and $ARGV[1] =~ /^[\d\.]{3,}$/);
79} elsif ($argc == 5) {
80 $filename=$ARGV[3] if (-f $ARGV[3]);
81 $version=$ARGV[4] if ($ARGV[4] =~ /^[\d\.]{3,}$/);
82} else {
83 &usage();
84}
85
86die "$0: filename expected" if(!length($filename));
87die "$filename: $!\n" if (! -f $filename);
88
89my $vold = $version;
90my $vnew = $version;
91
92if ($version=~/^.*\.1$/) {
93 $vold = $1 if ($version=~/^(\d+\.\d+(?:\.\d+\.\d+)*)\.\d+\.1$/);
94}
95else {
96 if ($version=~/^(.*)\.([^.]*)$/) { $v1 = $1; $v2 = $2 }
97 $v2old = ${v2}-1;
98 $vold = $v1 . '.' . $v2old;
99}
100my $base = basename($filename);
101my $dir = dirname($filename);
102my $cmd = "cd $dir; cvs -f log -N -r$vnew $base";
103print "$cmd\n";
104system("$cmd");
105my $whitespace = "";
106$whitespace = "-b" unless (defined $ENV{"CVSLASTCHANGE_KEEP_WHITESPACE"});
107$cmd = "cd $dir; cvs -f diff -kk $whitespace -p -u -r$vold -r$vnew $base";
108print "$cmd\n";
109sy
110!/usr/bin/perl
111
112use File::Basename;
113
114sub usage()
115{
116 print "Usage:\n";
117 print " $0 [ <filename > | <filename> <rev> | \n" .
118 " M +<digits> -<digits> <filename <rev> ]\n";
119 print "\n";
120
121 exit 5;
122}
123
124my $filename;
125
126my $argc = scalar @ARGV;
127
128if ($argc > 0 and $argc < 3 ) {
129 $filename = $ARGV[0];
130 $cvsversion= dirname($0) . "/cvsversion";
131 $version=`$cvsversion $filename`;
132 chomp $version;
133 $version=$ARGV[1] if ($argc > 1 and $ARGV[1] =~ /^[\d\.]{3,}$/);
134} elsif ($argc == 5) {
135 $filename=$ARGV[3] if (-f $ARGV[3]);
136 $version=$ARGV[4] if ($ARGV[4] =~ /^[\d\.]{3,}$/);
137} else {
138 &usage();
139}
6 140
7$cvsversion= dirname($0) . "/cvsversion"; 141die "$0: filename expected" if(!length($filename));
8$version=`$cvsversion $ARGV[0]`; 142die "$filename: $!\n" if (! -f $filename);
9 143
10chop $version;
11my $vold = $version; 144my $vold = $version;
12my $vnew = $version; 145my $vnew = $version;
13 146
14if ($version=~/^(.*)\.1$/) { 147if ($version=~/^.*\.1$/) {
15 $vold = $1 if ($version=~/^([^.]\.[^.])\.[^.]\.[^.]$/); 148 $vold = $1 if ($version=~/^(\d+\.\d+(?:\.\d+\.\d+)*)\.\d+\.1$/);
16} 149}
17else { 150else {
@@ -20,6 +153,12 @@ else {
20 $vold = $v1 . '.' . $v2old; 153 $vold = $v1 . '.' . $v2old;
21} 154}
22print "cvs -f log -N -r$vnew $ARGV[0]\n"; 155my $base = basename($filename);
23system("cvs -f log -N -r$vnew $ARGV[0]"); 156my $dir = dirname($filename);
24print "cvs -f diff -bp -u -r$vold -r$vnew $ARGV[0]\n"; 157my $cmd = "cd $dir; cvs -f log -N -r$vnew $base";
25system("cvs -f diff -bp -u -r$vold -r$vnew $ARGV[0]"); 158print "$cmd\n";
159system("$cmd");
160my $whitespace = "";
161$whitespace = "-b" unless (defined $ENV{"CVSLASTCHANGE_KEEP_WHITESPACE"});
162$cmd = "cd $dir; cvs -f diff -kk $whitespace -p -u -r$vold -r$vnew $base";
163print "$cmd\n";
164system("$cmd");