migrate: Copy over metadata to new key.

This commit is contained in:
Joey Hess 2016-01-07 14:21:12 -04:00
parent 66f3fb1ce2
commit 0b59fb423e
Failed to extract signature
3 changed files with 5 additions and 2 deletions

View file

@ -30,7 +30,7 @@ import Data.Time.Clock.POSIX
- When the file has been modified, the metadata is copied over
- from the old key to the new key. Note that it looks at the old key as
- committed to HEAD -- the new key may or may not have already been staged
- in th annex.
- in the index.
-
- Also, can generate new metadata, if configured to do so.
-}

View file

@ -17,6 +17,7 @@ import Annex.Content
import qualified Command.ReKey
import qualified Command.Fsck
import qualified Annex
import Logs.MetaData
cmd :: Command
cmd = notDirect $ withGlobalOptions annexedMatchingOptions $
@ -73,7 +74,8 @@ perform file oldkey oldbackend newbackend = go =<< genkey
| knowngoodcontent = finish newkey
| otherwise = stopUnless checkcontent $ finish newkey
checkcontent = Command.Fsck.checkBackend oldbackend oldkey Command.Fsck.KeyLocked $ Just file
finish newkey = stopUnless (Command.ReKey.linkKey oldkey newkey) $
finish newkey = stopUnless (Command.ReKey.linkKey oldkey newkey) $ do
copyMetaData oldkey newkey
next $ Command.ReKey.cleanup file oldkey newkey
genkey = case maybe Nothing (\fm -> fm oldkey newbackend (Just file)) (fastMigrate oldbackend) of
Just newkey -> return $ Just (newkey, True)

1
debian/changelog vendored
View file

@ -43,6 +43,7 @@ git-annex (6.20151219) UNRELEASED; urgency=medium
* unused: Bug fix when a new file was added to the annex, and then
removed (but not git rmed). git still has the add staged in this case,
so the content should not be unused and was wrongly treated as such.
* migrate: Copy over metadata to new key.
-- Joey Hess <id@joeyh.name> Sat, 19 Dec 2015 13:31:17 -0400