Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1046520
D227.id532.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Jun 28, 7:41 PM
Size
1 KB
Mime Type
text/x-diff
Expires
Sun, Jun 29, 7:41 PM (2 h, 28 m)
Engine
blob
Format
Raw Data
Handle
676551
Attached To
D227: INP-1564 Check duplicate SQL revisions across all defined revisions
D227.id532.diff
View Options
Index: core/units/helpers/deployment_helper.php
===================================================================
--- core/units/helpers/deployment_helper.php
+++ core/units/helpers/deployment_helper.php
@@ -396,22 +396,25 @@
return false;
}
- foreach ($matches as $index => $match) {
- $revision = $match[1][0];
+ $revision_numbers = array();
- if ( $this->revisionApplied($revision) ) {
- // skip applied revisions
- continue;
- }
+ foreach ( $matches as $index => $match ) {
+ $revision = $match[1][0];
- 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);
Event Timeline
Log In to Comment