diff --git a/Annex/AdjustedBranch.hs b/Annex/AdjustedBranch.hs index 4ce101d8f9..56a617db44 100644 --- a/Annex/AdjustedBranch.hs +++ b/Annex/AdjustedBranch.hs @@ -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 = diff --git a/Annex/AdjustedBranch/Name.hs b/Annex/AdjustedBranch/Name.hs index 7a1b44d54e..5a85b6ef9a 100644 --- a/Annex/AdjustedBranch/Name.hs +++ b/Annex/AdjustedBranch/Name.hs @@ -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 diff --git a/Annex/Ingest.hs b/Annex/Ingest.hs index e146c4238b..ae430dc89b 100644 --- a/Annex/Ingest.hs +++ b/Annex/Ingest.hs @@ -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 diff --git a/Annex/View.hs b/Annex/View.hs index 482ce17c3a..0f9a759acb 100644 --- a/Annex/View.hs +++ b/Annex/View.hs @@ -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 diff --git a/Command/Adjust.hs b/Command/Adjust.hs index 6e15ef8af9..0bf04b6f70 100644 --- a/Command/Adjust.hs +++ b/Command/Adjust.hs @@ -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" diff --git a/Types/AdjustedBranch.hs b/Types/AdjustedBranch.hs index bad81c50db..3c73d5e06c 100644 --- a/Types/AdjustedBranch.hs +++ b/Types/AdjustedBranch.hs @@ -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