Merge branch 'master' into tor

This commit is contained in:
Joey Hess 2016-11-29 15:45:29 -04:00
commit 398345cb26
No known key found for this signature in database
GPG key ID: C910D9222512E3C7
35 changed files with 697 additions and 20 deletions

View file

@ -340,13 +340,18 @@ cleanup :: UUID -> URLString -> FilePath -> Key -> Maybe FilePath -> Annex ()
cleanup u url file key mtmp = case mtmp of
Nothing -> go
Just tmp -> do
-- Move to final location for large file check.
liftIO $ renameFile tmp file
largematcher <- largeFilesMatcher
ifM (checkFileMatcher largematcher file)
( go
, do
liftIO $ renameFile tmp file
void $ Command.Add.addSmall file
)
large <- checkFileMatcher largematcher file
if large
then do
-- Move back to tmp because addAnnexedFile
-- needs the file in a different location
-- than the work tree file.
liftIO $ renameFile file tmp
go
else void $ Command.Add.addSmall file
where
go = do
maybeShowJSON $ JSONChunk [("key", key2file key)]

View file

@ -44,7 +44,7 @@ perform :: FilePath -> Key -> Key -> CommandPerform
perform file oldkey newkey = do
ifM (inAnnex oldkey)
( unlessM (linkKey file oldkey newkey) $
error "failed"
giveup "failed"
, unlessM (Annex.getState Annex.force) $
giveup $ file ++ " is not available (use --force to override)"
)

View file

@ -29,7 +29,7 @@ start = parse
where
parse (name:[]) = go name performGet
parse (name:expr:[]) = go name $ \uuid -> do
showStart "schedile" name
showStart "schedule" name
performSet expr uuid
parse _ = giveup "Specify a repository."