diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-02-06 16:03:02 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-02-06 16:03:02 -0400 |
commit | e24a7140fd8a4198ae470081a936c170df6ee495 (patch) | |
tree | defd80ae1bd15f94fbe0cfeb41f992c12711ed40 | |
parent | 4c8cfa61bfb6fa1d9482a6b07b04d9ec11be4d0d (diff) |
relFile does not have to be relative; rename to currFile
-rw-r--r-- | Annex/FileMatcher.hs | 2 | ||||
-rw-r--r-- | CmdLine/Seek.hs | 2 | ||||
-rw-r--r-- | Limit.hs | 4 | ||||
-rw-r--r-- | Types/FileMatcher.hs | 6 |
4 files changed, 8 insertions, 6 deletions
diff --git a/Annex/FileMatcher.hs b/Annex/FileMatcher.hs index 16ade922c..0de4d83d1 100644 --- a/Annex/FileMatcher.hs +++ b/Annex/FileMatcher.hs @@ -42,7 +42,7 @@ fileMatchInfo file = do matchfile <- getTopFilePath <$> inRepo (toTopFilePath file) return $ MatchingFile FileInfo { matchFile = matchfile - , relFile = file + , currFile = file } matchAll :: FileMatcher Annex diff --git a/CmdLine/Seek.hs b/CmdLine/Seek.hs index f3e37969a..2fe217703 100644 --- a/CmdLine/Seek.hs +++ b/CmdLine/Seek.hs @@ -77,7 +77,7 @@ withPathContents a params = do , return [(p, takeFileName p)] ) checkmatch matcher (f, relf) = matcher $ MatchingFile $ FileInfo - { relFile = f + { currFile = f , matchFile = relf } @@ -239,7 +239,7 @@ limitSize vs s = case readSize dataUnits s of checkkey sz key = return $ keySize key `vs` Just sz check _ sz (Just key) = checkkey sz key check fi sz Nothing = do - filesize <- liftIO $ catchMaybeIO $ getFileSize (relFile fi) + filesize <- liftIO $ catchMaybeIO $ getFileSize (currFile fi) return $ filesize `vs` Just sz addMetaData :: String -> Annex () @@ -271,7 +271,7 @@ addTimeLimit s = do else return True lookupFileKey :: FileInfo -> Annex (Maybe Key) -lookupFileKey = Backend.lookupFile . relFile +lookupFileKey = Backend.lookupFile . currFile checkKey :: (Key -> Annex Bool) -> MatchInfo -> Annex Bool checkKey a (MatchingFile fi) = lookupFileKey fi >>= maybe (return False) a diff --git a/Types/FileMatcher.hs b/Types/FileMatcher.hs index a79bbd258..377bba72a 100644 --- a/Types/FileMatcher.hs +++ b/Types/FileMatcher.hs @@ -19,8 +19,10 @@ data MatchInfo | MatchingKey Key data FileInfo = FileInfo - { relFile :: FilePath -- may be relative to cwd - , matchFile :: FilePath -- filepath to match on; may be relative to top + { currFile :: FilePath + -- ^ current path to the file, for operations that examine it + , matchFile :: FilePath + -- ^ filepath to match on; may be relative to top of repo or cwd } type FileMatcherMap a = M.Map UUID (Utility.Matcher.Matcher (S.Set UUID -> MatchInfo -> a Bool)) |