more RawFilePath conversion
451/645
This commit is contained in:
parent
b4b02e4c61
commit
87f91ce563
18 changed files with 57 additions and 56 deletions
|
@ -31,8 +31,8 @@ check = do
|
|||
b <- current_branch
|
||||
when (b == Annex.Branch.name) $ giveup $
|
||||
"cannot uninit when the " ++ Git.fromRef b ++ " branch is checked out"
|
||||
top <- fromRawFilePath <$> fromRepo Git.repoPath
|
||||
currdir <- liftIO getCurrentDirectory
|
||||
top <- fromRepo Git.repoPath
|
||||
currdir <- liftIO R.getCurrentDirectory
|
||||
whenM ((/=) <$> liftIO (absPath top) <*> liftIO (absPath currdir)) $
|
||||
giveup "can only run uninit from the top of the git repository"
|
||||
where
|
||||
|
|
|
@ -50,7 +50,7 @@ perform dest key = do
|
|||
replaceWorkTreeFile (fromRawFilePath dest) $ \tmp ->
|
||||
ifM (inAnnex key)
|
||||
( do
|
||||
r <- linkFromAnnex key tmp destmode
|
||||
r <- linkFromAnnex key (toRawFilePath tmp) destmode
|
||||
case r of
|
||||
LinkAnnexOk -> return ()
|
||||
LinkAnnexNoop -> return ()
|
||||
|
|
|
@ -108,7 +108,7 @@ check file msg a c = do
|
|||
l <- a
|
||||
let unusedlist = number c l
|
||||
unless (null l) $ showLongNote $ msg unusedlist
|
||||
updateUnusedLog file $ M.fromList unusedlist
|
||||
updateUnusedLog (toRawFilePath file) (M.fromList unusedlist)
|
||||
return $ c + length l
|
||||
|
||||
number :: Int -> [a] -> [(Int, a)]
|
||||
|
|
|
@ -43,11 +43,12 @@ seek = withNothing (commandAction start)
|
|||
start :: CommandStart
|
||||
start = do
|
||||
f <- fromRepo gitAnnexTmpCfgFile
|
||||
let f' = fromRawFilePath f
|
||||
createAnnexDirectory $ parentDir f
|
||||
cfg <- getCfg
|
||||
descs <- uuidDescriptions
|
||||
liftIO $ writeFile f $ genCfg cfg descs
|
||||
vicfg cfg f
|
||||
liftIO $ writeFile f' $ genCfg cfg descs
|
||||
vicfg cfg f'
|
||||
stop
|
||||
|
||||
vicfg :: Cfg -> FilePath -> Annex ()
|
||||
|
|
|
@ -19,6 +19,8 @@ import Types.View
|
|||
import Annex.View
|
||||
import Logs.View
|
||||
|
||||
import qualified System.FilePath.ByteString as P
|
||||
|
||||
cmd :: Command
|
||||
cmd = notBareRepo $
|
||||
command "view" SectionMetaData "enter a view branch"
|
||||
|
@ -101,19 +103,19 @@ checkoutViewBranch view mkbranch = do
|
|||
- and this pollutes the view, so remove them.
|
||||
- (However, emptry directories used by submodules are not
|
||||
- removed.) -}
|
||||
top <- liftIO . absPath . fromRawFilePath =<< fromRepo Git.repoPath
|
||||
top <- liftIO . absPath =<< fromRepo Git.repoPath
|
||||
(l, cleanup) <- inRepo $
|
||||
LsFiles.notInRepoIncludingEmptyDirectories [] False
|
||||
[toRawFilePath top]
|
||||
LsFiles.notInRepoIncludingEmptyDirectories [] False [top]
|
||||
forM_ l (removeemptydir top)
|
||||
liftIO $ void cleanup
|
||||
unlessM (liftIO $ doesDirectoryExist here) $ do
|
||||
showLongNote (cwdmissing top)
|
||||
showLongNote (cwdmissing (fromRawFilePath top))
|
||||
return ok
|
||||
where
|
||||
removeemptydir top d = do
|
||||
p <- inRepo $ toTopFilePath d
|
||||
liftIO $ tryIO $ removeDirectory (top </> fromRawFilePath (getTopFilePath p))
|
||||
liftIO $ tryIO $ removeDirectory $
|
||||
fromRawFilePath $ (top P.</> getTopFilePath p)
|
||||
cwdmissing top = unlines
|
||||
[ "This view does not include the subdirectory you are currently in."
|
||||
, "Perhaps you should: cd " ++ top
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue