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

SVN Merging Branches

From: <metricspacess_at_yahoo.com>
Date: Mon, 4 Apr 2011 02:29:41 -0700 (PDT)

Hi guys,

I have just started to use Subversion and I am having some difficulty
with merging. Would anyone be able to help?

I am attempting to create a merge conflict but one is not occurring
where I expect it to. My test case is based on the following set up:

***1. Create repository with the following structure***

- HelloWorldProject\trunk\HelloWorldProject
- HelloWorldProject\branches

***2. Add HelloWorld.java to the trunk:***

[code=java]package org.keane.helloworld;

public class HelloWorld {

        /**
         * @param args
         */
        public static void main(String[] args) {
                System.out.println("Hello World v1.0");
                System.out.println("Hello World v2.0 - change on trunk");
                System.out.println("Hello World v3.0 - change on trunk");
        }
}
[/code]

***3. Create branch from the HEAD of the trunk called BRANCH_01***

My repository structure is now as follows:
- HelloWorldProject\trunk\HelloWorldProject
- HelloWorldProject\branches\BRANCH_01\HelloWorldProject

***4. Modify HelloWorld.java on the branch***

[code=java]package org.keane.helloworld;

public class HelloWorld {

        /**
         * @param args
         */
        public static void main(String[] args) {
                System.out.println("Hello World v1.0 - change from BRANCH_01 for
merge conflict");
                System.out.println("Hello World v2.0 - change on trunk");
                System.out.println("Hello World v3.0 - change on trunk");
                System.out.println("Hello World v3.1 - change on BRANCH_01");
        }
}
[/code]

***5. Modify HelloWorld.java on the trunk to create a conflicting
change***
[code=java]package org.keane.helloworld;

public class HelloWorld {

        /**
         * @param args
         */
        public static void main(String[] args) {
                System.out.println("Hello World v1.0 - change from trunk for merge
conflict");
                System.out.println("Hello World v2.0 - change on trunk");
                System.out.println("Hello World v3.0 - change on trunk");
                System.out.println("Hello World v4.0 - change on trunk");
        }
}
[/code]

***6. Merge the branch into the trunk***

Now I expect these two lines to conflict

TRUNK: System.out.println("Hello World v1.0 - change from trunk for
merge conflict");
BRANCH: System.out.println("Hello World v1.0 - change from BRANCH_01
for merge conflict");

But here is what I get on the TRUNK:
[code=java]package org.keane.helloworld;

public class HelloWorld {

        /**
         * @param args
         */
        public static void main(String[] args) {
                System.out.println("Hello World v1.0 - change from BRANCH_01 for
merge conflict");
                System.out.println("Hello World v2.0 - change on trunk");
                System.out.println("Hello World v3.0 - change on trunk");
                System.out.println("Hello World v3.1 - change on BRANCH_01");
        }
}
[/code]

When I run a diff, here is what I get:

[code]Index: HelloWorldProject/src/org/keane/helloworld/
HelloWorld.java
===================================================================
--- HelloWorldProject/src/org/keane/helloworld/HelloWorld.java (.../
trunk) (revision 25)
+++ HelloWorldProject/src/org/keane/helloworld/HelloWorld.java (.../
branches/BRANCH_01) (revision 25)
@@ -6,9 +6,9 @@
          * @param args
          */
         public static void main(String[] args) {
- System.out.println("Hello World v1.0 - change from trunk for merge
conflict");
+ System.out.println("Hello World v1.0 - change from BRANCH_01 for
merge conflict");
                 System.out.println("Hello World v2.0 - change on trunk");
                 System.out.println("Hello World v3.0 - change on trunk");
- System.out.println("Hello World v4.0 - change on trunk");
+ System.out.println("Hello World v3.1 - change on BRANCH_01");
         }
 }[/code]

For all these operations I am using http://tortoisesvn.tigris.org/.

Any ideas of why I am not seeing a merge conflict? Cheers, Sean.
Received on 2011-04-04 15:21:26 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.