rename stuff for v5 unlocked files to indicate it's old

This commit is contained in:
Joey Hess 2015-12-15 14:08:07 -04:00
parent d1bb518e25
commit a983a3a7a2
Failed to extract signature
4 changed files with 14 additions and 14 deletions

View file

@ -119,25 +119,25 @@ withFilesToBeCommitted :: (FilePath -> CommandStart) -> CmdParams -> CommandSeek
withFilesToBeCommitted a params = seekActions $ prepFiltered a $ withFilesToBeCommitted a params = seekActions $ prepFiltered a $
seekHelper LsFiles.stagedNotDeleted params seekHelper LsFiles.stagedNotDeleted params
withFilesUnlocked :: (FilePath -> CommandStart) -> CmdParams -> CommandSeek withFilesOldUnlocked :: (FilePath -> CommandStart) -> CmdParams -> CommandSeek
withFilesUnlocked = withFilesUnlocked' LsFiles.typeChanged withFilesOldUnlocked = withFilesOldUnlocked' LsFiles.typeChanged
withFilesUnlockedToBeCommitted :: (FilePath -> CommandStart) -> CmdParams -> CommandSeek withFilesOldUnlockedToBeCommitted :: (FilePath -> CommandStart) -> CmdParams -> CommandSeek
withFilesUnlockedToBeCommitted = withFilesUnlocked' LsFiles.typeChangedStaged withFilesOldUnlockedToBeCommitted = withFilesOldUnlocked' LsFiles.typeChangedStaged
{- Unlocked files before v6 have changed type from a symlink to a regular file. {- Unlocked files before v6 have changed type from a symlink to a regular file.
- -
- Furthermore, unlocked files used to be a git-annex symlink, - Furthermore, unlocked files used to be a git-annex symlink,
- not some other sort of symlink. - not some other sort of symlink.
-} -}
withFilesUnlocked' :: ([FilePath] -> Git.Repo -> IO ([FilePath], IO Bool)) -> (FilePath -> CommandStart) -> CmdParams -> CommandSeek withFilesOldUnlocked' :: ([FilePath] -> Git.Repo -> IO ([FilePath], IO Bool)) -> (FilePath -> CommandStart) -> CmdParams -> CommandSeek
withFilesUnlocked' typechanged a params = seekActions $ withFilesOldUnlocked' typechanged a params = seekActions $
prepFiltered a unlockedfiles prepFiltered a unlockedfiles
where where
unlockedfiles = filterM isUnlocked =<< seekHelper typechanged params unlockedfiles = filterM isOldUnlocked =<< seekHelper typechanged params
isUnlocked :: FilePath -> Annex Bool isOldUnlocked :: FilePath -> Annex Bool
isUnlocked f = liftIO (notSymlink f) <&&> isOldUnlocked f = liftIO (notSymlink f) <&&>
(isJust <$> catKeyFile f <||> isJust <$> catKeyFileHEAD f) (isJust <$> catKeyFile f <||> isJust <$> catKeyFileHEAD f)
{- Finds files that may be modified. -} {- Finds files that may be modified. -}

View file

@ -69,7 +69,7 @@ seek o = allowConcurrentOutput $ do
ifM isDirect ifM isDirect
( go withFilesMaybeModified ( go withFilesMaybeModified
, unlessM versionSupportsUnlockedPointers $ , unlessM versionSupportsUnlockedPointers $
go withFilesUnlocked go withFilesOldUnlocked
) )
{- Pass file off to git-add. -} {- Pass file off to git-add. -}

View file

@ -32,8 +32,8 @@ seek :: CmdParams -> CommandSeek
seek ps = ifM versionSupportsUnlockedPointers seek ps = ifM versionSupportsUnlockedPointers
( withFilesInGit (whenAnnexed startNew) ps ( withFilesInGit (whenAnnexed startNew) ps
, do , do
withFilesUnlocked startOld ps withFilesOldUnlocked startOld ps
withFilesUnlockedToBeCommitted startOld ps withFilesOldUnlockedToBeCommitted startOld ps
) )
startNew :: FilePath -> Key -> CommandStart startNew :: FilePath -> Key -> CommandStart

View file

@ -46,7 +46,7 @@ seek ps = lockPreCommitHook $ ifM isDirect
ifM (liftIO Git.haveFalseIndex) ifM (liftIO Git.haveFalseIndex)
( do ( do
(fs, cleanup) <- inRepo $ Git.typeChangedStaged ps (fs, cleanup) <- inRepo $ Git.typeChangedStaged ps
whenM (anyM isUnlocked fs) $ whenM (anyM isOldUnlocked fs) $
error "Cannot make a partial commit with unlocked annexed files. You should `git annex add` the files you want to commit, and then run git commit." error "Cannot make a partial commit with unlocked annexed files. You should `git annex add` the files you want to commit, and then run git commit."
void $ liftIO cleanup void $ liftIO cleanup
, do , do
@ -58,7 +58,7 @@ seek ps = lockPreCommitHook $ ifM isDirect
-- (not needed when repo version uses -- (not needed when repo version uses
-- unlocked pointer files) -- unlocked pointer files)
unlessM versionSupportsUnlockedPointers $ unlessM versionSupportsUnlockedPointers $
withFilesUnlockedToBeCommitted startInjectUnlocked ps withFilesOldUnlockedToBeCommitted startInjectUnlocked ps
) )
runAnnexHook preCommitAnnexHook runAnnexHook preCommitAnnexHook
-- committing changes to a view updates metadata -- committing changes to a view updates metadata