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