Created
October 25, 2012 13:40
-
-
Save a13xb/3952603 to your computer and use it in GitHub Desktop.
Conflict example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
set -e | |
couch() { | |
cmd="curl localhost:5984/" | |
echo '===' ${cmd}$* | |
${cmd}$* | |
echo | |
} | |
# Cleanup | |
couch d1 -XDELETE | |
couch d2 -XDELETE | |
# Setup | |
couch d1 -XPUT | |
couch d2 -XPUT | |
couch d1/foo -XPUT -d{} | |
couch d2/foo -XPUT -d{} | |
# Introduce conflict | |
couch d1/foo -XPUT -d '{"_rev":"1-967a00dff5e02add41819138abb3284d"}' | |
couch d2/foo -XPUT -d '{"_rev":"1-967a00dff5e02add41819138abb3284d","a":111}' | |
couch _replicate -Hcontent-type:application/json -d'{"source":"d2","target":"d1"}' | |
couch d1/foo | |
couch 'd1/foo?conflicts=true&deleted_conflicts=true' | |
couch 'd1/foo?open_revs=all' | |
couch 'd1/foo?rev=2-7051cbe5c8faecd085a3fa619e6e6337' -XDELETE | |
couch 'd1/foo?conflicts=true&deleted_conflicts=true' | |
couch 'd1/foo?open_revs=all' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment