From 3729ee0549993ccb648b7f798c9c400661350cdf Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 7 Jan 2016 14:21:12 -0400 Subject: migrate: Copy over metadata to new key. --- Annex/MetaData.hs | 2 +- Command/Migrate.hs | 4 +++- debian/changelog | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Annex/MetaData.hs b/Annex/MetaData.hs index 0751bbb49..88415ffde 100644 --- a/Annex/MetaData.hs +++ b/Annex/MetaData.hs @@ -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. -} diff --git a/Command/Migrate.hs b/Command/Migrate.hs index b8d2eea87..ad3a5efa1 100644 --- a/Command/Migrate.hs +++ b/Command/Migrate.hs @@ -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) diff --git a/debian/changelog b/debian/changelog index e5d968d9b..af7bd0753 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Sat, 19 Dec 2015 13:31:17 -0400 -- cgit v1.2.3