summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Command/Add.hs4
-rw-r--r--Command/AddUrl.hs13
-rw-r--r--Command/Import.hs4
-rw-r--r--debian/changelog3
-rw-r--r--doc/git-annex-add.mdwn5
-rw-r--r--doc/git-annex-addurl.mdwn5
-rw-r--r--doc/git-annex-import.mdwn5
7 files changed, 28 insertions, 11 deletions
diff --git a/Command/Add.hs b/Command/Add.hs
index 11682207e..94a19fba5 100644
--- a/Command/Add.hs
+++ b/Command/Add.hs
@@ -35,7 +35,7 @@ import Utility.Tmp
import Control.Exception (IOException)
cmd :: Command
-cmd = notBareRepo $ withGlobalOptions fileMatchingOptions $
+cmd = notBareRepo $ withGlobalOptions (jobsOption : fileMatchingOptions) $
command "add" SectionCommon "add files to annex"
paramPaths (seek <$$> optParser)
@@ -56,7 +56,7 @@ optParser desc = AddOptions
-
- In direct mode, it acts on any files that have changed. -}
seek :: AddOptions -> CommandSeek
-seek o = do
+seek o = allowConcurrentOutput $ do
matcher <- largeFilesMatcher
let go a = flip a (addThese o) $ \file -> ifM (checkFileMatcher matcher file <||> Annex.getState Annex.force)
( start file
diff --git a/Command/AddUrl.hs b/Command/AddUrl.hs
index 4b34051e9..6ed4fb2e2 100644
--- a/Command/AddUrl.hs
+++ b/Command/AddUrl.hs
@@ -38,7 +38,7 @@ import qualified Utility.Quvi as Quvi
#endif
cmd :: Command
-cmd = notBareRepo $
+cmd = notBareRepo $ withGlobalOptions [jobsOption] $
command "addurl" SectionCommon "add urls to annex"
(paramRepeating paramUrl) (seek <$$> optParser)
@@ -87,11 +87,12 @@ parseRawOption = switch
)
seek :: AddUrlOptions -> CommandSeek
-seek o = forM_ (addUrls o) $ \u -> do
- r <- Remote.claimingUrl u
- if Remote.uuid r == webUUID || rawOption o
- then void $ commandAction $ startWeb o u
- else checkUrl r o u
+seek o = allowConcurrentOutput $
+ forM_ (addUrls o) $ \u -> do
+ r <- Remote.claimingUrl u
+ if Remote.uuid r == webUUID || rawOption o
+ then void $ commandAction $ startWeb o u
+ else checkUrl r o u
checkUrl :: Remote -> AddUrlOptions -> URLString -> Annex ()
checkUrl r o u = do
diff --git a/Command/Import.hs b/Command/Import.hs
index a96c08055..3ace2d2b0 100644
--- a/Command/Import.hs
+++ b/Command/Import.hs
@@ -21,7 +21,7 @@ import Annex.CheckIgnore
import Annex.NumCopies
cmd :: Command
-cmd = withGlobalOptions fileMatchingOptions $ notBareRepo $
+cmd = withGlobalOptions (jobsOption : fileMatchingOptions) $ notBareRepo $
command "import" SectionCommon
"move and add files from outside git working copy"
paramPaths (seek <$$> optParser)
@@ -59,7 +59,7 @@ duplicateModeParser =
)
seek :: ImportOptions -> CommandSeek
-seek o = do
+seek o = allowConcurrentOutput $ do
repopath <- liftIO . absPath =<< fromRepo Git.repoPath
inrepops <- liftIO $ filter (dirContains repopath) <$> mapM absPath (importFiles o)
unless (null inrepops) $ do
diff --git a/debian/changelog b/debian/changelog
index 44ed24a60..da322b50e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,7 +2,8 @@ git-annex (5.20151102.2) UNRELEASED; urgency=medium
* Use concurrent-output library when configured with -fConcurrentOutput.
This allows nicely displayed messages when using the -J flag.
- * Additional commands now suppport the -J flag: fsck, drop
+ * Additional commands now suppport the -J flag:
+ fsck, drop, add, addurl, import
-- Joey Hess <id@joeyh.name> Wed, 04 Nov 2015 12:50:20 -0400
diff --git a/doc/git-annex-add.mdwn b/doc/git-annex-add.mdwn
index ee5f499d9..cfeb8a98e 100644
--- a/doc/git-annex-add.mdwn
+++ b/doc/git-annex-add.mdwn
@@ -43,6 +43,11 @@ annexed content, and other symlinks.
For example: `--largerthan=1GB`
+* `--jobs=N` `-JN`
+
+ Adds multiple files in parallel. This may be faster.
+ For example: `-J4`
+
# SEE ALSO
[[git-annex]](1)
diff --git a/doc/git-annex-addurl.mdwn b/doc/git-annex-addurl.mdwn
index 1503a284e..0f5a763bc 100644
--- a/doc/git-annex-addurl.mdwn
+++ b/doc/git-annex-addurl.mdwn
@@ -65,6 +65,11 @@ be used to get better filenames.
Use to adjust the filenames that are created by addurl. For example,
`--suffix=.mp3` can be used to add an extension to the file.
+* `--jobs=N` `-JN`
+
+ Enables parallel downloads when multiple urls are being added.
+ For example: `-J4`
+
# SEE ALSO
[[git-annex]](1)
diff --git a/doc/git-annex-import.mdwn b/doc/git-annex-import.mdwn
index 48c087aec..ca37b81eb 100644
--- a/doc/git-annex-import.mdwn
+++ b/doc/git-annex-import.mdwn
@@ -66,6 +66,11 @@ Several options can be used to adjust handling of duplicate files.
git annex import /dir --include='*.png'
+* `--jobs=N` `-JN`
+
+ Imports multiple files in parallel. This may be faster.
+ For example: `-J4`
+
# CAVEATS
Note that using `--deduplicate` or `--clean-duplicates` with the WORM