diff options
author | Bruno Coudoin <bcoudoin@src.gnome.org> | 2007-01-30 21:15:03 (GMT) |
---|---|---|
committer | Bruno Coudoin <bcoudoin@src.gnome.org> | 2007-01-30 21:15:03 (GMT) |
commit | 059da8cd1ac50beed109f1ab0db6c7db34af98ac (patch) | |
tree | 4c58bbc5b08e2174ca83108e26b80803e1a58002 | |
parent | 5f5278a79846afcf9390db3fa3185084eba8d6b3 (diff) |
prepare-ChangeLog.pl: imported new one to support svn, taken from
http://www.gnome.org/~fherrera/patches/prepare-ChangeLog.pl
svn path=/trunk/; revision=2462
-rw-r--r-- | ChangeLog | 8 | ||||
-rwxr-xr-x | prepare-ChangeLog.pl | 45 |
2 files changed, 47 insertions, 6 deletions
@@ -1,4 +1,10 @@ -2007-01-30 Yves Combe <yves@ycombe.net> +2007-01-30 Bruno coudoin <bruno.coudoin@free.fr> + + * prepare-ChangeLog.pl: imported new one to support svn, taken from + http://www.gnome.org/~fherrera/patches/prepare-ChangeLog.pl + + +2007-01-30 Bruno coudoin <bruno.coudoin@free.fr> GCompris no more use a library libgcompris diff --git a/prepare-ChangeLog.pl b/prepare-ChangeLog.pl index b52482f..6cb4fba 100755 --- a/prepare-ChangeLog.pl +++ b/prepare-ChangeLog.pl @@ -46,11 +46,34 @@ use strict; use English; use Text::Wrap; +# Check for cvs or svn system +my $command; +if (-e "CVS/Root") + { + $command = "cvs"; + } +elsif (-e ".svn/README.txt") + { + $command = "svn"; + } +else + { + die "There is not known revision system.\n" + } + # Read the old change log file. # It's less efficient to read the whole thing into memory than it would be # to read it while we prepend to it later, but I like doing this part first. -print STDERR " Updating ChangeLog from cvs repository.\n"; -open ERRORS, "cvs update ChangeLog |" or die "The cvs update of ChangeLog failed: $OS_ERROR.\n"; +if ($command eq "cvs") + { + print STDERR " Updating ChangeLog from cvs repository.\n"; + open ERRORS, "cvs update ChangeLog |" or die "The cvs update of ChangeLog failed: $OS_ERROR.\n"; + } +else + { + print STDERR " Updating ChangeLog from svn repository.\n"; + open ERRORS, "svn update ChangeLog |" or die "The cvs update of ChangeLog failed: $OS_ERROR.\n"; + } print STDERR " $ARG" while <ERRORS>; close ERRORS; open OLD_CHANGE_LOG, "ChangeLog" or die "Could not open ChangeLog file: $OS_ERROR.\n"; @@ -59,10 +82,19 @@ close OLD_CHANGE_LOG; # For each file, build a list of modified lines. # Use line numbers from the "after" side of each diff. -print STDERR " Running cvs diff to find changes.\n"; my %changed_line_ranges; my $file; -open DIFF, "cvs -fq diff -N |" or die "The cvs diff failed: $OS_ERROR.\n"; +if ($command eq "cvs") + { + print STDERR " Running cvs diff to find changes.\n"; + open DIFF, "cvs -fq diff -N |" or die "The cvs diff failed: $OS_ERROR.\n"; + } +else + { + print STDERR " Running svn diff to find changes.\n"; + open DIFF, "svn --non-interactive diff --diff-cmd diff -x \"-b\" |" or die "The cvs diff failed: $OS_ERROR.\n"; + } + while (<DIFF>) { $file = $1 if /^Index: (\S+)$/; @@ -89,7 +121,7 @@ foreach my $file (keys %changed_line_ranges) $function_lists{$file} = ""; # Only look for function names in .c files. - next unless $file =~ /\.(c|java)/; + next unless $file =~ /\.(c|java|cs)/; # Find all the functions in the file. open SOURCE, $file or next; @@ -170,6 +202,9 @@ sub get_function_line_ranges return get_function_line_ranges_for_c ($file_handle, $file_name); } elsif ($file_name =~ /\.java$/) { return get_function_line_ranges_for_java ($file_handle, $file_name); + } elsif ($file_name =~ /\.cs$/) { + #FIXME write a function to extract from .cs files + return get_function_line_ranges_for_java ($file_handle, $file_name); } return (); } |