]>
git.saurik.com Git - wxWidgets.git/blob - difflast.pl
3 ###############################################################################
5 # Purpose: Shows the difference between the current local version of the file
6 # and the last cvs revision
10 # Copyright:(c) Vadim Zeitlin 1999
11 ###############################################################################
15 my $CVS = "cvs -z3"; # the cvs command
21 # decrement the revision number to get the previos one
22 # (FIXME this is totally bogus, won't work with branches)
23 my $revlen = length($rev) - rindex($rev, '.') - 1;
26 return int($rev) . "." . ($rev*$m - int($rev)*$m - 1)
34 $basename =~ s
@^.*/([^/]\
+)@$1@;
36 # first get the current version: try the Id RCS tag in the file itself
37 # first, use "cvs status" if this fails
38 if ( open(INPUT
, $file) ) {
40 # notice that we shouldn't have '$' followed by 'Id' or cvs will
42 if ( /\$(Id): $basename,v (\d+\.\d+)/ ) {
48 open(INPUT
, "$CVS -q status $file |") or return 0;
51 if ( /Working revision:\s+(\d+\.\d+)/ ) {
62 my $revlast = &get_last_rev
($file);
65 warn "Failed to get the last revision for $file, skipping.\n"
67 elsif ( $revlast =~ "\.0" ) {
68 warn "No previous revision of the file $file.\n"
71 print `$CVS diff -b -kk -r $revlast $file`;
77 die "Usage: $0 <filenames...>\n" if ( $#ARGV == -1 );
79 foreach my $file (@ARGV) { process_file($file); }