migrate: Copy over metadata to new key.
This commit is contained in:
parent
66f3fb1ce2
commit
0b59fb423e
3 changed files with 5 additions and 2 deletions
|
@ -30,7 +30,7 @@ import Data.Time.Clock.POSIX
|
||||||
- When the file has been modified, the metadata is copied over
|
- 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
|
- 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
|
- 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.
|
- Also, can generate new metadata, if configured to do so.
|
||||||
-}
|
-}
|
||||||
|
|
|
@ -17,6 +17,7 @@ import Annex.Content
|
||||||
import qualified Command.ReKey
|
import qualified Command.ReKey
|
||||||
import qualified Command.Fsck
|
import qualified Command.Fsck
|
||||||
import qualified Annex
|
import qualified Annex
|
||||||
|
import Logs.MetaData
|
||||||
|
|
||||||
cmd :: Command
|
cmd :: Command
|
||||||
cmd = notDirect $ withGlobalOptions annexedMatchingOptions $
|
cmd = notDirect $ withGlobalOptions annexedMatchingOptions $
|
||||||
|
@ -73,7 +74,8 @@ perform file oldkey oldbackend newbackend = go =<< genkey
|
||||||
| knowngoodcontent = finish newkey
|
| knowngoodcontent = finish newkey
|
||||||
| otherwise = stopUnless checkcontent $ finish newkey
|
| otherwise = stopUnless checkcontent $ finish newkey
|
||||||
checkcontent = Command.Fsck.checkBackend oldbackend oldkey Command.Fsck.KeyLocked $ Just file
|
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
|
next $ Command.ReKey.cleanup file oldkey newkey
|
||||||
genkey = case maybe Nothing (\fm -> fm oldkey newbackend (Just file)) (fastMigrate oldbackend) of
|
genkey = case maybe Nothing (\fm -> fm oldkey newbackend (Just file)) (fastMigrate oldbackend) of
|
||||||
Just newkey -> return $ Just (newkey, True)
|
Just newkey -> return $ Just (newkey, True)
|
||||||
|
|
1
debian/changelog
vendored
1
debian/changelog
vendored
|
@ -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
|
* 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,
|
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.
|
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
|
-- Joey Hess <id@joeyh.name> Sat, 19 Dec 2015 13:31:17 -0400
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue