From ec169f84b1cc140b6d4c316fbd0e8407297d038a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 15 Oct 2011 16:36:56 -0400 Subject: migrate: Copy url logs for keys when migrating. --- Command/Migrate.hs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Command/Migrate.hs') diff --git a/Command/Migrate.hs b/Command/Migrate.hs index 23ed6fd16..8167ac96e 100644 --- a/Command/Migrate.hs +++ b/Command/Migrate.hs @@ -14,6 +14,7 @@ import qualified Types.Key import Annex.Content import qualified Command.Add import Backend +import Logs.Web command :: [Command] command = [repoCommand "migrate" paramPaths seek @@ -65,6 +66,14 @@ perform file oldkey newbackend = do then do -- Update symlink to use the new key. liftIO $ removeFile file + + -- If the old key had some + -- associated urls, record them for + -- the new key as well. + urls <- getUrls oldkey + when (not $ null urls) $ + mapM_ (setUrlPresent newkey) urls + next $ Command.Add.cleanup file newkey True else stop where -- cgit v1.2.3