rename stuff for v5 unlocked files to indicate it's old
authorJoey Hess <joeyh@joeyh.name>
Tue, 15 Dec 2015 18:08:07 +0000 (14:08 -0400)
committerJoey Hess <joeyh@joeyh.name>
Tue, 15 Dec 2015 18:08:07 +0000 (14:08 -0400)
CmdLine/Seek.hs
Command/Add.hs
Command/Lock.hs
Command/PreCommit.hs

index f4ac4dfada01626ccc8d4232bd95a9f10d8ffc1e..e6ee6f3fe46ee398873d87ad0948d095d1a02bf9 100644 (file)
@@ -119,25 +119,25 @@ withFilesToBeCommitted :: (FilePath -> CommandStart) -> CmdParams -> CommandSeek
 withFilesToBeCommitted a params = seekActions $ prepFiltered a $
        seekHelper LsFiles.stagedNotDeleted params
 
-withFilesUnlocked :: (FilePath -> CommandStart) -> CmdParams -> CommandSeek
-withFilesUnlocked = withFilesUnlocked' LsFiles.typeChanged
+withFilesOldUnlocked :: (FilePath -> CommandStart) -> CmdParams -> CommandSeek
+withFilesOldUnlocked = withFilesOldUnlocked' LsFiles.typeChanged
 
-withFilesUnlockedToBeCommitted :: (FilePath -> CommandStart) -> CmdParams -> CommandSeek
-withFilesUnlockedToBeCommitted = withFilesUnlocked' LsFiles.typeChangedStaged
+withFilesOldUnlockedToBeCommitted :: (FilePath -> CommandStart) -> CmdParams -> CommandSeek
+withFilesOldUnlockedToBeCommitted = withFilesOldUnlocked' LsFiles.typeChangedStaged
 
 {- Unlocked files before v6 have changed type from a symlink to a regular file.
  -
  - Furthermore, unlocked files used to be a git-annex symlink,
  - not some other sort of symlink.
  -}
-withFilesUnlocked' :: ([FilePath] -> Git.Repo -> IO ([FilePath], IO Bool)) -> (FilePath -> CommandStart) -> CmdParams -> CommandSeek
-withFilesUnlocked' typechanged a params = seekActions $
+withFilesOldUnlocked' :: ([FilePath] -> Git.Repo -> IO ([FilePath], IO Bool)) -> (FilePath -> CommandStart) -> CmdParams -> CommandSeek
+withFilesOldUnlocked' typechanged a params = seekActions $
        prepFiltered a unlockedfiles
   where
-       unlockedfiles = filterM isUnlocked =<< seekHelper typechanged params
+       unlockedfiles = filterM isOldUnlocked =<< seekHelper typechanged params
 
-isUnlocked :: FilePath -> Annex Bool
-isUnlocked f = liftIO (notSymlink f) <&&> 
+isOldUnlocked :: FilePath -> Annex Bool
+isOldUnlocked f = liftIO (notSymlink f) <&&> 
        (isJust <$> catKeyFile f <||> isJust <$> catKeyFileHEAD f)
 
 {- Finds files that may be modified. -}
index 948a0d94cb57904772883c1e3630b1c6c3f39e6b..a0bcf789e507b04901793badfdc8d2579cda4819 100644 (file)
@@ -69,7 +69,7 @@ seek o = allowConcurrentOutput $ do
        ifM isDirect
                ( go withFilesMaybeModified
                , unlessM versionSupportsUnlockedPointers $
-                       go withFilesUnlocked
+                       go withFilesOldUnlocked
                )
 
 {- Pass file off to git-add. -}
index 3eceaefe4d44f453410fb456bce45ca46c474fdf..16ddce94248f0e5b8d5eb6c5de0132c452fc208c 100644 (file)
@@ -32,8 +32,8 @@ seek :: CmdParams -> CommandSeek
 seek ps = ifM versionSupportsUnlockedPointers
        ( withFilesInGit (whenAnnexed startNew) ps
        , do
-               withFilesUnlocked startOld ps
-               withFilesUnlockedToBeCommitted startOld ps
+               withFilesOldUnlocked startOld ps
+               withFilesOldUnlockedToBeCommitted startOld ps
        )
 
 startNew :: FilePath -> Key -> CommandStart
index b6f52d01c243f3e16844497ce1c2b0596c2bf7cd..71a9f86f8c245fe276ccae11d404cb88a34fb93f 100644 (file)
@@ -46,7 +46,7 @@ seek ps = lockPreCommitHook $ ifM isDirect
                ifM (liftIO Git.haveFalseIndex)
                        ( do
                                (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."
                                void $ liftIO cleanup
                        , do
@@ -58,7 +58,7 @@ seek ps = lockPreCommitHook $ ifM isDirect
                                -- (not needed when repo version uses
                                -- unlocked pointer files)
                                unlessM versionSupportsUnlockedPointers $
-                                       withFilesUnlockedToBeCommitted startInjectUnlocked ps
+                                       withFilesOldUnlockedToBeCommitted startInjectUnlocked ps
                        )
                runAnnexHook preCommitAnnexHook
                -- committing changes to a view updates metadata