Merge branch 'master' into smudge

This commit is contained in:
Joey Hess 2015-12-21 17:12:46 -04:00
commit d82b110da8
Failed to extract signature
35 changed files with 463 additions and 71 deletions

View file

@ -32,6 +32,7 @@ import Annex.Content.Direct
import Annex.FileMatcher
import Logs.Location
import Utility.Metered
import CmdLine.Batch
import qualified Annex.Transfer as Transfer
#ifdef WITH_QUVI
import Annex.Quvi
@ -51,6 +52,7 @@ data AddUrlOptions = AddUrlOptions
, suffixOption :: Maybe String
, relaxedOption :: Bool
, rawOption :: Bool
, batchOption :: BatchMode
}
optParser :: CmdParamsDesc -> Parser AddUrlOptions
@ -74,6 +76,7 @@ optParser desc = AddUrlOptions
))
<*> parseRelaxedOption
<*> parseRawOption
<*> parseBatchOption
parseRelaxedOption :: Parser Bool
parseRelaxedOption = switch
@ -88,8 +91,13 @@ parseRawOption = switch
)
seek :: AddUrlOptions -> CommandSeek
seek o = allowConcurrentOutput $
forM_ (addUrls o) $ \u -> do
seek o = allowConcurrentOutput $ do
forM_ (addUrls o) go
case batchOption o of
Batch -> batchSeek go
NoBatch -> noop
where
go u = do
r <- Remote.claimingUrl u
if Remote.uuid r == webUUID || rawOption o
then void $ commandAction $ startWeb o u

View file

@ -46,10 +46,19 @@ displayStatus s = do
unlessM (showFullJSON [("status", [c]), ("file", f)]) $
liftIO $ putStrLn $ [c] ++ " " ++ f
-- Git thinks that present direct mode files are typechanged;
-- check their content to see if they are modified or not.
-- Git thinks that present direct mode files are typechanged.
-- (On crippled filesystems, git instead thinks they're modified.)
-- Check their content to see if they are modified or not.
statusDirect :: Status -> Annex (Maybe Status)
statusDirect (TypeChanged t) = do
statusDirect (TypeChanged t) = statusDirect' t
statusDirect s@(Modified t) = ifM crippledFileSystem
( statusDirect' t
, pure (Just s)
)
statusDirect s = pure (Just s)
statusDirect' :: TopFilePath -> Annex (Maybe Status)
statusDirect' t = do
absf <- fromRepo $ fromTopFilePath t
f <- liftIO $ relPathCwdToFile absf
v <- liftIO (catchMaybeIO $ getFileStatus f)
@ -65,7 +74,6 @@ statusDirect (TypeChanged t) = do
, return $ Just $ Modified t
)
checkkey f _ Nothing = Just <$> checkNew f t
statusDirect s = pure (Just s)
checkNew :: FilePath -> TopFilePath -> Annex Status
checkNew f t = ifM (isJust <$> catObjectDetails (Git.Ref.fileRef f))