I have a normal SVN structure:
http://server/DEV/Project/trunk
http://server/DEV/Project/branches
I then branch off with the following command:
svn copy -m "message" "http://server/DEV/Project/trunk@123" "http://server/DEV/Project/branches/rel123"
Everything works great, and the content of /trunk@123
is placed under the new branch path /branches/rel123
. All good.
Added : /DEV/Project/branches/rel123 (Copy from path: /DEV/Project/trunk, Revision, 123)
If someone accidentally executes the branch off again, I expect it to fail with "svn: E160020: Path 'rel123' already exists". However it does not fail.
Repeating the same svn copy
command in-fact copies the /trunk
to /branches/rel123/trunk
Added : /DEV/Project/branches/rel123/trunk (Copy from path: /DEV/Project/trunk, Revision, 123)
So now, I end up with /branches/rel123
that contains all the files off the trunk, plus the extra folder "trunk" (/branches/rel123/trunk
) that also contains all the same files off the trunk.
I've tried terminating the paths to force SVN to understand this is the absolute directory name, but no luck (i've stripped out http://server
part in below examples)
svn copy -m "message" "/DEV/Project/trunk@123/" "/DEV/Project/branches/rel123"
svn copy -m "message" "/DEV/Project/trunk/@123" "/DEV/Project/branches/rel123"
svn copy -m "message" "/DEV/Project/trunk@123" "/DEV/Project/branches/rel123/"
svn copy -m "message" "/DEV/Project/trunk@123/" "/DEV/Project/branches/rel123/"
svn copy -m "message" "/DEV/Project/trunk/@123" "/DEV/Project/branches/rel123/"
Anyone experiencing this? Is this a known issue? Any workarounds to prevent this "branch inside a branch" mistake?
It's a feature. It lets you do things like:
svn move *.txt docs
to put all .txt files into a subdirectory.
This mirrors how any shell's "mv" or "move" or "cp" or "copy" or "xcopy" or "robocopy" command works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With