diff options
author | Joey Hess <joey@kitenet.net> | 2012-10-08 17:14:01 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-10-08 17:14:01 -0400 |
commit | 5f8d17ef558ee82e4cf9e75b8d750e90d35731ee (patch) | |
tree | 9fe4d61c0713464b7818c4998f5af8f097ae2d48 /Command | |
parent | 6a885aacfc549c2504ee847ead806b6f10b991bf (diff) |
generalized Annex.Wanted
this should make it easy to use from inside the assistant, where
everything is an AssociatedFile.
Diffstat (limited to 'Command')
-rw-r--r-- | Command/Copy.hs | 4 | ||||
-rw-r--r-- | Command/Drop.hs | 2 | ||||
-rw-r--r-- | Command/Get.hs | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/Command/Copy.hs b/Command/Copy.hs index c8a2d7efc..f044facf4 100644 --- a/Command/Copy.hs +++ b/Command/Copy.hs @@ -31,5 +31,5 @@ start to from file (key, backend) = autoCopies file key (<) $ Command.Move.start to from False file (key, backend) where shouldCopy = case to of - Nothing -> checkAuto $ shouldGet file key - Just r -> checkAuto $ shouldSend r file + Nothing -> checkAuto $ wantGet (Just file) + Just r -> checkAuto $ wantSend (Remote.uuid r) (Just file) diff --git a/Command/Drop.hs b/Command/Drop.hs index 3fe5ab20a..26e80f8e5 100644 --- a/Command/Drop.hs +++ b/Command/Drop.hs @@ -32,7 +32,7 @@ seek = [withField fromOption Remote.byName $ \from -> start :: Maybe Remote -> FilePath -> (Key, Backend) -> CommandStart start from file (key, _) = autoCopiesWith file key (>) $ \numcopies -> - stopUnless (checkAuto $ shouldDrop from file) $ + stopUnless (checkAuto $ wantDrop (Remote.uuid <$> from) (Just file)) $ case from of Nothing -> startLocal file numcopies key Just remote -> do diff --git a/Command/Get.hs b/Command/Get.hs index 10b74bfc7..c95e4eb94 100644 --- a/Command/Get.hs +++ b/Command/Get.hs @@ -24,7 +24,7 @@ seek = [withField Command.Move.fromOption Remote.byName $ \from -> withFilesInGit $ whenAnnexed $ start from] start :: Maybe Remote -> FilePath -> (Key, Backend) -> CommandStart -start from file (key, _) = stopUnless (checkAuto $ shouldGet file key) $ +start from file (key, _) = stopUnless ((not <$> inAnnex key) <&&> checkAuto (wantGet $ Just file)) $ autoCopies file key (<) $ case from of Nothing -> go $ perform key file |