clean up url removal presence update
* rmurl: Fix a case where removing the last url left git-annex thinking content was still present in the web special remote. * SETURLPRESENT, SETURIPRESENT, SETURLMISSING, and SETURIMISSING used to update the presence information of the external special remote that called them; this was not documented behavior and is no longer done. Done by making setUrlPresent and setUrlMissing only update presence info for the web, and only when the url is a web url. See the comment for reasoning about why that's the right thing to do. In AddUrl, had to make it update location tracking, to handle the non-web-url case. This commit was sponsored by Ewen McNeill on Patreon.
This commit is contained in:
parent
ca66e7b66a
commit
451171b7c1
14 changed files with 77 additions and 26 deletions
|
@ -39,4 +39,4 @@ ok
|
|||
|
||||
[[!meta name=yoh]]
|
||||
|
||||
> closing as yoh says "nothing to fix" [[done]] --[[Joey]]
|
||||
> I think I've now understood and fixed this, so [[done]] --[[Joey]]
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
[[!comment format=mdwn
|
||||
username="joey"
|
||||
subject="""comment 4"""
|
||||
date="2018-10-04T20:20:43Z"
|
||||
content="""
|
||||
I think that making rmurl filter out urls with an OtherDownloader
|
||||
when removing an url claimed by the web is sufficient.
|
||||
Then SETURIPRESENT won't confuse rmurl from the web.
|
||||
|
||||
But what about SETURLPRESENT? Well, that url ought to be a url that can be
|
||||
downloaded by the web special remote. And if the web special remote is marked
|
||||
as present, it will try to download from that url along with whatever other urls
|
||||
are recorded. So, it makes sense for rmurl to treat that url as an indication
|
||||
that the web still has content, when removing some other url.
|
||||
|
||||
But then if an url is added to the web, and then an external special remote
|
||||
uses SETURLPRESENT with another url, and then rmurl removes the first url,
|
||||
and then SETURLMISSING removes the other url, the content will still be marked
|
||||
as present in the web. So it seem that SETURLMISSING should mark the
|
||||
content as not present in the web if that was the last url. (So should other
|
||||
special remotes that remove regular urls, like bittorrent.)
|
||||
|
||||
Currently the content is marked as not present in the remote making the change,
|
||||
which is the wrong thing! (And SETURLPRESENT/SETURIPRESENT mark content
|
||||
as present in the external remote, which also seems unncessary.)
|
||||
|
||||
The remaining case is an rmurl on an url with an OtherDownloader,
|
||||
which is being removed from some other special remote than web, when there are
|
||||
some more urls with OtherDownloader that were set by other special remotes.
|
||||
|
||||
I think that it doesn't actually make sense for rmurl of such an url to
|
||||
mark the content as not being present in the special remote. The user should
|
||||
drop it if they want to remove it from the special remote. It's ok for it to
|
||||
remove the url but not update the presence information.
|
||||
"""]]
|
Loading…
Add table
Add a link
Reference in a new issue