Index: branches/5.2.x/core/units/helpers/deployment_helper.php =================================================================== diff -u -N -r16019 -r16467 --- branches/5.2.x/core/units/helpers/deployment_helper.php (.../deployment_helper.php) (revision 16019) +++ branches/5.2.x/core/units/helpers/deployment_helper.php (.../deployment_helper.php) (revision 16467) @@ -1,6 +1,6 @@ $match) { + $revision_numbers = array(); + + foreach ( $matches as $index => $match ) { $revision = $match[1][0]; - if ( $this->revisionApplied($revision) ) { - // skip applied revisions - continue; - } - - if ( isset($this->revisionSqls[$revision]) ) { - // duplicate revision among non-applied ones + if ( in_array($revision, $revision_numbers) ) { $this->displayStatus('FAILED' . PHP_EOL . 'Duplicate revision #' . $revision . ' found'); return false; } - // get revision sqls + $revision_numbers[] = $revision; + + if ( $this->revisionApplied($revision) ) { + // Skip applied revisions. + continue; + } + + // Get revision sqls. $start_pos = $match[0][1] + strlen($match[0][0]); $end_pos = isset($matches[$index + 1]) ? $matches[$index + 1][0][1] : strlen($sqls); $revision_sqls = substr($sqls, $start_pos, $end_pos - $start_pos);