summaryrefslogtreecommitdiff
path: root/Command/Migrate.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Command/Migrate.hs')
-rw-r--r--Command/Migrate.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/Command/Migrate.hs b/Command/Migrate.hs
index 87e4772d1..f0100cdc2 100644
--- a/Command/Migrate.hs
+++ b/Command/Migrate.hs
@@ -18,6 +18,8 @@ import qualified Command.ReKey
import qualified Command.Fsck
import qualified Annex
import Logs.MetaData
+import Logs.Web
+import qualified Remote
cmd :: Command
cmd = notDirect $ withGlobalOptions annexedMatchingOptions $
@@ -77,6 +79,12 @@ perform file oldkey oldbackend newbackend = go =<< genkey
finish newkey = ifM (Command.ReKey.linkKey file oldkey newkey)
( do
copyMetaData oldkey newkey
+ -- If the old key had some associated urls, record them for
+ -- the new key as well.
+ urls <- getUrls oldkey
+ forM_ urls $ \url -> do
+ r <- Remote.claimingUrl url
+ setUrlPresent (Remote.uuid r) newkey url
next $ Command.ReKey.cleanup file oldkey newkey
, error "failed"
)