mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 23:45:44 +07:00
[FIX] runbot: single version fill missing
The batch prepare fill missing won't work if the repo is single version, in a foreign bundle. This commit simply adds the branches depending on their version instead of the bundle version.
This commit is contained in:
parent
6284baa1dc
commit
700c018b33
@ -314,8 +314,14 @@ class Batch(models.Model):
|
|||||||
# 4. FIND missing commit in foreign project
|
# 4. FIND missing commit in foreign project
|
||||||
if missing_repos:
|
if missing_repos:
|
||||||
if foreign_projects:
|
if foreign_projects:
|
||||||
base_foreign_bundles = bundle.search([('name', '=', bundle.base_id.name), ('project_id', 'in', foreign_projects.ids)])
|
foreign_branches = self.env['runbot.branch']
|
||||||
_fill_missing({branch: branch.head for branch in base_foreign_bundles.mapped('branch_ids')}, 'base_head')
|
all_versions = missing_repos.single_version | bundle.version_id
|
||||||
|
foreign_bundles = bundle.search([('version_id', 'in', all_versions.ids), ('is_base', '=', True), ('project_id', 'in', missing_repos.project_id.ids)])
|
||||||
|
all_foreign_branches = foreign_bundles.mapped('branch_ids')
|
||||||
|
for repo in missing_repos:
|
||||||
|
version = repo.single_version or bundle.version_id
|
||||||
|
foreign_branches |= all_foreign_branches.filtered(lambda b: b.remote_id.repo_id == repo and b.bundle_id.version_id == version)
|
||||||
|
_fill_missing({branch: branch.head for branch in foreign_branches}, 'base_head')
|
||||||
|
|
||||||
# 5. FIND missing commit in foreign project
|
# 5. FIND missing commit in foreign project
|
||||||
if missing_repos and foreign_projects and missing_repos.mapped('single_version'):
|
if missing_repos and foreign_projects and missing_repos.mapped('single_version'):
|
||||||
|
Loading…
Reference in New Issue
Block a user