git-annex adjust --lock-missing
Like --hide-missing the branch does not get updated when content availability changes. Seems to basically work, but sync does not update it yet. Also, when a file is present and so unlocked, git mv followed by git-annex sync results in the basis branch being updated to contain the file with the new name, unlocked. This seems different than what happens in an adjusted unlocked branch, where the commit propigates back locked. Probably the reverse adjustment code needs to be improved to handle this case.
This commit is contained in:
parent
81f801c3b4
commit
c8e49c5ef5
6 changed files with 106 additions and 23 deletions
|
@ -1,6 +1,6 @@
|
|||
{- adjusted branch types
|
||||
-
|
||||
- Copyright 2016-2018 Joey Hess <id@joeyh.name>
|
||||
- Copyright 2016-2020 Joey Hess <id@joeyh.name>
|
||||
-
|
||||
- Licensed under the GNU AGPL version 3 or higher.
|
||||
-}
|
||||
|
@ -10,9 +10,9 @@ module Types.AdjustedBranch where
|
|||
data Adjustment
|
||||
= LinkAdjustment LinkAdjustment
|
||||
| PresenceAdjustment PresenceAdjustment (Maybe LinkAdjustment)
|
||||
| LinkMissingAdjustment LinkMissingAdjustment
|
||||
deriving (Show, Eq)
|
||||
|
||||
-- Doesn't make sense to combine unlock with fix.
|
||||
data LinkAdjustment
|
||||
= UnlockAdjustment
|
||||
| LockAdjustment
|
||||
|
@ -25,6 +25,11 @@ data PresenceAdjustment
|
|||
| ShowMissingAdjustment
|
||||
deriving (Show, Eq)
|
||||
|
||||
data LinkMissingAdjustment
|
||||
= LockMissingAdjustment
|
||||
| UnlockMissingAdjustment
|
||||
deriving (Show, Eq)
|
||||
|
||||
-- Adjustments have to be able to be reversed, so that commits made to the
|
||||
-- adjusted branch can be reversed to the commit that would have been made
|
||||
-- without the adjustment and applied to the original branch.
|
||||
|
@ -36,6 +41,8 @@ instance ReversableAdjustment Adjustment where
|
|||
LinkAdjustment (reverseAdjustment l)
|
||||
reverseAdjustment (PresenceAdjustment p ml) =
|
||||
PresenceAdjustment (reverseAdjustment p) (fmap reverseAdjustment ml)
|
||||
reverseAdjustment (LinkMissingAdjustment l) =
|
||||
LinkMissingAdjustment (reverseAdjustment l)
|
||||
|
||||
instance ReversableAdjustment LinkAdjustment where
|
||||
reverseAdjustment UnlockAdjustment = LockAdjustment
|
||||
|
@ -48,6 +55,10 @@ instance ReversableAdjustment PresenceAdjustment where
|
|||
reverseAdjustment HideMissingAdjustment = ShowMissingAdjustment
|
||||
reverseAdjustment ShowMissingAdjustment = HideMissingAdjustment
|
||||
|
||||
instance ReversableAdjustment LinkMissingAdjustment where
|
||||
reverseAdjustment LockMissingAdjustment = UnlockMissingAdjustment
|
||||
reverseAdjustment UnlockMissingAdjustment = LockMissingAdjustment
|
||||
|
||||
adjustmentHidesFiles :: Adjustment -> Bool
|
||||
adjustmentHidesFiles (PresenceAdjustment HideMissingAdjustment _) = True
|
||||
adjustmentHidesFiles _ = False
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue