This is an automated email from the ASF dual-hosted git repository. vatamane pushed a commit to branch scanner-improvements in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit 70238080ad42e522dc0a3b72113cdb767f4b5781 Author: Robert Newson <[email protected]> AuthorDate: Sun Aug 24 21:32:13 2025 +0100 include rev when scanning --- src/couch_scanner/src/couch_scanner_plugin.erl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/couch_scanner/src/couch_scanner_plugin.erl b/src/couch_scanner/src/couch_scanner_plugin.erl index 2d63cb9ce..1ef56378d 100644 --- a/src/couch_scanner/src/couch_scanner_plugin.erl +++ b/src/couch_scanner/src/couch_scanner_plugin.erl @@ -680,8 +680,10 @@ fold_ddocs(Fun, #st{dbname = DbName, mod = Mod} = Acc) -> % We just got these docs from the cluster, they are already saved on disk. ejson_to_doc({[_ | _] = Props}) -> {value, {_, DocId}, Props1} = lists:keytake(<<"_id">>, 1, Props), - Props2 = [{K, V} || {K, V} <- Props1, K =:= <<>> orelse binary:first(K) =/= $_], - #doc{id = DocId, body = {Props2}}. + {value, {_, Rev}, Props2} = lists:keytake(<<"_rev">>, 1, Props1), + {Pos, RevId} = couch_doc:parse_rev(Rev), + Props3 = [{K, V} || {K, V} <- Props2, K =:= <<>> orelse binary:first(K) =/= $_], + #doc{id = DocId, revs = {Pos, [RevId]}, body = {Props3}}. % Skip patterns
