summaryrefslogtreecommitdiff
path: root/doGui.go
diff options
context:
space:
mode:
Diffstat (limited to 'doGui.go')
-rw-r--r--doGui.go29
1 files changed, 22 insertions, 7 deletions
diff --git a/doGui.go b/doGui.go
index db03508..6906812 100644
--- a/doGui.go
+++ b/doGui.go
@@ -173,7 +173,12 @@ func findMergeToDevel() *gitpb.Repos {
for repo := range me.forge.Repos.IterByFullPath() {
// this sees if user has patches for devel. If it does, add it to found
- if repo.CountDiffObjects(repo.GetUserBranchName(), repo.GetDevelBranchName()) > 0 {
+ i, err := repo.CountDiffObjects(repo.GetUserBranchName(), repo.GetDevelBranchName())
+ if err != nil {
+ found.AppendByFullPath(repo)
+ continue
+ }
+ if i > 0 {
found.AppendByFullPath(repo)
}
}
@@ -211,15 +216,22 @@ func findMergeToMaster() *gitpb.Repos {
*/
// this sees if devel is behind master. IT SHOULD NOT BE
- if repo.CountDiffObjects(repo.GetMasterBranchName(), repo.GetDevelBranchName()) == 0 {
+ i, err := repo.CountDiffObjects(repo.GetMasterBranchName(), repo.GetDevelBranchName())
+ if err != nil {
+ repo.State = "findMergeToMaster() diff err"
+ continue
+ }
+ if i == 0 {
// everything is normal
} else {
- repo.State = "DEVEL < MASTER"
+ repo.State = "DEVEL != MASTER"
log.Info("SERIOUS ERROR. DEVEL BRANCH IS BEHIND MASTER", repo.GetNamespace())
}
+ i, err = repo.CountDiffObjects(repo.GetDevelBranchName(), repo.GetMasterBranchName())
// this sees if devel has patches for master. If it does, add it to me.found
- if repo.CountDiffObjects(repo.GetDevelBranchName(), repo.GetMasterBranchName()) > 0 {
+ if i > 0 {
+ repo.State = log.Sprintf("dev has %d patches", i)
found.AppendByFullPath(repo)
}
}
@@ -292,14 +304,17 @@ func mergeUserToDevel(doit bool) {
if repo.GetUserVersion() == "uerr" {
// no user branch
- return
+ continue
}
log.Info("trying", bruser, repo.GetUserVersion())
- b1 := repo.CountDiffObjects(bruser, brdevel) // should be zero
+ b1, err := repo.CountDiffObjects(bruser, brdevel) // should be zero
+ if err != nil {
+ log.Info("bad branches", err, bruser, repo.GetUserVersion())
+ }
if b1 == 0 {
// log.Info("User is already merged into Devel", repo.GetNamespace(), cmd)
- return
+ continue
}
log.Info("merging user into devel repo:", repo.GetNamespace())
if result, err := repo.MergeToDevel(); err == nil {