aboutsummaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-03-05 15:39:42 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-03-05 15:43:56 -0400
commit5c46685ab3bc1f579e55d764d5887b7f4a208d65 (patch)
tree7bb19dd15cea25d8c3617e4a3e12e92c1a28ab64 /Command
parent349da7cd84ab7b5d4b602bc3ab51e3a548a1633a (diff)
two types of byName
Clean up from 5123a1a83aa3b954fe67629508bab5ccea0e4148. In some cases, looking up a remote by name even though it has no UUID is desirable. This includes git annex sync, which can operate on remotes without an annex, and XMPP pairing, which runs addRemote (with calls byName) before the UUID of the XMPP remote has been configured in git.
Diffstat (limited to 'Command')
-rw-r--r--Command/Copy.hs4
-rw-r--r--Command/Drop.hs2
-rw-r--r--Command/DropUnused.hs2
-rw-r--r--Command/Fsck.hs2
-rw-r--r--Command/Get.hs2
-rw-r--r--Command/Move.hs4
-rw-r--r--Command/TransferKey.hs4
-rw-r--r--Command/Unused.hs2
8 files changed, 11 insertions, 11 deletions
diff --git a/Command/Copy.hs b/Command/Copy.hs
index 6967c2f93..4b04a2423 100644
--- a/Command/Copy.hs
+++ b/Command/Copy.hs
@@ -18,8 +18,8 @@ def = [withOptions Command.Move.options $ command "copy" paramPaths seek
"copy content of files to/from another repository"]
seek :: [CommandSeek]
-seek = [withField Command.Move.toOption Remote.byName $ \to ->
- withField Command.Move.fromOption Remote.byName $ \from ->
+seek = [withField Command.Move.toOption Remote.byNameWithUUID $ \to ->
+ withField Command.Move.fromOption Remote.byNameWithUUID $ \from ->
withFilesInGit $ whenAnnexed $ start to from]
{- A copy is just a move that does not delete the source file.
diff --git a/Command/Drop.hs b/Command/Drop.hs
index 1683f3b57..5699175ed 100644
--- a/Command/Drop.hs
+++ b/Command/Drop.hs
@@ -27,7 +27,7 @@ fromOption :: Option
fromOption = Option.field ['f'] "from" paramRemote "drop content from a remote"
seek :: [CommandSeek]
-seek = [withField fromOption Remote.byName $ \from ->
+seek = [withField fromOption Remote.byNameWithUUID $ \from ->
withFilesInGit $ whenAnnexed $ start from]
start :: Maybe Remote -> FilePath -> (Key, Backend) -> CommandStart
diff --git a/Command/DropUnused.hs b/Command/DropUnused.hs
index 95af062f5..ccf43c040 100644
--- a/Command/DropUnused.hs
+++ b/Command/DropUnused.hs
@@ -28,7 +28,7 @@ start :: UnusedMaps -> Int -> CommandStart
start = startUnused "dropunused" perform (performOther gitAnnexBadLocation) (performOther gitAnnexTmpLocation)
perform :: Key -> CommandPerform
-perform key = maybe droplocal dropremote =<< Remote.byName =<< from
+perform key = maybe droplocal dropremote =<< Remote.byNameWithUUID =<< from
where
dropremote r = do
showAction $ "from " ++ Remote.name r
diff --git a/Command/Fsck.hs b/Command/Fsck.hs
index b662ee578..a27588482 100644
--- a/Command/Fsck.hs
+++ b/Command/Fsck.hs
@@ -61,7 +61,7 @@ options =
seek :: [CommandSeek]
seek =
- [ withField fromOption Remote.byName $ \from ->
+ [ withField fromOption Remote.byNameWithUUID $ \from ->
withIncremental $ \i -> withFilesInGit $ whenAnnexed $ start from i
, withIncremental $ \i -> withBarePresentKeys $ startBare i
]
diff --git a/Command/Get.hs b/Command/Get.hs
index 9c58bde64..95f71a84b 100644
--- a/Command/Get.hs
+++ b/Command/Get.hs
@@ -20,7 +20,7 @@ def = [withOptions [Command.Move.fromOption] $ command "get" paramPaths seek
"make content of annexed files available"]
seek :: [CommandSeek]
-seek = [withField Command.Move.fromOption Remote.byName $ \from ->
+seek = [withField Command.Move.fromOption Remote.byNameWithUUID $ \from ->
withFilesInGit $ whenAnnexed $ start from]
start :: Maybe Remote -> FilePath -> (Key, Backend) -> CommandStart
diff --git a/Command/Move.hs b/Command/Move.hs
index 6d087ecae..cc8fb506f 100644
--- a/Command/Move.hs
+++ b/Command/Move.hs
@@ -32,8 +32,8 @@ options :: [Option]
options = [fromOption, toOption]
seek :: [CommandSeek]
-seek = [withField toOption Remote.byName $ \to ->
- withField fromOption Remote.byName $ \from ->
+seek = [withField toOption Remote.byNameWithUUID $ \to ->
+ withField fromOption Remote.byNameWithUUID $ \from ->
withFilesInGit $ whenAnnexed $ start to from True]
start :: Maybe Remote -> Maybe Remote -> Bool -> FilePath -> (Key, Backend) -> CommandStart
diff --git a/Command/TransferKey.hs b/Command/TransferKey.hs
index 28ace3cd2..407c1d483 100644
--- a/Command/TransferKey.hs
+++ b/Command/TransferKey.hs
@@ -29,8 +29,8 @@ fileOption :: Option
fileOption = Option.field [] "file" paramFile "the associated file"
seek :: [CommandSeek]
-seek = [withField Command.Move.toOption Remote.byName $ \to ->
- withField Command.Move.fromOption Remote.byName $ \from ->
+seek = [withField Command.Move.toOption Remote.byNameWithUUID $ \to ->
+ withField Command.Move.fromOption Remote.byNameWithUUID $ \from ->
withField fileOption return $ \file ->
withKeys $ start to from file]
diff --git a/Command/Unused.hs b/Command/Unused.hs
index 5f8af2185..64a619b0a 100644
--- a/Command/Unused.hs
+++ b/Command/Unused.hs
@@ -76,7 +76,7 @@ checkUnused = chain 0
chain v' as
checkRemoteUnused :: String -> CommandPerform
-checkRemoteUnused name = go =<< fromJust <$> Remote.byName (Just name)
+checkRemoteUnused name = go =<< fromJust <$> Remote.byNameWithUUID (Just name)
where
go r = do
showAction "checking for unused data"