diff options
Diffstat (limited to 'doNormal.go')
| -rw-r--r-- | doNormal.go | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/doNormal.go b/doNormal.go index 629fdb7..eb39db0 100644 --- a/doNormal.go +++ b/doNormal.go @@ -15,6 +15,7 @@ import ( "go.wit.com/lib/config" "go.wit.com/lib/fhelp" "go.wit.com/lib/gui/shell" + "go.wit.com/lib/protobuf/forgepb" "go.wit.com/lib/protobuf/gitpb" "go.wit.com/log" "google.golang.org/protobuf/proto" @@ -23,8 +24,31 @@ import ( // This does lots of "sanity" checking. It digs around and tries to resolve as much as possible // It'll dig into the actual git patchId to match patches since the normal hashes don't match // when you are applying with 'git am'. It tries to be thourogh (I can't spell) +func doNormal() (string, error) { + if doNormalOld() { + if me.forge.Config.Mode != forgepb.ForgeMode_NORMAL { + setForgeMode(forgepb.ForgeMode_NORMAL) + me.forge.Config.Save() + } + s := fmt.Sprintf("all your %d repos are in a normal stete for development", me.forge.Repos.Len()) + return s, nil + } + start := time.Now() + err := me.forge.DoAllCheckoutUser(argv.Force) + me.forge.ScanRepoDir() // looks for new dirs, checks existing repos for changes + me.forge.SaveRepos() + dur := time.Since(start) + log.Printf("Checked out %d user braches in %s\n", me.forge.Repos.Len(), shell.FormatDuration(dur)) + if err != nil { + return "not everything is 'normal' yet", err + } + setForgeMode(forgepb.ForgeMode_NORMAL) + me.forge.Config.Save() + log.Info("normal mode on") + return "normal mode on", nil +} -func doNormal() bool { +func doNormalOld() bool { me.forge.CheckDirtyQuiet() var count int |
