From 6e75bebb7e5f5fa2702e0142198063be4b6444dc Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 9 Feb 2016 14:52:43 -0400 Subject: improve api, removing IO --- doc/design/adjusted_branches.mdwn | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'doc/design/adjusted_branches.mdwn') diff --git a/doc/design/adjusted_branches.mdwn b/doc/design/adjusted_branches.mdwn index 351083d59..299ff62cf 100644 --- a/doc/design/adjusted_branches.mdwn +++ b/doc/design/adjusted_branches.mdwn @@ -187,14 +187,22 @@ like this, at its most simple: data FilterAction = UnchangedFile | UnlockFile | HideFile | RenameFile FilePath FilePath - applyFilter :: Filter -> FilePath -> Annex FilterAction + data FileInfo = FileInfo + { originalBranchFile :: FileStatus + , worktreeFile :: Maybe FileStatus + , isContentPresent :: Bool + } - -- Look at current state of file and get the FilterAction that + data FileStatus = IsAnnexSymlink | IsAnnexPointer + + applyFilter :: Filter -> FilePath -> FileInfo -> FilterAction + + -- Look at the current state of file and get the FilterAction that -- would have led to this state. - reverseFilter :: Filter -> FilePath -> Annex FilterAction + reverseFilter :: Filter -> FilePath -> FileInfo -> FilterAction applyFilterAction :: FilePath -> FilterAction -> Annex Bool -- Generate a version of the original commit with the filtering of -- modified files reversed. - reverseFilterActions :: [(FilePath, FilterAction)] -> Git.Commit -> Annex Git.Commit + reverseFilterActions :: [(FilePath, FilterAction)] -> Git.Commit -> Git.Commit -- cgit v1.2.3