[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Bugs in svn copy URL1 URL2 WC

From: Julian Foad <julianfoad_at_apache.org>
Date: Fri, 09 Nov 2018 16:22:10 +0000

Some bugs in "svn copy URL1 URL2 WC".
These examples are in a WC checked out from https://svn.apache.org/repos/asf/subversion/trunk

$ svn copy http://svn.apache.org/repos/asf/subversion/README https://svn.apache.org/repos/asf/subversion/site notes/
svn: E170000: Illegal repository URL ''

The problem is in repos_to_wc_copy(): we calculate a 'top_src_url' as the longest common ancestor of the source URLs. When they have no common ancestor (in this example, http: vs. https:), this error results.

$ svn copy https://svn.apache.org/repos/asf/ https://svn.apache.org/repos/infra/ notes/
svn: E170013: Unable to connect to a repository at URL 'https://svn.apache.org/repos'
svn: E175003: The server at 'https://svn.apache.org/repos' does not support the HTTP/DAV protocol

A similar failure mode. In this example, the longest common ancestor is a valid URL but is not a repository.

$ svn cp ^/apr/examples ^/subversion/README notes/
A notes/examples/trunk
A ...
svn: E170000: 'https://svn.apache.org/repos/asf/subversion/README' isn't a child of session URL 'https://svn.apache.org/repos/asf/apr/examples'

This example fails after copying the first source, because repos_to_wc_copy_single() has re-parented the session to point to the URL it used, and the caller didn't expect that.


For the first two cases, I propose that svn should require the copy sources are all in the same repository, and error out if not. And document the requirement in the API docs and 'svn help copy'.

For the third case, I propose we should fix the bug.

All these cases need tests.

- Julian
Received on 2018-11-09 17:22:18 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.