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,
)
| 699 | /// Information about the change's dependencies and whether it can be |
| 700 | /// safely unrecorded. |
| 701 | pub fn can_unrecord( |
| 702 | &self, |
| 703 | hash: &Hash, |
| 704 | ) -> Result<crate::unrecord::UnrecordDependencyInfo, RepositoryError> { |
| 705 | let txn = self |
| 706 | .pristine |
| 707 | .read_txn() |
| 708 | .map_err(|e| RepositoryError::Database(e.to_string()))?; |
| 709 | |
| 710 | let view = txn |
| 711 | .get_view(&self.current_view) |
| 712 | .map_err(|e| RepositoryError::Database(e.to_string()))? |
| 713 | .ok_or_else(|| RepositoryError::ViewNotFound { |
| 714 | name: self.current_view.clone(), |
| 715 | })?; |
| 716 | |
| 717 | crate::unrecord::check_can_unrecord(&txn, &view, hash, &UnrecordOptions::default()) |
| 718 | .map_err(|e| RepositoryError::Unrecord(e.to_string())) |
| 719 | } |
| 720 | } |
nothing calls this directly
no test coverage detected