r93997 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93996‎ | r93997 | r93998 >
Date:20:35, 5 August 2011
Author:reedy
Status:ok
Tags:
Comment:
Fix undefined variable, fixup documentation

Fixup spaces to tabs
Modified paths:
  • /trunk/tools/subversion/hooks/HooksCommon.inc (modified) (history)

Diff [purge]

Index: trunk/tools/subversion/hooks/HooksCommon.inc
@@ -50,16 +50,18 @@
5151 /**
5252 * Class constructor
5353 *
54 - * @param $repository String name of repository
55 - * @param $transaction
56 - */
57 - public function __construct( $repo, $txn ) {
58 - $this->repo = $repo;
59 - $this->transaction = $txn;
60 - }
 54+ * @param $repo String name of repository
 55+ * @param txn
 56+ */
 57+ public function __construct( $repo, $txn ) {
 58+ $this->repo = $repo;
 59+ $this->transaction = $txn;
 60+ }
6161
62 - /**
 62+ /**
6363 * Run SVN pre-commit tests
 64+ *
 65+ * @return int
6466 */
6567 public function runPreCommitTests() {
6668 $result = 0;
@@ -78,17 +80,17 @@
7981 return $result;
8082 }
8183
82 - /**
83 - * Get commit log message
84 - *
85 - * @return string
86 - */
87 - private function getLogMessage() {
88 - $output = null;
89 - $cmd = "{$this->svnlook} log -t '{$this->transaction}' '{$this->repo}'";
90 - exec( $cmd, $output );
91 - return implode( $output );
92 - }
 84+ /**
 85+ * Get commit log message
 86+ *
 87+ * @return string
 88+ */
 89+ private function getLogMessage() {
 90+ $output = null;
 91+ $cmd = "{$this->svnlook} log -t '{$this->transaction}' '{$this->repo}'";
 92+ exec( $cmd, $output );
 93+ return implode( $output );
 94+ }
9395
9496 /**
9597 * Get commit files list
@@ -105,10 +107,10 @@
106108 $pos = strpos( $item, ' ' );
107109 $status = substr( $item, 0, $pos );
108110 $file = trim( substr( $item, $pos ) );
109 - $list[$file] = $status;
110 - }
111 - return $list;
112 - }
 111+ $list[$file] = $status;
 112+ }
 113+ return $list;
 114+ }
113115
114116 /**
115117 * Get array of modified and added files
@@ -140,7 +142,9 @@
141143 /**
142144 * Check if log message validates length rules
143145 *
144 - * @param int $minlength minimum length of log message
 146+ * @param $minLength int minimum length of log message
 147+ * @param $regex string
 148+ *
145149 * @return bool
146150 */
147151 protected function testLogMessageLength( $minLength = 1, $regex = '' ) {
@@ -150,7 +154,7 @@
151155 if ( $minLength <= 1 ) {
152156 return "Log message should not be empty. Please specify descriptive log message.";
153157 } else {
154 - return "You log message is too short ($length). It should be at least $minlength characters long.";
 158+ return "You log message is too short ($length). It should be at least $minLength characters long.";
155159 }
156160 } elseif( !preg_match( "/$regex/i", $msg ) ) {
157161 return "Please provide a descriptive commit message with letters.";
@@ -158,6 +162,10 @@
159163 return true;
160164 }
161165
 166+ /**
 167+ * @param $fileTypes array
 168+ * @return bool|string
 169+ */
162170 protected function testPHPLint( $fileTypes ) {
163171 $output = null;
164172 $result = '';

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r93994Initial rewrite of pre-commit hooks, with framework for post-commit too :Ddemon20:28, 5 August 2011

Status & tagging log