diff options
author | Joey Hess <joey@kitenet.net> | 2012-01-06 04:02:35 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-01-06 04:06:13 -0400 |
commit | df21cbfdd2b7342c206ebd4aea32d989328374dc (patch) | |
tree | 24f6624e4e4c6dc06b53735bfb52973366e7b159 /Command/Drop.hs | |
parent | 0a36f92a31196451c2d838fd0ae15527e8bbce18 (diff) |
look up --to and --from remote names only once
This will speed up commands like move and drop.
Diffstat (limited to 'Command/Drop.hs')
-rw-r--r-- | Command/Drop.hs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Command/Drop.hs b/Command/Drop.hs index f76951f08..07ea50df1 100644 --- a/Command/Drop.hs +++ b/Command/Drop.hs @@ -25,15 +25,14 @@ fromOption :: Option fromOption = fieldOption ['f'] "from" paramRemote "drop content from a remote" seek :: [CommandSeek] -seek = [withField "from" id $ \from -> withNumCopies $ \n -> +seek = [withField "from" Remote.byName $ \from -> withNumCopies $ \n -> whenAnnexed $ start from n] -start :: Maybe String -> Maybe Int -> FilePath -> (Key, Backend) -> CommandStart +start :: Maybe Remote -> Maybe Int -> FilePath -> (Key, Backend) -> CommandStart start from numcopies file (key, _) = autoCopies key (>) numcopies $ do case from of Nothing -> startLocal file numcopies key - Just name -> do - remote <- Remote.byName name + Just remote -> do u <- getUUID if Remote.uuid remote == u then startLocal file numcopies key |