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

Merging branch into trunk

From: <Steve.Nelson_at_uk.delarue.com>
Date: 2006-12-20 17:00:01 CET

 

> -----Original Message-----
> From: Chris.Fouts@qimonda.com [mailto:Chris.Fouts@qimonda.com]
> here's the correct chronological order of branching/merging/tagging,
using your scenario

Aside from tagging, which I've paused on at present, here's what I've
done now:

1) Create a branch from trunk

$ svn info https://svntest/repos/devrep/dlr/trunk/dxbdpro.p | grep -i
revision
Revision: 31

$ svn mkdir --username nelsonst
https://svntest/repos/devrep/dlr/branches/SC1975 -m "Creating SC1975
branch"

Committed revision 32.

bash-3.00 $ svn copy https://svntest/repos/devrep/dlr/trunk/dxbdpro.p
https://svntest/repos/devrep/dlr/branches/SC1975 -m "Copying dxbdpro.p
to SC1975"

Committed revision 33.

bash-3.00 $ svn co https://svntest/repos/devrep/dlr/branches/SC1975
A SC1975/dxbdpro.p
Checked out revision 33.

$ echo "/* Comment by nelson for SC1975 */" >> SC1975/dxbdpro.p

bash-3.00 $ cd SC1975/
bash-3.00 $ svn commit -m "Commited comment for sc1975"
Sending dxbdpro.p
Transmitting file data .
Committed revision 34.

2) New user creates another branch of the same trunk code in the
same way, but to SC1976.

User adds a comment to the code and commits:

bash-3.1$ echo "/* Darryl's comment for sc1976 */" >> dxbdpro.p
bash-3.1$ svn commit -m "Added Darryl's comment"
Sending dxbdpro.p
Transmitting file data .
Committed revision 37.

3) While Darryl was doing this, Nelson does a merge:

bash-3.00 $ cd trunk/
bash-3.00 $ svn update
At revision 34.
bash-3.00 $ svn merge
https://svntest/repos/devrep/dlr/trunk/dxbdpro.p@29
https://svntest/repos/devrep/dlr/branches/SC1975/dxbdpro.p
U dxbdpro.p

And then commits:

bash-3.00 $ svn commit -m "commiting merge of sc1975 and trunk"
Sending dxbdpro.p
Transmitting file data .
Committed revision 38.

4) Now the second user tries to do the same.

bash-3.1$ cd trunk/
bash-3.1$ svn update
U dxbdpro.p
Updated to revision 38.
bash-3.1$ svn merge https://svntest/repos/devrep/dlr/trunk/dxbdpro.p@34
https://svntest/repos/devrep/dlr/branches/SC1976/dxbdpro.p
C dxbdpro.p

Aha! A conflict, as expected.

bash-3.1$ svn commit -m "trying to merge sc1976 into trunk"
svn: Commit failed (details follow):
svn: Aborting commit: '/cygdrive/d/Subversion/trunk/dxbdpro.p' remains
in conflict

Now resolve the conflict:

bash-3.1$ ls -1 | grep -Ei 'merge|work'
dxbdpro.p.merge-left.r34
dxbdpro.p.merge-right.r38
dxbdpro.p.working

We can examine these files to see the source of the conflict.

We can also use the subverison diff command:

bash-3.1$ svn diff dxbdpro.p ../SC1976/dxbdpro.p
Index: dxbdpro.p
===================================================================
--- dxbdpro.p (revision 38)
+++ dxbdpro.p (working copy)
@@ -1392,4 +1392,8 @@
 
    return "".
 end.
+<<<<<<< .working
 /* Comment by nelson for SC1975 */
+=======
+/* Darryl's comment for sc1976 */
+>>>>>>> .merge-right.r38

Using this intelligence, we can modify our own copy, to ensure that
there is no conflict. In this case, we can have both Darryl and
Nelson's comments.

So edit SC1976/dxbdpro.p and ensure we have 2 comments.

bash-3.1$ svn commit -m "resolved conflict by having 2 comments"
Sending dxbdpro.p
Transmitting file data .
Committed revision 39.

Try to merge now:

bash-3.1$ cd ../trunk/
bash-3.1$ svn merge https://svntest/repos/devrep/dlr/trunk/dxbdpro.p@34
https://svntest/repos/devrep/dlr/branches/SC1976/dxbdpro.p
C dxbdpro.p
bash-3.1$ svn merge https://svntest/repos/devrep/dlr/trunk/dxbdpro.p
https://svntest/repos/devrep/dlr/branches/SC1976/dxbdpro.p
C dxbdpro.p
bash-3.1$ svn merge https://svntest/repos/devrep/dlr/trunk/dxbdpro.p@38
https://svntest/repos/devrep/dlr/branches/SC1976/dxbdpro.p
C dxbdpro.p
bash-3.1$ svn commit
svn: Commit failed (details follow):
svn: Aborting commit: '/cygdrive/d/Subversion/trunk/dxbdpro.p' remains
in conflict

I thought I had resolved the conflict. Am confused now - what have I
missed?

S.

**********************************************************************
This e-mail and any files attached are strictly confidential, may be legally privileged
and are intended solely for the addressee. If you are not the intended recipient, note
that any disclosure, copying, distribution, or use of the contents of this message and
attachments is strictly prohibited. Please notify the sender immediately by return email,
phone or fax and then delete the e-mail and any attachments immediately. The views
and or opinions expressed in this e-mail are not necessarily the views of De La Rue plc
or any of its subsidiaries and the De La Rue Group of companies, their directors,
officers and employees make no representation about and accept no liability for its
accuracy or completeness. Please ensure you have adequate virus protection before
you open any attachment as the De La Rue Group of companies do not accept liability
 for any viruses.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Dec 20 17:01:11 2006

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.