Merge branch 'devel'
This commit is contained in:
commit
17067da936
|
@ -87,7 +87,7 @@ func globalDisplayOptions(box *gui.Node) {
|
||||||
hidegrid.NextRow()
|
hidegrid.NextRow()
|
||||||
|
|
||||||
group1 = vbox.NewGroup("prep for release")
|
group1 = vbox.NewGroup("prep for release")
|
||||||
grid := group1.NewGrid("test", 0, 0)
|
grid := group1.RawGrid()
|
||||||
|
|
||||||
var longB *gui.Node
|
var longB *gui.Node
|
||||||
longB = grid.NewButton("generate go.sum files", func() {
|
longB = grid.NewButton("generate go.sum files", func() {
|
||||||
|
@ -121,11 +121,38 @@ func globalDisplayOptions(box *gui.Node) {
|
||||||
})
|
})
|
||||||
grid.NextRow()
|
grid.NextRow()
|
||||||
|
|
||||||
var setTarget *gui.Node
|
grid.NewButton("increment tags", func() {
|
||||||
// check to see if target versions need to be changed
|
for _, repo := range me.repos.View.AllRepos() {
|
||||||
setTarget = grid.NewButton("increment target versions", func() {
|
if whitelist(repo.GoPath()) {
|
||||||
if incrementTargetVersion() {
|
continue
|
||||||
setTarget.SetText("DONE")
|
}
|
||||||
|
if repo.ReadOnly() {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
lasttag := repo.LastTag()
|
||||||
|
masterv := repo.Status.GetMasterVersion()
|
||||||
|
targetv := repo.Status.GetTargetVersion()
|
||||||
|
|
||||||
|
if lasttag == masterv {
|
||||||
|
// nothing to do if curv == masterv
|
||||||
|
// unless go.sum depends on changed repos
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
newversion := repo.Status.GetNewVersionTag()
|
||||||
|
if newversion == targetv {
|
||||||
|
log.Info(repo.GoPath(), "targetv has been increased already to", targetv)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if masterv != targetv {
|
||||||
|
log.Info(repo.GoPath(), "master and target differ", masterv, targetv)
|
||||||
|
repo.Status.IncrementVersion()
|
||||||
|
newversion := repo.Status.GetNewVersionTag()
|
||||||
|
repo.Status.SetTargetVersion(newversion)
|
||||||
|
// already incremented
|
||||||
|
continue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
grid.NextRow()
|
grid.NextRow()
|
||||||
|
|
|
@ -3,35 +3,14 @@ package main
|
||||||
// this initializes the repos
|
// this initializes the repos
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
|
||||||
"os/user"
|
|
||||||
"path/filepath"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"go.wit.com/lib/gui/repolist"
|
|
||||||
"go.wit.com/lib/gui/repostatus"
|
"go.wit.com/lib/gui/repostatus"
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (r *repoWindow) initRepoList() {
|
func (r *repoWindow) initRepoList() {
|
||||||
usr, _ := user.Current()
|
r.View.InitRepoList("~/.config/guireleaser")
|
||||||
|
|
||||||
repos := parsecfg("~/.config/guireleaser")
|
|
||||||
for _, line := range repos {
|
|
||||||
log.Verbose("repo =", line)
|
|
||||||
path, mbranch, dbranch, ubranch := splitLine(line)
|
|
||||||
if mbranch == "" {
|
|
||||||
mbranch = "master"
|
|
||||||
}
|
|
||||||
if dbranch == "" {
|
|
||||||
dbranch = "devel"
|
|
||||||
}
|
|
||||||
if ubranch == "" {
|
|
||||||
ubranch = usr.Username
|
|
||||||
}
|
|
||||||
r.View.AddRepo(path, mbranch, dbranch, ubranch)
|
|
||||||
}
|
|
||||||
|
|
||||||
log.Info("scanning everything in ~/go/src")
|
log.Info("scanning everything in ~/go/src")
|
||||||
for i, path := range repostatus.ListGitDirectories() {
|
for i, path := range repostatus.ListGitDirectories() {
|
||||||
|
@ -39,28 +18,6 @@ func (r *repoWindow) initRepoList() {
|
||||||
path = strings.TrimPrefix(path, me.goSrcPwd.String())
|
path = strings.TrimPrefix(path, me.goSrcPwd.String())
|
||||||
path = strings.Trim(path, "/")
|
path = strings.Trim(path, "/")
|
||||||
log.Info("addRepo()", i, path)
|
log.Info("addRepo()", i, path)
|
||||||
r.View.AddRepo(path, "master", "devel", usr.Username)
|
r.View.NewRepo(path)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func parsecfg(f string) []string {
|
|
||||||
homeDir, _ := os.UserHomeDir()
|
|
||||||
cfgfile := filepath.Join(homeDir, f)
|
|
||||||
content, _ := ioutil.ReadFile(cfgfile)
|
|
||||||
out := string(content)
|
|
||||||
out = strings.TrimSpace(out)
|
|
||||||
lines := strings.Split(out, "\n")
|
|
||||||
return lines
|
|
||||||
}
|
|
||||||
|
|
||||||
// returns path, master branch name, devel branch name, user branch name
|
|
||||||
func splitLine(line string) (string, string, string, string) {
|
|
||||||
var path, master, devel, user string
|
|
||||||
parts := strings.Split(line, " ")
|
|
||||||
path, parts = repolist.RemoveFirstElement(parts)
|
|
||||||
master, parts = repolist.RemoveFirstElement(parts)
|
|
||||||
devel, parts = repolist.RemoveFirstElement(parts)
|
|
||||||
user, parts = repolist.RemoveFirstElement(parts)
|
|
||||||
// path, master, devel, user := strings.Split(line, " ")
|
|
||||||
return path, master, devel, user
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue