diff --git a/common.go b/common.go index 3c6259f..0a40694 100644 --- a/common.go +++ b/common.go @@ -158,7 +158,13 @@ func (rs *RepoStatus) GetCurrentVersion() string { } func (rs *RepoStatus) IncrementVersion() bool { - return rs.setTag() + rs.incrementRevision() + rs.EnableSelectTag() + rs.setTag() + newtag := "v" + rs.newversion.String() + log.Log(REPOWARN, "new version is set to", newtag, "set target version to this") + rs.targetReleaseVersion.SetText(newtag) + return true } // TODO: run this through the sanity check! diff --git a/git.go b/git.go index 3dffb97..02563a5 100644 --- a/git.go +++ b/git.go @@ -44,10 +44,10 @@ func (rs *RepoStatus) GitPull() error { cmd = append(cmd, "git", "pull") err, _, output := RunCmd(rs.realPath.String(), cmd) if err == nil { - log.Log(REPOWARN,"git pull ran", rs.Path()) - log.Log(REPOWARN,"git pull output", output) + log.Log(REPOWARN, "git pull ran", rs.Path()) + log.Log(REPOWARN, "git pull output", output) } else { - log.Log(REPOWARN,"git pull error", rs.Path(), err) + log.Log(REPOWARN, "git pull error", rs.Path(), err) } return err } diff --git a/merge.go b/merge.go index 2d9a931..cad5f5a 100644 --- a/merge.go +++ b/merge.go @@ -187,7 +187,7 @@ func (rs *RepoStatus) setTag() bool { return true } -func (rs *RepoStatus) incrementVersion() { +func (rs *RepoStatus) incrementRevision() { lasttag := rs.lasttag.String() var major, minor, revision string if rs.targetReleaseVersion.String() == "" { @@ -215,9 +215,10 @@ func (rs *RepoStatus) incrementVersion() { rs.minor.SetText(widget.GetString(b)) // rs.c := strconv.Atoi(revision) - rs.revision.AddText(widget.GetString(c + 1)) - rs.revision.AddText(widget.GetString(c + 2)) - rs.setRevision(widget.GetString(c + 1)) + rs.revision.AddText(strconv.Itoa(c + 1)) + rs.revision.AddText(strconv.Itoa(c + 2)) + rs.revision.SetText(strconv.Itoa(c + 1)) + // rs.setRevision(widget.GetString(c + 1)) } func (rs *RepoStatus) recommend() { @@ -246,7 +247,7 @@ func (rs *RepoStatus) recommend() { } if rs.lasttag.String() != rs.GetMasterVersion() { log.Log(INFO, "master does not equal last tag") - rs.incrementVersion() + rs.incrementRevision() rs.EnableSelectTag() rs.setTag() return @@ -280,7 +281,7 @@ func (rs *RepoStatus) generateCmd() bool { } else { rs.versionMessage.SetLabel("tag message") } - rs.releaseVersion.SetLabel("Release!") + rs.releaseVersion.SetLabel("Release Tag!") rs.releaseVersion.Enable() return true } diff --git a/modifyBox.go b/modifyBox.go index ae577a2..5b9d030 100644 --- a/modifyBox.go +++ b/modifyBox.go @@ -65,6 +65,9 @@ func (rs *RepoStatus) drawGitCommands(box *gui.Node) { } rs.Enable() }) + newgrid.NewButton("increment version", func() { + rs.IncrementVersion() + }) newgrid.NextRow() rs.major = gadgets.NewBasicCombobox(newgrid, "major") @@ -72,7 +75,7 @@ func (rs *RepoStatus) drawGitCommands(box *gui.Node) { rs.setTag() rs.generateCmd() } - rs.major.Hide() + // rs.major.Hide() newgrid.NextRow() rs.minor = gadgets.NewBasicCombobox(newgrid, "minor") @@ -80,7 +83,7 @@ func (rs *RepoStatus) drawGitCommands(box *gui.Node) { rs.setTag() rs.generateCmd() } - rs.minor.Hide() + // rs.minor.Hide() newgrid.NextRow() rs.revision = gadgets.NewBasicCombobox(newgrid, "revision") @@ -88,30 +91,30 @@ func (rs *RepoStatus) drawGitCommands(box *gui.Node) { rs.setTag() rs.generateCmd() } - rs.revision.Hide() + // rs.revision.Hide() newgrid.NextRow() // newgrid.NewLabel("new tag version") rs.newversion = newgrid.NewLabel("0.0.1") - rs.newversion.Hide() + // rs.newversion.Hide() newgrid.NextRow() rs.versionMessage = gadgets.NewBasicEntry(newgrid, "tag message") rs.versionMessage.Custom = func() { rs.generateCmd() } - rs.versionMessage.Hide() + // rs.versionMessage.Hide() newgrid.NextRow() rs.versionCmdOutput = gadgets.NewOneLiner(newgrid, "tag cmd") - rs.versionCmdOutput.Hide() + // rs.versionCmdOutput.Hide() newgrid.NextRow() rs.releaseVersion = newgrid.NewButton("tag and release new version", func() { rs.Disable() rs.MergeDevelToMaster() }) - rs.releaseVersion.Hide() + // rs.releaseVersion.Hide() newgrid.NextRow() newgrid.Margin() diff --git a/tagWindow.go b/tagWindow.go index c630af7..683fee8 100644 --- a/tagWindow.go +++ b/tagWindow.go @@ -23,7 +23,8 @@ type Tag struct { ref *gui.Node // the .git/ref date - date *gui.Node + date *gui.Node + duration *gui.Node // the tag comment subject *gui.Node @@ -122,7 +123,7 @@ func (rs *RepoStatus) makeTagBox(box *gui.Node) { _, stamp, dur := getGitDateStamp(parts[1]) rTag.date = grid.NewLabel(stamp) - grid.NewLabel(dur) + rTag.duration = grid.NewLabel(dur) rTag.subject = grid.NewLabel(parts[4]) rTag.deleteB = grid.NewButton("delete", func() { @@ -272,6 +273,7 @@ func (rt *Tag) Hide() { rt.tag.Hide() rt.ref.Hide() rt.date.Hide() + rt.duration.Hide() rt.subject.Hide() rt.deleteB.Hide() } @@ -281,6 +283,7 @@ func (rt *Tag) Show() { rt.tag.Show() rt.ref.Show() rt.date.Show() + rt.duration.Show() rt.subject.Show() rt.deleteB.Show() } diff --git a/update.go b/update.go index ed849cf..99b17cb 100644 --- a/update.go +++ b/update.go @@ -11,8 +11,8 @@ import ( func (rs *RepoStatus) gitBranchAll() { err, out := rs.RunCmd([]string{"git", "branch", "--all"}) - log.Log(WARN, "git branch failed string =", rs.String()) - log.Log(WARN, "git branch failed realpath =", rs.realPath.String()) + log.Log(WARN, "git branch failed string =", rs.String()) + log.Log(WARN, "git branch failed realpath =", rs.realPath.String()) if err != nil { log.Log(WARN, "git branch failed string =", rs.String()) log.Log(WARN, "git branch failed realpath =", rs.realPath.String())