add Remote.readonly

Does nothing yet.

Considered making bup readonly, but while the content can't be removed,
it is able to delete a branch, so didn't.

This commit was supported by the NSF-funded DataLad project.
This commit is contained in:
Joey Hess 2018-08-30 11:12:18 -04:00
parent a3fa9ea0b5
commit 02630b39ee
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
17 changed files with 19 additions and 0 deletions

View file

@ -71,6 +71,7 @@ gen r u c gc = do
, remotetype = remote
, availability = LocallyAvailable
, readonly = False
, appendonly = False
, mkUnavailable = return Nothing
, getInfo = return
[ ("androidserial", fromAndroidSerial serial)

View file

@ -76,6 +76,7 @@ gen r _ c gc = do
, localpath = Nothing
, getRepo = return r
, readonly = True
, appendonly = False
, availability = GloballyAvailable
, remotetype = remote
, mkUnavailable = return Nothing

View file

@ -79,6 +79,7 @@ gen r u c gc = do
, remotetype = remote
, availability = if bupLocal buprepo then LocallyAvailable else GloballyAvailable
, readonly = False
, appendonly = True
, mkUnavailable = return Nothing
, getInfo = return [("repo", buprepo)]
, claimUrl = Nothing

View file

@ -78,6 +78,7 @@ gen r u c gc = do
, remotetype = remote
, availability = if ddarLocal ddarrepo then LocallyAvailable else GloballyAvailable
, readonly = False
, appendonly = False
, mkUnavailable = return Nothing
, getInfo = return [("repo", ddarRepoLocation ddarrepo)]
, claimUrl = Nothing

View file

@ -81,6 +81,7 @@ gen r u c gc = do
, gitconfig = gc
, localpath = Just dir
, readonly = False
, appendonly = False
, availability = LocallyAvailable
, remotetype = remote
, mkUnavailable = gen r u c $

View file

@ -127,6 +127,7 @@ gen r u c gc
, getRepo = return r
, gitconfig = gc
, readonly = False
, appendonly = False
, availability = avail
, remotetype = remote
{ exportSupported = cheapexportsupported }

View file

@ -127,6 +127,7 @@ gen' r u c gc = do
, getRepo = return r
, gitconfig = gc
, readonly = Git.repoIsHttp r
, appendonly = False
, availability = availabilityCalc r
, remotetype = remote
, mkUnavailable = return Nothing

View file

@ -179,6 +179,7 @@ gen r u c gc
, getRepo = getRepoFromState st
, gitconfig = gc
, readonly = Git.repoIsHttp r
, appendonly = False
, availability = availabilityCalc r
, remotetype = remote
, mkUnavailable = unavailable r u c gc

View file

@ -73,6 +73,7 @@ gen r u c gc = new <$> remoteCost gc veryExpensiveRemoteCost
, gitconfig = gc
, localpath = Nothing
, readonly = False
, appendonly = False
, availability = GloballyAvailable
, remotetype = remote
, mkUnavailable = return Nothing

View file

@ -65,6 +65,7 @@ gen r u c gc = do
, getRepo = return r
, gitconfig = gc
, readonly = False
, appendonly = False
, availability = GloballyAvailable
, remotetype = remote
, mkUnavailable = gen r u c $

View file

@ -67,6 +67,7 @@ chainGen addr r u c gc = do
, getRepo = return r
, gitconfig = gc
, readonly = False
, appendonly = False
, availability = GloballyAvailable
, remotetype = remote
, mkUnavailable = return Nothing

View file

@ -95,6 +95,7 @@ gen r u c gc = do
then Just $ rsyncUrl o
else Nothing
, readonly = False
, appendonly = False
, availability = if islocal then LocallyAvailable else GloballyAvailable
, remotetype = remote
, mkUnavailable = return Nothing

View file

@ -110,6 +110,7 @@ gen r u c gc = do
, gitconfig = gc
, localpath = Nothing
, readonly = False
, appendonly = False
, availability = GloballyAvailable
, remotetype = remote
, mkUnavailable = gen r u (M.insert "host" "!dne!" c) gc

View file

@ -88,6 +88,7 @@ gen r u c gc = do
, gitconfig = gc
, localpath = Nothing
, readonly = False
, appendonly = False
, availability = GloballyAvailable
, remotetype = remote
, mkUnavailable = return Nothing

View file

@ -66,6 +66,7 @@ gen r _ c gc = do
, localpath = Nothing
, getRepo = return r
, readonly = True
, appendonly = False
, availability = GloballyAvailable
, remotetype = remote
, mkUnavailable = return Nothing

View file

@ -96,6 +96,7 @@ gen r u c gc = new <$> remoteCost gc expensiveRemoteCost
, gitconfig = gc
, localpath = Nothing
, readonly = False
, appendonly = False
, availability = GloballyAvailable
, remotetype = remote
, mkUnavailable = gen r u (M.insert "url" "http://!dne!/" c) gc

View file

@ -122,6 +122,9 @@ data RemoteA a = Remote
, localpath :: Maybe FilePath
-- a Remote can be known to be readonly
, readonly :: Bool
-- a Remote can allow writes but not have a way to delete content
-- from it
, appendonly :: Bool
-- a Remote can be globally available. (Ie, "in the cloud".)
, availability :: Availability
-- the type of the remote