(metadata)
| 884 | // compact a tree by marking its non-leafs as missing, |
| 885 | // and return a list of revs to delete |
| 886 | function compactTree(metadata) { |
| 887 | var revs = []; |
| 888 | traverseRevTree(metadata.rev_tree, function (isLeaf, pos, |
| 889 | revHash, ctx, opts) { |
| 890 | if (opts.status === 'available' && !isLeaf) { |
| 891 | revs.push(pos + '-' + revHash); |
| 892 | opts.status = 'missing'; |
| 893 | } |
| 894 | }); |
| 895 | return revs; |
| 896 | } |
| 897 | |
| 898 | // `findPathToLeaf()` returns an array of revs that goes from the specified |
| 899 | // leaf rev to the root of that leaf’s branch. |
no test coverage detected
searching dependent graphs…