#!C:\Perl\bin

my $repos = shift @ARGV;
my $txn = shift @ARGV;
# Svnlook path.
my $svnlook = "\"c:\\Program Files \(x86\)\\VisualSVN Server\\bin\\svnlook\"";
print $svnlook;

#open(STDERR, "2>&STDOUT");

check_stateful_tag($svnlook,$repos,$txn);
exit (0);
sub check_stateful_tag
{
	my ($svnlook,$repos,$txn) = @_;
	my $res = `$svnlook changed $repos`;
	chomp ($res);
	$res =~ s/^.*\s//;
	$repos =~ s/\\/\//g;
	my $command = "$svnlook cat \"$repos\" \"$res\"";
	print STDERR "$command\n";
	#open TMP, ">tmperr.txt";
	my $cat = `$command`;
	$cat = $cat."my my my";
	#print TMP $cat;
	$cat =~ s/</\\</g;
	#$cat = exec($command);
	#chomp ($cat);
	print STDERR "cat before: $cat\n";
	print STDERR "---------------------\n";
		if ($cat =~ /^.*<statefule>\s*false\s*<\/statefule>.*/gi)
		{ 
			print STDERR "cat1= $cat\n";
			print STDERR "File: $repos\\$res has stateful value FALSE!!!\n";
			exit(1);
		}
		else
		{
			print STDERR "cat2= $cat\nFile Checked in... check condition\n";
			exit(1);
		}
}