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:
parent
a3fa9ea0b5
commit
02630b39ee
17 changed files with 19 additions and 0 deletions
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 $
|
||||
|
|
|
@ -127,6 +127,7 @@ gen r u c gc
|
|||
, getRepo = return r
|
||||
, gitconfig = gc
|
||||
, readonly = False
|
||||
, appendonly = False
|
||||
, availability = avail
|
||||
, remotetype = remote
|
||||
{ exportSupported = cheapexportsupported }
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 $
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue