aboutsummaryrefslogtreecommitdiff
path: root/Logs/UUID.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-11-11 00:51:07 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-11-11 00:51:07 -0400
commit264bd9ebe37855d4005022df057da13ec8080afb (patch)
treef32f13646ece29c8f6336b8680cb07dd55187be5 /Logs/UUID.hs
parentd9f5cc9f73ea046fcd2b59b5e75d4600593ac05b (diff)
where indenting
Diffstat (limited to 'Logs/UUID.hs')
-rw-r--r--Logs/UUID.hs48
1 files changed, 24 insertions, 24 deletions
diff --git a/Logs/UUID.hs b/Logs/UUID.hs
index 7b7090223..2f24a388e 100644
--- a/Logs/UUID.hs
+++ b/Logs/UUID.hs
@@ -53,32 +53,32 @@ describeUUID uuid desc = do
-}
fixBadUUID :: Log String -> Log String
fixBadUUID = M.fromList . map fixup . M.toList
- where
- fixup (k, v)
- | isbad = (fixeduuid, LogEntry (Date $ newertime v) fixedvalue)
- | otherwise = (k, v)
- where
- kuuid = fromUUID k
- isbad = not (isuuid kuuid) && isuuid lastword
- ws = words $ value v
- lastword = Prelude.last ws
- fixeduuid = toUUID lastword
- fixedvalue = unwords $ kuuid: Prelude.init ws
- -- For the fixed line to take precidence, it should be
- -- slightly newer, but only slightly.
- newertime (LogEntry (Date d) _) = d + minimumPOSIXTimeSlice
- newertime (LogEntry Unknown _) = minimumPOSIXTimeSlice
- minimumPOSIXTimeSlice = 0.000001
- isuuid s = length s == 36 && length (split "-" s) == 5
+ where
+ fixup (k, v)
+ | isbad = (fixeduuid, LogEntry (Date $ newertime v) fixedvalue)
+ | otherwise = (k, v)
+ where
+ kuuid = fromUUID k
+ isbad = not (isuuid kuuid) && isuuid lastword
+ ws = words $ value v
+ lastword = Prelude.last ws
+ fixeduuid = toUUID lastword
+ fixedvalue = unwords $ kuuid: Prelude.init ws
+ -- For the fixed line to take precidence, it should be
+ -- slightly newer, but only slightly.
+ newertime (LogEntry (Date d) _) = d + minimumPOSIXTimeSlice
+ newertime (LogEntry Unknown _) = minimumPOSIXTimeSlice
+ minimumPOSIXTimeSlice = 0.000001
+ isuuid s = length s == 36 && length (split "-" s) == 5
{- Records the uuid in the log, if it's not already there. -}
recordUUID :: UUID -> Annex ()
recordUUID u = go . M.lookup u =<< uuidMap
- where
- go (Just "") = set
- go Nothing = set
- go _ = noop
- set = describeUUID u ""
+ where
+ go (Just "") = set
+ go Nothing = set
+ go _ = noop
+ set = describeUUID u ""
{- The map is cached for speed. -}
uuidMap :: Annex UUIDMap
@@ -95,5 +95,5 @@ uuidMapLoad = do
let m' = M.insertWith' preferold u "" m
Annex.changeState $ \s -> s { Annex.uuidmap = Just m' }
return m'
- where
- preferold = flip const
+ where
+ preferold = flip const