support --unlock-present adjustment of view branches

When generating the view, check if the key is present.

When syncing in a view branch with an adjustment, run adjustedBranchRefreshFull
the same as is done when syncing in other adjusted branches. This is
needed because the docs for git-annex adjust --unlock-present suggest
using git-annex sync to update the branch when annex.adjustedbranchrefresh
is not set.

Note that, with annex.adjustedbranchrefresh set, it just works! The
adjusted branch gets updated in the usual way and it doesn't matter that
there's a view branch underneath.

And of course, re-running git-annex adjut --unlock-present also works,
as suggested in the docs.

Sponsored-by: Erik Bjäreholt on Patreon
This commit is contained in:
Joey Hess 2023-02-27 15:29:28 -04:00
parent 7d839176c3
commit 1c4f4b449a
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
5 changed files with 40 additions and 11 deletions

View file

@ -33,6 +33,7 @@ import Annex.GitOverlay
import Annex.Link
import Annex.CatFile
import Annex.Concurrent
import Annex.Content.Presence
import Logs
import Logs.MetaData
import Logs.View
@ -510,6 +511,15 @@ 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) ->
ifM (inAnnex k)
( stagepointerfile uh f k mtreeitemtype
, stagesymlink uh f k
)
Just (PresenceAdjustment HideMissingAdjustment _) ->
whenM (inAnnex k)
( stagesymlink uh f k
)
_ -> stagesymlink uh f k
stagesymlink uh f k = do