diff options
Diffstat (limited to 'applyPatch.go')
| -rw-r--r-- | applyPatch.go | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/applyPatch.go b/applyPatch.go index bc40ae3..2124acc 100644 --- a/applyPatch.go +++ b/applyPatch.go @@ -8,7 +8,6 @@ import ( "path/filepath" "strings" - "go.wit.com/lib/gui/shell" "go.wit.com/lib/protobuf/forgepb" "go.wit.com/lib/protobuf/gitpb" "go.wit.com/log" @@ -70,47 +69,6 @@ func countCurrentPatches(repo *gitpb.Repo) int { return len(result.Stdout) } -func applyPatchsetOLD(pset *forgepb.Patchset) error { - var everythingworked bool = true - tmpdir, err := os.MkdirTemp("", "forge") - if err != nil { - return err - } - // log.Info("got to applyPatches() pset", pset) - log.Info("applyPatches() NAME", pset.Name) - log.Info("applyPatches() COMMENT", pset.Comment) - log.Info("applyPatches() GIT_AUTHOR_NAME", pset.GetGitAuthorName()) - log.Info("applyPatches() GIT_AUTHOR_EMAIL", pset.GetGitAuthorEmail()) - all := pset.Patches.SortByFilename() - for all.Scan() { - p := all.Next() - - basedir := me.forge.GetGoSrc() - if fullname, err := savePatchFile(p, basedir); err != nil { - log.Info(fullname, "save failed", err) - continue - } 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) - for _, line := range result.Stdout { - log.Warn("stdout:", line) - } - for _, line := range result.Stderr { - log.Warn("stderr:", line) - } - } - everythingworked = false - } - if everythingworked { - os.RemoveAll(tmpdir) // clean up - } - log.Info("THIS IS THE END MY FRIEND") - return nil -} - func savePatchFile(p *forgepb.Patch, basedir string) (string, error) { basepath, filename := filepath.Split(p.Filename) fulldir := filepath.Join(basedir, basepath) |
