File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -753,6 +753,9 @@ - (BOOL) saveResolvedDocument: (CBLDocument*)resolvedDoc
753753 error : (NSError **)outError
754754{
755755 CBL_LOCK (_mutex) {
756+ CBLStringBytes winningRevID;
757+ CBLStringBytes losingRevID;
758+
756759 CBLDatabase* db = self.database ;
757760 if (![self database: db isValid: outError])
758761 return NO ;
@@ -769,19 +772,21 @@ - (BOOL) saveResolvedDocument: (CBLDocument*)resolvedDoc
769772 resolvedDoc = remoteDoc;
770773 }
771774
772- if (resolvedDoc != localDoc)
775+ if (resolvedDoc == localDoc) {
776+ winningRevID = localDoc.revisionID ;
777+ losingRevID = remoteDoc.revisionID ;
778+ } else {
773779 resolvedDoc.collection = self;
774-
775- // The remote branch has to win, so that the doc revision history matches the server's.
776- CBLStringBytes winningRevID = remoteDoc.revisionID ;
777- CBLStringBytes losingRevID = localDoc.revisionID ;
780+ winningRevID = remoteDoc.revisionID ;
781+ losingRevID = localDoc.revisionID ;
782+ }
778783
779784 // mergedRevFlags:
780785 C4RevisionFlags mergedFlags = 0 ;
781786
782787 // mergedBody:
783788 alloc_slice mergedBody;
784- if (resolvedDoc != remoteDoc) {
789+ if (resolvedDoc != localDoc && resolvedDoc != remoteDoc) {
785790 if (resolvedDoc) {
786791 // Unless the remote revision is being used as-is, we need a new revision:
787792 NSError * err = nil ;
Original file line number Diff line number Diff line change @@ -55,7 +55,6 @@ public struct BasicAuthenticator: IAuthenticator {
5555 }
5656
5757 // MARK: Internal
58-
5958 func toImpl( ) -> CBLAuthenticator {
6059 return CBLBasicAuthenticator ( username: username, password: password)
6160 }
You can’t perform that action at this time.
0 commit comments