(
self,
resource: FinalResource,
)
| 511 | } |
| 512 | |
| 513 | fn try_lock_final_resource( |
| 514 | self, |
| 515 | resource: FinalResource, |
| 516 | ) -> Result<FinalResourceWriteTxn<'a>, RepositoryError> { |
| 517 | let working_copy = self.operation.working_copy; |
| 518 | let (path, kind) = match resource { |
| 519 | FinalResource::Shelf => ( |
| 520 | working_copy_shelf_lock_path(&self.operation.common.dot_dir, working_copy), |
| 521 | RepositoryLockKind::Shelf { id: working_copy }, |
| 522 | ), |
| 523 | FinalResource::DeferredTree => ( |
| 524 | deferred_tree_operation_lock_path(&self.operation.common.dot_dir), |
| 525 | RepositoryLockKind::DeferredTree, |
| 526 | ), |
| 527 | }; |
| 528 | let final_lock = try_lock_file(&path, kind, self.operation.common.reentrant)?; |
| 529 | Ok(FinalResourceWriteTxn { |
| 530 | _final_lock: final_lock, |
| 531 | write: self, |
| 532 | }) |
| 533 | } |
| 534 | |
| 535 | pub(super) fn commit(self) -> Result<(), RepositoryError> { |
| 536 | self.txn |
no test coverage detected