summaryrefslogtreecommitdiff
path: root/common.go
diff options
context:
space:
mode:
Diffstat (limited to 'common.go')
-rw-r--r--common.go76
1 files changed, 20 insertions, 56 deletions
diff --git a/common.go b/common.go
index 64e5886..6f3ab4e 100644
--- a/common.go
+++ b/common.go
@@ -4,21 +4,6 @@ import (
"go.wit.com/lib/gui/repostatus"
)
-// deprecate this
-func (r *Repo) String() string {
- return r.status.String()
-}
-
-// full path "/home/username/go/src/go.wit.com/apps/autotypist"
-func (r *Repo) Path() string {
- return r.status.Path()
-}
-
-// go path "go.wit.com/apps/autotypist"
-func (r *Repo) GoPath() string {
- return r.status.GoName()
-}
-
func (r *RepoList) Hidden() bool {
return r.reposbox.Hidden()
}
@@ -48,55 +33,42 @@ func AllRepos() []*Repo {
return all
}
-func (r *Repo) Build() bool {
- return r.status.Build()
-}
-
-func (r *Repo) Xterm(s string) {
- r.status.Xterm(s)
-}
-
-func (r *Repo) RepoType() string {
- return r.status.RepoType()
-}
-
-func (r *Repo) Status() string {
+// a human readable state of the current repo
+func (r *Repo) State() string {
return r.dirtyLabel.String()
}
-func (r *Repo) MergeDevelToMaster() bool {
- return r.status.MergeDevelToMaster()
-}
-
-func (r *Repo) MergeUserToDevel() bool {
- return r.status.MergeUserToDevel()
-}
-
func (r *Repo) Scan() bool {
return r.NewScan()
}
-func (r *Repo) Exists(s string) bool {
- return false
+// returns a name for human consuption only
+// todo: implement nicknames
+func (rs *Repo) Name() string {
+ if rs.Status.IsGoLang() {
+ return rs.Status.GoPath()
+ }
+ return rs.Status.Path()
}
-func (r *Repo) MakeRedomod() {
+func (r *Repo) Exists(s string) bool {
+ return false
}
-func (r *Repo) CheckoutBranch(b string) bool {
- return r.status.CheckoutBranch(b)
+func (r *Repo) GoPath() string {
+ return r.Status.GoPath()
}
func (r *Repo) CheckDirty() bool {
- return r.status.CheckDirty()
+ return r.Status.CheckDirty()
}
func (r *Repo) IsDirty() bool {
- return r.status.IsDirty()
+ return r.Status.IsDirty()
}
func (r *Repo) ReadOnly() bool {
- return r.status.ReadOnly()
+ return r.Status.ReadOnly()
}
func (r *Repo) IsPerfect() bool {
@@ -110,27 +82,19 @@ func (r *Repo) IsPerfect() bool {
}
func (r *Repo) RunCmd(cmd []string) (error, string) {
- return r.status.RunCmd(cmd)
-}
-
-func (r *Repo) GetDevelBranchName() string {
- return r.status.GetDevelBranchName()
-}
-
-func (r *Repo) GetUserBranchName() string {
- return r.status.GetUserBranchName()
+ return r.Status.RunCmd(cmd)
}
func (r *Repo) AllTags() []*repostatus.Tag {
- return r.status.Tags.ListAll()
+ return r.Status.Tags.ListAll()
}
func (r *Repo) TagsBox() *repostatus.GitTagBox {
- return r.status.Tags
+ return r.Status.Tags
}
// todo, fix bool return for deletetag()
func (r *Repo) DeleteTag(t *repostatus.Tag) bool {
- r.status.DeleteTag(t)
+ r.Status.DeleteTag(t)
return true
}