Skip to content

Commit

Permalink
BUGFIX: neos#5364 throw better exceptions if workspace was up to date…
Browse files Browse the repository at this point in the history
… and publish didnt work
  • Loading branch information
mhsdesign committed Nov 15, 2024
1 parent b1fc4e6 commit 41b5453
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,11 @@ static function ($handle) use ($commandSimulator, $matchingCommands, $remainingC
yield $this->reopenContentStreamWithoutConstraintChecks(
$workspace->currentContentStreamId
);

if ($workspace->status === WorkspaceStatus::UP_TO_DATE) {
throw new \RuntimeException('TODO cannot publish changeset as the leftover changes would not be applicable.');
}
// todo either its a conflict with not applicable changes because the one change belongs to another OR the base workspace contains changes and we need to rebase first.
// we assume the latter and let the user up date the workspace first!
throw WorkspaceRebaseFailed::duringPublish($commandSimulator->getConflictingEvents());
}

Expand Down Expand Up @@ -630,6 +634,11 @@ static function ($handle) use ($commandsToKeep): void {
yield $this->reopenContentStreamWithoutConstraintChecks(
$workspace->currentContentStreamId
);
if ($workspace->status === WorkspaceStatus::UP_TO_DATE) {
throw new \RuntimeException('TODO cannot discard changeset as the leftover changes would not be applicable.');
}
// todo either its a conflict with not applicable changes because the one change belongs to another OR the base workspace contains changes and we need to rebase first.
// we assume the latter and let the user up date the workspace first!
throw WorkspaceRebaseFailed::duringDiscard($commandSimulator->getConflictingEvents());
}

Expand Down

0 comments on commit 41b5453

Please sign in to comment.