summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doGui.go39
1 files changed, 26 insertions, 13 deletions
diff --git a/doGui.go b/doGui.go
index 6c2a2df..3c80e2b 100644
--- a/doGui.go
+++ b/doGui.go
@@ -245,6 +245,30 @@ func drawWindow(win *gadgets.BasicWindow) {
})
}
+func findMergeToDevel() {
+ me.found = new(gitpb.Repos)
+
+ all := me.forge.Repos.SortByFullPath()
+ for all.Scan() {
+ repo := all.Next()
+
+ // this sees if user has patches for devel. If it does, add it to me.found
+ if repo.CountDiffObjects(repo.GetUserBranchName(), repo.GetDevelBranchName()) > 0 {
+ me.found.AppendByGoPath(repo)
+ }
+ }
+ now := time.Now()
+ if me.found.Len() == 0 {
+ log.Info("nothing to merge with devel")
+ return
+ }
+ me.forge.PrintHumanTable(me.found)
+
+ // check for merges from devel
+ total, count, nope, _ := IsEverythingOnDevel()
+ 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)))
+
+}
func findMergeToMaster() {
me.found = new(gitpb.Repos)
@@ -273,7 +297,7 @@ func findMergeToMaster() {
}
// this sees if devel has patches for master. If it does, add it to me.found
- if repo.CountDiffObjects(repo.GetMasterBranchName(), repo.GetDevelBranchName()) > 0 {
+ if repo.CountDiffObjects(repo.GetDevelBranchName(), repo.GetMasterBranchName()) > 0 {
me.found.AppendByGoPath(repo)
}
}
@@ -331,18 +355,7 @@ func mergeDevelToMaster(doit bool) {
}
func mergeUserToDevel(doit bool) {
- me.found = new(gitpb.Repos)
- findReposWithPatches()
- if me.found.Len() == 0 {
- log.Info("you currently have no patches in your user branches")
- return
- }
- me.forge.PrintHumanTable(me.found)
-
- now := time.Now()
- // check for devel branches
- total, count, nope, _ := IsEverythingOnDevel()
- 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)))
+ findMergeToDevel()
if !doit {
return