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

Why is merging in Subversion (not) harder than in CVS?

From: Erik Huelsmann <e.huelsmann_at_gmx.net>
Date: 2004-03-21 10:47:30 CET

The last weeks there have been a number of issues about merging being harder
in Subversion than in CVS. Most of them seem to have to do with the ability
to be able to tag or name revisions (in CVS) and calculate differences
between tags.

So I went and did some experiments. The results are shown below. As you can
see, I succeeded in merging from a branch without remembering one revision
number. I suppose the other way around should be possible too.

$ svnadmin create ./repos
$ svn co file://`pwd`/repos wc

# do initial setup
$ cd wc
$ mkdir trunk tags branches tags/{branch_traces,releases}
$ cd trunk
$ echo -e "some \n file \n content" > foo.txt
$ cd ../../
$ svn add wc/*
$ svn ci wc -m "Initial setup"

# the initial content is there now

# setup the branches and tags to trace
# branch development

# tags are setup for braching back to trunk
# the other way around is possible too
# ofcourse

$ svn cp file://`pwd`/repos/{trunk,branches/bar_branch} -m "start or bar
branch"
$ svn cp
file://`pwd`/repos/{branches/bar_branch,tags/branch_traces/bar_last_merge} -m "start"

# branch and tags setup; now setup working copy on branch
$ rm -rf wc
$ svn co file://`pwd`/repos/branches/bar_branch wc
$ cd wc

# edit foo.txt file and checkin
$ echo yo >>foo.txt
$ svn ci -m ""

# switch to trunk and merge
 1039 cd ..
 1040 svn switch file://`pwd`/repos/trunk wc
 1041 cd wc
# svn switch file://`pwd`/../repos/trunk won't work so hop up one level
# and get back after switching.

# do the merge from the branch
$ cd ..
$ svn merge
file:///`pwd`/repos/{tags/branch_traces/bar_last_merge,branches/bar_branch} wc
$ cd wc
# and check the file content
$ cat foo.txt

Hope this helps someone!

bye,

Erik.

-- 
+++ NEU bei GMX und erstmalig in Deutschland: TÜV-geprüfter Virenschutz +++
100% Virenerkennung nach Wildlist. Infos: http://www.gmx.net/virenschutz
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Sun Mar 21 10:47:53 2004

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