I've created SVN-4913 to cover this error.

Current behaviour:

Moving the repo root causes an assert (as in Pavel's initial report):
[[[
$ svn move $REPOURL $REPOURL/SUBDIR -m 'mv root'
svn: E235000: In file '../subversion/libsvn_client/copy.c' line 1187:
assertion failed (! svn_path_is_empty(path))
Aborted
]]]

Moving a directory below the repo root gives a less then clear error
message (A certainly exists in the repository, but not after the move):
[[[
$ svn move $REPOURL/A $REPOURL/A/SUBDIR -m 'mv dir'
svn: E160016: Path 'A' not present
]]]

Thus, moving a directory to its child does not work in either case.

I'm proposing the following fix:
[[[
Index: subversion/libsvn_client/copy.c
===================================================================
--- subversion/libsvn_client/copy.c (revision 1909002)
+++ subversion/libsvn_client/copy.c (working copy)
@@ -3077,7 +3077,7 @@
       APR_ARRAY_PUSH(copy_pairs, svn_client__copy_pair_t *) = pair;
     }

-  if (!srcs_are_urls && !dst_is_url)
+  if (is_move || (!srcs_are_urls && !dst_is_url))
     {
       apr_pool_t *iterpool = svn_pool_create(pool);

]]]
(This basically restores the check for a move to a child directory).

Both test cases now return the same error
[[[
$ svn  move $REPOURL $REPOURL/SUBDIR -m 'mv root'
svn: E200007: Cannot copy path '$REPOURL' into its own child
'$REPOURL/SUBDIR'
$ svn  move $REPOURL/A2 $REPOURL/A/SUBDIR -m 'mv dir'
svn: E200007: Cannot copy path '$REPOURL/A' into its own child
'$REPOURL/A/SUBDIR'
]]]

I believe it is reasonable to change error code as above. Although I
realise it says "copy", should be "move" in the final commit.

Kind regards,
Daniel Sahlberg

>

Reply via email to