content locking during drop working for local git remotes

Only ssh remotes lack locking now
This commit is contained in:
Joey Hess 2015-10-09 13:07:03 -04:00
parent ceb5819538
commit 4c6095b6f5
Failed to extract signature
4 changed files with 52 additions and 8 deletions

View file

@ -1,6 +1,6 @@
{- git-annex numcopies types
-
- Copyright 2014 Joey Hess <id@joeyh.name>
- Copyright 2014-2015 Joey Hess <id@joeyh.name>
-
- Licensed under the GNU GPL version 3 or higher.
-}

View file

@ -78,10 +78,11 @@ data RemoteA a = Remote {
-- Removes a key's contents (succeeds if the contents are not present)
removeKey :: Key -> a Bool,
-- Uses locking to prevent removal of a key's contents,
-- thus producing a VerifiedCopy.
-- The action must be run whether or not the locking succeeds.
-- thus producing a VerifiedCopy, which is passed to the callback.
-- If unable to lock, does not run the callback, and throws an
-- error.
-- This is optional; remotes do not have to support locking.
lockContent :: forall r. Maybe (Key -> (Maybe VerifiedCopy -> a r) -> a r),
lockContent :: forall r. Maybe (Key -> (VerifiedCopy -> a r) -> a r),
-- Checks if a key is present in the remote.
-- Throws an exception if the remote cannot be accessed.
checkPresent :: Key -> a Bool,