You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by "metricspacess@yahoo.com" <me...@yahoo.com> on 2011/04/04 11:29:41 UTC

SVN Merging Branches

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.

Re: SVN Merging Branches

Posted by "metricspacess@yahoo.com" <me...@rocketmail.com>.
Any thoughts or advice on this one guys?

Cheers, Sean.