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

Common Use-Cases for Merging

From: Joe <svn_at_freedomcircle.net>
Date: 2004-12-22 05:10:32 CET


Chapter 4 of the SVN book doesn't seem to cover what I think is a common
occurrence: branching back to the trunk a file added in a branch. The
section discusses mostly the use of "svn merge", but that doesn't seem
to allow such an operation. I assume the right command is to use "svn
copy" to propagate the addition (it seems obvious, but maybe not to a

I also have a more complicated scenario. In the branch, I added a new
file by branching it from an existing file in the branch and modifying
it prior to committing. For example, svn copy foo.php bar.php and edit
bar.php prior to svn commit. Now I want to merge bar.php into the trunk.
One option would be to copy foo.php to bar.php in the trunk and then use
svn merge to attempt to apply the changes made in the branch (don't know
if this works). The second option would be to svn copy bar.php directly
from the version in the branch. In the former case, the ancestry of the
trunk bar.php would remain within the trunk, with changes merged from
the branch. In the latter case, the ancestry of the trunk bar.php would be

bar.php (trunk) <- bar.php (branch) <- foo.php (branch) <- foo.php (trunk)

Is there any advantage to doing this one way or the other? Presumably,
foo.php and bar.php will lead separate lives in the future, but since
they still share some (redundant code) it's possible that a change in
one file may have to be replicated to the other three versions.

Incidentally, is there an "error messages explained" somewhere? When I
was trying some of the merge commands I got a "svn: Cannot replace a
directory from within". I did a Google search but none of the results
was very elucidating.


To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Dec 22 05:12:44 2004

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.