]>
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
17 # the regexp for cvs revision number
18 my $RE_CVS_REV = "\\d+(?:\\.\\d+)+";
24 # decrement the revision number to get the previos one
25 $rev =~ s/(\d+)$/$1 - 1/e;
35 $basename =~ s
@^.*/@@;
37 # first get the current version: try the Id RCS tag in the file itself
38 # first, use "cvs status" if this fails
39 if ( open(INPUT
, $file) ) {
41 # notice that we shouldn't have '$' followed by 'Id' or cvs will
43 if ( /\$(Id): $basename,v ($RE_CVS_REV)/ ) {
49 open(INPUT
, "$CVS -q status $file |") or return 0;
52 if ( /Working revision:\s+($RE_CVS_REV)/ ) {
63 my $revlast = &get_last_rev
($file);
66 warn "Failed to get the last revision for $file, skipping.\n"
68 elsif ( $revlast =~ '\.0' ) {
69 warn "No previous revision of the file $file.\n"
72 print `$CVS diff -b -kk -r $revlast $file`;
78 die "Usage: $0 <filenames...>\n" if ( $#ARGV == -1 );
80 foreach my $file (@ARGV) { process_file($file); }