From d7e391fed0843aa56ead128737c2770704846bac Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Wed, 14 Feb 2024 01:01:00 -0600 Subject: force reverted a branch Signed-off-by: Jeff Carr --- branchesBox.go | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'branchesBox.go') diff --git a/branchesBox.go b/branchesBox.go index 9aa78b9..d24af80 100644 --- a/branchesBox.go +++ b/branchesBox.go @@ -24,8 +24,30 @@ func (rs *RepoStatus) makeBranchesBox() { rs.currentVersion = gadgets.NewOneLiner(newgrid, "current version") newgrid.NextRow() - rs.showBranchesButton = newgrid.NewButton("getBranches()", func() { + rs.switchBranchB = newgrid.NewButton("Switch Branch", func() { + bname := rs.targetBranch.String() + log.Info("Should switch to branch", bname, "here") + + var all [][]string + all = append(all, []string{"git", "checkout", bname}) + if rs.DoAll(all) { + log.Info("branch switched to", bname) + } else { + log.Info("branch switched to", bname, "failed") + } + rs.UpdateCurrent() + }) + + rs.targetBranch = newgrid.NewDropdown() + // rs.targetBranch.AddText("master") + newgrid.NextRow() + + rs.showBranchesButton = newgrid.NewButton("scan branches()", func() { all := rs.getBranches() + for i, s := range all { + log.Log(WARN, "found branch", i, s) + rs.targetBranch.AddText(s) + } i := len(all) log.Log(WARN, "branch count =", i) }) @@ -38,4 +60,9 @@ func (rs *RepoStatus) makeBranchesBox() { log.Log(WARN, "Branches are not perfect") } }) + newgrid.NextRow() + + newgrid.NewButton("Revert master to devel", func() { + rs.RevertMasterToDevel() + }) } -- cgit v1.2.3