more patch stuff
This commit is contained in:
parent
4a27e7702b
commit
817107dc16
2
http.go
2
http.go
|
@ -21,7 +21,7 @@ func (f *Forge) HttpPost(url string, data []byte) ([]byte, error) {
|
|||
|
||||
usr, _ := user.Current()
|
||||
req.Header.Set("author", usr.Username)
|
||||
req.Header.Set("hostname", "fixme:hostname")
|
||||
req.Header.Set("hostname", f.hostname)
|
||||
|
||||
client := &http.Client{}
|
||||
resp, err := client.Do(req)
|
||||
|
|
|
@ -342,7 +342,11 @@ func (psets *Patchsets) PrintTable() {
|
|||
var countCONTENTS int
|
||||
var countPARTS int
|
||||
for x, pset := range psets.GetPatchsets() {
|
||||
log.Info(pset.Uuid, pset.Name)
|
||||
log.Info(pset.Uuid, pset.Name, pset.State)
|
||||
if pset.State == "DONE" {
|
||||
// old patchset
|
||||
continue
|
||||
}
|
||||
cId := log.Sprintf("%d", x)
|
||||
countCONTENTS += 1
|
||||
for i, p := range pset.Patches.GetPatches() {
|
||||
|
|
1
init.go
1
init.go
|
@ -178,6 +178,7 @@ func (f *Forge) setenv() {
|
|||
f.repoPB = os.Getenv("FORGE_REPOPB")
|
||||
f.forgeURL = os.Getenv("FORGE_URL")
|
||||
f.patchDir = os.Getenv("FORGE_PATCHDIR")
|
||||
f.hostname = os.Getenv("HOSTNAME")
|
||||
if os.Getenv("FORGE_GOWORK") == "true" {
|
||||
f.goWork = true
|
||||
}
|
||||
|
|
|
@ -28,6 +28,14 @@ func (f *Forge) GetPatches() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (f *Forge) expireAllPatchsets() {
|
||||
all := f.Patchsets.All()
|
||||
for all.Scan() {
|
||||
pset := all.Next()
|
||||
pset.State = "DONE"
|
||||
}
|
||||
}
|
||||
|
||||
func (f *Forge) loadUpstreamPatchsets(psets *Patchsets) {
|
||||
var foundnew bool
|
||||
|
||||
|
@ -36,6 +44,7 @@ func (f *Forge) loadUpstreamPatchsets(psets *Patchsets) {
|
|||
pset := all.Next()
|
||||
found := f.Patchsets.FindByUuid(pset.Uuid)
|
||||
if found == nil {
|
||||
f.expireAllPatchsets()
|
||||
log.Info("new patchset", pset.Name, pset.Uuid)
|
||||
pset.State = "new"
|
||||
foundnew = true
|
||||
|
|
Loading…
Reference in New Issue