Skip to content

Commit 363c7fa

Browse files
committed
Merge branch 'ACP2E-3725'
# Conflicts: # patches-info.json # src/UpdateInfoJson.php
2 parents 8e256c3 + 005f999 commit 363c7fa

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

patches-info.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/UpdateInfoJson.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ private function getSourceData(array $config, string $origin): array
132132
{
133133
$result = [];
134134
foreach ($config as $patchId => $patchGeneralConfig) {
135+
$replacedPatchReleases = [];
135136
$data = ['id' => $patchId];
136137
$data += $this->getPatchConstraintsData($patchGeneralConfig['packages']);
137138

@@ -145,11 +146,18 @@ private function getSourceData(array $config, string $origin): array
145146

146147
$replacedWith = [];
147148
foreach ($data['replacedWith'] ?? [] as $replacedPatchId => $replacedPatchConstraints) {
149+
$replacedPatchReleases = array_unique(array_merge(
150+
$replacedPatchReleases ?? [],
151+
$this->getCompatibleReleases($replacedPatchConstraints)
152+
));
148153
$replacedWith[] = $replacedPatchId . ' for ' .
149154
implode(', ', $this->getCompatibleReleases($replacedPatchConstraints));
150155
}
151156
if (!empty($replacedWith)) {
152-
$data['replacedWith'] = implode('; ', $replacedWith);
157+
$currentPatchReleases = array_diff($data['releases'], $replacedPatchReleases);
158+
$data['replacedWith'] = $currentPatchReleases ?
159+
$patchId . ' for ' . implode(', ', $currentPatchReleases) . '. Use ' : '';
160+
$data['replacedWith'] .= implode('; ', $replacedWith);
153161
}
154162

155163
$data['description'] = $patchGeneralConfig['title'];

0 commit comments

Comments
 (0)