move
This commit is contained in:
parent
3d936fdb59
commit
3b2a7f216d
2 changed files with 18 additions and 16 deletions
|
@ -162,14 +162,6 @@ removeInodeCache key = withInodeCacheFile key $ \f ->
|
||||||
withInodeCacheFile :: Key -> (FilePath -> Annex a) -> Annex a
|
withInodeCacheFile :: Key -> (FilePath -> Annex a) -> Annex a
|
||||||
withInodeCacheFile key a = a =<< calcRepo (gitAnnexInodeCache key)
|
withInodeCacheFile key a = a =<< calcRepo (gitAnnexInodeCache key)
|
||||||
|
|
||||||
{- Checks if a InodeCache matches the current version of a file. -}
|
|
||||||
sameInodeCache :: FilePath -> [InodeCache] -> Annex Bool
|
|
||||||
sameInodeCache _ [] = return False
|
|
||||||
sameInodeCache file old = go =<< withTSDelta (liftIO . genInodeCache file)
|
|
||||||
where
|
|
||||||
go Nothing = return False
|
|
||||||
go (Just curr) = elemInodeCaches curr old
|
|
||||||
|
|
||||||
{- Checks if a FileStatus matches the recorded InodeCache of a file. -}
|
{- Checks if a FileStatus matches the recorded InodeCache of a file. -}
|
||||||
sameFileStatus :: Key -> FilePath -> FileStatus -> Annex Bool
|
sameFileStatus :: Key -> FilePath -> FileStatus -> Annex Bool
|
||||||
sameFileStatus key f status = do
|
sameFileStatus key f status = do
|
||||||
|
@ -180,13 +172,6 @@ sameFileStatus key f status = do
|
||||||
([], Nothing) -> return True
|
([], Nothing) -> return True
|
||||||
_ -> return False
|
_ -> return False
|
||||||
|
|
||||||
elemInodeCaches :: InodeCache -> [InodeCache] -> Annex Bool
|
|
||||||
elemInodeCaches _ [] = return False
|
|
||||||
elemInodeCaches c (l:ls) = ifM (compareInodeCaches c l)
|
|
||||||
( return True
|
|
||||||
, elemInodeCaches c ls
|
|
||||||
)
|
|
||||||
|
|
||||||
compareInodeCachesWith :: Annex InodeComparisonType
|
compareInodeCachesWith :: Annex InodeComparisonType
|
||||||
compareInodeCachesWith = ifM inodesChanged ( return Weakly, return Strongly )
|
compareInodeCachesWith = ifM inodesChanged ( return Weakly, return Strongly )
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,8 @@ import qualified Annex
|
||||||
import Utility.InodeCache
|
import Utility.InodeCache
|
||||||
import Annex.Perms
|
import Annex.Perms
|
||||||
|
|
||||||
{- If the inodes have changed, only the size and mtime are compared. -}
|
{- If the sendinal shows the inodes have changed, only the size and mtime
|
||||||
|
- are compared. -}
|
||||||
compareInodeCaches :: InodeCache -> InodeCache -> Annex Bool
|
compareInodeCaches :: InodeCache -> InodeCache -> Annex Bool
|
||||||
compareInodeCaches x y
|
compareInodeCaches x y
|
||||||
| compareStrong x y = return True
|
| compareStrong x y = return True
|
||||||
|
@ -23,6 +24,22 @@ compareInodeCaches x y
|
||||||
, return False
|
, return False
|
||||||
)
|
)
|
||||||
|
|
||||||
|
{- Checks if one of the provided old InodeCache matches the current
|
||||||
|
- version of a file. -}
|
||||||
|
sameInodeCache :: FilePath -> [InodeCache] -> Annex Bool
|
||||||
|
sameInodeCache _ [] = return False
|
||||||
|
sameInodeCache file old = go =<< withTSDelta (liftIO . genInodeCache file)
|
||||||
|
where
|
||||||
|
go Nothing = return False
|
||||||
|
go (Just curr) = elemInodeCaches curr old
|
||||||
|
|
||||||
|
elemInodeCaches :: InodeCache -> [InodeCache] -> Annex Bool
|
||||||
|
elemInodeCaches _ [] = return False
|
||||||
|
elemInodeCaches c (l:ls) = ifM (compareInodeCaches c l)
|
||||||
|
( return True
|
||||||
|
, elemInodeCaches c ls
|
||||||
|
)
|
||||||
|
|
||||||
{- Some filesystems get new inodes each time they are mounted.
|
{- Some filesystems get new inodes each time they are mounted.
|
||||||
- In order to work on such a filesystem, a sentinal file is used to detect
|
- In order to work on such a filesystem, a sentinal file is used to detect
|
||||||
- when the inodes have changed.
|
- when the inodes have changed.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue