summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Command/Migrate.hs4
-rw-r--r--debian/changelog2
-rw-r--r--doc/git-annex.mdwn1
3 files changed, 6 insertions, 1 deletions
diff --git a/Command/Migrate.hs b/Command/Migrate.hs
index 46c0eb675..6ffe354d5 100644
--- a/Command/Migrate.hs
+++ b/Command/Migrate.hs
@@ -16,6 +16,7 @@ import Types.KeySource
import Annex.Content
import qualified Command.ReKey
import qualified Command.Fsck
+import qualified Annex
cmd :: [Command]
cmd = [notDirect $ withOptions annexedMatchingOptions $
@@ -27,13 +28,14 @@ seek = withFilesInGit $ whenAnnexed start
start :: FilePath -> Key -> CommandStart
start file key = do
+ forced <- Annex.getState Annex.force
v <- Backend.getBackend file key
case v of
Nothing -> stop
Just oldbackend -> do
exists <- inAnnex key
newbackend <- choosebackend =<< chooseBackend file
- if (newbackend /= oldbackend || upgradableKey oldbackend key) && exists
+ if (newbackend /= oldbackend || upgradableKey oldbackend key || forced) && exists
then do
showStart "migrate" file
next $ perform file key oldbackend newbackend
diff --git a/debian/changelog b/debian/changelog
index 2cd3cdb70..fe164a81a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,8 @@ git-annex (5.20150318) UNRELEASED; urgency=medium
to be present on a remote.
* Added a post-update-annex hook, which is run after the git-annex branch
is updated. Needed for git update-server-info.
+ * migrate: --force will force migration of keys already using the
+ destination backend. Useful in rare cases.
-- Joey Hess <id@joeyh.name> Thu, 19 Mar 2015 17:05:32 -0400
diff --git a/doc/git-annex.mdwn b/doc/git-annex.mdwn
index 8e56f42b5..6ced5c40b 100644
--- a/doc/git-annex.mdwn
+++ b/doc/git-annex.mdwn
@@ -868,6 +868,7 @@ subdirectories).
Normally, nothing will be done to files already using the new backend.
However, if a backend changes the information it uses to construct a key,
this can also be used to migrate files to use the new key format.
+ (To force migration of keys already using the new backend, use --force.)
* `reinject src dest`