2 require_once 'MTrack/Interface/CommitListener.php';
4 class MTrackCommitCheck_BlankLines implements IMTrackCommitListener
7 function vetoCommit($msg, $files, $actions, $checker)
9 // should only have a list of files which have been updated/added. (not deleted)
11 if (!method_exists($checker->bridge, 'getDiffStream')) { // kludge - we should use interface....
14 $fp = $checker->bridge->getDiffStream();
15 $diff = stream_get_contents($fp);
16 $lines = explode("\n",$contents);
20 // probably a CRLF fix....
21 if (count($lines) > 100) {
25 foreach($lines as $l) {
35 return "You are adding more than 2 blank lines - please remove the new blank lines you added and try again.";
44 function postCommit($msg, $files, $actions) {