Return the source view's own change hashes in sequence order. Used by the CLI to resolve `--last N` into concrete change hashes. Only the view's own log is returned (inherited changes are excluded), which matches what [`split_view`](Self::split_view) can operate on.
(&self, view_name: &str)
| 482 | /// the view's own log is returned (inherited changes are excluded), which |
| 483 | /// matches what [`split_view`](Self::split_view) can operate on. |
| 484 | pub fn view_own_change_hashes(&self, view_name: &str) -> Result<Vec<Hash>, RepositoryError> { |
| 485 | let db = |e: PristineError| RepositoryError::Database(e.to_string()); |
| 486 | let txn = self.pristine.read_txn().map_err(db)?; |
| 487 | let view = |
| 488 | txn.get_view(view_name) |
| 489 | .map_err(db)? |
| 490 | .ok_or_else(|| RepositoryError::ViewNotFound { |
| 491 | name: view_name.to_string(), |
| 492 | })?; |
| 493 | |
| 494 | let mut out = Vec::new(); |
| 495 | for item in txn.iter_changes(&view, 0).map_err(db)? { |
| 496 | let (_seq, id, _merkle) = item.map_err(db)?; |
| 497 | let hash = txn.get_external(id).map_err(db)?.ok_or_else(|| { |
| 498 | RepositoryError::ChangeNotFound { |
| 499 | hash: format!("id={}", id.0), |
| 500 | } |
| 501 | })?; |
| 502 | out.push(hash); |
| 503 | } |
| 504 | Ok(out) |
| 505 | } |
| 506 | } |
no test coverage detected