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