couchbase/couchbase-lite-java-core — pull request #78 by mjq (2014-02-11 05:43:18+00:00)
Title: Fix replication wtih CouchDB when more than one leaf revision has changed

Here's one way to go about fixing #77.

First commit adds an option to include conflicts in ChangeTracker's constructor. This was done to mimic iOS' [CBLChangeTracker initializer](https://github.com/couchbase/couchbase-lite-ios/blob/4e39ae4781adc83db7134aec945625d5e0305e58/Source/ChangeTracker/CBLChangeTracker.m#L58). This causes the `style=all_docs` parameter to get added to the call to `_changes`, which is required to get notified of changes to non-winning leaf revisions.

Second commit inspects the bodies of pulled revisions for the `_deleted` key, and if true, marks the revision as deleted. This is required when pulling from CouchDB, which doesn't set the "deleted" key in `all_docs`-style `_changes` feed entries when mixed live/deleted revisions are returned together.

Together, these fix the broken test in #77. That test and another to verify the ChangeTracker change are coming in PR to [couchbase-lite-android](https://github.com/couchbase/couchbase-lite-android) shortly.

Both of these changes could be introduced in a bunch of ways; this is just one take on it. Happy to make changes, or feel free to go another direction with it :+1: