registerurl: Check if a remote claims the url, same as addurl does.
This commit is contained in:
parent
432151f966
commit
68edd308af
2 changed files with 7 additions and 1 deletions
|
@ -14,6 +14,7 @@ import Command
|
||||||
import Logs.Web
|
import Logs.Web
|
||||||
import Annex.UUID
|
import Annex.UUID
|
||||||
import Command.FromKey (mkKey)
|
import Command.FromKey (mkKey)
|
||||||
|
import qualified Remote
|
||||||
|
|
||||||
cmd :: Command
|
cmd :: Command
|
||||||
cmd = notDirect $ notBareRepo $
|
cmd = notDirect $ notBareRepo $
|
||||||
|
@ -53,5 +54,9 @@ perform key url = do
|
||||||
|
|
||||||
perform' :: Key -> URLString -> Annex Bool
|
perform' :: Key -> URLString -> Annex Bool
|
||||||
perform' key url = do
|
perform' key url = do
|
||||||
setUrlPresent webUUID key url
|
r <- Remote.claimingUrl url
|
||||||
|
let url' = if Remote.uuid r == webUUID
|
||||||
|
then url
|
||||||
|
else setDownloader url OtherDownloader
|
||||||
|
setUrlPresent (Remote.uuid r) key url'
|
||||||
return True
|
return True
|
||||||
|
|
1
debian/changelog
vendored
1
debian/changelog
vendored
|
@ -10,6 +10,7 @@ git-annex (6.20160115) UNRELEASED; urgency=medium
|
||||||
* addurl --json: Include field for added key (unless the file was
|
* addurl --json: Include field for added key (unless the file was
|
||||||
added directly to git due to annex.largefiles configuration.)
|
added directly to git due to annex.largefiles configuration.)
|
||||||
(Also done by add --json and import --json)
|
(Also done by add --json and import --json)
|
||||||
|
* registerurl: Check if a remote claims the url, same as addurl does.
|
||||||
|
|
||||||
-- Joey Hess <id@joeyh.name> Fri, 15 Jan 2016 14:05:01 -0400
|
-- Joey Hess <id@joeyh.name> Fri, 15 Jan 2016 14:05:01 -0400
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue