aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-01-07 14:21:12 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-01-07 14:21:12 -0400
commit3729ee0549993ccb648b7f798c9c400661350cdf (patch)
tree2aa2ca2dfb48b0724bf1bb6fde4040e9d06fdcc9
parent4a05793349c55477cde81455810bfe57444ae9bf (diff)
migrate: Copy over metadata to new key.
-rw-r--r--Annex/MetaData.hs2
-rw-r--r--Command/Migrate.hs4
-rw-r--r--debian/changelog1
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 <id@joeyh.name> Sat, 19 Dec 2015 13:31:17 -0400