summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-12-21 17:12:46 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-12-21 17:12:46 -0400
commit80af78f48eb59fa33849eedc5779e3649328cde0 (patch)
tree6034ff3761f206c7cea50008fb9092bc43e81283 /Command
parent4263eb776a3b81354c77d2a1b3fd997ed85f1c3c (diff)
parentae0059cac6a403cbeae66483a363fe64025beb69 (diff)
Merge branch 'master' into smudge
Diffstat (limited to 'Command')
-rw-r--r--Command/AddUrl.hs12
-rw-r--r--Command/Status.hs16
2 files changed, 22 insertions, 6 deletions
diff --git a/Command/AddUrl.hs b/Command/AddUrl.hs
index af2e04a62..de83d8c9b 100644
--- a/Command/AddUrl.hs
+++ b/Command/AddUrl.hs
@@ -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
diff --git a/Command/Status.hs b/Command/Status.hs
index 35195fec6..3feea7cb4 100644
--- a/Command/Status.hs
+++ b/Command/Status.hs
@@ -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))