add repo.IsPrivate()
This commit is contained in:
parent
5268267408
commit
28a20e0922
41
common.go
41
common.go
|
@ -3,7 +3,6 @@ package repostatus
|
||||||
import (
|
import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"go.wit.com/gui"
|
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
// "go.wit.com/gui/gui"
|
// "go.wit.com/gui/gui"
|
||||||
)
|
)
|
||||||
|
@ -178,35 +177,17 @@ func (rs *RepoStatus) SetTargetVersion(s string) {
|
||||||
rs.targetReleaseVersion.SetText(s)
|
rs.targetReleaseVersion.SetText(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
// returns a widget of the last tag that acts as a mirror
|
func (rs *RepoStatus) IsPrivate() bool {
|
||||||
func (rs *RepoStatus) MirrorLastTag() *gui.Node {
|
if rs.private.String() == "true" {
|
||||||
return rs.lasttag.MirrorValue()
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func (rs *RepoStatus) MirrorTargetVersion() *gui.Node {
|
func (rs *RepoStatus) SetPrivate(b bool) {
|
||||||
return rs.targetReleaseVersion.MirrorValue()
|
if b {
|
||||||
}
|
rs.private.SetText("true")
|
||||||
|
} else {
|
||||||
func (rs *RepoStatus) MirrorCurrentVersion() *gui.Node {
|
rs.private.SetText("false")
|
||||||
return rs.currentVersion.MirrorValue()
|
}
|
||||||
}
|
|
||||||
|
|
||||||
func (rs *RepoStatus) MirrorCurrentName() *gui.Node {
|
|
||||||
return rs.currentBranch.MirrorValue()
|
|
||||||
}
|
|
||||||
|
|
||||||
func (rs *RepoStatus) MirrorGitState() *gui.Node {
|
|
||||||
return rs.gitState.MirrorValue()
|
|
||||||
}
|
|
||||||
|
|
||||||
func (rs *RepoStatus) MirrorMasterVersion() *gui.Node {
|
|
||||||
return rs.mainBranchVersion.MirrorValue()
|
|
||||||
}
|
|
||||||
|
|
||||||
func (rs *RepoStatus) MirrorDevelVersion() *gui.Node {
|
|
||||||
return rs.develBranchVersion.MirrorValue()
|
|
||||||
}
|
|
||||||
|
|
||||||
func (rs *RepoStatus) MirrorUserVersion() *gui.Node {
|
|
||||||
return rs.userBranchVersion.MirrorValue()
|
|
||||||
}
|
}
|
||||||
|
|
1
draw.go
1
draw.go
|
@ -28,6 +28,7 @@ func (rs *RepoStatus) drawGitStatus(box *gui.Node) {
|
||||||
rs.gitState = gadgets.NewOneLiner(newgrid, "git state")
|
rs.gitState = gadgets.NewOneLiner(newgrid, "git state")
|
||||||
rs.readOnly = gadgets.NewOneLiner(newgrid, "read only")
|
rs.readOnly = gadgets.NewOneLiner(newgrid, "read only")
|
||||||
rs.primitive = gadgets.NewOneLiner(newgrid, "primitive")
|
rs.primitive = gadgets.NewOneLiner(newgrid, "primitive")
|
||||||
|
rs.private = gadgets.NewOneLiner(newgrid, "private")
|
||||||
rs.targetReleaseVersion = gadgets.NewOneLiner(newgrid, "target release version")
|
rs.targetReleaseVersion = gadgets.NewOneLiner(newgrid, "target release version")
|
||||||
|
|
||||||
rs.speed = gadgets.NewOneLiner(newgrid, "refresh speed =")
|
rs.speed = gadgets.NewOneLiner(newgrid, "refresh speed =")
|
||||||
|
|
|
@ -229,6 +229,14 @@ func (rs *RepoStatus) ReadOnly() bool {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (rs *RepoStatus) SetReadOnly(b bool) {
|
||||||
|
if b {
|
||||||
|
rs.readOnly.SetText("true")
|
||||||
|
} else {
|
||||||
|
rs.readOnly.SetText("false")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (rs *RepoStatus) processBranch(branch string) {
|
func (rs *RepoStatus) processBranch(branch string) {
|
||||||
fullpath := rs.realPath.String()
|
fullpath := rs.realPath.String()
|
||||||
log.Log(INFO, " ", branch)
|
log.Log(INFO, " ", branch)
|
||||||
|
|
1
merge.go
1
merge.go
|
@ -186,6 +186,7 @@ func (rs *RepoStatus) setTag() bool {
|
||||||
rs.newversion.SetLabel(newver)
|
rs.newversion.SetLabel(newver)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
// the newversion field goes through some sanity checking
|
// the newversion field goes through some sanity checking
|
||||||
// to make sure it's greater than the existing tag and
|
// to make sure it's greater than the existing tag and
|
||||||
// valid according to golang -- it must be format 'v1.2.3'
|
// valid according to golang -- it must be format 'v1.2.3'
|
||||||
|
|
|
@ -0,0 +1,42 @@
|
||||||
|
package repostatus
|
||||||
|
|
||||||
|
import (
|
||||||
|
"go.wit.com/gui"
|
||||||
|
// "go.wit.com/gui/gui"
|
||||||
|
)
|
||||||
|
|
||||||
|
// this is experiemental work on making 'View's or Table Row's
|
||||||
|
// this may or may not be a good idea
|
||||||
|
|
||||||
|
// returns a widget of the last tag that acts as a mirror
|
||||||
|
func (rs *RepoStatus) MirrorLastTag() *gui.Node {
|
||||||
|
return rs.lasttag.MirrorValue()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (rs *RepoStatus) MirrorTargetVersion() *gui.Node {
|
||||||
|
return rs.targetReleaseVersion.MirrorValue()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (rs *RepoStatus) MirrorCurrentVersion() *gui.Node {
|
||||||
|
return rs.currentVersion.MirrorValue()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (rs *RepoStatus) MirrorCurrentName() *gui.Node {
|
||||||
|
return rs.currentBranch.MirrorValue()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (rs *RepoStatus) MirrorGitState() *gui.Node {
|
||||||
|
return rs.gitState.MirrorValue()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (rs *RepoStatus) MirrorMasterVersion() *gui.Node {
|
||||||
|
return rs.mainBranchVersion.MirrorValue()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (rs *RepoStatus) MirrorDevelVersion() *gui.Node {
|
||||||
|
return rs.develBranchVersion.MirrorValue()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (rs *RepoStatus) MirrorUserVersion() *gui.Node {
|
||||||
|
return rs.userBranchVersion.MirrorValue()
|
||||||
|
}
|
9
new.go
9
new.go
|
@ -1,6 +1,7 @@
|
||||||
package repostatus
|
package repostatus
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
@ -47,7 +48,7 @@ func NewRepoStatusWindow(path string) (error, *RepoStatus) {
|
||||||
if windowMap[path] == nil {
|
if windowMap[path] == nil {
|
||||||
log.Log(INFO, "NewRepoStatusWindow() adding new", path)
|
log.Log(INFO, "NewRepoStatusWindow() adding new", path)
|
||||||
} else {
|
} else {
|
||||||
log.Warn("This already exists yet for path", path)
|
log.Warn("This already exists for path", path)
|
||||||
log.Warn("should return windowMap[path] here")
|
log.Warn("should return windowMap[path] here")
|
||||||
return nil, windowMap[path]
|
return nil, windowMap[path]
|
||||||
}
|
}
|
||||||
|
@ -74,6 +75,11 @@ func NewRepoStatusWindow(path string) (error, *RepoStatus) {
|
||||||
realpath = filepath.Join(goSrcDir, path)
|
realpath = filepath.Join(goSrcDir, path)
|
||||||
isGoLang = true
|
isGoLang = true
|
||||||
}
|
}
|
||||||
|
if !IsDirectory(realpath) {
|
||||||
|
log.Log(REPOWARN, "directory doesn't exist", realpath)
|
||||||
|
// directory doesn't exist. exit with nil and error nil
|
||||||
|
return errors.New(realpath + " does not exist"), nil
|
||||||
|
}
|
||||||
|
|
||||||
filename := filepath.Join(realpath, ".git/config")
|
filename := filepath.Join(realpath, ".git/config")
|
||||||
|
|
||||||
|
@ -120,6 +126,7 @@ func NewRepoStatusWindow(path string) (error, *RepoStatus) {
|
||||||
|
|
||||||
rs.readOnly.SetValue("true")
|
rs.readOnly.SetValue("true")
|
||||||
// ignore everything else for now
|
// ignore everything else for now
|
||||||
|
// todo: move this logic to cfgfile.go
|
||||||
if strings.HasPrefix(path, "go.wit.com") {
|
if strings.HasPrefix(path, "go.wit.com") {
|
||||||
rs.readOnly.SetValue("false")
|
rs.readOnly.SetValue("false")
|
||||||
}
|
}
|
||||||
|
|
45
structs.go
45
structs.go
|
@ -7,25 +7,19 @@ import (
|
||||||
|
|
||||||
type RepoStatus struct {
|
type RepoStatus struct {
|
||||||
ready bool
|
ready bool
|
||||||
|
changed bool // keeps track of changes that might have happened
|
||||||
// keeps track of changes that might have happened
|
|
||||||
changed bool
|
|
||||||
changes string
|
changes string
|
||||||
|
dirty bool // updates each time CheckDirty() is run
|
||||||
// updates each time CheckDirty() is run
|
|
||||||
dirty bool
|
|
||||||
|
|
||||||
tags map[string]string
|
tags map[string]string
|
||||||
|
|
||||||
window *gadgets.BasicWindow
|
window *gadgets.BasicWindow // the main window for this repo
|
||||||
|
Tags *GitTagBox // a box of all the git tags
|
||||||
// a box of all the git tags
|
|
||||||
Tags *GitTagBox
|
|
||||||
|
|
||||||
dirtyLabel *gadgets.OneLiner
|
dirtyLabel *gadgets.OneLiner
|
||||||
readOnly *gadgets.OneLiner
|
readOnly *gadgets.OneLiner
|
||||||
gitState *gadgets.OneLiner
|
gitState *gadgets.OneLiner
|
||||||
primitive *gadgets.OneLiner
|
primitive *gadgets.OneLiner
|
||||||
|
private *gadgets.OneLiner
|
||||||
|
|
||||||
path *gadgets.OneLiner
|
path *gadgets.OneLiner
|
||||||
goSrcPath *gadgets.OneLiner
|
goSrcPath *gadgets.OneLiner
|
||||||
|
@ -36,22 +30,19 @@ type RepoStatus struct {
|
||||||
currentBranch *gadgets.OneLiner
|
currentBranch *gadgets.OneLiner
|
||||||
currentVersion *gadgets.OneLiner
|
currentVersion *gadgets.OneLiner
|
||||||
|
|
||||||
lasttag *gadgets.OneLiner
|
mainWorkingName *gadgets.OneLiner // the actual name of the primary branch
|
||||||
mainBranchVersion *gadgets.OneLiner
|
develWorkingName *gadgets.OneLiner // the actual name of the devel branch
|
||||||
develBranchVersion *gadgets.OneLiner
|
userWorkingName *gadgets.OneLiner // the actual name of the user branch
|
||||||
userBranchVersion *gadgets.OneLiner
|
develMergeB *gui.Node // button to merge from user to devel
|
||||||
|
mainMergeB *gui.Node // button to merge from devel to master
|
||||||
mainWorkingName *gadgets.OneLiner
|
releaseVersion *gui.Node // the release version
|
||||||
develWorkingName *gadgets.OneLiner
|
minor *gadgets.BasicCombobox // the '3' in version v3.1.4
|
||||||
userWorkingName *gadgets.OneLiner
|
major *gadgets.BasicCombobox // the '1' in version v3.1.4
|
||||||
|
revision *gadgets.BasicCombobox // the '4' in version v3.1.4
|
||||||
develMergeB *gui.Node
|
lasttag *gadgets.OneLiner // the last tag version
|
||||||
mainMergeB *gui.Node
|
mainBranchVersion *gadgets.OneLiner // the primary branch version
|
||||||
releaseVersion *gui.Node
|
develBranchVersion *gadgets.OneLiner // the devel branch version
|
||||||
|
userBranchVersion *gadgets.OneLiner // the user branch version
|
||||||
minor *gadgets.BasicCombobox
|
|
||||||
major *gadgets.BasicCombobox
|
|
||||||
revision *gadgets.BasicCombobox
|
|
||||||
|
|
||||||
versionMessage *gadgets.BasicEntry
|
versionMessage *gadgets.BasicEntry
|
||||||
versionCmds [][]string
|
versionCmds [][]string
|
||||||
|
|
Loading…
Reference in New Issue