better name for LinkPresentAdjustment
This commit is contained in:
parent
4c1b3ca6bb
commit
2c14181bcb
6 changed files with 18 additions and 18 deletions
|
@ -11,7 +11,7 @@ module Annex.AdjustedBranch (
|
|||
Adjustment(..),
|
||||
LinkAdjustment(..),
|
||||
PresenceAdjustment(..),
|
||||
LinkPresentAdjustment(..),
|
||||
LockUnlockPresentAdjustment(..),
|
||||
adjustmentHidesFiles,
|
||||
adjustmentIsStable,
|
||||
OrigBranch,
|
||||
|
@ -88,11 +88,11 @@ instance AdjustTreeItem Adjustment where
|
|||
adjustTreeItem p t >>= \case
|
||||
Nothing -> return Nothing
|
||||
Just t' -> adjustTreeItem l t'
|
||||
adjustTreeItem (LinkPresentAdjustment l) t = adjustTreeItem l t
|
||||
adjustTreeItem (LockUnlockPresentAdjustment l) t = adjustTreeItem l t
|
||||
|
||||
adjustmentIsStable (LinkAdjustment l) = adjustmentIsStable l
|
||||
adjustmentIsStable (PresenceAdjustment p _) = adjustmentIsStable p
|
||||
adjustmentIsStable (LinkPresentAdjustment l) = adjustmentIsStable l
|
||||
adjustmentIsStable (LockUnlockPresentAdjustment l) = adjustmentIsStable l
|
||||
|
||||
instance AdjustTreeItem LinkAdjustment where
|
||||
adjustTreeItem UnlockAdjustment =
|
||||
|
@ -115,7 +115,7 @@ instance AdjustTreeItem PresenceAdjustment where
|
|||
adjustmentIsStable HideMissingAdjustment = False
|
||||
adjustmentIsStable ShowMissingAdjustment = True
|
||||
|
||||
instance AdjustTreeItem LinkPresentAdjustment where
|
||||
instance AdjustTreeItem LockUnlockPresentAdjustment where
|
||||
adjustTreeItem UnlockPresentAdjustment =
|
||||
ifPresent adjustToPointer adjustToSymlink
|
||||
adjustTreeItem LockPresentAdjustment =
|
||||
|
|
|
@ -37,7 +37,7 @@ instance SerializeAdjustment Adjustment where
|
|||
serializeAdjustment p
|
||||
serializeAdjustment (PresenceAdjustment p (Just l)) =
|
||||
serializeAdjustment p <> "-" <> serializeAdjustment l
|
||||
serializeAdjustment (LinkPresentAdjustment l) =
|
||||
serializeAdjustment (LockUnlockPresentAdjustment l) =
|
||||
serializeAdjustment l
|
||||
deserializeAdjustment s =
|
||||
(LinkAdjustment <$> deserializeAdjustment s)
|
||||
|
@ -46,7 +46,7 @@ instance SerializeAdjustment Adjustment where
|
|||
<|>
|
||||
(PresenceAdjustment <$> deserializeAdjustment s <*> pure Nothing)
|
||||
<|>
|
||||
(LinkPresentAdjustment <$> deserializeAdjustment s)
|
||||
(LockUnlockPresentAdjustment <$> deserializeAdjustment s)
|
||||
where
|
||||
(s1, s2) = separate' (== (fromIntegral (ord '-'))) s
|
||||
|
||||
|
@ -68,7 +68,7 @@ instance SerializeAdjustment PresenceAdjustment where
|
|||
deserializeAdjustment "showmissing" = Just ShowMissingAdjustment
|
||||
deserializeAdjustment _ = Nothing
|
||||
|
||||
instance SerializeAdjustment LinkPresentAdjustment where
|
||||
instance SerializeAdjustment LockUnlockPresentAdjustment where
|
||||
serializeAdjustment UnlockPresentAdjustment = "unlockpresent"
|
||||
serializeAdjustment LockPresentAdjustment = "lockpresent"
|
||||
deserializeAdjustment "unlockpresent" = Just UnlockPresentAdjustment
|
||||
|
|
|
@ -359,8 +359,8 @@ addUnlocked matcher mi contentpresent =
|
|||
go (LinkAdjustment UnFixAdjustment) = False
|
||||
go (PresenceAdjustment _ (Just la)) = go (LinkAdjustment la)
|
||||
go (PresenceAdjustment _ Nothing) = False
|
||||
go (LinkPresentAdjustment UnlockPresentAdjustment) = contentpresent
|
||||
go (LinkPresentAdjustment LockPresentAdjustment) = False
|
||||
go (LockUnlockPresentAdjustment UnlockPresentAdjustment) = contentpresent
|
||||
go (LockUnlockPresentAdjustment LockPresentAdjustment) = False
|
||||
|
||||
{- Adds a file to the work tree for the key, and stages it in the index.
|
||||
- The content of the key may be provided in a temp file, which will be
|
||||
|
|
|
@ -513,7 +513,7 @@ applyView'' mkviewedfile getfilemetadata view madj l clean conv = do
|
|||
Nothing -> stagesymlink uh f k
|
||||
Just (LinkAdjustment UnlockAdjustment) ->
|
||||
stagepointerfile uh f k mtreeitemtype
|
||||
Just (LinkPresentAdjustment UnlockPresentAdjustment) ->
|
||||
Just (LockUnlockPresentAdjustment UnlockPresentAdjustment) ->
|
||||
ifM (inAnnex k)
|
||||
( stagepointerfile uh f k mtreeitemtype
|
||||
, stagesymlink uh f k
|
||||
|
|
|
@ -19,7 +19,7 @@ optParser :: CmdParamsDesc -> Parser Adjustment
|
|||
optParser _ =
|
||||
(LinkAdjustment <$> linkAdjustmentParser)
|
||||
<|> (PresenceAdjustment <$> presenceAdjustmentParser <*> maybeLinkAdjustmentParser)
|
||||
<|> (LinkPresentAdjustment <$> linkPresentAdjustmentParser)
|
||||
<|> (LockUnlockPresentAdjustment <$> lockUnlockPresentAdjustmentParser)
|
||||
|
||||
linkAdjustmentParser :: Parser LinkAdjustment
|
||||
linkAdjustmentParser =
|
||||
|
@ -46,8 +46,8 @@ presenceAdjustmentParser =
|
|||
<> help "hide annexed files whose content is not present"
|
||||
)
|
||||
|
||||
linkPresentAdjustmentParser :: Parser LinkPresentAdjustment
|
||||
linkPresentAdjustmentParser =
|
||||
lockUnlockPresentAdjustmentParser :: Parser LockUnlockPresentAdjustment
|
||||
lockUnlockPresentAdjustmentParser =
|
||||
flag' UnlockPresentAdjustment
|
||||
( long "unlock-present"
|
||||
<> help "unlock files whose content is present; lock rest"
|
||||
|
|
|
@ -10,7 +10,7 @@ module Types.AdjustedBranch where
|
|||
data Adjustment
|
||||
= LinkAdjustment LinkAdjustment
|
||||
| PresenceAdjustment PresenceAdjustment (Maybe LinkAdjustment)
|
||||
| LinkPresentAdjustment LinkPresentAdjustment
|
||||
| LockUnlockPresentAdjustment LockUnlockPresentAdjustment
|
||||
deriving (Show, Eq)
|
||||
|
||||
data LinkAdjustment
|
||||
|
@ -25,7 +25,7 @@ data PresenceAdjustment
|
|||
| ShowMissingAdjustment
|
||||
deriving (Show, Eq)
|
||||
|
||||
data LinkPresentAdjustment
|
||||
data LockUnlockPresentAdjustment
|
||||
= UnlockPresentAdjustment
|
||||
| LockPresentAdjustment
|
||||
deriving (Show, Eq)
|
||||
|
@ -41,8 +41,8 @@ instance ReversableAdjustment Adjustment where
|
|||
LinkAdjustment (reverseAdjustment l)
|
||||
reverseAdjustment (PresenceAdjustment p ml) =
|
||||
PresenceAdjustment (reverseAdjustment p) (fmap reverseAdjustment ml)
|
||||
reverseAdjustment (LinkPresentAdjustment l) =
|
||||
LinkPresentAdjustment (reverseAdjustment l)
|
||||
reverseAdjustment (LockUnlockPresentAdjustment l) =
|
||||
LockUnlockPresentAdjustment (reverseAdjustment l)
|
||||
|
||||
instance ReversableAdjustment LinkAdjustment where
|
||||
reverseAdjustment UnlockAdjustment = LockAdjustment
|
||||
|
@ -55,7 +55,7 @@ instance ReversableAdjustment PresenceAdjustment where
|
|||
reverseAdjustment HideMissingAdjustment = ShowMissingAdjustment
|
||||
reverseAdjustment ShowMissingAdjustment = HideMissingAdjustment
|
||||
|
||||
instance ReversableAdjustment LinkPresentAdjustment where
|
||||
instance ReversableAdjustment LockUnlockPresentAdjustment where
|
||||
reverseAdjustment UnlockPresentAdjustment = LockPresentAdjustment
|
||||
reverseAdjustment LockPresentAdjustment = UnlockPresentAdjustment
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue