Subclipse conflict resolution

Gok Demir picture Gok Demir · Oct 8, 2009 · Viewed 51.9k times · Source

Me and my friend using flex builder (eclipse based) with subclipse for a project.

Before committing I always update but sometimes I could not commit because of conflicts. Then I use Team->Synchronize with Repository and it shows at the right side latest from repository and at the left side the my current working copy. It has a button to copy from all non-conflicts from right to left (from latest repository to my working copy). But there are still conflicting lines.

Sometimes I just want to copy from left to right but there is no button for that (I mean overwriting repository file lines with my lines). After copying non-conflicting parts from right to left I just want to commit left side (I want to overwrite and commit my final file to repository). I cannot commit because of these conflict issues. Then my friend can use Replace With-> Latest from Repository command to get latest overwrited version.

Subclipse documentation is weak I could not find any good guide on the Internet. Could you explain subclipse conflict resolution step by step for a dummy like me? A video showing the steps, or an alien technology to fix it quickly will be fine. Are there any better (easier) solution for source control for eclipse?

(I use subclipse 1.4)

Answer

blissfool picture blissfool · Oct 8, 2009

Yes, you are right. There is no button for that. in the Diff View(Side-by-Side View) the items in red are in conflict. They can not be automatically merged. You must review the item in conflict and manually resolve it by copying/editing the block of code that is in conflict.

After committing to or updating from repository(Synchronize with Repository) you'll see in the Console view that some items are in conflict. When you take a look at that file in Package you'll see 3 files right next to your original file:

myfile.txt (original file)
myfile.txt.mine
myfile.txt.r3293 
myfile.txt.r3501

Right-click your original file then select Team -> Edit Conflict. In the Diff View provided, edit the file on the left-side to match the final result you want. (i.e. You may want to keep some of your changes and copy over new update from the revision in SVN, discard all changes and only keep your changes, etc.) After you are done, save the file. Right click your original file again then select Team -> Mark Resovled.

You will see that the addition 3 files disappear. You can now "safely" commit your work.

There is no easy way to do this since SVN can't decide what's the best option when such conflict arise.