Check if a change can be unrecorded. This checks whether the change is in the view and whether it has any dependents that would also need to be unrecorded. # Arguments `hash` - Hash of the change to check # Returns Information about the change's dependencies and whether it can be safely unrecorded.
(
&self,
hash: &Hash,
)
| 419 | /// Information about the change's dependencies and whether it can be |
| 420 | /// safely unrecorded. |
| 421 | pub fn can_unrecord( |
| 422 | &self, |
| 423 | hash: &Hash, |
| 424 | ) -> Result<crate::unrecord::UnrecordDependencyInfo, RepositoryError> { |
| 425 | let txn = self |
| 426 | .pristine |
| 427 | .read_txn() |
| 428 | .map_err(|e| RepositoryError::Database(e.to_string()))?; |
| 429 | |
| 430 | let view = txn |
| 431 | .get_view(&self.current_view) |
| 432 | .map_err(|e| RepositoryError::Database(e.to_string()))? |
| 433 | .ok_or_else(|| RepositoryError::ViewNotFound { |
| 434 | name: self.current_view.clone(), |
| 435 | })?; |
| 436 | |
| 437 | crate::unrecord::check_can_unrecord(&txn, &view, hash, &UnrecordOptions::default()) |
| 438 | .map_err(|e| RepositoryError::Unrecord(e.to_string())) |
| 439 | } |
| 440 | } |
nothing calls this directly
no test coverage detected