-rw-r--r-- | scripts/cvslastchange | 25 | ||||
-rw-r--r-- | scripts/cvslastlog | 8 | ||||
-rw-r--r-- | scripts/cvsversion | 33 |
3 files changed, 66 insertions, 0 deletions
diff --git a/scripts/cvslastchange b/scripts/cvslastchange new file mode 100644 index 0000000..ca77297 --- a/dev/null +++ b/scripts/cvslastchange | |||
@@ -0,0 +1,25 @@ | |||
1 | #!/usr/bin/perl | ||
2 | |||
3 | use File::Basename; | ||
4 | |||
5 | die "need a filename!" if (!length($ARGV[0])); | ||
6 | |||
7 | $cvsversion= dirname($0) . "/cvsversion"; | ||
8 | $version=`$cvsversion $ARGV[0]`; | ||
9 | |||
10 | chop $version; | ||
11 | my $vold = $version; | ||
12 | my $vnew = $version; | ||
13 | |||
14 | if ($version=~/^(.*)\.1$/) { | ||
15 | $vold = $1 if ($version=~/^([^.]\.[^.])\.[^.]\.[^.]$/); | ||
16 | } | ||
17 | else { | ||
18 | if ($version=~/^(.*)\.([^.]*)$/) { $v1 = $1; $v2 = $2 } | ||
19 | $v2old = ${v2}-1; | ||
20 | $vold = $v1 . '.' . $v2old; | ||
21 | } | ||
22 | print "cvs -f log -N -r$vnew $ARGV[0]\n"; | ||
23 | system("cvs -f log -N -r$vnew $ARGV[0]"); | ||
24 | print "cvs -f diff -bp -u -r$vold -r$vnew $ARGV[0]\n"; | ||
25 | system("cvs -f diff -bp -u -r$vold -r$vnew $ARGV[0]"); | ||
diff --git a/scripts/cvslastlog b/scripts/cvslastlog new file mode 100644 index 0000000..7676a6a --- a/dev/null +++ b/scripts/cvslastlog | |||
@@ -0,0 +1,8 @@ | |||
1 | #!/bin/sh | ||
2 | # cvslastlog - prints log of last commit for a file | ||
3 | # Depends on the version of the local file, not the one on the server | ||
4 | # Requires cvsversion | ||
5 | # David Faure, faure@kde.org | ||
6 | |||
7 | cvs log -r`cvsversion $1` $1 | ||
8 | |||
diff --git a/scripts/cvsversion b/scripts/cvsversion new file mode 100644 index 0000000..e14d16d --- a/dev/null +++ b/scripts/cvsversion | |||
@@ -0,0 +1,33 @@ | |||
1 | #!/bin/sh | ||
2 | d=`dirname $1` | ||
3 | f=`basename $1` | ||
4 | cat $d/CVS/Entries | grep "\/$f\/" | gawk 'BEGIN { FS = "/" } { print $3 }' | ||
5 | exit 0 | ||
6 | |||
7 | =head1 NAME | ||
8 | |||
9 | cvsversion -- Displays version of the file passed as argument. | ||
10 | |||
11 | =head1 SYNOPSIS | ||
12 | |||
13 | cvsversion <file> | ||
14 | |||
15 | =head1 DESCRIPTION | ||
16 | |||
17 | cvsversion displays the version in CVS of a file, as known by the local | ||
18 | checked out directory. No connection is required to the CVS server. | ||
19 | It can be used in other scripts, or simply to ask | ||
20 | for diffs using | ||
21 | |||
22 | cvs diff -r <version> [-r <version>] <file> | ||
23 | |||
24 | =head1 EXAMPLES | ||
25 | |||
26 | cd baseline/kdelibs ; cvsversion configure.in | ||
27 | cvsversion baseline/kdelibs/configure.in | ||
28 | |||
29 | =head1 AUTHOR | ||
30 | |||
31 | David Faure <faure@kde.org> | ||
32 | |||
33 | =cut \ No newline at end of file | ||