add 'forge merge master'
This commit is contained in:
parent
86e513d845
commit
807049f6c7
10
doFind.go
10
doFind.go
|
@ -167,10 +167,18 @@ func findReposWithPatches() *gitpb.Repos {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// this is an old test to see if the current 'last tag' is accurate and should be removed
|
// ignore read-only repos for checks below here
|
||||||
if me.forge.Config.IsReadOnly(repo.GetGoPath()) {
|
if me.forge.Config.IsReadOnly(repo.GetGoPath()) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// show anything that differs between 'devel' & 'master' branches
|
||||||
|
if repo.GetDevelVersion() != repo.GetMasterVersion() {
|
||||||
|
found.AppendByGoPath(repo)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
// this is an old test to see if the current 'last tag' is accurate and should be removed
|
||||||
if repo.GetLastTag() != repo.GetMasterVersion() {
|
if repo.GetLastTag() != repo.GetMasterVersion() {
|
||||||
found.AppendByGoPath(repo)
|
found.AppendByGoPath(repo)
|
||||||
repo.FindLastTag()
|
repo.FindLastTag()
|
||||||
|
|
1
doGui.go
1
doGui.go
|
@ -273,6 +273,7 @@ func findMergeToDevel() *gitpb.Repos {
|
||||||
log.Printf("devel branch check. %d total repos. (%d ok) (%d not on devel branch) (%s)\n", total, count, nope, shell.FormatDuration(time.Since(now)))
|
log.Printf("devel branch check. %d total repos. (%d ok) (%d not on devel branch) (%s)\n", total, count, nope, shell.FormatDuration(time.Since(now)))
|
||||||
return found
|
return found
|
||||||
}
|
}
|
||||||
|
|
||||||
func findMergeToMaster() *gitpb.Repos {
|
func findMergeToMaster() *gitpb.Repos {
|
||||||
found := new(gitpb.Repos)
|
found := new(gitpb.Repos)
|
||||||
|
|
||||||
|
|
30
doPull.go
30
doPull.go
|
@ -168,3 +168,33 @@ func doMergeDevel() (*gitpb.Repos, error) {
|
||||||
}
|
}
|
||||||
return done, err
|
return done, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func doMergeMaster() (*gitpb.Repos, error) {
|
||||||
|
var err error
|
||||||
|
done := gitpb.NewRepos()
|
||||||
|
found := findMergeToMaster()
|
||||||
|
for repo := range found.IterAll() {
|
||||||
|
if repo.CheckDirty() {
|
||||||
|
log.Info("repo is dirty", repo.GetGoPath())
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
log.Info("Starting merge on", repo.GetGoPath())
|
||||||
|
if repo.CheckoutMaster() {
|
||||||
|
log.Info("checkout devel failed", repo.GetGoPath())
|
||||||
|
err = fmt.Errorf("checkout devel failed")
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
if _, err := repo.MergeToMaster(); err != nil {
|
||||||
|
log.Info("merge from user failed", repo.GetGoPath(), err)
|
||||||
|
err = fmt.Errorf("merge from user failed")
|
||||||
|
// log.Info(strings.Join(r.Stdout, "\n"))
|
||||||
|
// log.Info(strings.Join(r.Stderr, "\n"))
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
done.Append(repo)
|
||||||
|
}
|
||||||
|
return done, err
|
||||||
|
}
|
||||||
|
|
7
main.go
7
main.go
|
@ -146,6 +146,13 @@ func main() {
|
||||||
}
|
}
|
||||||
okExit("devel merge ok")
|
okExit("devel merge ok")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if argv.Merge.Master != nil {
|
||||||
|
if _, err := doMergeMaster(); err != nil {
|
||||||
|
badExit(err)
|
||||||
|
}
|
||||||
|
okExit("master merge ok")
|
||||||
|
}
|
||||||
badExit(fmt.Errorf("merge what?"))
|
badExit(fmt.Errorf("merge what?"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue