add repo.IsPrivate()
This commit is contained in:
parent
5268267408
commit
28a20e0922
39
common.go
39
common.go
|
@ -3,7 +3,6 @@ package repostatus
|
|||
import (
|
||||
"strings"
|
||||
|
||||
"go.wit.com/gui"
|
||||
"go.wit.com/log"
|
||||
// "go.wit.com/gui/gui"
|
||||
)
|
||||
|
@ -178,35 +177,17 @@ func (rs *RepoStatus) SetTargetVersion(s string) {
|
|||
rs.targetReleaseVersion.SetText(s)
|
||||
}
|
||||
|
||||
// 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) IsPrivate() bool {
|
||||
if rs.private.String() == "true" {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (rs *RepoStatus) MirrorTargetVersion() *gui.Node {
|
||||
return rs.targetReleaseVersion.MirrorValue()
|
||||
func (rs *RepoStatus) SetPrivate(b bool) {
|
||||
if b {
|
||||
rs.private.SetText("true")
|
||||
} else {
|
||||
rs.private.SetText("false")
|
||||
}
|
||||
|
||||
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()
|
||||
}
|
||||
|
|
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.readOnly = gadgets.NewOneLiner(newgrid, "read only")
|
||||
rs.primitive = gadgets.NewOneLiner(newgrid, "primitive")
|
||||
rs.private = gadgets.NewOneLiner(newgrid, "private")
|
||||
rs.targetReleaseVersion = gadgets.NewOneLiner(newgrid, "target release version")
|
||||
|
||||
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) {
|
||||
fullpath := rs.realPath.String()
|
||||
log.Log(INFO, " ", branch)
|
||||
|
|
1
merge.go
1
merge.go
|
@ -186,6 +186,7 @@ func (rs *RepoStatus) setTag() bool {
|
|||
rs.newversion.SetLabel(newver)
|
||||
return true
|
||||
}
|
||||
|
||||
// the newversion field goes through some sanity checking
|
||||
// to make sure it's greater than the existing tag and
|
||||
// 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
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
@ -47,7 +48,7 @@ func NewRepoStatusWindow(path string) (error, *RepoStatus) {
|
|||
if windowMap[path] == nil {
|
||||
log.Log(INFO, "NewRepoStatusWindow() adding new", path)
|
||||
} 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")
|
||||
return nil, windowMap[path]
|
||||
}
|
||||
|
@ -74,6 +75,11 @@ func NewRepoStatusWindow(path string) (error, *RepoStatus) {
|
|||
realpath = filepath.Join(goSrcDir, path)
|
||||
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")
|
||||
|
||||
|
@ -120,6 +126,7 @@ func NewRepoStatusWindow(path string) (error, *RepoStatus) {
|
|||
|
||||
rs.readOnly.SetValue("true")
|
||||
// ignore everything else for now
|
||||
// todo: move this logic to cfgfile.go
|
||||
if strings.HasPrefix(path, "go.wit.com") {
|
||||
rs.readOnly.SetValue("false")
|
||||
}
|
||||
|
|
45
structs.go
45
structs.go
|
@ -7,25 +7,19 @@ import (
|
|||
|
||||
type RepoStatus struct {
|
||||
ready bool
|
||||
|
||||
// keeps track of changes that might have happened
|
||||
changed bool
|
||||
changed bool // keeps track of changes that might have happened
|
||||
changes string
|
||||
|
||||
// updates each time CheckDirty() is run
|
||||
dirty bool
|
||||
|
||||
dirty bool // updates each time CheckDirty() is run
|
||||
tags map[string]string
|
||||
|
||||
window *gadgets.BasicWindow
|
||||
|
||||
// a box of all the git tags
|
||||
Tags *GitTagBox
|
||||
window *gadgets.BasicWindow // the main window for this repo
|
||||
Tags *GitTagBox // a box of all the git tags
|
||||
|
||||
dirtyLabel *gadgets.OneLiner
|
||||
readOnly *gadgets.OneLiner
|
||||
gitState *gadgets.OneLiner
|
||||
primitive *gadgets.OneLiner
|
||||
private *gadgets.OneLiner
|
||||
|
||||
path *gadgets.OneLiner
|
||||
goSrcPath *gadgets.OneLiner
|
||||
|
@ -36,22 +30,19 @@ type RepoStatus struct {
|
|||
currentBranch *gadgets.OneLiner
|
||||
currentVersion *gadgets.OneLiner
|
||||
|
||||
lasttag *gadgets.OneLiner
|
||||
mainBranchVersion *gadgets.OneLiner
|
||||
develBranchVersion *gadgets.OneLiner
|
||||
userBranchVersion *gadgets.OneLiner
|
||||
|
||||
mainWorkingName *gadgets.OneLiner
|
||||
develWorkingName *gadgets.OneLiner
|
||||
userWorkingName *gadgets.OneLiner
|
||||
|
||||
develMergeB *gui.Node
|
||||
mainMergeB *gui.Node
|
||||
releaseVersion *gui.Node
|
||||
|
||||
minor *gadgets.BasicCombobox
|
||||
major *gadgets.BasicCombobox
|
||||
revision *gadgets.BasicCombobox
|
||||
mainWorkingName *gadgets.OneLiner // the actual name of the primary branch
|
||||
develWorkingName *gadgets.OneLiner // the actual name of the devel branch
|
||||
userWorkingName *gadgets.OneLiner // the actual name of the user branch
|
||||
develMergeB *gui.Node // button to merge from user to devel
|
||||
mainMergeB *gui.Node // button to merge from devel to master
|
||||
releaseVersion *gui.Node // the release version
|
||||
minor *gadgets.BasicCombobox // the '3' in version v3.1.4
|
||||
major *gadgets.BasicCombobox // the '1' in version v3.1.4
|
||||
revision *gadgets.BasicCombobox // the '4' in version v3.1.4
|
||||
lasttag *gadgets.OneLiner // the last tag version
|
||||
mainBranchVersion *gadgets.OneLiner // the primary branch version
|
||||
develBranchVersion *gadgets.OneLiner // the devel branch version
|
||||
userBranchVersion *gadgets.OneLiner // the user branch version
|
||||
|
||||
versionMessage *gadgets.BasicEntry
|
||||
versionCmds [][]string
|
||||
|
|
Loading…
Reference in New Issue