summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKari Oikarinen <kari.oikarinen@qt.io>2019-08-27 09:58:10 +0300
committerKari Oikarinen <kari.oikarinen@qt.io>2019-09-06 11:50:49 +0300
commitcd7003a5bb8cf022044ee0fe0e10e5e601dbfcf2 (patch)
treee758a2ed143740e8c694c287d0feb84a56c28230
parent3cbc0456a5c238c755e47c49ee4b047836eae5eb (diff)
branch_qt.py: Handle merges that have conflicts
Note that the merge had conflicts and those need to be resolved manually and continue for all the other modules. Change-Id: Id4409bf16e8ea22ef7dc32d92b38a0a0adf75f60 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
-rwxr-xr-xscripts/qt/branch_qt.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/scripts/qt/branch_qt.py b/scripts/qt/branch_qt.py
index 910f27aa..022590da 100755
--- a/scripts/qt/branch_qt.py
+++ b/scripts/qt/branch_qt.py
@@ -250,14 +250,19 @@ class QtBranching:
def merge_repo(self, repo: git.Repo) -> None:
log.info(f"Merge: {repo.working_dir}")
+ push_merge = lambda: self.subprocess_or_pretend(f'git push gerrit {self.toBranch}:{self.toBranch}'.split(), check=True)
self.checkout_and_pull_branch(repo, self.toBranch)
try:
subprocess.run(f'git merge --ff-only --quiet gerrit/{self.fromBranch}'.split(), check=True, stderr=subprocess.PIPE)
+ push_merge()
except subprocess.CalledProcessError:
# The merge was not fast forward, try again
- log.info(f" Attempting non ff merge for {repo.working_dir}")
- subprocess.run(['git', 'merge', f'gerrit/{self.fromBranch}', '--quiet', '-m', f'Merge {self.fromBranch} into {self.toBranch}'], check=True)
- self.subprocess_or_pretend(f'git push gerrit {self.toBranch}:{self.toBranch}'.split(), check=True)
+ try:
+ log.info(f" Attempting non ff merge for {repo.working_dir}")
+ subprocess.run(['git', 'merge', f'gerrit/{self.fromBranch}', '--quiet', '-m', f'Merge {self.fromBranch} into {self.toBranch}'], check=True)
+ push_merge()
+ except subprocess.CalledProcessError:
+ log.warning(f" Merge had conflicts. {repo.working_dir} needs to be merged manually!")
def version_bump_repo(self, repo: git.Repo) -> None:
qmake_conf_file_name = '.qmake.conf'