attempting to set pb repo state

This commit is contained in:
Jeff Carr 2025-01-07 20:28:40 -06:00
parent 51db8c4f0c
commit 33c556f95d
4 changed files with 15 additions and 6 deletions

View File

@ -23,6 +23,7 @@ type args struct {
URL string `arg:"--connect" help:"gowebd url"`
Bash bool `arg:"--bash" help:"generate bash completion"`
BashAuto []string `arg:"--auto-complete" help:"does the actual autocompletion"`
Force bool `arg:"--force" help:"try to strong arm things"`
}
type EmptyCmd struct {

View File

@ -27,8 +27,11 @@ func (args) doBashAuto() {
fmt.Println("--list --submit --show")
case "dirty":
case "user":
fmt.Println("--force")
case "devel":
fmt.Println("--force")
case "master":
fmt.Println("--force")
default:
if argv.BashAuto[0] == ARGNAME {
// list the subcommands here

View File

@ -62,7 +62,11 @@ func main() {
if argv.Checkout != nil {
if argv.Checkout.User != nil {
me.forge.CheckoutUser()
if argv.Force {
me.forge.CheckoutUserForce()
} else {
me.forge.CheckoutUser()
}
me.forge = forgepb.Init()
me.found = new(gitpb.Repos)
argv.Checkout.User.findRepos()

View File

@ -159,24 +159,25 @@ func (r *repoWindow) mergeAllDevelToMain() bool {
for loop.Scan() {
repo := loop.Next()
if me.forge.Config.IsReadOnly(repo.GetGoPath()) {
log.Info("skipping readonly", repo.GetFullPath())
// log.Info("skipping readonly", repo.GetFullPath())
continue
}
if repo.IsDirty() {
log.Info("skipping dirty", repo.GetFullPath())
continue
}
if repo.GetCurrentBranchName() != repo.GetDevelBranchName() {
log.Info("not on devel branch", repo.GetFullPath())
if repo.GetDevelVersion() != repo.GetUserVersion() {
log.Info("devel and user branch are different", repo.GetFullPath())
continue
}
if repo.GetDevelVersion() == repo.GetMasterVersion() {
log.Info("devel and master branch are the same", repo.GetFullPath())
// log.Info("devel and master branch are the same", repo.GetFullPath())
continue
}
if result, err := repo.MergeDevelToMaster(); err == nil {
log.Warn("MERGE WORKED", repo.GetFullPath())
continue
// continue
return true
} else {
log.Warn("THINGS FAILED ", repo.GetFullPath())
log.Warn("err", err)