-J for add/addurl/import
This commit is contained in:
parent
31472161e4
commit
5db7d435e7
7 changed files with 28 additions and 11 deletions
|
@ -35,7 +35,7 @@ import Utility.Tmp
|
||||||
import Control.Exception (IOException)
|
import Control.Exception (IOException)
|
||||||
|
|
||||||
cmd :: Command
|
cmd :: Command
|
||||||
cmd = notBareRepo $ withGlobalOptions fileMatchingOptions $
|
cmd = notBareRepo $ withGlobalOptions (jobsOption : fileMatchingOptions) $
|
||||||
command "add" SectionCommon "add files to annex"
|
command "add" SectionCommon "add files to annex"
|
||||||
paramPaths (seek <$$> optParser)
|
paramPaths (seek <$$> optParser)
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ optParser desc = AddOptions
|
||||||
-
|
-
|
||||||
- In direct mode, it acts on any files that have changed. -}
|
- In direct mode, it acts on any files that have changed. -}
|
||||||
seek :: AddOptions -> CommandSeek
|
seek :: AddOptions -> CommandSeek
|
||||||
seek o = do
|
seek o = allowConcurrentOutput $ do
|
||||||
matcher <- largeFilesMatcher
|
matcher <- largeFilesMatcher
|
||||||
let go a = flip a (addThese o) $ \file -> ifM (checkFileMatcher matcher file <||> Annex.getState Annex.force)
|
let go a = flip a (addThese o) $ \file -> ifM (checkFileMatcher matcher file <||> Annex.getState Annex.force)
|
||||||
( start file
|
( start file
|
||||||
|
|
|
@ -38,7 +38,7 @@ import qualified Utility.Quvi as Quvi
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
cmd :: Command
|
cmd :: Command
|
||||||
cmd = notBareRepo $
|
cmd = notBareRepo $ withGlobalOptions [jobsOption] $
|
||||||
command "addurl" SectionCommon "add urls to annex"
|
command "addurl" SectionCommon "add urls to annex"
|
||||||
(paramRepeating paramUrl) (seek <$$> optParser)
|
(paramRepeating paramUrl) (seek <$$> optParser)
|
||||||
|
|
||||||
|
@ -87,11 +87,12 @@ parseRawOption = switch
|
||||||
)
|
)
|
||||||
|
|
||||||
seek :: AddUrlOptions -> CommandSeek
|
seek :: AddUrlOptions -> CommandSeek
|
||||||
seek o = forM_ (addUrls o) $ \u -> do
|
seek o = allowConcurrentOutput $
|
||||||
r <- Remote.claimingUrl u
|
forM_ (addUrls o) $ \u -> do
|
||||||
if Remote.uuid r == webUUID || rawOption o
|
r <- Remote.claimingUrl u
|
||||||
then void $ commandAction $ startWeb o u
|
if Remote.uuid r == webUUID || rawOption o
|
||||||
else checkUrl r o u
|
then void $ commandAction $ startWeb o u
|
||||||
|
else checkUrl r o u
|
||||||
|
|
||||||
checkUrl :: Remote -> AddUrlOptions -> URLString -> Annex ()
|
checkUrl :: Remote -> AddUrlOptions -> URLString -> Annex ()
|
||||||
checkUrl r o u = do
|
checkUrl r o u = do
|
||||||
|
|
|
@ -21,7 +21,7 @@ import Annex.CheckIgnore
|
||||||
import Annex.NumCopies
|
import Annex.NumCopies
|
||||||
|
|
||||||
cmd :: Command
|
cmd :: Command
|
||||||
cmd = withGlobalOptions fileMatchingOptions $ notBareRepo $
|
cmd = withGlobalOptions (jobsOption : fileMatchingOptions) $ notBareRepo $
|
||||||
command "import" SectionCommon
|
command "import" SectionCommon
|
||||||
"move and add files from outside git working copy"
|
"move and add files from outside git working copy"
|
||||||
paramPaths (seek <$$> optParser)
|
paramPaths (seek <$$> optParser)
|
||||||
|
@ -59,7 +59,7 @@ duplicateModeParser =
|
||||||
)
|
)
|
||||||
|
|
||||||
seek :: ImportOptions -> CommandSeek
|
seek :: ImportOptions -> CommandSeek
|
||||||
seek o = do
|
seek o = allowConcurrentOutput $ do
|
||||||
repopath <- liftIO . absPath =<< fromRepo Git.repoPath
|
repopath <- liftIO . absPath =<< fromRepo Git.repoPath
|
||||||
inrepops <- liftIO $ filter (dirContains repopath) <$> mapM absPath (importFiles o)
|
inrepops <- liftIO $ filter (dirContains repopath) <$> mapM absPath (importFiles o)
|
||||||
unless (null inrepops) $ do
|
unless (null inrepops) $ do
|
||||||
|
|
3
debian/changelog
vendored
3
debian/changelog
vendored
|
@ -2,7 +2,8 @@ git-annex (5.20151102.2) UNRELEASED; urgency=medium
|
||||||
|
|
||||||
* Use concurrent-output library when configured with -fConcurrentOutput.
|
* Use concurrent-output library when configured with -fConcurrentOutput.
|
||||||
This allows nicely displayed messages when using the -J flag.
|
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
|
-- Joey Hess <id@joeyh.name> Wed, 04 Nov 2015 12:50:20 -0400
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,11 @@ annexed content, and other symlinks.
|
||||||
|
|
||||||
For example: `--largerthan=1GB`
|
For example: `--largerthan=1GB`
|
||||||
|
|
||||||
|
* `--jobs=N` `-JN`
|
||||||
|
|
||||||
|
Adds multiple files in parallel. This may be faster.
|
||||||
|
For example: `-J4`
|
||||||
|
|
||||||
# SEE ALSO
|
# SEE ALSO
|
||||||
|
|
||||||
[[git-annex]](1)
|
[[git-annex]](1)
|
||||||
|
|
|
@ -65,6 +65,11 @@ be used to get better filenames.
|
||||||
Use to adjust the filenames that are created by addurl. For example,
|
Use to adjust the filenames that are created by addurl. For example,
|
||||||
`--suffix=.mp3` can be used to add an extension to the file.
|
`--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
|
# SEE ALSO
|
||||||
|
|
||||||
[[git-annex]](1)
|
[[git-annex]](1)
|
||||||
|
|
|
@ -66,6 +66,11 @@ Several options can be used to adjust handling of duplicate files.
|
||||||
|
|
||||||
git annex import /dir --include='*.png'
|
git annex import /dir --include='*.png'
|
||||||
|
|
||||||
|
* `--jobs=N` `-JN`
|
||||||
|
|
||||||
|
Imports multiple files in parallel. This may be faster.
|
||||||
|
For example: `-J4`
|
||||||
|
|
||||||
# CAVEATS
|
# CAVEATS
|
||||||
|
|
||||||
Note that using `--deduplicate` or `--clean-duplicates` with the WORM
|
Note that using `--deduplicate` or `--clean-duplicates` with the WORM
|
||||||
|
|
Loading…
Reference in a new issue