New patches: [refactor getOnePatchset -> matchOnePatchset Ben Franksen **20210916064826 Ignore-this: fdfd1c83a97bdf09bc6cd59bf9dad24bf918520d2192a1e977a6bcbefbde465e4fd8eb44e78577d7 Darcs.Repository.Match.getOnePatchSet only needed the Repository argument to call readPatches. However, in all use cases we have already done that, so we can as well pass the PatchSet directly. The new function matchOnePatchSet was then moved to Darcs.Patch.Match as it no longer depends on the Repository layer. ] hunk ./src/Darcs/Patch/Match.hs 56 - , PatchSetMatch(..) + , PatchSetMatch hunk ./src/Darcs/Patch/Match.hs 62 + , matchOnePatchset hunk ./src/Darcs/Patch/Match.hs 103 -import Darcs.Util.Path ( AbsolutePath ) +import Darcs.Util.Path ( AbsolutePath, toFilePath ) hunk ./src/Darcs/Patch/Match.hs 105 +import Darcs.Patch.Bundle ( readContextFile ) hunk ./src/Darcs/Patch/Match.hs 650 +-- | Return the patches in a 'PatchSet' up to the given 'PatchSetMatch'. +matchOnePatchset + :: MatchableRP p + => PatchSet p Origin wR + -> PatchSetMatch + -> IO (SealedPatchSet p Origin) +matchOnePatchset ps (IndexMatch n ) = return $ patchSetDrop (n - 1) ps +matchOnePatchset ps (PatchMatch m ) = return $ matchAPatchset m ps +matchOnePatchset ps (TagMatch m ) = return $ getMatchingTag m ps +matchOnePatchset ps (ContextMatch path) = readContextFile ps (toFilePath path) + hunk ./src/Darcs/Repository/Clone.hs 69 -import Darcs.Repository.Match ( getOnePatchset ) hunk ./src/Darcs/Repository/Clone.hs 122 -import Darcs.Patch.Match ( MatchFlag(..), patchSetMatch ) +import Darcs.Patch.Match ( MatchFlag(..), patchSetMatch, matchOnePatchset ) hunk ./src/Darcs/Repository/Clone.hs 230 - Sealed context <- getOnePatchset _toRepo psm + Sealed context <- matchOnePatchset patches psm hunk ./src/Darcs/Repository/Match.hs 19 - ( - getPristineUpToMatch - , getOnePatchset + ( getPristineUpToMatch hunk ./src/Darcs/Repository/Match.hs 24 -import Darcs.Patch.Match - ( rollbackToPatchSetMatch - , PatchSetMatch(..) - , getMatchingTag - , matchAPatchset - ) - -import Darcs.Patch.Bundle ( readContextFile ) -import Darcs.Patch.Apply( ApplyState ) hunk ./src/Darcs/Repository/Match.hs 25 -import Darcs.Patch.Set ( Origin, SealedPatchSet, patchSetDrop ) - +import Darcs.Patch.Apply ( ApplyState ) +import Darcs.Patch.Match ( PatchSetMatch, rollbackToPatchSetMatch ) + +import Darcs.Repository.Hashed ( readPatches ) hunk ./src/Darcs/Repository/Match.hs 30 -import Darcs.Repository.Hashed ( readPatches ) hunk ./src/Darcs/Repository/Match.hs 35 -import Darcs.Util.Path ( toFilePath ) - hunk ./src/Darcs/Repository/Match.hs 47 - --- | Return the patches up to the given 'PatchSetMatch'. -getOnePatchset :: RepoPatch p - => Repository rt p wU wR - -> PatchSetMatch - -> IO (SealedPatchSet p Origin) -getOnePatchset repository pm = - case pm of - IndexMatch n -> patchSetDrop (n-1) <$> readPatches repository - PatchMatch m -> matchAPatchset m <$> readPatches repository - TagMatch m -> getMatchingTag m <$> readPatches repository - ContextMatch path -> do - ref <- readPatches repository - readContextFile ref (toFilePath path) hunk ./src/Darcs/UI/Commands/Annotate.hs 45 -import Darcs.Repository.Match ( getOnePatchset ) +import Darcs.Patch.Match ( matchOnePatchset ) hunk ./src/Darcs/UI/Commands/Annotate.hs 107 - Sealed x <- getOnePatchset repository psm + Sealed x <- matchOnePatchset r psm Context: [TAG 2.18.1 Ganesh Sittampalam **20240225173219 Ignore-this: dc3a92eafcab9d4fa9f53b1811d4c99d330615a8c202bff1b77f44d551d21684eee81e96c69be62b ] Patch bundle hash: 724024ea9592f78fb3a6d2207e8ce10db25976de