Bugs in svn copy URL1 URL2 WC

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Bugs in svn copy URL1 URL2 WC

Julian Foad-5
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