in unexport, check for annexobjects presence before updating location log
The key may still be in the annexobjects location.
This commit is contained in:
parent
069d90eab5
commit
c4352adf6a
2 changed files with 17 additions and 6 deletions
|
@ -1,6 +1,6 @@
|
||||||
{- git-annex command
|
{- git-annex command
|
||||||
-
|
-
|
||||||
- Copyright 2017-2023 Joey Hess <id@joeyh.name>
|
- Copyright 2017-2024 Joey Hess <id@joeyh.name>
|
||||||
-
|
-
|
||||||
- Licensed under the GNU AGPL version 3 or higher.
|
- Licensed under the GNU AGPL version 3 or higher.
|
||||||
-}
|
-}
|
||||||
|
@ -21,6 +21,7 @@ import Git.Types
|
||||||
import Git.FilePath
|
import Git.FilePath
|
||||||
import Git.Sha
|
import Git.Sha
|
||||||
import qualified Remote
|
import qualified Remote
|
||||||
|
import qualified Types.Remote as Remote
|
||||||
import Types.Remote
|
import Types.Remote
|
||||||
import Types.Export
|
import Types.Export
|
||||||
import Annex.Export
|
import Annex.Export
|
||||||
|
@ -29,6 +30,7 @@ import Annex.Transfer
|
||||||
import Annex.CatFile
|
import Annex.CatFile
|
||||||
import Annex.FileMatcher
|
import Annex.FileMatcher
|
||||||
import Annex.RemoteTrackingBranch
|
import Annex.RemoteTrackingBranch
|
||||||
|
import Annex.SpecialRemote.Config
|
||||||
import Logs.Location
|
import Logs.Location
|
||||||
import Logs.Export
|
import Logs.Export
|
||||||
import Logs.PreferredContent
|
import Logs.PreferredContent
|
||||||
|
@ -387,7 +389,15 @@ cleanupUnexport r db eks loc = do
|
||||||
concat <$> forM eks (getExportedLocation db)
|
concat <$> forM eks (getExportedLocation db)
|
||||||
when (null remaininglocs) $
|
when (null remaininglocs) $
|
||||||
forM_ eks $ \ek ->
|
forM_ eks $ \ek ->
|
||||||
logChange ek (uuid r) InfoMissing
|
-- When annexobject=true, a key that
|
||||||
|
-- was unexported may still be present
|
||||||
|
-- on the remote.
|
||||||
|
if annexObjects (Remote.config r)
|
||||||
|
then tryNonAsync (checkPresent r ek) >>= \case
|
||||||
|
Right False ->
|
||||||
|
logChange ek (uuid r) InfoMissing
|
||||||
|
_ -> noop
|
||||||
|
else logChange ek (uuid r) InfoMissing
|
||||||
|
|
||||||
removeEmptyDirectories r db loc eks
|
removeEmptyDirectories r db loc eks
|
||||||
|
|
||||||
|
|
|
@ -67,12 +67,13 @@ exporttree=yes special remote R.
|
||||||
* A exports tree T1 to R
|
* A exports tree T1 to R
|
||||||
* B pulls from A, so knows R has tree T1
|
* B pulls from A, so knows R has tree T1
|
||||||
* A exports tree T2 to R, which deletes file `foo`. So
|
* A exports tree T2 to R, which deletes file `foo`. So
|
||||||
it is moved to R's .git/annex/objects/
|
it is moved to R's .git/annex/objects. Or, alternatively,
|
||||||
|
`foo` is deleted, and the key is then copied to R again,
|
||||||
|
also to .git/annex/objects.
|
||||||
* B exports tree T2 to R also. So B deletes file `foo`. But it was not
|
* B exports tree T2 to R also. So B deletes file `foo`. But it was not
|
||||||
present anyway. If B then marks the key as not present in R, we will have
|
present anyway. If B then marks the key as not present in R, we will have
|
||||||
lost track of the fact that A moved it to the objects location.
|
lost track of the fact that A moved it to the objects location.
|
||||||
|
|
||||||
So, when calling removeExport, have to also check if the key is present in
|
So, when calling removeExport, have to also check if the key is present in
|
||||||
the objects location. If so, don't record the key as missing. (Or course,
|
the objects location. If so, either don't record the key as missing, or
|
||||||
it already checks if some other exported file also has the content of the
|
also remove from the objects location.
|
||||||
key.)
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue