I'm new in working with branches in SVN and I'm having a problem (maybe is a concept issue) I can't understand when trying to merge the changes of a branch into the trunk.
I will develop a full example in order to explain the full problem. I'm working with Eclipse/Android and Subversive:
I created a new project with the structure shown in the Picture 1
and commit it as the Revision #1 to https://mysubversionhost/Tests/SVNTests/trunk
(ignoring gen and bin folders)
Picture 1:
At this point the MainActivity.java is
package com.example.svntests;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
public class MainActivity extends FragmentActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
}
Then I continue working in the project and update the MainActivity.java commiting it as the Revision #2:
package com.example.svntests;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
public class MainActivity extends FragmentActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
codeA();
codeB();
codeC();
System.out.println("This is a bug!");
codeA();
codeB();
codeC();
}
private void codeA() {
// CODE A
}
private void codeB() {
// CODE A
}
private void codeC() {
// CODE A
}
}
At this point I decide to make a release and create a tag name Release1.0. The SVN structure at this point is shown in the Picture 2
(Revision #3)
Picture 2:
Then I continue working in the trunk and removing the calls to codeA()
and adding a class OtherActivity.class in the com.example.svntests
. Commiting the Revision #4 MainActivity.java at this point is:
package com.example.svntests;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
public class MainActivity extends FragmentActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
codeB();
codeC();
System.out.println("This is a bug!");
codeB();
codeC();
}
private void codeB() {
// CODE A
}
private void codeC() {
// CODE A
}
}
Then I detect the bug "This is a bug!" and want to patch it in production. So I switch to the tag Release 1.0 and fix it (removing the print line and adding a class MainController.java to the same package) and commit it Revision #5
At this point I want to continue working with the Revision #4 with the bug fixed. So I switch to the trunk and use the merge wizard to bring the changes from the branch to the trunk:
I was expecting to get in my working copy the classes:
- MainActivity.java (With conflicts)
- OtherActivity.java
- MainController.java
But instead I get conflicted files that were not modified. See image below
The final state after the merge is:
What do I am missing?
Well, you have some misunderstanding in SVN common (I'm too lazy to adopt some of it to Eclipse GUI)
Release 1.1
, probably)