#! /usr/bin/perl -w

##  $Id: mkchangelog 7516 2006-04-15 02:51:03Z eagle $
##
##  Generate a ChangeLog from svn log using svn2cl.
##
##  This script prompts the user for a date from which to pull log entries
##  and the prefix to strip from file names and generates a ChangeLog file
##  by running svn2cl.

$| = 1;

print "Enter prefix to strip from file names: ";
my $prefix = <STDIN>;
chomp $prefix;

print "Enter date to start log at (YYYY-MM-DD): ";
my $date = <STDIN>;
chomp $date;

print "\nRunning svn2cl....\n";
my @options = qw(--strip-prefix=$prefix --reparagraph --group-by-day
                 --separate-daylogs);
system ('svn2cl', @options, '-r', "HEAD:{$date}") == 0
    or die "svn2cl exited with status " . ($? >> 8) . "\n";
