diff --git a/runbot_merge/models/batch.py b/runbot_merge/models/batch.py index fbca57fc..d35f743d 100644 --- a/runbot_merge/models/batch.py +++ b/runbot_merge/models/batch.py @@ -227,10 +227,10 @@ class Batch(models.Model): batch.blocked = f"Multiple target branches: {', '.join(targets.mapped('name'))!r}" else: if batch.blocked and batch.cancel_staging: + if splits := batch.target.split_ids: + splits.unlink() batch.target.active_staging_id.cancel( - 'unstaged by %s on %s (%s)', - self.env.user.login, - batch, + 'unstaged by %s becoming ready', ', '.join(batch.prs.mapped('display_name')), ) batch.blocked = False diff --git a/runbot_merge/models/pull_requests.py b/runbot_merge/models/pull_requests.py index 76bc6a9f..927536af 100644 --- a/runbot_merge/models/pull_requests.py +++ b/runbot_merge/models/pull_requests.py @@ -842,6 +842,8 @@ For your own safety I've ignored *everything in your entire comment*. case commands.CancelStaging() if is_admin: self.batch_id.cancel_staging = True if not self.batch_id.blocked: + if splits := self.target.split_ids: + splits.unlink() self.target.active_staging_id.cancel( "Unstaged by %s on %s", author.github_login, self.display_name,