Skip to content

Commit

Permalink
common: check remote revision when getting project branch
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
massonju authored and makohoek committed Sep 17, 2024
1 parent 0d3078a commit ff64a5f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions repo_resource/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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 (
Expand Down

0 comments on commit ff64a5f

Please sign in to comment.