minor syntax changes
This commit is contained in:
parent
025ded4a2d
commit
b505ba83e8
19 changed files with 78 additions and 95 deletions
12
Remote.hs
12
Remote.hs
|
@ -78,7 +78,7 @@ genList = do
|
|||
enumerate t >>=
|
||||
mapM (gen m t)
|
||||
gen m t r = do
|
||||
u <- getUUID r
|
||||
u <- getRepoUUID r
|
||||
generate t r u (M.lookup u m)
|
||||
|
||||
{- Looks up a remote by name. (Or by UUID.) Only finds currently configured
|
||||
|
@ -104,7 +104,7 @@ byName' n = do
|
|||
- and returns its UUID. Finds even remotes that are not configured in
|
||||
- .git/config. -}
|
||||
nameToUUID :: String -> Annex UUID
|
||||
nameToUUID "." = getUUID =<< gitRepo -- special case for current repo
|
||||
nameToUUID "." = getUUID -- special case for current repo
|
||||
nameToUUID n = do
|
||||
res <- byName' n
|
||||
case res of
|
||||
|
@ -129,7 +129,7 @@ nameToUUID n = do
|
|||
- of the UUIDs. -}
|
||||
prettyPrintUUIDs :: String -> [UUID] -> Annex String
|
||||
prettyPrintUUIDs desc uuids = do
|
||||
here <- getUUID =<< gitRepo
|
||||
here <- getUUID
|
||||
m <- M.unionWith addname <$> uuidMap <*> remoteMap
|
||||
maybeShowJSON [(desc, map (jsonify m here) uuids)]
|
||||
return $ unwords $ map (\u -> "\t" ++ prettify m here u ++ "\n") uuids
|
||||
|
@ -178,8 +178,7 @@ keyPossibilitiesTrusted = keyPossibilities' True
|
|||
|
||||
keyPossibilities' :: Bool -> Key -> Annex ([Remote Annex], [UUID])
|
||||
keyPossibilities' withtrusted key = do
|
||||
g <- gitRepo
|
||||
u <- getUUID g
|
||||
u <- getUUID
|
||||
trusted <- if withtrusted then trustGet Trusted else return []
|
||||
|
||||
-- get uuids of all remotes that are recorded to have the key
|
||||
|
@ -198,8 +197,7 @@ keyPossibilities' withtrusted key = do
|
|||
{- Displays known locations of a key. -}
|
||||
showLocations :: Key -> [UUID] -> Annex ()
|
||||
showLocations key exclude = do
|
||||
g <- gitRepo
|
||||
u <- getUUID g
|
||||
u <- getUUID
|
||||
uuids <- keyLocations key
|
||||
untrusteduuids <- trustGet UnTrusted
|
||||
let uuidswanted = filteruuids uuids (u:exclude++untrusteduuids)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue