add repo.IncrementVersion()

This commit is contained in:
Jeff Carr 2024-02-23 00:10:30 -06:00
parent 359ebce26e
commit 5105bd4a99
6 changed files with 34 additions and 21 deletions

View File

@ -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!

View File

@ -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
}

View File

@ -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()

View File

@ -24,6 +24,7 @@ type Tag struct {
// the .git/ref date
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()
}