rm old code
This commit is contained in:
parent
07e0fdc437
commit
e323d5920c
9
git.go
9
git.go
|
@ -6,6 +6,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"go.wit.com/lib/gui/shell"
|
"go.wit.com/lib/gui/shell"
|
||||||
|
"go.wit.com/lib/protobuf/gitpb"
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -199,7 +200,7 @@ func (rs *RepoStatus) setLastTagVersion() {
|
||||||
func (rs *RepoStatus) populateTags() {
|
func (rs *RepoStatus) populateTags() {
|
||||||
tmp := rs.realPath.String() + "/.git/refs/tags"
|
tmp := rs.realPath.String() + "/.git/refs/tags"
|
||||||
log.Log(REPO, "populateTags() path =", tmp)
|
log.Log(REPO, "populateTags() path =", tmp)
|
||||||
for _, tag := range listFiles(tmp) {
|
for _, tag := range gitpb.ListFiles(tmp) {
|
||||||
if rs.tags[tag] == "" {
|
if rs.tags[tag] == "" {
|
||||||
log.Log(REPO, "populateTags() Adding new tag", tag)
|
log.Log(REPO, "populateTags() Adding new tag", tag)
|
||||||
// rs.tagsDrop.AddText(tag)
|
// rs.tagsDrop.AddText(tag)
|
||||||
|
@ -209,12 +210,13 @@ func (rs *RepoStatus) populateTags() {
|
||||||
// rs.tagsDrop.SetText(rs.lasttagrev)
|
// rs.tagsDrop.SetText(rs.lasttagrev)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
func (rs *RepoStatus) getBranches() []string {
|
func (rs *RepoStatus) getBranches() []string {
|
||||||
var all []string
|
var all []string
|
||||||
var heads []string
|
var heads []string
|
||||||
var remotes []string
|
var remotes []string
|
||||||
heads = listFiles(rs.realPath.String() + "/.git/refs/heads")
|
heads = gitpb.ListFiles(rs.realPath.String() + "/.git/refs/heads")
|
||||||
remotes = listFiles(rs.realPath.String() + "/.git/refs/remotes")
|
remotes = gitpb.ListFiles(rs.realPath.String() + "/.git/refs/remotes")
|
||||||
|
|
||||||
all = heads
|
all = heads
|
||||||
|
|
||||||
|
@ -225,6 +227,7 @@ func (rs *RepoStatus) getBranches() []string {
|
||||||
}
|
}
|
||||||
return all
|
return all
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
// returns quickly based on the last time it was checked
|
// returns quickly based on the last time it was checked
|
||||||
func (rs *RepoStatus) IsDirty() bool {
|
func (rs *RepoStatus) IsDirty() bool {
|
||||||
|
|
29
unix.go
29
unix.go
|
@ -5,7 +5,6 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"regexp"
|
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
@ -15,31 +14,6 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
func run(path string, thing string, cmdline string) string {
|
|
||||||
parts := strings.Split(cmdline, " ")
|
|
||||||
// Create the command
|
|
||||||
cmd := exec.Command(thing, parts...)
|
|
||||||
|
|
||||||
// Set the working directory
|
|
||||||
cmd.Dir = path
|
|
||||||
|
|
||||||
// Execute the command
|
|
||||||
output, err := cmd.CombinedOutput()
|
|
||||||
tmp := string(output)
|
|
||||||
tmp = strings.TrimSpace(tmp)
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
log.Log(WARN, "run()", path, thing, cmdline, "=", tmp)
|
|
||||||
log.Error(err, "cmd error'd out", parts)
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
// Print the output
|
|
||||||
log.Log(INFO, "run()", path, thing, cmdline, "=", tmp)
|
|
||||||
return tmp
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
// goes in one directory so it gets remote branch names
|
// goes in one directory so it gets remote branch names
|
||||||
func listFiles(directory string) []string {
|
func listFiles(directory string) []string {
|
||||||
var files []string
|
var files []string
|
||||||
|
@ -65,7 +39,9 @@ func listFiles(directory string) []string {
|
||||||
|
|
||||||
return files
|
return files
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
func normalizeVersion(s string) string {
|
func normalizeVersion(s string) string {
|
||||||
// reg, err := regexp.Compile("[^a-zA-Z0-9]+")
|
// reg, err := regexp.Compile("[^a-zA-Z0-9]+")
|
||||||
parts := strings.Split(s, "-")
|
parts := strings.Split(s, "-")
|
||||||
|
@ -94,6 +70,7 @@ func splitVersion(version string) (a, b, c string) {
|
||||||
return parts[0], parts[1], parts[2]
|
return parts[0], parts[1], parts[2]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
func (rs *RepoStatus) Run(cmd []string) cmd.Status {
|
func (rs *RepoStatus) Run(cmd []string) cmd.Status {
|
||||||
path := rs.realPath.String()
|
path := rs.realPath.String()
|
||||||
|
|
Loading…
Reference in New Issue