push location log updating up to callers of download
authorJoey Hess <joeyh@joeyh.name>
Mon, 23 Jan 2023 17:45:26 +0000 (13:45 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 23 Jan 2023 17:47:41 +0000 (13:47 -0400)
Prep for move --to --from, which needs to download from a src repo
without updating the location log for the local repo, before sending the
content on to the dest repo.

Note that caller of download' already update the log themselves.
See previous commit a422a056f2785999220cde55e07b0fbf999edd44
that pushed it up to download from getViaTmpFrom.

(Also removed in passing a debug print + readline that I accidentially
committed last week on this branch.)

Sponsored-by: Dartmouth College's DANDI project
Annex/Transfer.hs
Command/Get.hs
Command/Move.hs

index 315033d21908e39f7afc970f42378a004c705bf7..e33c309fc85765aa9d1ebea019cebfb1b0dd548a 100644 (file)
@@ -29,7 +29,6 @@ import Annex.Notification as X
 import Annex.Content
 import Annex.Perms
 import Annex.Action
-import Logs.Location
 import Utility.Metered
 import Utility.ThreadScheduler
 import Annex.LockPool
@@ -73,7 +72,7 @@ alwaysUpload u key f sd d a _witness = guardHaveUUID u $
 
 -- Download, supporting canceling detected stalls.
 download :: Remote -> Key -> AssociatedFile -> RetryDecider -> NotifyWitness -> Annex Bool
-download r key f d witness = logStatusAfter key $
+download r key f d witness = 
        case remoteAnnexStallDetection (Remote.gitconfig r) of
                Nothing -> go (Just ProbeStallDetection)
                Just StallDetectionDisabled -> go Nothing
index 41e37a2e42902a0a3ccba628c8e3fbd4ccbe7506..a31b6470a49e01825223bf3522b1d1a478969fd0 100644 (file)
@@ -1,6 +1,6 @@
 {- git-annex command
  -
- - Copyright 2010, 2013 Joey Hess <id@joeyh.name>
+ - Copyright 2010-2023 Joey Hess <id@joeyh.name>
  -
  - Licensed under the GNU AGPL version 3 or higher.
  -}
@@ -13,6 +13,7 @@ import Annex.Transfer
 import Annex.NumCopies
 import Annex.Wanted
 import qualified Command.Move
+import Logs.Location
 
 cmd :: Command
 cmd = withAnnexOptions [jobsOption, jsonOptions, jsonProgressOption, annexedMatchingOptions] $ 
@@ -115,7 +116,6 @@ getKey' key afile = dispatch
                        either (const False) id <$> Remote.hasKey r key
                | otherwise = return True
        docopy r witness = do
-               liftIO $ print "read line"
-               void $ liftIO $ getLine
                showAction $ "from " ++ Remote.name r
-               download r key afile stdRetry witness
+               logStatusAfter key $
+                       download r key afile stdRetry witness
index 8d5760f9ed82e2aaa4c1270e11cd3753e5e6c82d..945d9c0eb335e3ea770799a8854a386c63fc9dcd 100644 (file)
@@ -19,6 +19,7 @@ import Annex.Transfer
 import Logs.Presence
 import Logs.Trust
 import Logs.File
+import Logs.Location
 import Annex.NumCopies
 
 import qualified Data.ByteString.Char8 as B8
@@ -258,7 +259,8 @@ fromPerform' present src removewhen key afile = do
                        else dispatch removewhen deststartedwithcopy =<< get
   where
        get = notifyTransfer Download afile $
-               download src key afile stdRetry
+               logStatusAfter key .
+                       download src key afile stdRetry
        
        dispatch _ deststartedwithcopy False = do
                logMoveCleanup deststartedwithcopy