@@ -2,6 +2,7 @@ package types
22
33import (
44 treetypes "github.com/sdcio/data-server/pkg/tree/types"
5+ sdcpb "github.com/sdcio/sdc-protos/sdcpb"
56)
67
78type TransactionIntent struct {
@@ -15,15 +16,15 @@ type TransactionIntent struct {
1516 // it will be stored and used for change calculation but will be excluded when claculating actual deviations.
1617 deviation bool
1718 deleteIgnoreNonExisting bool
18- deletes treetypes. PathSlices
19+ deletes * sdcpb. PathSet
1920}
2021
2122func NewTransactionIntent (name string , priority int32 ) * TransactionIntent {
2223 return & TransactionIntent {
2324 name : name ,
2425 updates : make (treetypes.UpdateSlice , 0 ),
2526 priority : priority ,
26- deletes : make (treetypes. PathSlices , 0 ),
27+ deletes : sdcpb . NewPathSet ( ),
2728 }
2829}
2930
@@ -43,7 +44,7 @@ func (ti *TransactionIntent) GetUpdates() treetypes.UpdateSlice {
4344 return ti .updates
4445}
4546
46- func (ti * TransactionIntent ) GetDeletes () treetypes. PathSlices {
47+ func (ti * TransactionIntent ) GetDeletes () * sdcpb. PathSet {
4748 return ti .deletes
4849}
4950
@@ -67,6 +68,8 @@ func (ti *TransactionIntent) AddUpdate(u *treetypes.Update) {
6768 ti .updates = append (ti .updates , u )
6869}
6970
70- func (ti * TransactionIntent ) AddDelete (p treetypes.PathSlice ) {
71- ti .deletes = append (ti .deletes , p )
71+ func (ti * TransactionIntent ) AddDeletes (p []* sdcpb.Path ) {
72+ for _ , x := range p {
73+ ti .deletes .AddPath (x )
74+ }
7275}
0 commit comments