You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ji...@apache.org on 2018/08/14 09:22:07 UTC
[couchdb] 07/07: Resolve merge conflict
This is an automated email from the ASF dual-hosted git repository.
jiangphcn pushed a commit to branch COUCHDB-3326-clustered-purge-pr3-refactor-pse-tests
in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit bff390d222bd611ac006fc6603a09021d01bd3a5
Author: jiangph <ji...@cn.ibm.com>
AuthorDate: Thu Aug 9 17:58:35 2018 +0800
Resolve merge conflict
COUCHDB-3326
---
src/couch_pse_tests/src/cpse_util.erl | 31 +++----------------------------
1 file changed, 3 insertions(+), 28 deletions(-)
diff --git a/src/couch_pse_tests/src/cpse_util.erl b/src/couch_pse_tests/src/cpse_util.erl
index 202b11e..ff11951 100644
--- a/src/couch_pse_tests/src/cpse_util.erl
+++ b/src/couch_pse_tests/src/cpse_util.erl
@@ -188,7 +188,8 @@ gen_write(Db, {Action, {<<"_local/", _/binary>> = DocId, Body}}) ->
deleted = Deleted
}};
- Rev = couch_hash:md5_hash(term_to_binary({DocId, Body, Atts})),
+gen_write(Db, {Action, {DocId, Body}}) ->
+ gen_write(Db, {Action, {DocId, Body, []}});
gen_write(Db, {create, {DocId, Body, Atts}}) ->
{not_found, _} = couch_db:open_doc(Db, DocId),
@@ -234,33 +235,7 @@ gen_write(Db, {Action, {DocId, Body, Atts}}) ->
deleted = Deleted,
body = Body,
atts = Atts
- },
-
- Path = gen_path(Action, RevPos, PrevRevId, Rev, Leaf),
- RevsLimit = Engine:get_revs_limit(St),
- NodeType = case Action of
- conflict -> new_branch;
- _ -> new_leaf
- end,
- {MergedTree, NodeType} = couch_key_tree:merge(PrevRevTree, Path),
- NewTree = couch_key_tree:stem(MergedTree, RevsLimit),
-
- NewFDI = PrevFDI#full_doc_info{
- deleted = couch_doc:is_deleted(NewTree),
- update_seq = UpdateSeq,
- rev_tree = NewTree,
- sizes = Sizes
- },
-
- {PrevFDI, NewFDI}.
-
-
-gen_revision(conflict, DocId, _PrevRev, Body, Atts) ->
- couch_hash:md5_hash(term_to_binary({DocId, Body, Atts}));
-gen_revision(delete, DocId, PrevRev, Body, Atts) ->
- gen_revision(update, DocId, PrevRev, Body, Atts);
-gen_revision(update, DocId, PrevRev, Body, Atts) ->
- couch_hash:md5_hash(term_to_binary({DocId, PrevRev, Body, Atts})).
+ }}.
gen_rev(A, DocId, {Pos, Rev}, Body, Atts) when A == update; A == delete ->