filestore 0.6.5 → 0.6.5.1
raw patch · 4 files changed
+31/−23 lines, 4 filesdep ~containersdep ~filepathdep ~timePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: containers, filepath, time
API changes (from Hackage documentation)
Files
- CHANGES +10/−0
- Data/FileStore/Darcs.hs +3/−3
- Data/FileStore/Git.hs +10/−11
- filestore.cabal +8/−9
CHANGES view
@@ -1,3 +1,13 @@+Version 0.6.5.1 released 23 Aug 2025++* Call `git log --raw` instead of `git whatchanged`, as the latter+ will be removed from git in a future release (Jack Kelly).+* Raise bounds for `filepath` and `time` (Jack Kelly).+* Raise `Diff` upper bound (kokobd).+* Support containers 0.7 (kokobd).+* Fix darcs arguments for file and directory listings (tauli).+* Update GitHub repository URL to use https (Felix Yan).+ Version 0.6.5 released 28 Aug 2020 * Removed data files in extra.
Data/FileStore/Darcs.hs view
@@ -205,7 +205,7 @@ -- | Get a list of all known files inside and managed by a repository. darcsIndex :: FilePath ->IO [FilePath] darcsIndex repo = withVerifyDir repo $ do- (status, _errOutput, output) <- runDarcsCommand repo "query" ["files","--no-directories"]+ (status, _errOutput, output) <- runDarcsCommand repo "show" ["files","--no-directories"] if status == ExitSuccess then return . getNames $ output else return [] -- return empty list if invalid path (see gitIndex)@@ -214,8 +214,8 @@ darcsDirectory :: FilePath -> FilePath -> IO [Resource] darcsDirectory repo dir = withVerifyDir (repo </> dir) $ do let dir' = if null dir then "" else addTrailingPathSeparator dir- (status1, _errOutput1, output1) <- runDarcsCommand repo "query" ["files","--no-directories"]- (status2, _errOutput2, output2) <- runDarcsCommand repo "query" ["files","--no-files"]+ (status1, _errOutput1, output1) <- runDarcsCommand repo "show" ["files","--no-directories"]+ (status2, _errOutput2, output2) <- runDarcsCommand repo "show" ["files","--no-files"] if status1 == ExitSuccess && status2 == ExitSuccess then do let files = adhocParsing dir' . lines . toString $ output1
Data/FileStore/Git.hs view
@@ -41,7 +41,7 @@ gitFileStore :: FilePath -> FileStore gitFileStore repo = FileStore { initialize = gitInit repo- , save = gitSave repo + , save = gitSave repo , retrieve = gitRetrieve repo , delete = gitDelete repo , rename = gitMove repo@@ -50,7 +50,7 @@ , revision = gitGetRevision repo , index = gitIndex repo , directory = gitDirectory repo- , search = gitSearch repo + , search = gitSearch repo , idsMatch = const hashsMatch repo } @@ -89,7 +89,7 @@ if status' == ExitSuccess then return () else throwIO $ UnknownError $ "git config failed:\n" ++ err'- else throwIO $ UnknownError $ "git-init failed:\n" ++ err + else throwIO $ UnknownError $ "git-init failed:\n" ++ err -- | Commit changes to a resource. Raise 'Unchanged' exception if there were -- no changes.@@ -173,7 +173,7 @@ gitMove :: FilePath -> FilePath -> FilePath -> Author -> Description -> IO () gitMove repo oldName newName author logMsg = do _ <- gitLatestRevId repo oldName -- will throw a NotFound error if oldName doesn't exist- (statusAdd, err, _) <- withSanityCheck repo [".git"] newName $ runGitCommand repo "mv" [oldName, newName] + (statusAdd, err, _) <- withSanityCheck repo [".git"] newName $ runGitCommand repo "mv" [oldName, newName] if statusAdd == ExitSuccess then gitCommit repo [oldName, newName] author logMsg else throwIO $ UnknownError $ "Could not git mv " ++ oldName ++ " " ++ newName ++ "\n" ++ err@@ -196,7 +196,7 @@ -- | Get revision information for a particular revision ID, or latest revision. gitGetRevision :: FilePath -> RevisionId -> IO Revision gitGetRevision repo revid = do- (status, _, output) <- runGitCommand repo "whatchanged" ["-z","--pretty=format:" ++ gitLogFormat, "--max-count=1", revid]+ (status, _, output) <- runGitCommand repo "log" ["--raw","-z","--pretty=format:" ++ gitLogFormat, "--max-count=1", revid] if status == ExitSuccess then parseLogEntry $ B.drop 1 output -- drop initial \1 else throwIO NotFound@@ -248,7 +248,7 @@ else error $ "parseMatchLine: " ++ str , matchLine = cont} where (fname,xs) = break (== '\NUL') str- rest = drop 1 xs + rest = drop 1 xs -- for some reason, NUL is used after line number instead of -- : when --match-all is passed to git-grep. (ln,ys) = span (`elem` ['0'..'9']) rest@@ -276,8 +276,8 @@ -- If list of resources is empty, log entries for all resources are returned. gitLog :: FilePath -> [FilePath] -> TimeRange -> Maybe Int -> IO [Revision] gitLog repo names (TimeRange mbSince mbUntil) mblimit = do- (status, err, output) <- runGitCommand repo "whatchanged" $- ["-z","--pretty=format:" ++ gitLogFormat] +++ (status, err, output) <- runGitCommand repo "log" $+ ["--raw","-z","--pretty=format:" ++ gitLogFormat] ++ (case mbSince of Just since -> ["--since='" ++ show since ++ "'"] Nothing -> []) ++@@ -290,7 +290,7 @@ ["--"] ++ names if status == ExitSuccess then parseGitLog output- else throwIO $ UnknownError $ "git whatchanged returned error status.\n" ++ err+ else throwIO $ UnknownError $ "git log --raw returned error status.\n" ++ err -- -- Parsers to parse git log into Revisions.@@ -369,7 +369,7 @@ postUpdate :: B.ByteString postUpdate =- B.pack + B.pack "#!/bin/bash\n\ \#\n\ \# This hook does two things:\n\@@ -455,4 +455,3 @@ \ fi\n\ \ done\n\ \fi"-
filestore.cabal view
@@ -1,5 +1,5 @@ Name: filestore-Version: 0.6.5+Version: 0.6.5.1 Cabal-Version: >= 1.10 Build-type: Simple Synopsis: Interface for versioning file stores.@@ -19,7 +19,7 @@ Source-repository head type: git- location: git://github.com/jgm/filestore.git+ location: https://github.com/jgm/filestore.git Flag maxcount default: True@@ -30,16 +30,16 @@ Library Build-depends: base >= 4 && < 5, bytestring >= 0.9 && < 1.0,- containers >= 0.3 && < 0.7,+ containers >= 0.3 && < 0.9, utf8-string >= 0.3 && < 1.1,- filepath >= 1.1 && < 1.5,+ filepath >= 1.1 && < 1.6, directory >= 1.0 && < 1.4, parsec >= 2 && < 3.2, process >= 1.0 && < 1.7,- time >= 1.5 && < 1.11,+ time >= 1.5 && < 1.16, xml >= 1.3 && < 1.4, split >= 0.1 && < 0.3,- Diff >= 0.4 && < 0.5,+ Diff >= 0.4 && < 0.6 || >= 1.0 && < 1.1, old-locale >= 1.0 && < 1.1 Exposed-modules: Data.FileStore@@ -72,8 +72,7 @@ HUnit >= 1.2 && < 1.7, mtl, time,- Diff >= 0.4 && < 0.5,- filepath >= 1.1 && < 1.5,+ Diff >= 0.4 && < 0.6 || >= 1.0 && < 1.1,+ filepath >= 1.1 && < 1.6, directory >= 1.1 && < 1.4, filestore-