diff options
author | Filipe David Borba Manana <fdmanana@apache.org> | 2010-11-23 15:50:26 +0000 |
---|---|---|
committer | Filipe David Borba Manana <fdmanana@apache.org> | 2010-11-23 15:50:26 +0000 |
commit | 5dcc10a9ad8b180431bee49cc1b36a8f0859ff71 (patch) | |
tree | 9014fbe569ae9af2c3ad91027a1729ecafe79e8a /src/couchdb/couch_doc.erl | |
parent | 1b07ac052dd87d5dd255ebc328e9b8e66fac21c5 (diff) |
Merged revision 1038172 from trunk:
Replicator DB: added underscore prefix to the replication document fields that are meant to to be set/updated only by the replicator.
This makes it more clear to end users that those fields are meant to be used internally by CouchDB.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1038173 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_doc.erl')
-rw-r--r-- | src/couchdb/couch_doc.erl | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/couchdb/couch_doc.erl b/src/couchdb/couch_doc.erl index f8c874b0..b014de2d 100644 --- a/src/couchdb/couch_doc.erl +++ b/src/couchdb/couch_doc.erl @@ -252,6 +252,14 @@ transfer_fields([{<<"_conflicts">>, _} | Rest], Doc) -> transfer_fields([{<<"_deleted_conflicts">>, _} | Rest], Doc) -> transfer_fields(Rest, Doc); +% special fields for replication documents +transfer_fields([{<<"_replication_state">>, _} = Field | Rest], + #doc{body=Fields} = Doc) -> + transfer_fields(Rest, Doc#doc{body=[Field|Fields]}); +transfer_fields([{<<"_replication_id">>, _} = Field | Rest], + #doc{body=Fields} = Doc) -> + transfer_fields(Rest, Doc#doc{body=[Field|Fields]}); + % unknown special field transfer_fields([{<<"_",Name/binary>>, _} | _], _) -> throw({doc_validation, |