summaryrefslogtreecommitdiffstats
path: root/src/qtmoduleupdater/qt5.go
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2019-10-11 17:00:59 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2019-10-14 10:10:44 +0200
commit25c601642a30050948d7ab1cb2bd93f20aaca3d3 (patch)
treed9244e1d40b3670abf6bd459750f6e6bc692411b /src/qtmoduleupdater/qt5.go
parent6782d52ba4279b5c7400073da1025bbf7b332c20 (diff)
Clean up gerrit interaction options
Collect the parameters in a struct to reduce the amount of parameters to pass through. This is done also in preparation for making the code easier when dealing with multiple batches. Change-Id: I3bbe99286b8cf14f9f948bc27c95664d4959db08 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Diffstat (limited to 'src/qtmoduleupdater/qt5.go')
-rw-r--r--src/qtmoduleupdater/qt5.go10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/qtmoduleupdater/qt5.go b/src/qtmoduleupdater/qt5.go
index 73710d24..738a084b 100644
--- a/src/qtmoduleupdater/qt5.go
+++ b/src/qtmoduleupdater/qt5.go
@@ -171,7 +171,7 @@ func getQt5ProductModules(productProject string, branchOrRef string, productFetc
return listSubmodules(productRepo, productRepoURL, productHead)
}
-func prepareQt5Update(product string, branch string, updatedModules map[string]*Module, pushUserName string, manualStage bool) error {
+func prepareQt5Update(product string, branch string, updatedModules map[string]*Module, gerrit *gerritInstance) error {
productRepoURL, err := RepoURL(product)
if err != nil {
return fmt.Errorf("Error determining %s repo URL: %s", product, err)
@@ -246,13 +246,9 @@ func prepareQt5Update(product string, branch string, updatedModules map[string]*
fmt.Printf("Created new commit for submodule update: %s\n", commitOid)
- if err = pushChange(product, branch, commitOid, "Updating all submodules with a new consistent set", pushUserName); err != nil {
+ if err = gerrit.pushChange(product, branch, commitOid, "Updating all submodules with a new consistent set"); err != nil {
return fmt.Errorf("Error pushing qt5 change: %s", err)
}
- if manualStage {
- return nil
- }
-
- return reviewAndStageChange(product, branch, commitOid, "Updating all submodules with a new consistent set")
+ return gerrit.reviewAndStageChange(product, branch, commitOid, "Updating all submodules with a new consistent set")
}