diff options
Diffstat (limited to 'git.go')
| -rw-r--r-- | git.go | 62 |
1 files changed, 55 insertions, 7 deletions
@@ -156,36 +156,36 @@ func (rs *RepoStatus) checkoutBranch(level string, branch string) { } } -func (rs *RepoStatus) SetMasterName(s string) { +func (rs *RepoStatus) SetMasterBranchName(s string) { rs.masterDrop.SetText(s) rs.masterBranchVersion.SetLabel(s) // rs.major.SetTitle(s) } -func (rs *RepoStatus) SetDevelName(s string) { +func (rs *RepoStatus) SetDevelBranchName(s string) { rs.develDrop.SetText(s) rs.develBranchVersion.SetLabel(s) } -func (rs *RepoStatus) SetUserName(s string) { +func (rs *RepoStatus) SetUserBranchName(s string) { rs.userDrop.SetText(s) rs.userBranchVersion.SetLabel(s) } // returns "master", "devel", os.Username, etc -func (rs *RepoStatus) GetMasterName() string { +func (rs *RepoStatus) GetMasterBranchName() string { name := rs.masterDrop.String() log.Warn("GetMasterName() =", name) return name } -func (rs *RepoStatus) GetDevelName() string { +func (rs *RepoStatus) GetDevelBranchName() string { name := rs.develDrop.String() log.Warn("GetDevelName() =", name) return name } -func (rs *RepoStatus) GetUserName() string { +func (rs *RepoStatus) GetUserBranchName() string { name := rs.userDrop.String() - log.Warn("GetUserName() =", name) + log.Warn("GetUserBranchName() =", name) return name } @@ -206,6 +206,54 @@ func (rs *RepoStatus) GetUserVersion() string { return name } +func (rs *RepoStatus) SetMasterVersion(s string) { + if rs.GetMasterVersion() == s { + return + } + rs.changed = true + log.Warn("git", rs.GetMasterBranchName(), "version now =", s) + rs.masterBranchVersion.SetValue(s) +} + +func (rs *RepoStatus) SetDevelVersion(s string) { + if rs.GetDevelVersion() == s { + return + } + rs.changed = true + log.Warn("git", rs.GetDevelBranchName(), "version now =", s) + rs.develBranchVersion.SetValue(s) +} + +func (rs *RepoStatus) SetUserVersion(s string) { + if rs.GetUserVersion() == s { + return + } + rs.changed = true + log.Warn("git", rs.GetUserBranchName(), "version now =", s) + rs.userBranchVersion.SetValue(s) +} + +func (rs *RepoStatus) GetStatus() string { + rs.changed = false + if rs.CheckDirty() { + log.Warn("CheckDirty() true") + return "dirty" + } + if rs.userBranchVersion.String() != rs.develBranchVersion.String() { + return "merge to devel" + } + if rs.userBranchVersion.String() != rs.masterBranchVersion.String() { + return "release" + } + + if rs.CheckBranches() { + log.Warn("Branches are Perfect") + return "PERFECT" + } + log.Warn("Branches are not Perfect") + return "unknown branches" +} + // TODO: make this report the error somewhere func (rs *RepoStatus) CheckBranches() bool { var hashCheck string |
