add forget command
Works, more or less. --dead is not implemented, and so far a new branch is made, but keys no longer present anywhere are not scrubbed. git annex sync fails to push the synced/git-annex branch after a forget, because it's not a fast-forward of the existing synced branch. Could be fixed by making git-annex sync use assistant-style sync branches.
This commit is contained in:
parent
fcd5c167ef
commit
4a915cd3cd
5 changed files with 51 additions and 5 deletions
|
@ -50,6 +50,9 @@ describeTransition :: Transition -> String
|
|||
describeTransition ForgetGitHistory = "forget git history"
|
||||
describeTransition ForgetDeadRemotes = "forget dead remotes"
|
||||
|
||||
noTransitions :: Transitions
|
||||
noTransitions = S.empty
|
||||
|
||||
addTransition :: POSIXTime -> Transition -> Transitions -> Transitions
|
||||
addTransition ts t = S.insert $ TransitionLine ts t
|
||||
|
||||
|
@ -91,8 +94,7 @@ transitionList = map transition . S.elems
|
|||
|
||||
{- Typically ran with Annex.Branch.change, but we can't import Annex.Branch
|
||||
- here since it depends on this module. -}
|
||||
recordTransition :: (FilePath -> (String -> String) -> Annex ()) -> Transition -> Annex ()
|
||||
recordTransition changer o = do
|
||||
t <- liftIO getPOSIXTime
|
||||
recordTransitions :: (FilePath -> (String -> String) -> Annex ()) -> Transitions -> Annex ()
|
||||
recordTransitions changer t = do
|
||||
changer transitionsLog $
|
||||
showTransitions . addTransition t o . parseTransitionsStrictly "local"
|
||||
showTransitions . S.union t . parseTransitionsStrictly "local"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue