old code
This commit is contained in:
parent
92bbfa1ebe
commit
141bd0e6b0
25
README.md
25
README.md
|
@ -1,26 +1,7 @@
|
||||||
autotypist
|
autotypist
|
||||||
|
|
||||||
This can be used to maintain git repositories
|
# see instead: 'forge' at:
|
||||||
|
|
||||||
* Scans directories looking for git repositories
|
http://go.wit.com/
|
||||||
* The default behavior is to use 3 branches. 'master or main', 'devel', '<username>'
|
|
||||||
* shows tags and dirty state
|
|
||||||
* uses a GUI or the console(console display needs work)
|
|
||||||
* always wrap around 'git' -- it basically just types 'git' commands really fast
|
|
||||||
|
|
||||||
Notes & Goals:
|
### This has been rewritten as forge ###
|
||||||
|
|
||||||
* use a GUI that also works on the command line
|
|
||||||
* andlabs GTK gui plugin starts breaking around 200 repos
|
|
||||||
|
|
||||||
Build / install:
|
|
||||||
|
|
||||||
* go build go.wit.com/apps/autotypist@latest
|
|
||||||
* go install go.wit.com/apps/autotypist@latest
|
|
||||||
|
|
||||||
Debian packages:
|
|
||||||
|
|
||||||
* echo deb http://mirrors.wit.com/wit/ sid main > /etc/apt/sources.list.d/wit.list
|
|
||||||
* apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4A854AEAF7E0E16D
|
|
||||||
* apt update
|
|
||||||
* apt install autotypist
|
|
||||||
|
|
155
repoview.go
155
repoview.go
|
@ -61,171 +61,18 @@ func makeRepoView() *repoWindow {
|
||||||
|
|
||||||
r.View.ScanRepositories()
|
r.View.ScanRepositories()
|
||||||
|
|
||||||
/*
|
|
||||||
r.View = repolist.AutotypistView(r.box)
|
|
||||||
|
|
||||||
showncount := r.View.MirrorShownCount()
|
|
||||||
r.topbox.Append(showncount)
|
|
||||||
duration := r.View.MirrorScanDuration()
|
|
||||||
r.topbox.Append(duration)
|
|
||||||
*/
|
|
||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
|
|
||||||
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("")
|
||||||
|
|
||||||
hbox := group1.Box()
|
hbox := group1.Box()
|
||||||
// hbox.Horizontal()
|
// hbox.Horizontal()
|
||||||
hbox.Vertical()
|
hbox.Vertical()
|
||||||
|
|
||||||
box2 := hbox.Box().Vertical()
|
box2 := hbox.Box().Vertical()
|
||||||
/*
|
|
||||||
box2.NewButton("merge all user to devel", func() {
|
|
||||||
r.Disable()
|
|
||||||
if !r.mergeAllUserToDevel() {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
r.Enable()
|
|
||||||
})
|
|
||||||
|
|
||||||
box2.NewButton("merge all devel to main", func() {
|
|
||||||
r.Disable()
|
|
||||||
if !r.mergeAllDevelToMain() {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
r.Enable()
|
|
||||||
})
|
|
||||||
*/
|
|
||||||
|
|
||||||
box2.NewButton("merge it all (old)", func() {
|
|
||||||
/*
|
|
||||||
r.Disable()
|
|
||||||
if !r.mergeAllUserToDevel() {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if !r.mergeAllDevelToMain() {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
r.Enable()
|
|
||||||
*/
|
|
||||||
})
|
|
||||||
|
|
||||||
box2.NewButton("show apps", func() {
|
|
||||||
/*
|
|
||||||
loop := me.repos.View.ReposSortByName()
|
|
||||||
for loop.Scan() {
|
|
||||||
repo := loop.Repo()
|
|
||||||
rtype := repo.Status.RepoType()
|
|
||||||
switch rtype {
|
|
||||||
case "'binary'":
|
|
||||||
// log.Info(repo.Status.Path(), "compile here. Show()")
|
|
||||||
repo.Show()
|
|
||||||
case "'library'":
|
|
||||||
// log.Info(repo.Status.Path(), "library here. Hide()")
|
|
||||||
repo.Hide()
|
|
||||||
default:
|
|
||||||
log.Info(repo.Status.Path(), "unknown type", rtype)
|
|
||||||
// repo.Hide()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
})
|
|
||||||
box2.NewButton("scan now", func() {
|
|
||||||
log.Info("re-scanning now")
|
|
||||||
i, s := me.repos.View.ScanRepositories()
|
|
||||||
log.Info("re-scanning done", i, "repos in", s)
|
|
||||||
})
|
|
||||||
|
|
||||||
box2.NewButton("make patch set", func() {
|
|
||||||
pset, err := me.forge.MakeDevelPatchSet()
|
|
||||||
if err != nil {
|
|
||||||
log.Info("make devel patch set failed", err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
all := pset.Patches.SortByFilename()
|
|
||||||
for all.Scan() {
|
|
||||||
p := all.Next()
|
|
||||||
log.Info("read in patch:", p.Filename)
|
|
||||||
}
|
|
||||||
err = me.forge.SendPatchSet(pset)
|
|
||||||
if err != nil {
|
|
||||||
log.Info("send patch set failed", err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
return box2
|
return box2
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
func (r *repoWindow) mergeAllDevelToMain() bool {
|
|
||||||
log.Info("merge all here")
|
|
||||||
loop := me.repos.View.ReposSortByName()
|
|
||||||
for loop.Scan() {
|
|
||||||
repo := loop.Repo()
|
|
||||||
if repo.ReadOnly() {
|
|
||||||
log.Info("skipping readonly", repo.Name(), repo.State())
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if repo.State() != "merge to main" {
|
|
||||||
log.Info("skipping. not merge to main", repo.Name(), repo.State())
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if repo.CheckDirty() {
|
|
||||||
log.Info("skipping dirty", repo.Name(), repo.State())
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
log.Info("found", repo.Name(), repo.State())
|
|
||||||
repo.NewScan()
|
|
||||||
if repo.Status.MergeDevelToMaster() {
|
|
||||||
log.Warn("THINGS SEEM OK fullAutomation() returned true.")
|
|
||||||
} else {
|
|
||||||
log.Warn("last repo:", repo.Name())
|
|
||||||
log.Warn("THINGS FAILED fullAutomation() returned false")
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
repo.NewScan()
|
|
||||||
}
|
|
||||||
log.Warn("EVERYTHING WORKED. with merge to master")
|
|
||||||
cmd := []string{"forge", "master"}
|
|
||||||
shell.Run(cmd)
|
|
||||||
cmd = []string{"forge", "list"}
|
|
||||||
shell.Run(cmd)
|
|
||||||
os.Exit(0)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r *repoWindow) mergeAllUserToDevel() bool {
|
|
||||||
log.Info("merge all here")
|
|
||||||
loop := me.repos.View.ReposSortByName()
|
|
||||||
for loop.Scan() {
|
|
||||||
repo := loop.Repo()
|
|
||||||
if repo.ReadOnly() {
|
|
||||||
log.Info("skipping readonly", repo.Name(), repo.State())
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if repo.State() != "merge to devel" {
|
|
||||||
log.Info("skipping. not merge to devel", repo.Name(), repo.State())
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if repo.CheckDirty() {
|
|
||||||
log.Info("skipping dirty", repo.Name(), repo.State())
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
log.Info("found", repo.Name(), repo.State())
|
|
||||||
repo.NewScan()
|
|
||||||
if repo.Status.MergeUserToDevel() {
|
|
||||||
log.Warn("THINGS SEEM OK fullAutomation() returned true.")
|
|
||||||
} else {
|
|
||||||
log.Warn("last repo:", repo.Status.Path())
|
|
||||||
log.Warn("THINGS FAILED fullAutomation() returned false")
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
repo.NewScan()
|
|
||||||
}
|
|
||||||
log.Warn("EVERYTHING WORKED")
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
Loading…
Reference in New Issue