summaryrefslogtreecommitdiff
path: root/getPatches.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-01-07 18:06:41 -0600
committerJeff Carr <[email protected]>2025-01-07 18:06:41 -0600
commitd71cf27653bfc09738f63cdb975254aff8c6501f (patch)
tree15168cb79890714a68e732dbe95e6f6bf9900fa1 /getPatches.go
parent0fac12c31e11fc6394bdfd4ecc29991c63397a29 (diff)
rm old code
Diffstat (limited to 'getPatches.go')
-rw-r--r--getPatches.go112
1 files changed, 0 insertions, 112 deletions
diff --git a/getPatches.go b/getPatches.go
deleted file mode 100644
index 46e8587..0000000
--- a/getPatches.go
+++ /dev/null
@@ -1,112 +0,0 @@
-package repolist
-
-import (
- "go.wit.com/lib/gui/repostatus"
-)
-
-type Patch struct {
- Ref string
- giturl string
- comment string
- RS *repostatus.RepoStatus
-}
-
-// move all this to repolist and gowit repos
-
-/*
-func (repo *RepoRow) GetPatches(oldname string, newname string) (int, []*Patch) {
- var patchcount int
- patches := make([]*Patch, 0, 0)
-
- if oldname == newname {
- return 0, nil
- }
- // log.Info("repo userv, develv", userv, develv)
- gitcmd := []string{"git", "log", "--oneline", oldname + ".." + newname}
- log.Info("Run:", gitcmd)
- r := repo.Status.Run(gitcmd)
- if r.Error != nil {
- log.Info("git failed ", repo.GetGoPath(), "err =", r.Error)
- return 0, nil
- }
-
- // patches = strings.Split(output, "\n")
- log.Info("Run:", r.Stdout)
- for _, line := range r.Stdout {
- line = strings.TrimSpace(line)
- if line == "" {
- continue
- }
- parts := strings.Split(line, " ")
- newp := new(Patch)
- newp.RS = repo.Status
- newp.Ref = parts[0]
- newp.comment = strings.Join(parts[1:], " ")
- log.Info("Patch line:", line, newp.RS.String())
- patchcount += 1
- patches = append(patches, newp)
- }
- return patchcount, patches
-}
-
-func (repo *RepoRow) GetUserPatches() (int, []*Patch) {
- usern := repo.Status.GetUserBranchName()
- develn := repo.Status.GetDevelBranchName()
- userv := repo.Status.GetUserVersion()
- develv := repo.Status.GetDevelVersion()
-
- if userv == develv {
- return 0, nil
- }
-
- c, all := repo.GetPatches(develn, usern)
- log.Info("GetPatches() guireleaser", develn, usern, "count =", c)
- return c, all
-}
-
-func (repo *RepoRow) GetMasterPatches() (int, []*Patch) {
- lasttag := repo.LastTag()
- mastern := repo.Status.GetMasterBranchName()
- masterv := repo.Status.GetMasterVersion()
-
- if lasttag == masterv {
- return 0, nil
- }
-
- c, all := repo.GetPatches(lasttag, mastern)
- log.Info("GetPatches() guireleaser", lasttag, mastern, "count =", c)
- return c, all
-}
-
-func isEmpty(a any) bool {
- return false
-}
-
-func (r *RepoList) MakePatchset(setdir string) bool {
- for _, repo := range r.allrepos {
- userv := repo.Status.GetUserVersion()
- develv := repo.Status.GetDevelVersion()
- usern := repo.Status.GetUserBranchName()
- develn := repo.Status.GetDevelBranchName()
- if userv == develv {
- // this repo is unchanged
- continue
- }
-
- repodir := filepath.Join(setdir, repo.GetGoPath())
- os.MkdirAll(repodir, os.ModeDir)
- // git format-patch branch1..branch2
- gitcmd := []string{"git", "format-patch", "-o", repodir, develn + ".." + usern}
- log.Info("Run:", gitcmd)
- r := repo.Status.Run(gitcmd)
- log.Info("output =", r.Stdout)
- if r.Error == nil {
- log.Info("patches made okay for:", repo.GetGoPath())
- continue
- }
- log.Info("patches failed for:", repo.GetGoPath())
- return false
- }
- return true
-}
-*/