By | ~fr33domlover |
At | 2018-05-23 |
Title | Move patch content hash out of patch info record |
Description |
Edit file src/Development/Darcs/Internal/Hash/Codec.hs 0 → 0
- 3 - Written in 2016 by fr33domlover <fr33domlover@riseup.net>.
+ 3 - Written in 2016, 2018 by fr33domlover <fr33domlover@riseup.net>.
… … … … - 19 ( encodePatchHash
+ 19 ( encodePatchInfoHash
… … … … - 45 encodePatchHash :: PatchHash -> ByteString
- 46 encodePatchHash (PatchHash h) = encodeHash h
+ 45 encodePatchInfoHash :: PatchInfoHash -> ByteString
+ 46 encodePatchInfoHash (PatchInfoHash h) = encodeHash h
… … … … Edit file src/Development/Darcs/Internal/Hash/Types.hs 0 → 0
- 3 - Written in 2016 by fr33domlover <fr33domlover@riseup.net>.
+ 3 - Written in 2016, 2018 by fr33domlover <fr33domlover@riseup.net>.
… … … … - 17 ( PatchHash (..)
- 18 , ContentHash (..)
+ 17 ( PatchInfoHash (..)
+ 18 , PatchContentHash (..)
- 29 newtype PatchHash = PatchHash { unPatchHash :: ByteString }
+ 29 newtype PatchInfoHash = PatchInfoHash { unPatchInfoHash :: ByteString }
- 33 data ContentHash = ContentHash
- 34 { chSize :: Int
- 35 , chHash :: ByteString
+ 33 data PatchContentHash = PatchContentHash
+ 34 { pchSize :: Int
+ 35 , pchHash :: ByteString
… … … … Edit file src/Development/Darcs/Internal/Inventory/Parser.hs 0 → 0
- 3 - Written in 2016 by fr33domlover <fr33domlover@riseup.net>.
+ 3 - Written in 2016, 2018 by fr33domlover <fr33domlover@riseup.net>.
… … … … - 173 patchInfoRawP :: Parser PatchInfoRaw
+ 173 patchInfoRawP :: Parser (PatchInfoRaw, (Int, ByteString))
… … … … - 195 return PatchInfoRaw
- 196 { pirAuthor = author
- 197 , pirHash = hash
- 198 , pirTitle = title
- 199 , pirDescription = lines
- 200 , pirJunkPrefix = junkp
- 201 , pirJunkContent = junkc
- 202 , pirTime = (timeRaw, time)
- 203 , pirInverted = inverted
- 204 }
+ 195 return
+ 196 ( PatchInfoRaw
+ 197 { pirAuthor = author
+ 198 , pirTitle = title
+ 199 , pirDescription = lines
+ 200 , pirJunkPrefix = junkp
+ 201 , pirJunkContent = junkc
+ 202 , pirTime = (timeRaw, time)
+ 203 , pirInverted = inverted
+ 204 }
+ 205 , hash
+ 206 )
… … … … - 216 patchInfoP :: Parser (PatchInfo, PatchHash)
+ 218 patchInfoP :: Parser (PatchInfo, PatchInfoHash, PatchContentHash)
- 218 pir <- patchInfoRawP
- 219 return (refinePatchInfo pir, PatchHash $ convert $ hashPatchInfo SHA1 pir)
- 220 - 221 tagInfoP :: Parser (TagInfo, PatchHash)
+ 220 (pir, hash) <- patchInfoRawP
+ 221 let (pi, chash) = refinePatchInfo pir hash
+ 222 return (pi, PatchInfoHash $ convert $ hashPatchInfo SHA1 pir, chash)
+ 223 + 224 tagInfoP :: Parser (TagInfo, PatchInfoHash, PatchContentHash)
- 224 (pi, ph) <- patchInfoP
+ 227 (pi, pih, pch) <- patchInfoP
- 227 Just ti -> return (ti, ph)
+ 230 Just ti -> return (ti, pih, pch)
… … … … - 263 :: Int -> Int -> Parser (Maybe InventoryHash, [(PatchInfo, PatchHash)])
+ 266 :: Int -> Int -> Parser (Maybe InventoryHash, [(PatchInfo, PatchInfoHash, PatchContentHash)])
… … … … - 311 :: Int -> Int -> Parser (Maybe InventoryHash, [(PatchInfo, PatchHash)])
+ 314 :: Int -> Int -> Parser (Maybe InventoryHash, [(PatchInfo, PatchInfoHash, PatchContentHash)])
… … … … Edit file src/Development/Darcs/Internal/Inventory/Types.hs 0 → 0
- 3 - Written in 2016 by fr33domlover <fr33domlover@riseup.net>.
+ 3 - Written in 2016, 2018 by fr33domlover <fr33domlover@riseup.net>.
… … … … - 60 , liPrevTag :: Maybe (InventoryHash, (TagInfo, PatchHash))
- 61 , liPatches :: [(PatchInfo, PatchHash)]
+ 60 , liPrevTag :: Maybe (InventoryHash, (TagInfo, PatchInfoHash, PatchContentHash))
+ 61 , liPatches :: [(PatchInfo, PatchInfoHash, PatchContentHash)]
- 66 , miTag :: (TagInfo, PatchHash)
- 67 , miPatches :: [(PatchInfo, PatchHash)]
+ 66 , miTag :: (TagInfo, PatchInfoHash, PatchContentHash)
+ 67 , miPatches :: [(PatchInfo, PatchInfoHash, PatchContentHash)]
- 71 { eiPatches :: [(PatchInfo, PatchHash)]
+ 71 { eiPatches :: [(PatchInfo, PatchInfoHash, PatchContentHash)]
… … … … Edit file src/Development/Darcs/Internal/Patch.hs 0 → 0
- 3 - Written in 2016 by fr33domlover <fr33domlover@riseup.net>.
+ 3 - Written in 2016, 2018 by fr33domlover <fr33domlover@riseup.net>.
… … … … - 68 refinePatchInfo :: PatchInfoRaw -> PatchInfo
- 69 refinePatchInfo pir =
+ 68 refinePatchInfo :: PatchInfoRaw -> (Int, ByteString) -> (PatchInfo, PatchContentHash)
+ 69 refinePatchInfo pir hash =
- 77 in PatchInfo
+ 77 in ( PatchInfo
- 79 , piHash = uncurry ContentHash $ pirHash pir
+ 83 , uncurry PatchContentHash hash
+ 84 )
- 90 , piHash = tiHash tag
… … … … - 105 , tiHash = piHash patch
… … … … Edit file src/Development/Darcs/Internal/Patch/Types.hs 0 → 0
- 3 - Written in 2016 by fr33domlover <fr33domlover@riseup.net>.
+ 3 - Written in 2016, 2018 by fr33domlover <fr33domlover@riseup.net>.
… … … … - 27 import Development.Darcs.Internal.Hash.Types (ContentHash)
+ 27 import Development.Darcs.Internal.Hash.Types (PatchContentHash)
- 33 , pirHash :: (Int, ByteString)
… … … … - 45 -- | Patch content hash
- 46 , piHash :: ContentHash
… … … … - 59 -- | Tag content hash
- 60 , tiHash :: ContentHash
… … … …