Add purge_seq to DbInfo

Change-Id: I4dd9c337dfedf3e3949f1dcedfaa87462f9b10b8
Reviewed-on: http://review.couchbase.org/35062
Reviewed-by: Aaron Miller <apage43@ninjawhale.com>
Reviewed-by: Sundararaman Sridharan <sundar@couchbase.com>
Tested-by: Sundararaman Sridharan <sundar@couchbase.com>
MB-10736: Install lib/python/couchstore.py

Change-Id: Ie7c81fdb55a44996e0451c8f41715f1603da04b4
Reviewed-on: http://review.couchbase.org/35487
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Remove config_static.h

CMake isn't as terrible slow as automake to regenerate
config.h

Change-Id: I2f4e777ce729d66375724857bca83487e94f07db
Reviewed-on: http://review.couchbase.org/35434
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Minor cleanup

Change-Id: Icc348a80744bf4fdce14997935f3a1ea8629308d
Reviewed-on: http://review.couchbase.org/35680
Reviewed-by: Chris Hillery <ceej@couchbase.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
MB-10839 Fixing the string length in unicode comparision

Change-Id: I557651e59e3807e143d680dcbabdb0e8acbdccc5
Reviewed-on: http://review.couchbase.org/36133
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
Add dbdiff utility to compare two couchstore files

dbdiff is a command line utility you may use to compare the
content in two different database files to ensure that they
have the same content.

Change-Id: I21360daaef0be0638e26c38a1c793e7681e629f6
Reviewed-on: http://review.couchbase.org/36570
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Make couch_dbdump able to get more things available

This fixes MB-10102, MB-10019, MB-10103 and satisfies some requests
from the support team.

Specifically added are:

 * Can look up a specific key
 * Can dump all local documents or a specific local doc
 * Fixed --byid sort option being ignored
 * Local doc dump and regular dump can output data as machine-readable
   JSON
 * Can dump document bodies as hex (if document is binary data)
 * Show document physical (disk) and actual (uncompressed) size.
 * More useful help message

[Dave Rigby]: Forward-ported to 3.0 branch from 2.5.1.
    Original SHA: de0dcdc292935b93c4700386c5f65c92daff7039
    Original gerrit: http://review.couchbase.org/33948

Change-Id: I447fe670ed4edbc9b841050ae11a0848cd440830
Reviewed-on: http://review.couchbase.org/37187
Reviewed-by: Chiyoung Seo <chiyoung@couchbase.com>
Tested-by: Chiyoung Seo <chiyoung@couchbase.com>
Fix build break on win32

Change-Id: Ie73f65afde7b6915e2f8db235daf02e4c800714e
Reviewed-on: http://review.couchbase.org/37374
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
MB-10273 Implement deduplication in file merger

The current k-way file merger is not designed to handle
duplicate entries. We need to be able to merge multiple
sort record files which are created at different points in time.
The merge should be able to be peformed such that it deduplicates
the records according to the file priority. If there are duplicate
entries for same key across multiple files, the entry from highest
filenumber should be picked.

Refactored file_merger to handle deduplication. The file merger expects
all its input files to be sorted and have only unique records. The input
files should be deduplicated before passing over to the file merger for
deduplication.

The file merger deduplicates records as per the following example:

File 1:
insert key1,valx1
insert key2,valx2
insert key3,valx3

File 2:
insert key0,valy0
insert key3,valy3
insert key4,valy4

Output merger file:
insert key0,valy0
insert key1,valx1
insert key2,valx2
insert key3,valy3 <-- picked key3 from latest file (File 2)
insert key4,valy4

Change-Id: If3ad629e06fc0aaba97cdbba68db9bc27dd56bb3
Reviewed-on: http://review.couchbase.org/34981
Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
MB-10273 Add tests for file merger with deduplication

Change-Id: I26618c6fd5f02c9b8b79ff9377315ef19e620bfd
Reviewed-on: http://review.couchbase.org/34982
Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
Add exit message listener thread for view file merger

Add support for view file merger process to exit if an
"exit" message arrives or stdin pipe is closed.

Change-Id: I5dd812f002222241ee0362601409d19b84067679
Reviewed-on: http://review.couchbase.org/36263
Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
quicksort: Remove "switch to insertion sort" optimization

Reference commit from NetBSD:
http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/stdlib/qsort.c?rev=1.20&content-type=text/x-cvsweb-markup&only_with_tag=MAIN

Change-Id: I4ce2507fa5f3cc240d478f84a1e59bc18f74eb8a
Reviewed-on: http://review.couchbase.org/36459
Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
diff tool initial pass

Rebased to 3.0 master.

Conflicts:
	Makefile.am

Change-Id: I374a713cea29dca798e25743342f2129d758a6bf
changes history scanner

Change-Id: Ia07b86d4ee692e938158b2c9329402051777e7cb