[cvsnt] Scripts variables
GOLLOT Erik
erik_gollot at yahoo.fr
Mon Dec 20 15:52:10 GMT 2004
Thanks !
Adrian Crossley <adrian.crossley at hesa.ac.uk> wrote:Variables: http://www.cvsnt.org/manual/Variables.html
stdin is mostly just the log message.
My loginfo command is: DEFAULT php /cvsnt/cvsroot-it/CVSROOT/loginfo-log.php %{sVv} $CVSROOT $USER $COMMITID >> /cvsnt/cvsroot-it/CVSROOT/commitlog
My php loginfo script is below. I run on Windows2003.
hth
Ade
/*
** print cvs commit info obtained from args and stdin
*/
if (strftime("%Z") == 'GMT Daylight Time') {
$timestamp = strftime("%Y-%m-%d %H:%M:%S BST");
} else {
$timestamp = strftime("%Y-%m-%d %H:%M:%S GMT");
}
$changes = explode(' ', $argv[1]);
$module = array_shift($changes);
$cvsroot = $argv[2];
$user = $argv[3];
$commitid = $argv[4];
$logmsg = '';
$previousLine = '';
while ($currentLine = fgets(STDIN)) {
if ( ereg('^Log Message:', $previousLine)) {
$logmsg .= $currentLine;
} elseif ($logmsg != '') {
$logmsg .= $currentLine;
}
$previousLine = $currentLine;
}
echo "------------------------------------------------------\n";
echo "Timestamp : $timestamp\n";
echo "Repository: $cvsroot\n";
echo "Module : $module\n";
echo "User : $user\n";
echo "CommitID : $commitid\n";
echo "Changes : \n";
foreach($changes as $change) {
$part = explode(',', $change);
if ($part[1] == 'NONE') {
echo " $part[0] Added\n";
} elseif ($part[2] == 'NONE') {
echo " $part[0] Removed\n";
} else {
echo " $part[0] Modified\n";
}
}
echo "Reason : \n$logmsg";
?>
_______________________________________________
cvsnt mailing list
cvsnt at cvsnt.org
http://www.cvsnt.org/cgi-bin/mailman/listinfo/cvsnt
---------------------------------
Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails !
Créez votre Yahoo! Mail
More information about the cvsnt
mailing list