force reverted a branch
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
a223e9f1c3
commit
d7e391fed0
|
@ -24,8 +24,30 @@ func (rs *RepoStatus) makeBranchesBox() {
|
||||||
rs.currentVersion = gadgets.NewOneLiner(newgrid, "current version")
|
rs.currentVersion = gadgets.NewOneLiner(newgrid, "current version")
|
||||||
newgrid.NextRow()
|
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()
|
all := rs.getBranches()
|
||||||
|
for i, s := range all {
|
||||||
|
log.Log(WARN, "found branch", i, s)
|
||||||
|
rs.targetBranch.AddText(s)
|
||||||
|
}
|
||||||
i := len(all)
|
i := len(all)
|
||||||
log.Log(WARN, "branch count =", i)
|
log.Log(WARN, "branch count =", i)
|
||||||
})
|
})
|
||||||
|
@ -38,4 +60,9 @@ func (rs *RepoStatus) makeBranchesBox() {
|
||||||
log.Log(WARN, "Branches are not perfect")
|
log.Log(WARN, "Branches are not perfect")
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
newgrid.NextRow()
|
||||||
|
|
||||||
|
newgrid.NewButton("Revert master to devel", func() {
|
||||||
|
rs.RevertMasterToDevel()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,4 +72,7 @@ type RepoStatus struct {
|
||||||
|
|
||||||
gitConfig *GitConfig
|
gitConfig *GitConfig
|
||||||
goConfig GoConfig
|
goConfig GoConfig
|
||||||
|
|
||||||
|
switchBranchB *gui.Node
|
||||||
|
targetBranch *gui.Node
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue