almost there on a first git am attempt
This commit is contained in:
parent
25fe17d59c
commit
5f0a271bf7
|
@ -7,6 +7,7 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"go.wit.com/lib/gui/shell"
|
||||||
"go.wit.com/lib/protobuf/forgepb"
|
"go.wit.com/lib/protobuf/forgepb"
|
||||||
"go.wit.com/lib/protobuf/gitpb"
|
"go.wit.com/lib/protobuf/gitpb"
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
|
@ -89,6 +90,23 @@ func applyPatchset(pset *forgepb.Patchset) error {
|
||||||
log.Info(fullname, "save failed", err)
|
log.Info(fullname, "save failed", err)
|
||||||
continue
|
continue
|
||||||
} else {
|
} else {
|
||||||
|
basedir, filename := filepath.Split(fullname)
|
||||||
|
cmd := []string{"git", "am", filename}
|
||||||
|
log.Info("Should run: at", basedir, ":", cmd)
|
||||||
|
log.Info(basedir, filename)
|
||||||
|
result := shell.PathRun(basedir, cmd)
|
||||||
|
/*
|
||||||
|
if err != nil {
|
||||||
|
log.Info("git am failed", err)
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
for _, line := range result.Stdout {
|
||||||
|
log.Warn("stdout:", line)
|
||||||
|
}
|
||||||
|
for _, line := range result.Stderr {
|
||||||
|
log.Warn("stderr:", line)
|
||||||
|
}
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
// log.Info("pset filename FILENAME IS REAL?", p.Filename, pset.Name, pset.Comment)
|
// log.Info("pset filename FILENAME IS REAL?", p.Filename, pset.Name, pset.Comment)
|
||||||
basepath, filename := filepath.Split(p.Filename)
|
basepath, filename := filepath.Split(p.Filename)
|
||||||
|
@ -109,16 +127,12 @@ func applyPatchset(pset *forgepb.Patchset) error {
|
||||||
raw.Close()
|
raw.Close()
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
FIX THIS
|
|
||||||
cmd := []string{"git", "am", fullname}
|
|
||||||
result := shell.PathRun(fullpath, cmd)
|
result := shell.PathRun(fullpath, cmd)
|
||||||
if result.Exit != 0 {
|
if result.Exit != 0 {
|
||||||
log.Info("cmd failed", cmd, result.Exit)
|
log.Info("cmd failed", cmd, result.Exit)
|
||||||
everythingworked = false
|
everythingworked = false
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
}
|
|
||||||
// until 'git am' works
|
|
||||||
everythingworked = false
|
everythingworked = false
|
||||||
}
|
}
|
||||||
if everythingworked {
|
if everythingworked {
|
||||||
|
|
|
@ -161,5 +161,13 @@ func doPatchGet() error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
log.Info("Got Patchsets ok", psets.Uuid)
|
log.Info("Got Patchsets ok", psets.Uuid)
|
||||||
|
|
||||||
|
log.Info("got psets len", len(psets.Patchsets))
|
||||||
|
all := psets.SortByName()
|
||||||
|
for all.Scan() {
|
||||||
|
pset := all.Next()
|
||||||
|
// log.Info("pset name =", pset.Name)
|
||||||
|
dumpPatchset(pset)
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -154,6 +154,7 @@ func (r *patchesWindow) addPatchsetNew(pset *forgepb.Patchset) {
|
||||||
r.psetgrid.NewLabel(pset.Name)
|
r.psetgrid.NewLabel(pset.Name)
|
||||||
r.psetgrid.NewLabel(pset.Comment)
|
r.psetgrid.NewLabel(pset.Comment)
|
||||||
r.psetgrid.NewLabel(pset.GitAuthorName)
|
r.psetgrid.NewLabel(pset.GitAuthorName)
|
||||||
|
// r.psetgrid.NewLabel(pset.RepoNamespace)
|
||||||
if pset.State == "BROKEN" {
|
if pset.State == "BROKEN" {
|
||||||
r.psetgrid.NewLabel("Bad")
|
r.psetgrid.NewLabel("Bad")
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue