summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_key_tree.erl
diff options
context:
space:
mode:
authorAdam Kocoloski <kocolosk@apache.org>2010-12-29 03:19:17 +0000
committerAdam Kocoloski <kocolosk@apache.org>2010-12-29 03:19:17 +0000
commit85d358f89ecb88560a6b8f263da8c24df1ebec98 (patch)
tree02931bdf26c9d7b58bf4aebb167ec165d6a6f043 /src/couchdb/couch_key_tree.erl
parent1a93bfd193c6b235a2296feff461c43ef64c1316 (diff)
Stem revision trees after merging a path, COUCHDB-968
git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.0.x@1053519 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_key_tree.erl')
-rw-r--r--src/couchdb/couch_key_tree.erl8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/couchdb/couch_key_tree.erl b/src/couchdb/couch_key_tree.erl
index 7c84865c..6701da58 100644
--- a/src/couchdb/couch_key_tree.erl
+++ b/src/couchdb/couch_key_tree.erl
@@ -12,7 +12,7 @@
-module(couch_key_tree).
--export([merge/2, find_missing/2, get_key_leafs/2, get_full_key_paths/2, get/2]).
+-export([merge/3, find_missing/2, get_key_leafs/2, get_full_key_paths/2, get/2]).
-export([map/2, get_all_leafs/1, count_leafs/1, remove_leafs/2,
get_all_leafs_full/1,stem/2,map_leafs/2]).
@@ -23,6 +23,12 @@
% partial trees arranged by how much they are cut off.
+-spec merge([path()], path(), pos_integer()) -> {[path()],
+ conflicts | no_conflicts}.
+merge(Paths, Path, Depth) ->
+ {Merged, Conflicts} = merge(Paths, Path),
+ {stem(Merged, Depth), Conflicts}.
+
-spec merge([path()], path()) -> {[path()], conflicts | no_conflicts}.
merge(Paths, Path) ->
{ok, Merged, HasConflicts} = merge_one(Paths, Path, [], false),