From 3600d4c9c1b9eb0112d2c4bfb10b896a723d3ff7 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Wed, 31 Jan 2024 00:19:21 -0600 Subject: [PATCH] allow switching all branches Signed-off-by: Jeff Carr --- globalBuildOptions.go | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/globalBuildOptions.go b/globalBuildOptions.go index e9aa180..0641d08 100644 --- a/globalBuildOptions.go +++ b/globalBuildOptions.go @@ -84,28 +84,39 @@ func globalBuildOptions(box *gui.Node) { me.userBranch = gadgets.NewBasicCombobox(grid, "default user branch") me.userBranch.AddText(usr.Username) - grid.NewLabel("") - grid.NewButton("set working branches", func() { - log.Warn("set working branches here") - }) + var newBranch *gui.Node + var setBranchB *gui.Node + // gadgets.OneLiner(grid, "default user branch") // select the branch you want to test, build and develop against // this lets you select your user branch, but, when you are happy // you can merge everything into the devel branch and make sure it actually // works. Then, when that is good, merge and version everything in master - var newBranch *gui.Node - grid.NewButton("set current branch to:", func() { + setBranchB = grid.NewButton("set current branch to:", func() { log.Warn("set current branch to:", newBranch.String()) /* me.toMoveToBranch = guiBranch.String() setCurrentBranch.SetLabel("set all branches to " + me.toMoveToBranch) me.mainBranch.Disable() */ + for _, repo := range me.allrepos { + if repo.status.CheckoutMaster() { + log.Warn("set master branch worked", repo.String) + repo.newScan() + } else { + log.Warn("set master branch failed", repo.String) + repo.newScan() + } + // return + } }) newBranch = grid.NewCombobox() newBranch.AddText("master") newBranch.AddText("devel") newBranch.AddText(usr.Username) newBranch.SetText(usr.Username) + newBranch.Custom = func () { + setBranchB.SetLabel("set current branches to " + newBranch.String()) + } }