Skip to content

Commit

Permalink
Item11210: More debugging
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/trunk@12930 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
GeorgeClark authored and GeorgeClark committed Oct 29, 2011
1 parent 84f0aa3 commit 4a6b669
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions core/tools/develop/post-commit.pl
Expand Up @@ -15,6 +15,9 @@

my $verbose = 1; # 1 to debug

# Don't know where STDERR goes, so send it somewhere we can read it
open( STDERR, '>>', "$SUPPORT/logs/post-commit.log" ) || die $!;

my $first = 1;
if ( open( F, '<', "$SUPPORT/lastupdate" ) ) {
local $/ = "\n";
Expand All @@ -33,7 +36,7 @@

$first ||= ( $last - 1 );

print "F:$first L:$last\n" if $verbose;
print STDERR "F:$first L:$last\n" if $verbose;
my @changes;
for ( my $i = $first + 1 ; $i <= $last ; $i++ ) {
push(
Expand All @@ -45,7 +48,7 @@
split( /\n/, `/usr/local/bin/svnlook changed -r $i $REPOS` )
);
}
print scalar(@changes), " changes\n" if $verbose;
print STDERR scalar(@changes) . " changes\n" if $verbose;
exit 0 unless scalar(@changes);

sub _add {
Expand All @@ -60,8 +63,6 @@ sub _add {
return $new;
}

# Don't know where STDERR goes, so send it somewhere we can read it
open( STDERR, '>>', "$SUPPORT/logs/post-commit.log" ) || die $!;
print STDERR "Post-Commit $first..$last in $REPOS\n";
$/ = undef;

Expand All @@ -88,7 +89,7 @@ sub _add {
if ( -e "$BUGS/$item.txt,v" ) {
my $rlog = `rlog -h $BUGS/$item.txt`;
($lastrev) = $rlog =~ m/^head: 1\.(\d+).*?$/ms;
print "LAST REVISION $lastrev of Item$item \n" if $verbose;
print STDERR "LAST REVISION $lastrev of Item$item \n" if $verbose;
}
$lastrev++;

Expand All @@ -102,6 +103,7 @@ sub _add {
$text =~ s/^(%META:TOPICINFO{.*?comment=")(?:[^"]*)(".*?}%)$/$1svn commit$2/m;
my $timestamp = time();
$text =~ s/^(%META:TOPICINFO{.*?date=")(?:[^"]*)(".*?}%)$/$1$timestamp$2/m;
print STDERR "Updated TOPICINFO with author $committer rev $lastrev timestamp $timestamp\n" if $verbose;

unless ( $text =~
s/^(%META:FIELD.*name="Checkins".*value=")(.*?)(".*%)$/$1._add($2, $rev, \$changed).$3/gem
Expand Down

0 comments on commit 4a6b669

Please sign in to comment.