diff options
author | Joey Hess <joey@kitenet.net> | 2014-02-18 21:02:27 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2014-02-18 21:09:25 -0400 |
commit | d8cc840cc7fd9d543486b7a86426eb4bc444b5aa (patch) | |
tree | a524b4d7ff9c24e0839beec5546e4a4a40cf7166 /Logs | |
parent | 935f5ed55b1ed9a218955fdd34cb40db3b1c9425 (diff) |
fixed vpop
Diffstat (limited to 'Logs')
-rw-r--r-- | Logs/View.hs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Logs/View.hs b/Logs/View.hs index 9739992ae..cb1e33125 100644 --- a/Logs/View.hs +++ b/Logs/View.hs @@ -12,6 +12,7 @@ module Logs.View ( currentView, setView, + removeView, recentViews, branchView, prop_branchView_legal, @@ -40,9 +41,16 @@ parseLog s = setView :: View -> Annex () setView v = do - l <- take 99 . filter (/= v) <$> recentViews + old <- take 99 . filter (/= v) <$> recentViews + writeViews (v : old) + +writeViews :: [View] -> Annex () +writeViews l = do f <- fromRepo gitAnnexViewLog - liftIO $ viaTmp writeFile f $ unlines $ map showLog (v : l) + liftIO $ viaTmp writeFile f $ unlines $ map showLog l + +removeView :: View -> Annex () +removeView v = writeViews =<< filter (/= v) <$> recentViews recentViews :: Annex [View] recentViews = do |