summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
Diffstat (limited to 'Command')
-rw-r--r--Command/AddUnused.hs3
-rw-r--r--Command/DropKey.hs3
-rw-r--r--Command/Find.hs2
-rw-r--r--Command/FromKey.hs2
-rw-r--r--Command/Fsck.hs5
-rw-r--r--Command/ReKey.hs2
-rw-r--r--Command/Status.hs4
-rw-r--r--Command/Sync.hs5
-rw-r--r--Command/Unused.hs3
9 files changed, 17 insertions, 12 deletions
diff --git a/Command/AddUnused.hs b/Command/AddUnused.hs
index c498216dc..f70500354 100644
--- a/Command/AddUnused.hs
+++ b/Command/AddUnused.hs
@@ -11,6 +11,7 @@ import Common.Annex
import Logs.Unused
import Command
import qualified Command.Add
+import Types.Key
def :: [Command]
def = [command "addunused" (paramRepeating paramNumRange)
@@ -25,7 +26,7 @@ start = startUnused "addunused" perform (performOther "bad") (performOther "tmp"
perform :: Key -> CommandPerform
perform key = next $ Command.Add.cleanup file key True
where
- file = "unused." ++ show key
+ file = "unused." ++ key2file key
{- The content is not in the annex, but in another directory, and
- it seems better to error out, rather than moving bad/tmp content into
diff --git a/Command/DropKey.hs b/Command/DropKey.hs
index 68fdbfdd9..d55c5e83a 100644
--- a/Command/DropKey.hs
+++ b/Command/DropKey.hs
@@ -12,6 +12,7 @@ import Command
import qualified Annex
import Logs.Location
import Annex.Content
+import Types.Key
def :: [Command]
def = [oneShot $ command "dropkey" (paramRepeating paramKey) seek
@@ -24,7 +25,7 @@ start :: Key -> CommandStart
start key = stopUnless (inAnnex key) $ do
unlessM (Annex.getState Annex.force) $
error "dropkey can cause data loss; use --force if you're sure you want to do this"
- showStart "dropkey" (show key)
+ showStart "dropkey" (key2file key)
next $ perform key
perform :: Key -> CommandPerform
diff --git a/Command/Find.hs b/Command/Find.hs
index e568c3510..177b794cd 100644
--- a/Command/Find.hs
+++ b/Command/Find.hs
@@ -53,7 +53,7 @@ start format file (key, _) = do
where
vars =
[ ("file", file)
- , ("key", show key)
+ , ("key", key2file key)
, ("backend", keyBackendName key)
, ("bytesize", size show)
, ("humansize", size $ roughSize storageUnits True)
diff --git a/Command/FromKey.hs b/Command/FromKey.hs
index f7841c977..f998fe1e6 100644
--- a/Command/FromKey.hs
+++ b/Command/FromKey.hs
@@ -22,7 +22,7 @@ seek = [withWords start]
start :: [String] -> CommandStart
start (keyname:file:[]) = notBareRepo $ do
- let key = fromMaybe (error "bad key") $ readKey keyname
+ let key = fromMaybe (error "bad key") $ file2key keyname
inbackend <- inAnnex key
unless inbackend $ error $
"key ("++ keyname ++") is not present in backend"
diff --git a/Command/Fsck.hs b/Command/Fsck.hs
index 0e3cc934c..89ba0eef8 100644
--- a/Command/Fsck.hs
+++ b/Command/Fsck.hs
@@ -26,6 +26,7 @@ import Utility.DataUnits
import Utility.FileMode
import Config
import qualified Option
+import Types.Key
def :: [Command]
def = [withOptions options $ command "fsck" paramPaths seek
@@ -114,7 +115,7 @@ startBare :: Key -> CommandStart
startBare key = case Backend.maybeLookupBackendName (Types.Key.keyBackendName key) of
Nothing -> stop
Just backend -> do
- showStart "fsck" (show key)
+ showStart "fsck" (key2file key)
next $ performBare key backend
{- Note that numcopies cannot be checked in a bare repository, because
@@ -122,7 +123,7 @@ startBare key = case Backend.maybeLookupBackendName (Types.Key.keyBackendName ke
- files. -}
performBare :: Key -> Backend -> CommandPerform
performBare key backend = check
- [ verifyLocationLog key (show key)
+ [ verifyLocationLog key (key2file key)
, checkKeySize key
, checkBackend backend key
]
diff --git a/Command/ReKey.hs b/Command/ReKey.hs
index 6de7e45e3..5bd419ca3 100644
--- a/Command/ReKey.hs
+++ b/Command/ReKey.hs
@@ -26,7 +26,7 @@ seek = [withPairs start]
start :: (FilePath, String) -> CommandStart
start (file, keyname) = ifAnnexed file go stop
where
- newkey = fromMaybe (error "bad key") $ readKey keyname
+ newkey = fromMaybe (error "bad key") $ file2key keyname
go (oldkey, _)
| oldkey == newkey = stop
| otherwise = do
diff --git a/Command/Status.hs b/Command/Status.hs
index 2d63c525c..7bb4dc8ca 100644
--- a/Command/Status.hs
+++ b/Command/Status.hs
@@ -183,8 +183,8 @@ transfer_list = stat "transfers in progress" $ nojson $ lift $ do
pp _ c [] = c
pp uuidmap c ((t, i):xs) = "\n\t" ++ line uuidmap t i ++ pp uuidmap c xs
line uuidmap t i = unwords
- [ show (transferDirection t) ++ "ing"
- , fromMaybe (show $ transferKey t) (associatedFile i)
+ [ showLcDirection (transferDirection t) ++ "ing"
+ , fromMaybe (key2file $ transferKey t) (associatedFile i)
, if transferDirection t == Upload then "to" else "from"
, maybe (fromUUID $ transferUUID t) Remote.name $
M.lookup (transferUUID t) uuidmap
diff --git a/Command/Sync.hs b/Command/Sync.hs
index ab29c82b6..f40a2f621 100644
--- a/Command/Sync.hs
+++ b/Command/Sync.hs
@@ -25,6 +25,7 @@ import qualified Git
import Git.Types (BlobType(..))
import qualified Types.Remote
import qualified Remote.Git
+import Types.Key
import qualified Data.Map as M
import qualified Data.ByteString.Lazy as L
@@ -260,8 +261,8 @@ resolveMerge' u
-}
mergeFile :: FilePath -> Key -> FilePath
mergeFile file key
- | doubleconflict = go $ show key
- | otherwise = go $ shortHash $ show key
+ | doubleconflict = go $ key2file key
+ | otherwise = go $ shortHash $ key2file key
where
varmarker = ".variant-"
doubleconflict = varmarker `isSuffixOf` (dropExtension file)
diff --git a/Command/Unused.hs b/Command/Unused.hs
index 09b4be5df..39a7a59cf 100644
--- a/Command/Unused.hs
+++ b/Command/Unused.hs
@@ -34,6 +34,7 @@ import qualified Remote
import qualified Annex.Branch
import qualified Option
import Annex.CatFile
+import Types.Key
def :: [Command]
def = [withOptions [fromOption] $ command "unused" paramNothing seek
@@ -100,7 +101,7 @@ number n (x:xs) = (n+1, x) : number (n+1) xs
table :: [(Int, Key)] -> [String]
table l = " NUMBER KEY" : map cols l
where
- cols (n,k) = " " ++ pad 6 (show n) ++ " " ++ show k
+ cols (n,k) = " " ++ pad 6 (show n) ++ " " ++ key2file k
pad n s = s ++ replicate (n - length s) ' '
staleTmpMsg :: [(Int, Key)] -> String