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

Re: Can a merge follow changes in paths in trunk/branch?

From: Matt England <mengland_at_mengland.net>
Date: 2006-02-13 06:55:35 CET

Blair et al,

The technique described below worked extremely well for me, and we've
merged my branch back with my trunk. (We haven't gone through all the
builds and regression testing, but that will come in time.)

Thanks for taking the time outline this alternative approach. I think this
saved me a *lot* of time.

-Matt

At 2/10/2006 11:53 PM, Blair Zajac wrote:
>In your case, what I recommend doing is the following. This should
>avoid the use of third party merge tools and be pretty efficient in
>steps.
>
>1) First deciding which way the merge is going (from branch to trunk
>or trunk to branch). For example, here, I'll assume you're going
>from the branch (branches/b1) to the trunk.
>
>2) Do an 'svn log -v' on the source of the merge (branches/b1) and
>noting all of the revisions that changed the contents of the files,
>not any that do any renames. Hopefully, you have no commits that
>rename and change the contents of files.
>
>3) Merge the revisions over that contain file content changes. If
>the changes where made to files, say in 'branches/b1/olddir/file.txt'
>at older revisions, and now you have 'trunk/newdir/file.txt' in the
>target location, you can merge the revision at the level of 'olddir'
>over, not at the 'branches/b1':
>
>cd trunk/newdir
>svn merge -r N:N+n ../../branches/b1/olddir
>
>Ideally, you should be able to pull over large swathes of directories
>and revisions using this technique. You just have to break up
>revision ranges across directory and/or file renames.
>
>BTW, you can merge changes to files even if the files have changed.
>See the transcript below:
>
>Regards,
>Blair
>
>--
>Blair Zajac, Ph.D.
>CTO, OrcaWare Technologies
><blair@orcaware.com>
>Subversion training, consulting and support
>http://www.orcaware.com/svn/
>
>
>
>svnadmin create repos
>svn co file://`pwd`/repos wc
>cd wc/
>svn mkdir trunk
>cd trunk/
>cp /etc/passwd .
>svn add passwd
>cd ..
>svn ci -m ''
>svn mkdir branches
>svn ci -m ''
>svn cp trunk branches/b1
>svn ci -m ''
>cd branches/
>cd b1/
>vi passwd (delete line number 1)
>svn ci -m ''
>svn mv passwd passwd.1
>svn ci -m ''
>cd ../../
>svn update
>cd trunk/
>ls
>vi passwd (delete line number 2)
>svn ci -m ''
>svn update
>cd ..
>svu
>svn update
>cd branches/b1
>svn merge -r 5:6 ../../trunk (this will fail)
>svn merge -r 5:6 ../../trunk/passwd passwd.1 (this will work)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon Feb 13 06:57:15 2006

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