sim: add action repo sync command

This commit is contained in:
Joey Hess 2024-09-16 16:48:21 -04:00
parent 2cbd3fb26b
commit c420ec9364
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 23 additions and 8 deletions

View file

@ -221,6 +221,7 @@ data SimCommand
data SimAction
= ActionPull RemoteName
| ActionPush RemoteName
| ActionSync RemoteName
| ActionGetWanted RemoteName
| ActionDropUnwanted (Maybe RemoteName)
| ActionSendWanted RemoteName
@ -413,6 +414,7 @@ applySimAction
-> Either String (Either (Annex (SimState SimRepo)) (SimState SimRepo))
applySimAction _r _u (ActionPull _remote) _st = undefined -- TODO
applySimAction _r _u (ActionPush _remote) _st = undefined -- TODO
applySimAction _r _u (ActionSync _remote) _st = undefined -- TODO
applySimAction r u (ActionGetWanted remote) st =
overFilesRemote r u remote S.member wanted go st
where
@ -593,6 +595,7 @@ randomAction u st = case M.lookup u (simConnections st) of
mkactions =
[ ActionPull
, ActionPush
, ActionSync
, ActionGetWanted
, ActionDropUnwanted . Just
, const (ActionDropUnwanted Nothing)