Find the sequence number for a hash in the current view.
(
&self,
repo: &Repository,
view_name: &str,
hash: &Hash,
)
| 207 | |
| 208 | /// Find the sequence number for a hash in the current view. |
| 209 | fn find_sequence_for_hash( |
| 210 | &self, |
| 211 | repo: &Repository, |
| 212 | view_name: &str, |
| 213 | hash: &Hash, |
| 214 | ) -> CliResult<Option<u64>> { |
| 215 | let txn = repo |
| 216 | .pristine() |
| 217 | .read_txn() |
| 218 | .map_err(|e| CliError::Internal(anyhow::anyhow!("{}", e)))?; |
| 219 | |
| 220 | let view = txn |
| 221 | .get_view(view_name) |
| 222 | .map_err(|e| CliError::Internal(anyhow::anyhow!("{}", e)))? |
| 223 | .ok_or_else(|| CliError::ViewNotFound { |
| 224 | name: view_name.to_string(), |
| 225 | })?; |
| 226 | |
| 227 | find_change_sequence(&txn, &view, hash) |
| 228 | .map_err(|e| CliError::Internal(anyhow::anyhow!("{}", e))) |
| 229 | } |
| 230 | |
| 231 | /// Resolve a hash prefix to a full hash. |
| 232 | fn resolve_hash_prefix( |
no test coverage detected