On 23.04.2015 16:01, Branko Čibej wrote:
On 22.04.2015 20:28, Marc Strapetz wrote:
Using copy with the new metadataOnly option (through the API) only
allows to "move" or "copy" a missing file onto an unversioned file. It
could also be helpful to copy/move metadata from a removed (or
replaced) source to an already added (or replaced) target.
Use case 1: the user has removed file "a" and moved file "b" to file
"a" without using SVN:
$ svn status
M a
! b
Goal is to preserve "b"'s history for the new "a" and have the history
of the old "a" being ended. With metadataOnly being more tolerant,
this could then be done by:
$ svn rm --keep-local a
$ svn add a
$ svn cp --metadata-only b a
What happens if you do (the API equivalent of):
$ svn cp --metadata-only b@BASE a
Brane, I guess this is a question of what happens currently, not a
counter-example which would result in problems?
I've tried now with following JavaHL code, but the problem remains the
same (problem is that the target file already exists):
client.remove(
Collections.singleton(a.getAbsolutePath()), false, true,
null, null, null);
client.add(a.getAbsolutePath(), Depth.empty, false, false, false, true);
client.copy(
Collections.singletonList(new CopySource(b.getAbsolutePath(),
Revision.BASE, Revision.BASE)),
a.getAbsolutePath(), false, true, true, true, false, null,
null, null, null);
Output:
Exception in thread "main" org.apache.subversion.javahl.ClientException:
Entry already exists
svn: Path 'D:\svntest\small\a.txt' already exists
at org.apache.subversion.javahl.SVNClient.copy(Native Method)
-Marc