start work on an apply patchset window
This commit is contained in:
parent
b7a6001ba4
commit
c5fcb2a6c0
2
Makefile
2
Makefile
|
@ -32,7 +32,7 @@ goimports:
|
||||||
@# // gofmt -w -r '"go.wit.com/gui/gadgets" -> "go.wit.com/lib/gadgets"' *.go
|
@# // gofmt -w -r '"go.wit.com/gui/gadgets" -> "go.wit.com/lib/gadgets"' *.go
|
||||||
|
|
||||||
gocui: install
|
gocui: install
|
||||||
forge --gui gocui --do-gui
|
forge --gui gocui --do-gui >/tmp/forge.log 2>&1
|
||||||
|
|
||||||
redomod-all:
|
redomod-all:
|
||||||
forge --do-RedoGoMod
|
forge --do-RedoGoMod
|
||||||
|
|
55
argv.go
55
argv.go
|
@ -7,31 +7,32 @@ package main
|
||||||
var argv args
|
var argv args
|
||||||
|
|
||||||
type args struct {
|
type args struct {
|
||||||
Config bool `arg:"--config" help:"work from your .config/forge/ configuration"`
|
Config bool `arg:"--config" help:"work from your .config/forge/ configuration"`
|
||||||
FindAll bool `arg:"--find-all" help:"select every repo"`
|
FindAll bool `arg:"--find-all" help:"select every repo"`
|
||||||
FindReadOnly bool `arg:"--find-readonly" help:"include read-only repos"`
|
FindReadOnly bool `arg:"--find-readonly" help:"include read-only repos"`
|
||||||
FindMine bool `arg:"--find-mine" help:"download private and writeable repos"`
|
FindMine bool `arg:"--find-mine" help:"download private and writeable repos"`
|
||||||
FindFavorites bool `arg:"--find-favorites" help:"download repos marked as favorites"`
|
FindFavorites bool `arg:"--find-favorites" help:"download repos marked as favorites"`
|
||||||
FindPrivate bool `arg:"--find-private" help:"list private repos in .config/forge/"`
|
FindPrivate bool `arg:"--find-private" help:"list private repos in .config/forge/"`
|
||||||
DoList bool `arg:"--do-list" help:"list found repos"`
|
DoList bool `arg:"--do-list" help:"list found repos"`
|
||||||
DoScan bool `arg:"--do-scan" help:"rescan your repos"`
|
DoScan bool `arg:"--do-scan" help:"rescan your repos"`
|
||||||
DoClone bool `arg:"--do-clone" help:"go-clone things you are missing"`
|
DoClone bool `arg:"--do-clone" help:"go-clone things you are missing"`
|
||||||
DoForce bool `arg:"--do-force" help:"force redo go-clone"`
|
DoForce bool `arg:"--do-force" help:"force redo go-clone"`
|
||||||
DoGitPull bool `arg:"--do-git-pull" help:"run 'git pull' on all your repos"`
|
DoGitPull bool `arg:"--do-git-pull" help:"run 'git pull' on all your repos"`
|
||||||
DoGitReset bool `arg:"--do-git-reset" help:"run 'git reset --hard' on all read-only repos"`
|
DoGitReset bool `arg:"--do-git-reset" help:"run 'git reset --hard' on all read-only repos"`
|
||||||
DoBuild bool `arg:"--do-build" default:"true" help:"also try to build it"`
|
DoBuild bool `arg:"--do-build" default:"true" help:"also try to build it"`
|
||||||
DoInstall bool `arg:"--do-install" help:"try to install every binary package"`
|
DoInstall bool `arg:"--do-install" help:"try to install every binary package"`
|
||||||
DoRedoGoMod bool `arg:"--do-RedoGoMod" help:"remake all the go.sum and go.mod files"`
|
DoRedoGoMod bool `arg:"--do-RedoGoMod" help:"remake all the go.sum and go.mod files"`
|
||||||
DoPatchSet bool `arg:"--do-patches" help:"make patch set"`
|
DoPatchSet bool `arg:"--do-patches" help:"make patch set"`
|
||||||
ListPatchSet bool `arg:"--list-patches" help:"make patch set"`
|
ListPatchSet bool `arg:"--list-patches" help:"make patch set"`
|
||||||
DoGui bool `arg:"--do-gui" help:"test the gui"`
|
DoGui bool `arg:"--do-gui" help:"test the gui"`
|
||||||
DryRun bool `arg:"--dry-run" help:"show what would be run"`
|
DryRun bool `arg:"--dry-run" help:"show what would be run"`
|
||||||
Fix bool `arg:"--fix" help:"fix config, save config & exit"`
|
Fix bool `arg:"--fix" help:"fix config, save config & exit"`
|
||||||
URL string `arg:"--url" default:"http://go.wit.com/" help:"base url"`
|
URL string `arg:"--url" default:"http://go.wit.com/" help:"base url"`
|
||||||
Delete string `arg:"--delete" help:"delete this repo"`
|
Delete string `arg:"--delete" help:"delete this repo"`
|
||||||
Dirty bool `arg:"--dirty" help:"git CheckDirty() on every repo"`
|
Dirty bool `arg:"--dirty" help:"git CheckDirty() on every repo"`
|
||||||
User bool `arg:"--user" help:"git checkout user"`
|
User bool `arg:"--user" help:"git checkout user"`
|
||||||
Master bool `arg:"--master" help:"git checkout master"`
|
Master bool `arg:"--master" help:"git checkout master"`
|
||||||
|
Map []string `arg:"--map" help:"map a new repo"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (args) Version() string {
|
func (args) Version() string {
|
||||||
|
@ -50,5 +51,7 @@ Examples:
|
||||||
forge --git-pull # run 'git pull' in every repo
|
forge --git-pull # run 'git pull' in every repo
|
||||||
forge --build --dry-run # build every binary package (but just show what would run)
|
forge --build --dry-run # build every binary package (but just show what would run)
|
||||||
forge --mine --clone # clone every package you have in your config file
|
forge --mine --clone # clone every package you have in your config file
|
||||||
`
|
`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// forge --map lib/foo https://github.com/me/myfoo # map go.wit.com/lib/foo -> github.com/me/myfoo
|
||||||
|
|
2
doGui.go
2
doGui.go
|
@ -12,7 +12,7 @@ func doGui() {
|
||||||
me.myGui = gui.New()
|
me.myGui = gui.New()
|
||||||
me.myGui.Default()
|
me.myGui.Default()
|
||||||
|
|
||||||
me.mainWindow = gadgets.RawBasicWindow("Forge: use this to submit patches")
|
me.mainWindow = gadgets.RawBasicWindow("Forge: (this doesn't work yet)")
|
||||||
me.mainWindow.Make()
|
me.mainWindow.Make()
|
||||||
me.mainWindow.Show()
|
me.mainWindow.Show()
|
||||||
me.mainbox = me.mainWindow.Box()
|
me.mainbox = me.mainWindow.Box()
|
||||||
|
|
5
main.go
5
main.go
|
@ -54,6 +54,11 @@ func main() {
|
||||||
okExit("")
|
okExit("")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(argv.Map) != 0 {
|
||||||
|
log.Info("need to map here", argv.Map)
|
||||||
|
okExit("")
|
||||||
|
}
|
||||||
|
|
||||||
if argv.Delete != "" {
|
if argv.Delete != "" {
|
||||||
me.forge.DeleteByGoPath(argv.Delete)
|
me.forge.DeleteByGoPath(argv.Delete)
|
||||||
me.forge.SetConfigSave(true)
|
me.forge.SetConfigSave(true)
|
||||||
|
|
|
@ -0,0 +1,61 @@
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"sync"
|
||||||
|
|
||||||
|
"go.wit.com/lib/gadgets"
|
||||||
|
"go.wit.com/log"
|
||||||
|
|
||||||
|
"go.wit.com/gui"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Shout out to "Go Generics 101" by Tapir Liu. Buy this book!
|
||||||
|
|
||||||
|
type Lockable[T any] struct {
|
||||||
|
mu sync.Mutex
|
||||||
|
data T
|
||||||
|
}
|
||||||
|
|
||||||
|
func (l *Lockable[T]) Do(f func(*T)) {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (l *Lockable[T]) Hide() {
|
||||||
|
log.Info("testing:", l)
|
||||||
|
}
|
||||||
|
|
||||||
|
type applyWindow struct {
|
||||||
|
win *gadgets.BasicWindow
|
||||||
|
box *gui.Node
|
||||||
|
|
||||||
|
// the top box of the repolist window
|
||||||
|
topbox *gui.Node
|
||||||
|
}
|
||||||
|
|
||||||
|
type C3 = interface {
|
||||||
|
Show()
|
||||||
|
Hide()
|
||||||
|
Hidden() bool
|
||||||
|
Enable()
|
||||||
|
Disable()
|
||||||
|
~*gadgets.BasicWindow | ~*gui.Node
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r applyWindow) Hidden() bool {
|
||||||
|
return r.win.Hidden()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r applyWindow) Show() {
|
||||||
|
r.win.Show()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r applyWindow) Hide() {
|
||||||
|
r.win.Hide()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r applyWindow) Disable() {
|
||||||
|
r.box.Disable()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r applyWindow) Enable() {
|
||||||
|
r.box.Enable()
|
||||||
|
}
|
|
@ -173,6 +173,9 @@ func submitPatchesBox(box *gui.Node) *patchSummary {
|
||||||
me.repos.View.MakePatchset(patchdir)
|
me.repos.View.MakePatchset(patchdir)
|
||||||
*/
|
*/
|
||||||
})
|
})
|
||||||
|
s.grid.NewButton("Show Patchsets", func() {
|
||||||
|
listPatches()
|
||||||
|
})
|
||||||
s.grid.NewButton("Show Repos", func() {
|
s.grid.NewButton("Show Repos", func() {
|
||||||
s.Update()
|
s.Update()
|
||||||
if me.repos.Hidden() {
|
if me.repos.Hidden() {
|
||||||
|
|
|
@ -74,30 +74,20 @@ func makeRepoView() *repoWindow {
|
||||||
|
|
||||||
func (r *repoWindow) repoMenu() *gui.Node {
|
func (r *repoWindow) repoMenu() *gui.Node {
|
||||||
// reposbox.SetExpand(false)
|
// reposbox.SetExpand(false)
|
||||||
group1 := r.box.NewGroup("Run on all repos:")
|
group1 := r.box.NewGroup("Filter:")
|
||||||
|
|
||||||
hbox := group1.Box()
|
hbox := group1.Box()
|
||||||
// hbox.Horizontal()
|
// hbox.Horizontal()
|
||||||
hbox.Vertical()
|
hbox.Vertical()
|
||||||
|
|
||||||
box2 := hbox.Box().Vertical()
|
box2 := hbox.Box().Horizontal()
|
||||||
/*
|
/*
|
||||||
box2.NewButton("merge all user to devel", func() {
|
*/
|
||||||
r.Disable()
|
|
||||||
if !r.mergeAllUserToDevel() {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
r.Enable()
|
|
||||||
})
|
|
||||||
|
|
||||||
box2.NewButton("merge all devel to main", func() {
|
dirty := box2.NewCheckbox("dirty")
|
||||||
r.Disable()
|
dirty.Custom = func() {
|
||||||
if !r.mergeAllDevelToMain() {
|
log.Info("filter dirty =", dirty.Checked())
|
||||||
return
|
}
|
||||||
}
|
|
||||||
r.Enable()
|
|
||||||
})
|
|
||||||
*/
|
|
||||||
|
|
||||||
box2.NewButton("merge it all", func() {
|
box2.NewButton("merge it all", func() {
|
||||||
r.Disable()
|
r.Disable()
|
||||||
|
|
Loading…
Reference in New Issue