summaryrefslogtreecommitdiffstats
path: root/scripts/cvslastreferenced
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitbd9e6617827818fd043452c08c606f07b78014a0 (patch)
tree425bb4c3168f9c02f10150f235d2cb998dcc6108 /scripts/cvslastreferenced
downloadtdesdk-bd9e6617827818fd043452c08c606f07b78014a0.tar.gz
tdesdk-bd9e6617827818fd043452c08c606f07b78014a0.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'scripts/cvslastreferenced')
-rwxr-xr-xscripts/cvslastreferenced64
1 files changed, 64 insertions, 0 deletions
diff --git a/scripts/cvslastreferenced b/scripts/cvslastreferenced
new file mode 100755
index 00000000..666a5b6d
--- /dev/null
+++ b/scripts/cvslastreferenced
@@ -0,0 +1,64 @@
+#!/usr/bin/perl -w
+# Written by Zack Rusin <zack@kde.org>
+#
+# This file is free software, licensed under the BSD licence.
+# That means that you can do anything you want with it except
+# eating too much candy since that totally messes up your teeth
+# and here in KDE land we care about your teeth. They're out
+# greatest priority right next to scoring chicks of course...
+#
+
+# This script goes through the whole history of a file to find
+# all modifications referencing specific string. It's useful if
+# you want to know when a function has been removed/modified/added
+# to a file if a recent cvs annotate doesn't anymore reference it.
+
+our $file;
+our $func;
+
+sub check_file
+{
+ my $rev1 = shift;
+ my $rev2 = shift;
+
+ my $output = `cvs diff -r $rev1 -r $rev2 $file`;
+
+ if ( $output =~ /(^[+-].+$func.+$)/m ) {
+ print "FOUND IN: cvs diff -r $rev1 -r $rev2 $file\n";
+ $_ = $1;
+ s/^([-+])\s*(.+)/$1 $2/;
+ return $_;
+ }
+ return 0;
+}
+
+sub get_revision
+{
+ my $output = `cvsversion $file`;
+ chomp $output;
+ return $output;
+}
+
+my $argc = scalar @ARGV;
+
+die "$0 <function> <file>" if ( $argc != 2 );
+$func = $ARGV[0];
+$file = $ARGV[1];
+
+my $current_revision = get_revision( $file );
+
+$current_revision =~ /(\d+)\.(\d+)/;
+$base = $1;
+$working = $2;
+
+while ( $working > 1 ) {
+ my $older = $working - 1;
+ my $res = check_file( "$base.$older", "$base.$working");
+
+ if ( $res ) {
+ print "\t($res)\n";
+ }
+ --$working;
+}
+
+print "Didn't find a reference to that $func in $file\n";