summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doCheckout.go13
-rw-r--r--doClean.go2
2 files changed, 9 insertions, 6 deletions
diff --git a/doCheckout.go b/doCheckout.go
index 2946500..29a5fe3 100644
--- a/doCheckout.go
+++ b/doCheckout.go
@@ -2,7 +2,9 @@ package main
import (
"fmt"
+ "time"
+ "go.wit.com/lib/gui/shell"
"go.wit.com/lib/protobuf/gitpb"
"go.wit.com/log"
)
@@ -11,7 +13,7 @@ var ErrorNotAllReposOnMaster error = fmt.Errorf("not all repos on are on the mas
var ErrorNotAllReposOnDevel error = fmt.Errorf("not all repos on are on the devel branch")
var ErrorNotAllReposOnUser error = fmt.Errorf("not all repos on are on the user branch")
-func IsEverythingOnMaster() (int, int, error) {
+func IsEverythingOnMaster() (int, int, int, error) {
var total int
var count int
var nope int
@@ -27,12 +29,11 @@ func IsEverythingOnMaster() (int, int, error) {
nope += 1
}
}
- log.Printf("Master branch check. %d total repos. (%d ok) (%d not on master branch)\n", total, count, nope)
if total != count {
// log.Info(ErrorNotAllReposOnMaster)
- return total, count, ErrorNotAllReposOnMaster
+ return total, count, nope, ErrorNotAllReposOnMaster
}
- return total, count, nil
+ return total, count, nope, nil
}
func IsEverythingOnDevel() (int, int, error) {
@@ -200,13 +201,15 @@ func rillCheckoutMaster(repo *gitpb.Repo) error {
// todo: redo this logic as it is terrible
func doAllCheckoutMaster() error {
+ now := time.Now()
me.forge.RillFuncError(rillCheckoutMaster)
count := me.forge.RillReload()
if count != 0 {
me.forge.ConfigSave()
}
- if _, _, err := IsEverythingOnMaster(); err != nil {
+ if total, count, nope, err := IsEverythingOnMaster(); err != nil {
+ log.Printf("Master branch check. %d total repos. (%d ok) (%d not on master branch) (%s)\n", total, count, nope, shell.FormatDuration(time.Since(now)))
// display all repos not on master
me.found = new(gitpb.Repos)
all := me.forge.Repos.SortByFullPath()
diff --git a/doClean.go b/doClean.go
index f7c6489..adeac89 100644
--- a/doClean.go
+++ b/doClean.go
@@ -32,7 +32,7 @@ func doClean() error {
}
func doCleanUser() error {
- if _, count, err := IsEverythingOnMaster(); err != nil {
+ if _, count, _, err := IsEverythingOnMaster(); err != nil {
if count == 0 {
log.Info("No repos are on the master branch")
return nil