From 1a52af777b36e92b5c8414b1438d0889c42ad8de Mon Sep 17 00:00:00 2001 From: zecke Date: Tue, 23 Jul 2002 12:21:02 +0000 Subject: some neat KDE scripts which makes living with cvs more easy Carsten said I should commit then --- (limited to 'scripts') 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 @@ +#!/usr/bin/perl + +use File::Basename; + +die "need a filename!" if (!length($ARGV[0])); + +$cvsversion= dirname($0) . "/cvsversion"; +$version=`$cvsversion $ARGV[0]`; + +chop $version; +my $vold = $version; +my $vnew = $version; + +if ($version=~/^(.*)\.1$/) { + $vold = $1 if ($version=~/^([^.]\.[^.])\.[^.]\.[^.]$/); +} +else { + if ($version=~/^(.*)\.([^.]*)$/) { $v1 = $1; $v2 = $2 } + $v2old = ${v2}-1; + $vold = $v1 . '.' . $v2old; +} +print "cvs -f log -N -r$vnew $ARGV[0]\n"; +system("cvs -f log -N -r$vnew $ARGV[0]"); +print "cvs -f diff -bp -u -r$vold -r$vnew $ARGV[0]\n"; +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 @@ +#!/bin/sh +# cvslastlog - prints log of last commit for a file +# Depends on the version of the local file, not the one on the server +# Requires cvsversion +# David Faure, faure@kde.org + +cvs log -r`cvsversion $1` $1 + 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 @@ +#!/bin/sh +d=`dirname $1` +f=`basename $1` +cat $d/CVS/Entries | grep "\/$f\/" | gawk 'BEGIN { FS = "/" } { print $3 }' +exit 0 + +=head1 NAME + +cvsversion -- Displays version of the file passed as argument. + +=head1 SYNOPSIS + + cvsversion + +=head1 DESCRIPTION + +cvsversion displays the version in CVS of a file, as known by the local +checked out directory. No connection is required to the CVS server. +It can be used in other scripts, or simply to ask +for diffs using + +cvs diff -r [-r ] + +=head1 EXAMPLES + + cd baseline/kdelibs ; cvsversion configure.in + cvsversion baseline/kdelibs/configure.in + +=head1 AUTHOR + +David Faure + +=cut \ No newline at end of file -- cgit v0.9.0.2