diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-01-07 18:06:20 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-01-07 18:06:20 -0400 |
commit | f77724a9d76f15c20497fd42ff5d56c264c6a308 (patch) | |
tree | 4ffe059d0e21bb06a8e460022cac7574d9033bf5 /Command | |
parent | 11c1bf9924c4ff5945572005529ffdfabf8cf4e9 (diff) |
rekey: No longer copies over urls from the old to the new key.
It makes sense for migrate to do that, but not for this low-level (and
little used) plumbing command to.
Diffstat (limited to 'Command')
-rw-r--r-- | Command/Migrate.hs | 8 | ||||
-rw-r--r-- | Command/ReKey.hs | 9 |
2 files changed, 8 insertions, 9 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" ) diff --git a/Command/ReKey.hs b/Command/ReKey.hs index 468d0dfe6..91329ec82 100644 --- a/Command/ReKey.hs +++ b/Command/ReKey.hs @@ -16,10 +16,8 @@ import Annex.Ingest import Annex.Link import Annex.Perms import Annex.ReplaceFile -import Logs.Web import Logs.Location import Git.FilePath -import qualified Remote import qualified Database.Keys import Annex.InodeSentinal import Utility.InodeCache @@ -93,13 +91,6 @@ linkKey file oldkey newkey = ifM (isJust <$> isAnnexLink file) cleanup :: FilePath -> Key -> Key -> CommandCleanup cleanup file oldkey newkey = do - -- 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 - ifM (isJust <$> isAnnexLink file) ( do -- Update symlink to use the new key. |