You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Erik Huelsmann <e....@gmx.net> on 2004/03/21 09:47:30 UTC

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


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

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

Posted by Erik Huelsmann <e....@gmx.net>.
> Erik, I'd be +1 if you wanted to turn this into a FAQ item.  It *is*,
> in actual fact, a Frequently Asked Question :-).  And your list of
> examples is a good answer.

No problem. Not today though. I'm kind of short on time this week. (Hint to
readers: I accept patches!)

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

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

Posted by kf...@collab.net.
Erik, I'd be +1 if you wanted to turn this into a FAQ item.  It *is*,
in actual fact, a Frequently Asked Question :-).  And your list of
examples is a good answer.

-K

"Erik Huelsmann" <e....@gmx.net> writes:
> 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

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org