Usort the infos during compaction to remove dupes, COUCHDB-968
Usort the infos during compaction to remove dupes, COUCHDB-968

This is not a bulletproof solution; it only removes dupes when the
they appear in the same batch of 1000 updates.  However, for dupes
that show up in _all_docs the probability of that happening is quite
high.  If the dupes are only in _changes a user may need to compact
twice, once to get the dupes ordered together and a second time to
remove them.

A more complete solution would be to trigger the compaction in "retry"
mode, but this is siginificantly slower.

git-svn-id: c1f8a8ec0b3bb2e99ab3413722f81f687760e79c@1043451 13f79535-47bb-0310-9956-ffa450edef68

fkaempfer/couchdb,cloudant/couchdb-couch,alanning/couchdb-couch,alanning/couchdb-couch,fkaempfer/couchdb,ngpestelos/couchdb-couch,KlausTrainer/couchdb-couch,smithsz/couchdb-couch,apache/couchdb-couch,ngpestelos/couchdb-couch,apache/couchdb-couch,ngpestelos/couchdb-couch,fkaempfer/couchdb,smithsz/couchdb-couch,fkaempfer/couchdb,fkaempfer/couchdb,cloudant/couchdb-couch,KlausTrainer/couchdb-couch,KlausTrainer/couchdb-couch,smithsz/couchdb-couch,cloudant/couchdb-couch,fkaempfer/couchdb,alanning/couchdb-couch,apache/couchdb-couch