aboutsummaryrefslogtreecommitdiffstats
path: root/entities/bug/op_label_change.go
diff options
context:
space:
mode:
Diffstat (limited to 'entities/bug/op_label_change.go')
-rw-r--r--entities/bug/op_label_change.go31
1 files changed, 17 insertions, 14 deletions
diff --git a/entities/bug/op_label_change.go b/entities/bug/op_label_change.go
index 45441f7c..76b2ebef 100644
--- a/entities/bug/op_label_change.go
+++ b/entities/bug/op_label_change.go
@@ -59,12 +59,14 @@ AddLoop:
return string(snapshot.Labels[i]) < string(snapshot.Labels[j])
})
+ id := op.Id()
item := &LabelChangeTimelineItem{
- id: op.Id(),
- Author: op.Author(),
- UnixTime: timestamp.Timestamp(op.UnixTime),
- Added: op.Added,
- Removed: op.Removed,
+ // id: id,
+ combinedId: entity.CombineIds(snapshot.Id(), id),
+ Author: op.Author(),
+ UnixTime: timestamp.Timestamp(op.UnixTime),
+ Added: op.Added,
+ Removed: op.Removed,
}
snapshot.Timeline = append(snapshot.Timeline, item)
@@ -103,19 +105,20 @@ func NewLabelChangeOperation(author identity.Interface, unixTime int64, added, r
}
type LabelChangeTimelineItem struct {
- id entity.Id
- Author identity.Interface
- UnixTime timestamp.Timestamp
- Added []Label
- Removed []Label
+ // id entity.Id
+ combinedId entity.CombinedId
+ Author identity.Interface
+ UnixTime timestamp.Timestamp
+ Added []Label
+ Removed []Label
}
-func (l LabelChangeTimelineItem) Id() entity.Id {
- return l.id
+func (l LabelChangeTimelineItem) CombinedId() entity.CombinedId {
+ return l.combinedId
}
// IsAuthored is a sign post method for gqlgen
-func (l LabelChangeTimelineItem) IsAuthored() {}
+func (l *LabelChangeTimelineItem) IsAuthored() {}
// ChangeLabels is a convenience function to change labels on a bug
func ChangeLabels(b Interface, author identity.Interface, unixTime int64, add, remove []string, metadata map[string]string) ([]LabelChangeResult, *LabelChangeOperation, error) {
@@ -180,7 +183,7 @@ func ChangeLabels(b Interface, author identity.Interface, unixTime int64, add, r
}
// ForceChangeLabels is a convenience function to apply the operation
-// The difference with ChangeLabels is that no checks of deduplications are done. You are entirely
+// The difference with ChangeLabels is that no checks for deduplication are done. You are entirely
// responsible for what you are doing. In the general case, you want to use ChangeLabels instead.
// The intended use of this function is to allow importers to create legal but unexpected label changes,
// like removing a label with no information of when it was added before.