blob: d02b6f2b438acf9fee9b888082509f85db40c844 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
// This is a simple example
package main
import (
"go.wit.com/log"
"go.wit.com/lib/gui/repostatus"
)
func (r *repo) newScan() bool {
if r.status == nil {
log.Warn("repo.status = nil. not initialized for some reason")
return false
}
// r.scan()
if repostatus.VerifyLocalGoRepo(r.getPath()) {
log.Warn("repo actually exists", r.getPath())
} else {
log.Warn("repo does not exist", r.getPath())
return false
}
mn := r.status.GetMasterName()
r.masterName.Set(mn)
mv := r.status.GetMasterVersion()
r.masterVersion.Set(mv)
dn := r.status.GetDevelName()
r.develName.Set(dn)
dv := r.status.GetDevelVersion()
r.develVersion.Set(dv)
un := r.status.GetUserName()
r.userName.Set(un)
uv := r.status.GetUserVersion()
r.userVersion.Set(uv)
cbname := r.status.GetCurrentBranchName()
cbversion := r.status.GetCurrentBranchVersion()
lasttag := r.status.GetLastTagVersion()
r.lastTag.Set(lasttag)
r.vLabel.Set(cbname + " " + cbversion)
status := r.getStatus()
if status == "dirty" {
r.dirtyLabel.Set(status)
return false
}
if status == "merge" {
r.dirtyLabel.Set(status)
return false
}
if status == "PERFECT" {
r.dirtyLabel.Set(status)
return true
}
r.dirtyLabel.Set("unknown " + status)
return false
}
func (r *repo) getStatus() string {
if r.status.CheckDirty() {
log.Warn("CheckDirty() true")
return "dirty"
}
if r.status.CheckBranches() {
log.Warn("Branches are Perfect")
return "PERFECT"
}
log.Warn("Branches are not Perfect")
return "merge"
}
|