summaryrefslogtreecommitdiff
path: root/patchset.Get.go
diff options
context:
space:
mode:
Diffstat (limited to 'patchset.Get.go')
-rw-r--r--patchset.Get.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/patchset.Get.go b/patchset.Get.go
index 5570b87..c650a82 100644
--- a/patchset.Get.go
+++ b/patchset.Get.go
@@ -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