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

Re: svn copy twice to same folder creates unexpeted subfolder in destination

From: Nathan Hartman <hartman.nathan_at_gmail.com>
Date: Thu, 7 Nov 2019 09:04:32 -0500

On Thu, Nov 7, 2019 at 8:19 AM Roger Périat <roger.periat_at_bluewin.ch> wrote:

> Hi all
>
> Not sure if this is a bug or not.
>
> Doing a svn copy twice to same destination, does create an unexpected
> subfolder in destination.

It's not a bug. The last component of the destination path for the copy can
be interpreted two ways:

(1) As a new name for the object being copied. This is the case in your
first step:

1) first step
>
> (The tags folder exists and is empty)
>
> svn copy file:///D:/tmp/myrepo/trunk file:///D:/tmp/myrepo/tags/v1 -m
> "this is v1"

Because tmp/myrepo/tags/v1 does not exist yet, this is taken as a "copy and
rename" -- copy trunk to the tags directory and call it v1 instead of trunk.

(2) The other way the last component of the destination path for the copy
can be interpreted is simply as part of the destination path. Because v1
already exists in your second step, the last component of the path (v1) is
not given any special treatment and trunk is copied into the v1 directory.

I hope this (admittedly verbose) explanation makes sense... if not let us
know. :-)

Kind regards,
Nathan
Received on 2019-11-07 15:04:49 CET

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

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