fixed bugs in the rewritten perl scripts
This commit is contained in:
		| @ -69,15 +69,20 @@ sub write_commit_log | ||||
| 	my $message = "svn,$projectid,$revision"; | ||||
| 	my $createdon = strftime ('%Y-%m-%d %H:%M:%S', localtime()); | ||||
|  | ||||
| 	my $query = $dbh->prepare ("INSERT INTO ${prefix}log(type,projectid,message,createdon,action,userid) VALUES(?,?,?,?,?,?)"); | ||||
| 	$dbh->begin_work (); | ||||
|  | ||||
| 	my $query = $dbh->prepare ("INSERT INTO ${prefix}log (type,projectid,message,createdon,action,userid) VALUES (?,?,?,?,?,?)"); | ||||
| 	if (!$query || !$query->execute ('code', $projectid, $message, $createdon, 'commit', $userid)) | ||||
| 	{ | ||||
| 		my $errstr = $dbh->errstr(); | ||||
| 		$query->finish (); | ||||
| 		$dbh->rollback (); | ||||
| 		return (-1, $dbh->errstr()); | ||||
| 		return (-1, $errstr); | ||||
| 	} | ||||
|  | ||||
| 	$query->finish (); | ||||
| 	$dbh->commit (); | ||||
| 	return 0; | ||||
| 	return (0, undef); | ||||
| } | ||||
|  | ||||
| #------------------------------------------------------------ | ||||
|  | ||||
| @ -83,15 +83,20 @@ sub write_revprop_change_log | ||||
| 	my $message = "svn,$projectid,$revision,$propname,$action"; | ||||
| 	my $createdon = strftime ('%Y-%m-%d %H:%M:%S', localtime()); | ||||
|  | ||||
| 	my $query = $dbh->prepare ("INSERT INTO ${prefix}log(type,projectid,message,createdon,action,userid) VALUES(?,?,?,?,?,?)"); | ||||
| 	$dbh->begin_word (); | ||||
|  | ||||
| 	my $query = $dbh->prepare ("INSERT INTO ${prefix}log (type,projectid,message,createdon,action,userid) VALUES (?,?,?,?,?,?)"); | ||||
| 	if (!$query || !$query->execute ('code', $projectid, $message, $createdon, 'revpropchange', $userid)) | ||||
| 	{ | ||||
| 		$dbh->rollback (); | ||||
| 		return (-1, $dbh->errstr()); | ||||
| 	} | ||||
|                 my $errstr = $dbh->errstr(); | ||||
|                 $query->finish (); | ||||
|                 $dbh->rollback (); | ||||
|                 return (-1, $errstr); | ||||
|         } | ||||
|  | ||||
| 	$query->finish (); | ||||
| 	$dbh->commit (); | ||||
| 	return 0; | ||||
| 	return (0, undef); | ||||
| } | ||||
|  | ||||
| #------------------------------------------------------------ | ||||
|  | ||||
| @ -69,6 +69,7 @@ sub is_project_member | ||||
| 	} | ||||
|  | ||||
| 	my @row = $query->fetchrow_array; | ||||
| 	$query->finish (); | ||||
| 	return (((scalar(@row) > 0)? 1: 0), undef); | ||||
| } | ||||
|  | ||||
|  | ||||
| @ -66,6 +66,7 @@ sub is_project_member | ||||
| 	} | ||||
|  | ||||
| 	my @row = $query->fetchrow_array; | ||||
| 	$query->finish (); | ||||
| 	return (((scalar(@row) > 0)? 1: 0), undef); | ||||
| } | ||||
|  | ||||
| @ -80,6 +81,7 @@ sub is_project_commitable | ||||
| 	} | ||||
|  | ||||
| 	my @row = $query->fetchrow_array; | ||||
| 	$query->finish (); | ||||
| 	return (((scalar(@row) > 0 && $row[0] eq 'Y')? 1: 0), undef); | ||||
| } | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user