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

Re: Howto: Merge Branch Into Trunk

From: Ryan Schmidt <subversion-2008b_at_ryandesign.com>
Date: Thu, 26 Jun 2008 15:20:51 -0500

On Jun 26, 2008, at 03:43, Ali Yakout wrote:

> I'm using svn version 1.4.0 (r21228) and my Project structure looks
> like
> DEMO_PROJECT
> ├───branches
> │ ├───ali
> │ └───sally
> ├───tags
> └───trunk
>
> I do merge as follows, I checked out the project "demo_project",
> and create a copy of the trunk to branch ali and branch sally.
> I modify files under the 2 branches, and commit.
> Now I try to merge,
>
> ali_at_linux-yfg0:~/svn/demo_project/trunk> cat myfile.txt
> Original file
> ali_at_linux-yfg0:~/svn/demo_project/trunk> cd ../branches/ali
> ali_at_linux-yfg0:~/svn/demo_project/branches/ali> vi myfile.txt
> ali_at_linux-yfg0:~/svn/demo_project/branches/ali> cat myfile.txt
> Original file
> Added by Ali
> ali_at_linux-yfg0:~/svn/demo_project/branches/ali> svn commit -m
> "Modified"
> Sending ali/myfile.txt
> Transmitting file data .
> Committed revision 540.
> ali_at_linux-yfg0:~/svn/demo_project/branches/ali> cd ../sally/
> ali_at_linux-yfg0:~/svn/demo_project/branches/sally> vi myfile.txt
> ali_at_linux-yfg0:~/svn/demo_project/branches/sally> svn commit -m
> "Modified"
> Sending sally/myfile.txt
> Transmitting file data .
> Committed revision 541.
> ali_at_linux-yfg0:~/svn/demo_project/branches/sally> svn log --stop-on-
> copy
> ----------------------------------------------------------------------
> --
> r539 | ealiyak | 2008-06-26 11:14:34 +0300 (Thu, 26 Jun 2008) | 1 line
>
>
> ----------------------------------------------------------------------
> --
> ali_at_linux-yfg0:~/svn/demo_project/branches/sally> cd ../../trunk/
> ali_at_linux-yfg0:~/svn/demo_project/trunk> svn update
> At revision 541.
> ali_at_linux-yfg0:~/svn/demo_project/trunk> svn merge -r 539:541 svn
> +ssh://ealiyak@cas/usr/local/svn/cacrepos/demo_project/branches/sally
> U myfile.txt
> ali_at_linux-yfg0:~/svn/demo_project/trunk> svn commit -m "Commit
> Sally changes"
> Sending trunk/myfile.txt
> Transmitting file data .
> Committed revision 542.
> ali_at_linux-yfg0:~/svn/demo_project/trunk> cd ../branches/ali/
> ali_at_linux-yfg0:~/svn/demo_project/branches/ali> svn log --stop-on-copy
> ----------------------------------------------------------------------
> --
> r538 | ealiyak | 2008-06-26 11:13:57 +0300 (Thu, 26 Jun 2008) | 1 line
>
>
> ----------------------------------------------------------------------
> --
> ali_at_linux-yfg0:~/svn/demo_project/branches/ali> cd ../../trunk/
> ali_at_linux-yfg0:~/svn/demo_project/trunk> svn update
> At revision 542.
> ali_at_linux-yfg0:~/svn/demo_project/trunk> svn merge -r 538:542 svn
> +ssh://ealiyak@cas/usr/local/svn/cacrepos/demo_project/branches/ali
> C myfile.txt
> ali_at_linux-yfg0:~/svn/demo_project/trunk> ls
> myfile.txt myfile.txt.merge-left.r538 myfile.txt.merge-
> right.r542 myfile.txt.working
> ali_at_linux-yfg0:~/svn/demo_project/trunk> more *
> ::::::::::::::
> myfile.txt
> ::::::::::::::
> <<<<<<< .working
> Original file - Added by sally
> =======
> Original file
> Added by Ali
> >>>>>>> .merge-right.r542
> ::::::::::::::
> myfile.txt.merge-left.r538
> ::::::::::::::
> Original file
> ::::::::::::::
> myfile.txt.merge-right.r542
> ::::::::::::::
> Original file
> Added by Ali
> ::::::::::::::
> myfile.txt.working
> ::::::::::::::
> Original file - Added by sally
> ali_at_linux-yfg0:~/svn/demo_project/trunk>
>
>
> I had a conflict in "C myfile.txt", instead I wanted to merge Ali
> and Sally work!
>
> How can I merge the changes made by Ali and Sally in their branches?

Everything looks correct. A conflict occurred in this case because
Ali and Sally both modified the same part of the same file and
Subversion doesn't know what to do with that. You must now manually
merge this file. Open Ali's file and Sally's file and examine them
and open the original file incorporate both of their changes. A diff3
tool can help you with this.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-06-26 22:21:21 CEST

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.