common code moved to forgepb
This commit is contained in:
parent
e896cae995
commit
6f4ec05ccb
|
@ -48,7 +48,7 @@ func savePatchset(pset *forgepb.Patchset) error {
|
||||||
// re-run git CheckDirty() on everything
|
// re-run git CheckDirty() on everything
|
||||||
func IsAnythingDirty() bool {
|
func IsAnythingDirty() bool {
|
||||||
doCheckDirtyAndConfigSave()
|
doCheckDirtyAndConfigSave()
|
||||||
found := findDirty()
|
found := me.forge.FindDirty()
|
||||||
if found.Len() == 0 {
|
if found.Len() == 0 {
|
||||||
return false
|
return false
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -14,7 +14,7 @@ import (
|
||||||
func doCommit() {
|
func doCommit() {
|
||||||
if argv.All {
|
if argv.All {
|
||||||
doCheckDirtyAndConfigSave()
|
doCheckDirtyAndConfigSave()
|
||||||
found := findDirty()
|
found := me.forge.FindDirty()
|
||||||
var newpatches bool
|
var newpatches bool
|
||||||
for repo := range found.IterAll() {
|
for repo := range found.IterAll() {
|
||||||
log.Info("do a commit on repo", repo.GetGoPath())
|
log.Info("do a commit on repo", repo.GetGoPath())
|
||||||
|
|
|
@ -14,7 +14,7 @@ import (
|
||||||
func doDirty() {
|
func doDirty() {
|
||||||
doCheckDirtyAndConfigSave()
|
doCheckDirtyAndConfigSave()
|
||||||
|
|
||||||
found := findDirty()
|
found := me.forge.FindDirty()
|
||||||
if found.Len() == 0 {
|
if found.Len() == 0 {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
16
doFind.go
16
doFind.go
|
@ -24,7 +24,7 @@ func doFind() *gitpb.Repos {
|
||||||
}
|
}
|
||||||
|
|
||||||
if argv.List.Dirty {
|
if argv.List.Dirty {
|
||||||
return findDirty()
|
return me.forge.FindDirty()
|
||||||
}
|
}
|
||||||
|
|
||||||
return findAll()
|
return findAll()
|
||||||
|
@ -52,7 +52,7 @@ func (f *FindCmd) findRepos() *gitpb.Repos {
|
||||||
}
|
}
|
||||||
|
|
||||||
if f.Dirty {
|
if f.Dirty {
|
||||||
return findDirty()
|
return me.forge.FindDirty()
|
||||||
}
|
}
|
||||||
|
|
||||||
if f.User {
|
if f.User {
|
||||||
|
@ -101,18 +101,6 @@ func findFavorites() *gitpb.Repos {
|
||||||
return found
|
return found
|
||||||
}
|
}
|
||||||
|
|
||||||
// finds repos that git is reporting as dirty
|
|
||||||
func findDirty() *gitpb.Repos {
|
|
||||||
found := gitpb.NewRepos()
|
|
||||||
|
|
||||||
for repo := range me.forge.Repos.IterByFullPath() {
|
|
||||||
if repo.IsDirty() {
|
|
||||||
found.AppendByFullPath(repo)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return found
|
|
||||||
}
|
|
||||||
|
|
||||||
func findAll() *gitpb.Repos {
|
func findAll() *gitpb.Repos {
|
||||||
found := gitpb.NewRepos()
|
found := gitpb.NewRepos()
|
||||||
for repo := range me.forge.Repos.IterByFullPath() {
|
for repo := range me.forge.Repos.IterByFullPath() {
|
||||||
|
|
2
doGui.go
2
doGui.go
|
@ -49,7 +49,7 @@ func debug() {
|
||||||
}
|
}
|
||||||
|
|
||||||
doCheckDirtyAndConfigSave()
|
doCheckDirtyAndConfigSave()
|
||||||
found := findDirty()
|
found := me.forge.FindDirty()
|
||||||
dirty := found.Len()
|
dirty := found.Len()
|
||||||
|
|
||||||
if me.repoDirtyB != nil {
|
if me.repoDirtyB != nil {
|
||||||
|
|
|
@ -64,7 +64,7 @@ func doGitPullNew() error {
|
||||||
check := gitpb.NewRepos()
|
check := gitpb.NewRepos()
|
||||||
|
|
||||||
if argv.Pull.Dirty != nil {
|
if argv.Pull.Dirty != nil {
|
||||||
check = findDirty()
|
check = me.forge.FindDirty()
|
||||||
}
|
}
|
||||||
|
|
||||||
if argv.Pull.Patches != nil {
|
if argv.Pull.Patches != nil {
|
||||||
|
|
|
@ -62,7 +62,7 @@ func (r *foundWindow) initWindow() {
|
||||||
group1 := r.stack.NewGroup("Repo Summary")
|
group1 := r.stack.NewGroup("Repo Summary")
|
||||||
group1.NewButton("dirty", func() {
|
group1.NewButton("dirty", func() {
|
||||||
log.Info("find dirty here")
|
log.Info("find dirty here")
|
||||||
found := findDirty()
|
found := me.forge.FindDirty()
|
||||||
me.forge.PrintHumanTable(found)
|
me.forge.PrintHumanTable(found)
|
||||||
})
|
})
|
||||||
group1.NewButton("all", func() {
|
group1.NewButton("all", func() {
|
||||||
|
|
|
@ -255,7 +255,7 @@ func makeHackModeWindow(stdwin *stdReposTableWin) {
|
||||||
|
|
||||||
grid.NewButton("show dirty repos on win.Bottom", func() {
|
grid.NewButton("show dirty repos on win.Bottom", func() {
|
||||||
log.Info("try to show dirty repos on bottom")
|
log.Info("try to show dirty repos on bottom")
|
||||||
found := findDirty()
|
found := me.forge.FindDirty()
|
||||||
stdwin.doReposTable(found)
|
stdwin.doReposTable(found)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ func makeReposWinNew() *gadgets.GenericWindow {
|
||||||
t.Delete()
|
t.Delete()
|
||||||
t = nil
|
t = nil
|
||||||
}
|
}
|
||||||
found := findDirty()
|
found := me.forge.FindDirty()
|
||||||
|
|
||||||
// display the protobuf
|
// display the protobuf
|
||||||
t = addWindowPB(insertWin, found)
|
t = addWindowPB(insertWin, found)
|
||||||
|
|
Loading…
Reference in New Issue