summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-02-14 01:01:00 -0600
committerJeff Carr <[email protected]>2024-02-14 01:01:00 -0600
commitd7e391fed0843aa56ead128737c2770704846bac (patch)
tree8a6092d8ab384272d1a9707536d807ed4e21d2f3
parenta223e9f1c3f35edebf25e977fe897c707f6456da (diff)
force reverted a branchv0.20.4
Signed-off-by: Jeff Carr <[email protected]>
-rw-r--r--branchesBox.go29
-rw-r--r--structs.go3
2 files changed, 31 insertions, 1 deletions
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()
+ })
}
diff --git a/structs.go b/structs.go
index f1e3309..22195bb 100644
--- a/structs.go
+++ b/structs.go
@@ -72,4 +72,7 @@ type RepoStatus struct {
gitConfig *GitConfig
goConfig GoConfig
+
+ switchBranchB *gui.Node
+ targetBranch *gui.Node
}