diff options
-rw-r--r-- | CHANGELOG | 2 | ||||
-rw-r--r-- | Command/Move.hs | 20 |
2 files changed, 15 insertions, 7 deletions
@@ -18,6 +18,8 @@ git-annex (6.20160528) UNRELEASED; urgency=medium * remotedaemon: Fixed support for notifications of changes to gcrypt remotes, which was never tested and didn't quite work before. * list: Do not include dead repositories. + * move --to: Better behavior when system is completely out of disk space; + drop content from disk before writing location log. -- Joey Hess <id@joeyh.name> Fri, 27 May 2016 13:12:48 -0400 diff --git a/Command/Move.hs b/Command/Move.hs index 710d09d06..2d2a6a227 100644 --- a/Command/Move.hs +++ b/Command/Move.hs @@ -113,23 +113,29 @@ toPerform dest move key afile fastcheck isthere = upload (Remote.uuid dest) key afile noRetry noObserver $ Remote.storeKey dest key afile if ok - then do + then finish $ Remote.logStatus dest key InfoPresent - finish else do when fastcheck $ warning "This could have failed because --fast is enabled." stop - Right True -> do + Right True -> finish $ unlessM (expectedPresent dest key) $ Remote.logStatus dest key InfoPresent - finish where - finish + finish :: Annex () -> CommandPerform + finish setpresentremote | move = lockContentForRemoval key $ \contentlock -> do + -- Drop content before updating location logs, + -- in case disk space is very low this frees up + -- space before writing data to disk. removeAnnex contentlock - next $ Command.Drop.cleanupLocal key - | otherwise = next $ return True + next $ do + setpresentremote + Command.Drop.cleanupLocal key + | otherwise = next $ do + setpresentremote + return True {- Moves (or copies) the content of an annexed file from a remote - to the current repository. |