(root: &Path)
| 138 | } |
| 139 | |
| 140 | fn current_view(root: &Path) -> Observation<CurrentViewCounts> { |
| 141 | let result = (|| { |
| 142 | let repo = atomic_repository::Repository::open_readonly_without_migration(root).ok()?; |
| 143 | let id = repo.working_copy_id()?; |
| 144 | let name = repo.desired_view_name(id).ok()?; |
| 145 | let info = repo.get_view_info(&name).ok()?; |
| 146 | Some(CurrentViewCounts { |
| 147 | own: info.own_change_count, |
| 148 | inherited: info.inherited_change_count, |
| 149 | membership: info |
| 150 | .own_change_count |
| 151 | .checked_add(info.inherited_change_count)?, |
| 152 | }) |
| 153 | })(); |
| 154 | match result { |
| 155 | Some(value) => Observation::available(value), |
| 156 | None => Observation::unavailable("current working-copy view cannot be verified"), |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | fn intents(txn: &redb::ReadTransaction) -> Observation<IntentCounts> { |
| 161 | let result = (|| { |
no test coverage detected