syncNewRemote is not only used for new remotes; rename to syncRemote

This commit is contained in:
Joey Hess 2013-04-08 15:36:09 -04:00
parent 4ba729461c
commit 1f1cddbaa7
7 changed files with 11 additions and 15 deletions

View file

@ -32,7 +32,7 @@ makeSshRemote forcersync sshdata mcost = do
r <- liftAnnex $
addRemote $ maker (sshRepoName sshdata) sshurl
liftAnnex $ maybe noop (setRemoteCost r) mcost
syncNewRemote r
syncRemote r
return r
where
rsync = forcersync || rsyncOnly sshdata

View file

@ -204,9 +204,9 @@ manualPull currentbranch remotes = do
sendNetMessage $ Pushing (getXMPPClientID r) PushRequest
return (catMaybes failed, haddiverged)
{- Start syncing a newly added remote, using a background thread. -}
syncNewRemote :: Remote -> Assistant ()
syncNewRemote remote = do
{- Start syncing a remote, using a background thread. -}
syncRemote :: Remote -> Assistant ()
syncRemote remote = do
updateSyncRemotes
thread <- asIO $ do
reconnectRemotes False [remote]

View file

@ -191,7 +191,7 @@ makeAWSRemote remotetype (AWSCreds ak sk) name setup config = do
makeSpecialRemote hostname remotetype config
return remotename
setup r
liftAssistant $ syncNewRemote r
liftAssistant $ syncRemote r
redirect $ EditNewCloudRepositoryR $ Remote.uuid r
where
{- AWS services use the remote name as the basis for a host

View file

@ -10,9 +10,9 @@
module Assistant.WebApp.Configurators.Local where
import Assistant.WebApp.Common
import Assistant.WebApp.Utility
import Assistant.WebApp.OtherRepos
import Assistant.MakeRemote
import Assistant.Sync
import Init
import qualified Git
import qualified Git.Construct
@ -166,7 +166,7 @@ postNewRepositoryR = page "Add another repository" (Just Configuration) $ do
getCombineRepositoryR :: FilePathAndUUID -> Handler RepHtml
getCombineRepositoryR (FilePathAndUUID newrepopath newrepouuid) = do
r <- combineRepos newrepopath remotename
syncRemote r
liftAssistant $ syncRemote r
redirect $ EditRepositoryR newrepouuid
where
remotename = takeFileName newrepopath
@ -244,7 +244,7 @@ getFinishAddDriveR drive = make >>= redirect . EditNewRepositoryR
u <- liftIO $ initRepo isnew False dir $ Just remotename
r <- combineRepos dir remotename
liftAnnex $ setStandardGroup u TransferGroup
syncRemote r
liftAssistant $ syncRemote r
return u
mountpoint = T.unpack (mountPoint drive)
dir = removableDriveRepository drive

View file

@ -128,6 +128,6 @@ makeWebDavRemote name creds setup config = do
makeSpecialRemote name WebDAV.remote config
return remotename
setup r
liftAssistant $ syncNewRemote r
liftAssistant $ syncRemote r
redirect $ EditNewCloudRepositoryR $ Remote.uuid r
#endif

View file

@ -44,7 +44,7 @@ changeSyncable Nothing enable = do
| otherwise = PauseWatcher
changeSyncable (Just r) True = do
changeSyncFlag r True
syncRemote r
liftAssistant $ syncRemote r
changeSyncable (Just r) False = do
changeSyncFlag r False
liftAssistant $ updateSyncRemotes
@ -64,10 +64,6 @@ changeSyncFlag r enabled = liftAnnex $ do
where
key = Config.remoteConfig (Remote.repo r) "sync"
{- Start syncing remote, using a background thread. -}
syncRemote :: Remote -> Handler ()
syncRemote = liftAssistant . syncNewRemote
pauseTransfer :: Transfer -> Handler ()
pauseTransfer = cancelTransfer True

View file

@ -60,7 +60,7 @@ makeXMPPGitRemote buddyname jid u = do
liftAnnex $ void remoteListRefresh
remote' <- liftAnnex $ fromMaybe (error "failed to add remote")
<$> Remote.byName (Just buddyname)
syncNewRemote remote'
syncRemote remote'
return True
{- Pushes over XMPP, communicating with a specific client.