hidden widgets

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-01-13 22:08:49 -06:00
parent 966348d534
commit 6223ffe7bf
1 changed files with 41 additions and 3 deletions

44
draw.go
View File

@ -251,6 +251,10 @@ func (rs *RepoStatus) recommend() {
if rs.develBranchVersion.Get() != rs.jcarrBranchVersion.Get() {
log.Warn("devel does not equal jcarr")
log.Warn("merge or squash?")
rs.EnableMergeDevel()
rs.setMergeUserCommands()
label := "merge " + rs.GetUserName() + " into " + rs.GetDevelName()
rs.develMerge.SetText(label)
return
}
log.Warn("Does master == devel? ", rs.masterBranchVersion.Get(), rs.develBranchVersion.Get())
@ -258,6 +262,8 @@ func (rs *RepoStatus) recommend() {
log.Warn("master does not equal devel. merge devel into master")
rs.EnableMergeDevel()
rs.setMergeDevelCommands()
label := "merge " + rs.GetDevelName() + " into " + rs.GetMasterName()
rs.develMerge.SetText(label)
return
}
rs.getLastTagVersion()
@ -345,13 +351,45 @@ func (rs *RepoStatus) setGitCommands() {
}
func (rs *RepoStatus) setMergeDevelCommands() {
var line1, line2 []string
var line1, line2, line3 []string
var all [][]string
line1 = append(line1, "git", "merge", "devel")
master := rs.GetMasterName()
devel := rs.GetDevelName()
line1 = append(line1, "git", "checkout", master)
all = append(all, line1)
line2 = append(line2, "git", "push")
line2 = append(line2, "git", "merge", devel)
all = append(all, line2)
line3 = append(line3, "git", "push")
all = append(all, line3)
rs.versionCmds = all
var tmp []string
// convert to displayable to the user text
for _, line := range all {
s := strings.Join(line, " ")
log.Warn("s =", s)
tmp = append(tmp, s)
}
rs.versionCmdOutput.Set(strings.Join(tmp, "\n"))
}
func (rs *RepoStatus) setMergeUserCommands() {
var line1, line2, line3 []string
var all [][]string
devel := rs.GetDevelName()
user := rs.GetUserName()
line1 = append(line1, "git", "checkout", devel)
all = append(all, line1)
line2 = append(line2, "git", "merge", user)
all = append(all, line2)
line3 = append(line3, "git", "push")
all = append(all, line3)
rs.versionCmds = all