diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-02-09 14:59:13 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-02-09 14:59:13 -0400 |
commit | a2c1b753d61a91f25457762fd1ca93f08cf1898d (patch) | |
tree | e73d19f62025f031221ba765448165fc0b0aeaec /doc/design | |
parent | 6e75bebb7e5f5fa2702e0142198063be4b6444dc (diff) |
improve
Diffstat (limited to 'doc/design')
-rw-r--r-- | doc/design/adjusted_branches.mdwn | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/doc/design/adjusted_branches.mdwn b/doc/design/adjusted_branches.mdwn index 299ff62cf..4cbed8701 100644 --- a/doc/design/adjusted_branches.mdwn +++ b/doc/design/adjusted_branches.mdwn @@ -185,7 +185,11 @@ like this, at its most simple: setFilter :: Filter -> Annex () - data FilterAction = UnchangedFile | UnlockFile | HideFile | RenameFile FilePath FilePath + data FilterAction + = UnchangedFile FilePath + | UnlockFile FilePath + | HideFile FilePath + | RenameFile FilePath FilePath data FileInfo = FileInfo { originalBranchFile :: FileStatus @@ -194,15 +198,24 @@ like this, at its most simple: } data FileStatus = IsAnnexSymlink | IsAnnexPointer + deriving (Eq) applyFilter :: Filter -> FilePath -> FileInfo -> FilterAction + applyFilter UnlockFilter f fi + | worktreeFile fi == Just IsAnnexSymlink = UnlockFile f + applyFilter HideMissingFilter f fi + | not (isContentPresent fi) = HideFile f + applyFilter UnlockHideMissingFilter f fi + | not (isContentPresent fi) = HideFile f + | otherwise = applyFilter UnlockFilter f fi + applyFilter _ f _ = UnchangedFile f + + applyFilterAction :: FilePath -> FilterAction -> Annex Bool -- Look at the current state of file and get the FilterAction that -- would have led to this state. 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 -> Git.Commit + -- Generate a version of the commit made on the filter branch + -- with the filtering of modified files reversed. + unfilteredCommit :: Filter -> Git.Commit -> Git.Commit |