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

Method try_lock_final_resource

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

Source from the content-addressed store, hash-verified

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

Callers 2

try_lock_shelfMethod · 0.80

Calls 3

try_lock_fileFunction · 0.85

Tested by

no test coverage detected