@@ -230,8 +230,8 @@ func TestProcessLegacyRev(t *testing.T) {
230
230
231
231
// assert this legacy doc has been given source version pair
232
232
docSource , docVrs := collection .GetDocumentCurrentVersion (t , "doc1" )
233
- assert .Equal (t , docVersion .CV .SourceID , docSource )
234
- assert .NotEqual (t , docVersion .CV . Value , docVrs )
233
+ assert .Equal (t , docVersion .HLV .SourceID , docSource )
234
+ assert .NotEqual (t , docVersion .HLV . Version , docVrs )
235
235
236
236
// try new rev to process
237
237
_ , _ , _ , err = bt .SendRev (
@@ -288,7 +288,7 @@ func TestProcessRevWithLegacyHistory(t *testing.T) {
288
288
rev1ID := docVersion .RevTreeID
289
289
290
290
// remove hlv here to simulate a legacy rev
291
- require .NoError (t , ds .RemoveXattrs (ctx , docID , []string {base .VvXattrName }, docVersion .CV . Value ))
291
+ require .NoError (t , ds .RemoveXattrs (ctx , docID , []string {base .VvXattrName }, docVersion .HLV . Version ))
292
292
rt .GetDatabase ().FlushRevisionCacheForTest ()
293
293
294
294
// Have CBL send an update to that doc, with history in revTreeID format
@@ -308,7 +308,7 @@ func TestProcessRevWithLegacyHistory(t *testing.T) {
308
308
rev1ID = docVersion .RevTreeID
309
309
310
310
// remove hlv here to simulate a legacy rev
311
- require .NoError (t , ds .RemoveXattrs (ctx , docID2 , []string {base .VvXattrName }, docVersion .CV . Value ))
311
+ require .NoError (t , ds .RemoveXattrs (ctx , docID2 , []string {base .VvXattrName }, docVersion .HLV . Version ))
312
312
rt .GetDatabase ().FlushRevisionCacheForTest ()
313
313
314
314
// Have CBL send an update to that doc, with history in HLV + revTreeID format
@@ -329,7 +329,7 @@ func TestProcessRevWithLegacyHistory(t *testing.T) {
329
329
rev1ID = docVersion .RevTreeID
330
330
331
331
// remove hlv here to simulate a legacy rev
332
- require .NoError (t , ds .RemoveXattrs (ctx , docID3 , []string {base .VvXattrName }, docVersion .CV . Value ))
332
+ require .NoError (t , ds .RemoveXattrs (ctx , docID3 , []string {base .VvXattrName }, docVersion .HLV . Version ))
333
333
rt .GetDatabase ().FlushRevisionCacheForTest ()
334
334
335
335
history = []string {"1000@CBL2" , "2-abc" , rev1ID }
@@ -363,7 +363,7 @@ func TestProcessRevWithLegacyHistory(t *testing.T) {
363
363
docVersion = rt .PutDocDirectly (docID5 , db.Body {"test" : "doc" })
364
364
365
365
docVersion = rt .UpdateDocDirectly (docID5 , docVersion , db.Body {"some" : "update" })
366
- version := docVersion .CV . Value
366
+ version := docVersion .HLV . Version
367
367
rev2ID := docVersion .RevTreeID
368
368
pushedRev := db.Version {
369
369
Value : version + 1000 ,
@@ -379,7 +379,7 @@ func TestProcessRevWithLegacyHistory(t *testing.T) {
379
379
bucketDoc , _ , err = collection .GetDocWithXattrs (ctx , docID5 , db .DocUnmarshalAll )
380
380
require .NoError (t , err )
381
381
assert .Equal (t , pushedRev .String (), bucketDoc .HLV .GetCurrentVersionString ())
382
- assert .Equal (t , docVersion .CV . Value , bucketDoc .HLV .PreviousVersions [docVersion .CV .SourceID ])
382
+ assert .Equal (t , docVersion .HLV . Version , bucketDoc .HLV .PreviousVersions [docVersion .HLV .SourceID ])
383
383
assert .NotNil (t , bucketDoc .History [rev2ID ])
384
384
385
385
// 6. CBL sends rev=1010@CBL1, history=3-abc,2-abc,1-abc and SGW has 1000@SGW, 1-abc
@@ -404,7 +404,7 @@ func TestProcessRevWithLegacyHistory(t *testing.T) {
404
404
bucketDoc , _ , err = collection .GetDocWithXattrs (ctx , docID6 , db .DocUnmarshalAll )
405
405
require .NoError (t , err )
406
406
assert .Equal (t , pushedRev .String (), bucketDoc .HLV .GetCurrentVersionString ())
407
- assert .Equal (t , docVersion .CV . Value , bucketDoc .HLV .PreviousVersions [docVersion .CV .SourceID ])
407
+ assert .Equal (t , docVersion .HLV . Version , bucketDoc .HLV .PreviousVersions [docVersion .HLV .SourceID ])
408
408
assert .NotNil (t , bucketDoc .History [rev1ID ])
409
409
assert .NotNil (t , bucketDoc .History ["2-abc" ])
410
410
assert .NotNil (t , bucketDoc .History ["3-abc" ])
@@ -444,7 +444,7 @@ func TestProcessRevWithLegacyHistoryConflict(t *testing.T) {
444
444
docVersion = rt .UpdateDocDirectly (docID , docVersion , db.Body {"some" : "update2" })
445
445
446
446
// remove hlv here to simulate a legacy rev
447
- require .NoError (t , ds .RemoveXattrs (base .TestCtx (t ), docID , []string {base .VvXattrName }, docVersion .CV . Value ))
447
+ require .NoError (t , ds .RemoveXattrs (base .TestCtx (t ), docID , []string {base .VvXattrName }, docVersion .HLV . Version ))
448
448
rt .GetDatabase ().FlushRevisionCacheForTest ()
449
449
450
450
history := []string {rev2ID , rev1ID }
@@ -473,7 +473,7 @@ func TestProcessRevWithLegacyHistoryConflict(t *testing.T) {
473
473
docVersion = rt .UpdateDocDirectly (docID3 , docVersion , db.Body {"some" : "update" })
474
474
475
475
// remove hlv here to simulate a legacy rev
476
- require .NoError (t , ds .RemoveXattrs (base .TestCtx (t ), docID3 , []string {base .VvXattrName }, docVersion .CV . Value ))
476
+ require .NoError (t , ds .RemoveXattrs (base .TestCtx (t ), docID3 , []string {base .VvXattrName }, docVersion .HLV . Version ))
477
477
rt .GetDatabase ().FlushRevisionCacheForTest ()
478
478
479
479
history = []string {"1000@CBL2" , rev1ID }
@@ -515,7 +515,7 @@ func TestChangesResponseLegacyRev(t *testing.T) {
515
515
516
516
// assert the rev property contains cv
517
517
rev := request .Properties ["rev" ]
518
- assert .Equal (t , docVersion2 .CV . String (), rev )
518
+ assert .Equal (t , docVersion2 .HLV . GetCurrentVersionString (), rev )
519
519
520
520
// assert that history contain current revID and previous revID
521
521
history := request .Properties ["history" ]
@@ -633,7 +633,7 @@ func TestChangesResponseWithHLVInHistory(t *testing.T) {
633
633
assert .Len (t , historyList , 3 )
634
634
assert .Equal (t , newDoc .CurrentRev , historyList [1 ])
635
635
assert .Equal (t , docVersion .RevTreeID , historyList [2 ])
636
- assert .Equal (t , docVersion .CV . String (), historyList [0 ])
636
+ assert .Equal (t , docVersion .HLV . GetCurrentVersionString (), historyList [0 ])
637
637
}
638
638
639
639
bt .blipContext .HandlerForProfile ["changes" ] = func (request * blip.Message ) {
@@ -712,7 +712,7 @@ func TestCBLHasPreUpgradeMutationThatHasNotBeenReplicated(t *testing.T) {
712
712
rev1ID := docVersion .RevTreeID
713
713
714
714
// remove hlv here to simulate a legacy rev
715
- require .NoError (t , ds .RemoveXattrs (ctx , "doc1" , []string {base .VvXattrName }, docVersion .CV . Value ))
715
+ require .NoError (t , ds .RemoveXattrs (ctx , "doc1" , []string {base .VvXattrName }, docVersion .HLV . Version ))
716
716
rt .GetDatabase ().FlushRevisionCacheForTest ()
717
717
718
718
history := []string {rev1ID }
@@ -752,7 +752,7 @@ func TestCBLHasOfPreUpgradeMutationThatSGWAlreadyKnows(t *testing.T) {
752
752
rev2ID := docVersion .RevTreeID
753
753
754
754
// remove hlv here to simulate a legacy rev
755
- require .NoError (t , ds .RemoveXattrs (ctx , "doc1" , []string {base .VvXattrName }, docVersion .CV . Value ))
755
+ require .NoError (t , ds .RemoveXattrs (ctx , "doc1" , []string {base .VvXattrName }, docVersion .HLV . Version ))
756
756
rt .GetDatabase ().FlushRevisionCacheForTest ()
757
757
758
758
history := []string {rev1ID }
@@ -791,7 +791,7 @@ func TestPushOfPostUpgradeMutationThatHasCommonAncestorToSGWVersion(t *testing.T
791
791
rev2ID := docVersion .RevTreeID
792
792
793
793
// remove hlv here to simulate a legacy rev
794
- require .NoError (t , ds .RemoveXattrs (ctx , "doc1" , []string {base .VvXattrName }, docVersion .CV . Value ))
794
+ require .NoError (t , ds .RemoveXattrs (ctx , "doc1" , []string {base .VvXattrName }, docVersion .HLV . Version ))
795
795
rt .GetDatabase ().FlushRevisionCacheForTest ()
796
796
797
797
// send 100@CBL1
@@ -833,7 +833,7 @@ func TestPushDocConflictBetweenPreUpgradeCBLMutationAndPreUpgradeSGWMutation(t *
833
833
rev3ID := docVersion .RevTreeID
834
834
835
835
// remove hlv here to simulate a legacy rev
836
- require .NoError (t , ds .RemoveXattrs (ctx , "doc1" , []string {base .VvXattrName }, docVersion .CV . Value ))
836
+ require .NoError (t , ds .RemoveXattrs (ctx , "doc1" , []string {base .VvXattrName }, docVersion .HLV . Version ))
837
837
rt .GetDatabase ().FlushRevisionCacheForTest ()
838
838
839
839
// send rev 3-def
@@ -922,7 +922,7 @@ func TestConflictBetweenPostUpgradeCBLMutationAndPostUpgradeSGWMutation(t *testi
922
922
require .NoError (t , err )
923
923
assert .Equal (t , "100@CBL1" , bucketDoc .HLV .GetCurrentVersionString ())
924
924
assert .NotNil (t , bucketDoc .History [rev1ID ])
925
- assert .Equal (t , docVersion .CV . Value , bucketDoc .HLV .PreviousVersions [docVersion .CV .SourceID ])
925
+ assert .Equal (t , docVersion .HLV . Version , bucketDoc .HLV .PreviousVersions [docVersion .HLV .SourceID ])
926
926
927
927
// conflict rev
928
928
docVersion = rt .PutDocDirectly (docID2 , db.Body {"some" : "doc" })
@@ -937,5 +937,5 @@ func TestConflictBetweenPostUpgradeCBLMutationAndPostUpgradeSGWMutation(t *testi
937
937
bucketDoc , _ , err = collection .GetDocWithXattrs (ctx , docID2 , db .DocUnmarshalAll )
938
938
require .NoError (t , err )
939
939
assert .Equal (t , rev1ID , bucketDoc .CurrentRev )
940
- assert .Equal (t , docVersion .CV . String (), bucketDoc .HLV .GetCurrentVersionString ())
940
+ assert .Equal (t , docVersion .HLV . GetCurrentVersionString (), bucketDoc .HLV .GetCurrentVersionString ())
941
941
}
0 commit comments