attempting to set pb repo state
This commit is contained in:
parent
51db8c4f0c
commit
33c556f95d
1
argv.go
1
argv.go
|
@ -23,6 +23,7 @@ type args struct {
|
||||||
URL string `arg:"--connect" help:"gowebd url"`
|
URL string `arg:"--connect" help:"gowebd url"`
|
||||||
Bash bool `arg:"--bash" help:"generate bash completion"`
|
Bash bool `arg:"--bash" help:"generate bash completion"`
|
||||||
BashAuto []string `arg:"--auto-complete" help:"does the actual autocompletion"`
|
BashAuto []string `arg:"--auto-complete" help:"does the actual autocompletion"`
|
||||||
|
Force bool `arg:"--force" help:"try to strong arm things"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type EmptyCmd struct {
|
type EmptyCmd struct {
|
||||||
|
|
|
@ -27,8 +27,11 @@ func (args) doBashAuto() {
|
||||||
fmt.Println("--list --submit --show")
|
fmt.Println("--list --submit --show")
|
||||||
case "dirty":
|
case "dirty":
|
||||||
case "user":
|
case "user":
|
||||||
|
fmt.Println("--force")
|
||||||
case "devel":
|
case "devel":
|
||||||
|
fmt.Println("--force")
|
||||||
case "master":
|
case "master":
|
||||||
|
fmt.Println("--force")
|
||||||
default:
|
default:
|
||||||
if argv.BashAuto[0] == ARGNAME {
|
if argv.BashAuto[0] == ARGNAME {
|
||||||
// list the subcommands here
|
// list the subcommands here
|
||||||
|
|
4
main.go
4
main.go
|
@ -62,7 +62,11 @@ func main() {
|
||||||
|
|
||||||
if argv.Checkout != nil {
|
if argv.Checkout != nil {
|
||||||
if argv.Checkout.User != nil {
|
if argv.Checkout.User != nil {
|
||||||
|
if argv.Force {
|
||||||
|
me.forge.CheckoutUserForce()
|
||||||
|
} else {
|
||||||
me.forge.CheckoutUser()
|
me.forge.CheckoutUser()
|
||||||
|
}
|
||||||
me.forge = forgepb.Init()
|
me.forge = forgepb.Init()
|
||||||
me.found = new(gitpb.Repos)
|
me.found = new(gitpb.Repos)
|
||||||
argv.Checkout.User.findRepos()
|
argv.Checkout.User.findRepos()
|
||||||
|
|
|
@ -159,24 +159,25 @@ func (r *repoWindow) mergeAllDevelToMain() bool {
|
||||||
for loop.Scan() {
|
for loop.Scan() {
|
||||||
repo := loop.Next()
|
repo := loop.Next()
|
||||||
if me.forge.Config.IsReadOnly(repo.GetGoPath()) {
|
if me.forge.Config.IsReadOnly(repo.GetGoPath()) {
|
||||||
log.Info("skipping readonly", repo.GetFullPath())
|
// log.Info("skipping readonly", repo.GetFullPath())
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if repo.IsDirty() {
|
if repo.IsDirty() {
|
||||||
log.Info("skipping dirty", repo.GetFullPath())
|
log.Info("skipping dirty", repo.GetFullPath())
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if repo.GetCurrentBranchName() != repo.GetDevelBranchName() {
|
if repo.GetDevelVersion() != repo.GetUserVersion() {
|
||||||
log.Info("not on devel branch", repo.GetFullPath())
|
log.Info("devel and user branch are different", repo.GetFullPath())
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if repo.GetDevelVersion() == repo.GetMasterVersion() {
|
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
|
continue
|
||||||
}
|
}
|
||||||
if result, err := repo.MergeDevelToMaster(); err == nil {
|
if result, err := repo.MergeDevelToMaster(); err == nil {
|
||||||
log.Warn("MERGE WORKED", repo.GetFullPath())
|
log.Warn("MERGE WORKED", repo.GetFullPath())
|
||||||
continue
|
// continue
|
||||||
|
return true
|
||||||
} else {
|
} else {
|
||||||
log.Warn("THINGS FAILED ", repo.GetFullPath())
|
log.Warn("THINGS FAILED ", repo.GetFullPath())
|
||||||
log.Warn("err", err)
|
log.Warn("err", err)
|
||||||
|
|
Loading…
Reference in New Issue