Find the sequence number for a hash in the current view.
(
&self,
repo: &Repository,
view_name: &str,
hash: &Hash,
)
| 182 | |
| 183 | /// Find the sequence number for a hash in the current view. |
| 184 | fn find_sequence_for_hash( |
| 185 | &self, |
| 186 | repo: &Repository, |
| 187 | view_name: &str, |
| 188 | hash: &Hash, |
| 189 | ) -> CliResult<Option<u64>> { |
| 190 | let txn = repo |
| 191 | .pristine() |
| 192 | .read_txn() |
| 193 | .map_err(|e| CliError::Internal(anyhow::anyhow!("{}", e)))?; |
| 194 | |
| 195 | let view = txn |
| 196 | .get_view(view_name) |
| 197 | .map_err(|e| CliError::Internal(anyhow::anyhow!("{}", e)))? |
| 198 | .ok_or_else(|| CliError::ViewNotFound { |
| 199 | name: view_name.to_string(), |
| 200 | })?; |
| 201 | |
| 202 | find_change_sequence(&txn, &view, hash) |
| 203 | .map_err(|e| CliError::Internal(anyhow::anyhow!("{}", e))) |
| 204 | } |
| 205 | |
| 206 | /// Resolve a hash prefix to a full hash. |
| 207 | fn resolve_hash_prefix( |
no test coverage detected