use gitRepo
This commit is contained in:
parent
a7642b3b6e
commit
549c779a38
7 changed files with 10 additions and 10 deletions
|
@ -90,10 +90,10 @@ makeGitRemote basename location = makeRemote basename location $ \name ->
|
||||||
- Returns the name of the remote. -}
|
- Returns the name of the remote. -}
|
||||||
makeRemote :: String -> String -> (String -> Annex ()) -> Annex String
|
makeRemote :: String -> String -> (String -> Annex ()) -> Annex String
|
||||||
makeRemote basename location a = do
|
makeRemote basename location a = do
|
||||||
r <- fromRepo id
|
g <- gitRepo
|
||||||
if not (any samelocation $ Git.remotes r)
|
if not (any samelocation $ Git.remotes g)
|
||||||
then do
|
then do
|
||||||
let name = uniqueRemoteName basename 0 r
|
let name = uniqueRemoteName basename 0 g
|
||||||
a name
|
a name
|
||||||
return name
|
return name
|
||||||
else return basename
|
else return basename
|
||||||
|
|
|
@ -84,7 +84,7 @@ reconnectRemotes threadname st dstatus scanremotes rs = void $
|
||||||
pushToRemotes :: ThreadName -> UTCTime -> ThreadState -> Maybe FailedPushMap -> [Remote] -> IO Bool
|
pushToRemotes :: ThreadName -> UTCTime -> ThreadState -> Maybe FailedPushMap -> [Remote] -> IO Bool
|
||||||
pushToRemotes threadname now st mpushmap remotes = do
|
pushToRemotes threadname now st mpushmap remotes = do
|
||||||
(g, branch, u) <- runThreadState st $ (,,)
|
(g, branch, u) <- runThreadState st $ (,,)
|
||||||
<$> fromRepo id
|
<$> gitRepo
|
||||||
<*> inRepo Git.Branch.current
|
<*> inRepo Git.Branch.current
|
||||||
<*> getUUID
|
<*> getUUID
|
||||||
go True branch g u remotes
|
go True branch g u remotes
|
||||||
|
@ -145,7 +145,7 @@ pushToRemotes threadname now st mpushmap remotes = do
|
||||||
{- Manually pull from remotes and merge their branches. -}
|
{- Manually pull from remotes and merge their branches. -}
|
||||||
manualPull :: ThreadState -> Maybe Git.Ref -> [Remote] -> IO Bool
|
manualPull :: ThreadState -> Maybe Git.Ref -> [Remote] -> IO Bool
|
||||||
manualPull st currentbranch remotes = do
|
manualPull st currentbranch remotes = do
|
||||||
g <- runThreadState st $ fromRepo id
|
g <- runThreadState st gitRepo
|
||||||
forM_ remotes $ \r ->
|
forM_ remotes $ \r ->
|
||||||
Git.Command.runBool "fetch" [Param $ Remote.name r] g
|
Git.Command.runBool "fetch" [Param $ Remote.name r] g
|
||||||
haddiverged <- runThreadState st Annex.Branch.forceUpdate
|
haddiverged <- runThreadState st Annex.Branch.forceUpdate
|
||||||
|
|
|
@ -25,7 +25,7 @@ thisThread = "Merger"
|
||||||
- pushes. -}
|
- pushes. -}
|
||||||
mergeThread :: ThreadState -> DaemonStatusHandle -> TransferQueue -> NamedThread
|
mergeThread :: ThreadState -> DaemonStatusHandle -> TransferQueue -> NamedThread
|
||||||
mergeThread st dstatus transferqueue = thread $ do
|
mergeThread st dstatus transferqueue = thread $ do
|
||||||
g <- runThreadState st $ fromRepo id
|
g <- runThreadState st gitRepo
|
||||||
let dir = Git.localGitDir g </> "refs"
|
let dir = Git.localGitDir g </> "refs"
|
||||||
createDirectoryIfMissing True dir
|
createDirectoryIfMissing True dir
|
||||||
let hook a = Just $ runHandler st dstatus transferqueue a
|
let hook a = Just $ runHandler st dstatus transferqueue a
|
||||||
|
|
|
@ -74,7 +74,7 @@ oneDay = 24 * 60 * 60
|
||||||
- will block the watcher. -}
|
- will block the watcher. -}
|
||||||
check :: ThreadState -> DaemonStatusHandle -> TransferQueue -> ChangeChan -> IO Bool
|
check :: ThreadState -> DaemonStatusHandle -> TransferQueue -> ChangeChan -> IO Bool
|
||||||
check st dstatus transferqueue changechan = do
|
check st dstatus transferqueue changechan = do
|
||||||
g <- runThreadState st $ fromRepo id
|
g <- runThreadState st gitRepo
|
||||||
-- Find old unstaged symlinks, and add them to git.
|
-- Find old unstaged symlinks, and add them to git.
|
||||||
(unstaged, cleanup) <- Git.LsFiles.notInRepo False ["."] g
|
(unstaged, cleanup) <- Git.LsFiles.notInRepo False ["."] g
|
||||||
now <- getPOSIXTime
|
now <- getPOSIXTime
|
||||||
|
|
|
@ -24,7 +24,7 @@ thisThread = "TransferPoller"
|
||||||
- of each transfer is complete. -}
|
- of each transfer is complete. -}
|
||||||
transferPollerThread :: ThreadState -> DaemonStatusHandle -> NamedThread
|
transferPollerThread :: ThreadState -> DaemonStatusHandle -> NamedThread
|
||||||
transferPollerThread st dstatus = thread $ do
|
transferPollerThread st dstatus = thread $ do
|
||||||
g <- runThreadState st $ fromRepo id
|
g <- runThreadState st gitRepo
|
||||||
tn <- newNotificationHandle =<<
|
tn <- newNotificationHandle =<<
|
||||||
transferNotifier <$> getDaemonStatus dstatus
|
transferNotifier <$> getDaemonStatus dstatus
|
||||||
forever $ do
|
forever $ do
|
||||||
|
|
|
@ -94,7 +94,7 @@ expensiveScan :: ThreadState -> DaemonStatusHandle -> TransferQueue -> [Remote]
|
||||||
expensiveScan st dstatus transferqueue rs = unless onlyweb $ do
|
expensiveScan st dstatus transferqueue rs = unless onlyweb $ do
|
||||||
liftIO $ debug thisThread ["starting scan of", show visiblers]
|
liftIO $ debug thisThread ["starting scan of", show visiblers]
|
||||||
void $ alertWhile dstatus (scanAlert visiblers) $ do
|
void $ alertWhile dstatus (scanAlert visiblers) $ do
|
||||||
g <- runThreadState st $ fromRepo id
|
g <- runThreadState st gitRepo
|
||||||
(files, cleanup) <- LsFiles.inRepo [] g
|
(files, cleanup) <- LsFiles.inRepo [] g
|
||||||
go files
|
go files
|
||||||
void cleanup
|
void cleanup
|
||||||
|
|
|
@ -24,7 +24,7 @@ thisThread = "TransferWatcher"
|
||||||
- and updates the DaemonStatus's map of ongoing transfers. -}
|
- and updates the DaemonStatus's map of ongoing transfers. -}
|
||||||
transferWatcherThread :: ThreadState -> DaemonStatusHandle -> TransferQueue -> NamedThread
|
transferWatcherThread :: ThreadState -> DaemonStatusHandle -> TransferQueue -> NamedThread
|
||||||
transferWatcherThread st dstatus transferqueue = thread $ do
|
transferWatcherThread st dstatus transferqueue = thread $ do
|
||||||
g <- runThreadState st $ fromRepo id
|
g <- runThreadState st gitRepo
|
||||||
let dir = gitAnnexTransferDir g
|
let dir = gitAnnexTransferDir g
|
||||||
createDirectoryIfMissing True dir
|
createDirectoryIfMissing True dir
|
||||||
let hook a = Just $ runHandler st dstatus transferqueue a
|
let hook a = Just $ runHandler st dstatus transferqueue a
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue