From 7ac7496cc399b89e9895c5b7bc40dba7f7d3c32f Mon Sep 17 00:00:00 2001 From: Julien Masson Date: Tue, 17 Sep 2024 10:32:00 +0200 Subject: [PATCH] common: check remote revision when getting project branch The project branch is set according to: 1. 'revision' entry in the xml or 2. the remote revision of the project or 3. default branch (retrieved by 'default' xml entry) We added the condition 2. because if a project contains a remote different than the default, we must get the revision according to this remote and not the default. Signed-off-by: Julien Masson --- repo_resource/common.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/repo_resource/common.py b/repo_resource/common.py index bf895e1..e23c6ef 100644 --- a/repo_resource/common.py +++ b/repo_resource/common.py @@ -460,8 +460,10 @@ def update_manifest(self, jobs): for p in manifest.findall('project'): project = p.get('name') - projectBranch = p.get('revision') or defaultBranch projectRemote = p.get('remote') or defaultRemote + projectBranch = p.get('revision') \ + or self.__get_remote_revision(projectRemote) \ + or defaultBranch projectRemoteUrl = self.__get_remote_url(projectRemote) projects.append((projectRemote, projectRemoteUrl, project, projectBranch)) @@ -472,8 +474,10 @@ def update_manifest(self, jobs): # Update revisions for p in manifest.findall('project'): project = p.get('name') - projectBranch = p.get('revision') or defaultBranch projectRemote = p.get('remote') or defaultRemote + projectBranch = p.get('revision') \ + or self.__get_remote_revision(projectRemote) \ + or defaultBranch # find revision of the project in revisionList for url, branch, rev in revisionList: if (