(
repo: &Repository,
)
| 674 | } |
| 675 | |
| 676 | fn snapshot( |
| 677 | repo: &Repository, |
| 678 | ) -> ( |
| 679 | Merkle, |
| 680 | u64, |
| 681 | Vec<OperationId>, |
| 682 | Vec<OperationId>, |
| 683 | Vec<OperationId>, |
| 684 | usize, |
| 685 | ) { |
| 686 | let txn = repo.pristine().read_txn().unwrap(); |
| 687 | let view = txn.get_view("target").unwrap().unwrap(); |
| 688 | let mut operations: Vec<_> = txn |
| 689 | .list_operations() |
| 690 | .unwrap() |
| 691 | .iter() |
| 692 | .map(|op| op.id()) |
| 693 | .collect(); |
| 694 | operations.sort(); |
| 695 | let receipts = operations |
| 696 | .iter() |
| 697 | .map(|id| txn.get_effect_receipts(*id).unwrap().len()) |
| 698 | .sum(); |
| 699 | let mut heads = txn |
| 700 | .get_operation_heads(OperationScope::Repository) |
| 701 | .unwrap() |
| 702 | .as_slice() |
| 703 | .to_vec(); |
| 704 | heads.sort(); |
| 705 | let mut wc_heads = txn |
| 706 | .get_operation_heads(OperationScope::WorkingCopy( |
| 707 | repo.require_working_copy_id().unwrap(), |
| 708 | )) |
| 709 | .unwrap() |
| 710 | .as_slice() |
| 711 | .to_vec(); |
| 712 | wc_heads.sort(); |
| 713 | ( |
| 714 | view.state, |
| 715 | view.change_count, |
| 716 | operations, |
| 717 | heads, |
| 718 | wc_heads, |
| 719 | receipts, |
| 720 | ) |
| 721 | } |
| 722 | |
| 723 | fn fixture() -> (tempfile::TempDir, Repository, Hash, Hash) { |
| 724 | let dir = tempfile::tempdir().unwrap(); |
no test coverage detected