On Fri, Oct 22, 2010 at 5:08 AM, Mark _ <mark_...@hotmail.com> wrote:

>  Hi all,
>
> I have never understood the proper way to transfer files (or directories)
> between a branch and trunk and vice versa.
>
> Originally I thought the svn copy command was the best command to use, but
> then someone on this forum informed me that instead svn merge should be
> used, so that in the future updates can easily be transferered using svn
> merge again.
>
> The problem is...svn merge doesn't work :(
>
> Consider a very simple scenerio:
> I add a directory called myFeature to branchX.  I then want to copy this
> myFeature directory to trunk.  Using svn copy everything is fine.  But check
> what happens when I try to merge:
>
> $ svn merge http://svn/trunk/myfeat...@head
> http://svn/branches/branchX/myfeat...@1234 .
> svn: '/product/!svn/bc/389517/trunk/myFeature' path not found.
>

You've formatted your merge command incorrectly. Merges are done between
like levels on a tree. You shouldn't try to merge a subdirectory of a branch
with the root of trunk.

So, assuming branchX was created via a 'svn copy trunk branchX' command, and
the myFeature folder was added in r1234, then you would want to do the
following:

$ svn merge -c 1234 http://svn/branches/branchX .

If there were additional revisions that need to come across, then these
would need to be done as well.

Trying to think of the output as 'copy directory myFeature from this branch
to trunk' seems to be causing headaches. Instead, what you're after is 'take
this set of changes from this branch to trunk'.

Regards,
Daniel B.

Reply via email to