(
self,
resource: FinalResource,
)
| 486 | } |
| 487 | |
| 488 | fn try_lock_final_resource( |
| 489 | self, |
| 490 | resource: FinalResource, |
| 491 | ) -> Result<FinalResourceWriteTxn<'a>, RepositoryError> { |
| 492 | let working_copy = self.operation.working_copy; |
| 493 | let (path, kind) = match resource { |
| 494 | FinalResource::Shelf => ( |
| 495 | working_copy_shelf_lock_path(&self.operation.common.dot_dir, working_copy), |
| 496 | RepositoryLockKind::Shelf { id: working_copy }, |
| 497 | ), |
| 498 | FinalResource::DeferredTree => ( |
| 499 | deferred_tree_operation_lock_path(&self.operation.common.dot_dir), |
| 500 | RepositoryLockKind::DeferredTree, |
| 501 | ), |
| 502 | }; |
| 503 | let final_lock = try_lock_file(&path, kind, self.operation.common.reentrant)?; |
| 504 | Ok(FinalResourceWriteTxn { |
| 505 | _final_lock: final_lock, |
| 506 | write: self, |
| 507 | }) |
| 508 | } |
| 509 | |
| 510 | pub(super) fn commit(self) -> Result<(), RepositoryError> { |
| 511 | self.txn |
no test coverage detected