()
| 9919 | } |
| 9920 | |
| 9921 | function getDiffs() { |
| 9922 | var diff = {}; |
| 9923 | currentBatch.changes.forEach(function (change) { |
| 9924 | returnValue.emit('checkpoint', { 'revs_diff': change }); |
| 9925 | // Couchbase Sync Gateway emits these, but we can ignore them |
| 9926 | /* istanbul ignore if */ |
| 9927 | if (change.id === "_user/") { |
| 9928 | return; |
| 9929 | } |
| 9930 | diff[change.id] = change.changes.map(function (x) { |
| 9931 | return x.rev; |
| 9932 | }); |
| 9933 | }); |
| 9934 | return target.revsDiff(diff).then(function (diffs) { |
| 9935 | /* istanbul ignore if */ |
| 9936 | if (returnValue.cancelled) { |
| 9937 | completeReplication(); |
| 9938 | throw new Error('cancelled'); |
| 9939 | } |
| 9940 | // currentBatch.diffs elements are deleted as the documents are written |
| 9941 | currentBatch.diffs = diffs; |
| 9942 | }); |
| 9943 | } |
| 9944 | |
| 9945 | function getBatchDocs() { |
| 9946 | return getDocs(src, target, currentBatch.diffs, returnValue).then(function (got) { |
no test coverage detected
searching dependent graphs…