MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / try_lock_final_resource

Method try_lock_final_resource

atomic-repository/src/repository/locks.rs:513–533  ·  view source on GitHub ↗
(
        self,
        resource: FinalResource,
    )

Source from the content-addressed store, hash-verified

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

Callers 2

try_lock_shelfMethod · 0.80

Calls 3

try_lock_fileFunction · 0.85

Tested by

no test coverage detected