diff --git a/merge_into_manifest.py b/merge_into_manifest.py index e83a3d04fb7fdf7bbe0ea1795240f4606e5b86ca..2ba9eb3cd5c9903d29e039e52cf8aeee9902ef8f 100755 --- a/merge_into_manifest.py +++ b/merge_into_manifest.py @@ -9,6 +9,7 @@ from accept_merge_request import accept_merge_request from create_merge_request import create_merge_request from get_merge_requests import get_merge_requests from integrate_into_manifest import integrate_into_manifest +from get_current_revision_from_manifest import get_current_revision_from_manifest def merge_into_manifest( @@ -26,6 +27,27 @@ def merge_into_manifest( the current manifest master. """ + # Check if the commit is already merged + # Currently this is especially true if the gitlab-ci + # pipeline already has merged an gitlab-ci update + current_revisions = get_current_revision_from_manifest( + manifest_project=manifest_project, + manifest_branch=master_branch, + project=project, + recipe_name=recipe_name, + srcrev_file=srcrev_file, + ) + # This commit is contained there if current_revisions contains + # it directly or any parrent of current_revisions is commit + for rev in current_revisions: + if common.is_commit_parent_of_project_commit(project, rev, commit): + print( + "Commit {} is already merged into {}".format( + commit, manifest_project.name + ) + ) + return + # Get source merge request mrs = get_merge_requests( project,