32

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)

Ether
  • 53,118
  • 13
  • 86
  • 159
Gok Demir
  • 1,404
  • 4
  • 21
  • 40
  • 5
    sometimes the eclipse ecosystem makes me go mad. – smartnut007 Aug 09 '11 at 00:47
  • 1
    @Gok: I think there's good news: subclipse at last make the "resolved by mine/theirs/..." work. The bad news is that dialog only appears after click "Mark resolved" (I have already fix all the conflicts by hand before!!!!) – Hoàng Long Jun 11 '12 at 08:45

4 Answers4

53

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.

Riduidel
  • 22,052
  • 14
  • 85
  • 185
blissfool
  • 1,007
  • 1
  • 12
  • 21
  • 5
    SVN doesn't need to decide in this case, OP wants is explicitly asking to override all remote updates with his/her own. See mine-full here: http://svnbook.spears.at/nightly/en/svn.ref.svn.c.resolve.html subclipse really should have this. – Stop Slandering Monica Cellio May 29 '12 at 15:57
  • @Sequoia, I apologize for the newbie question but I'm confused by the post. It seems like this feature is already committed and checked into SVN's nightly builds? So does that mean in a forthcoming release (1.7.7? 1.8?) it will be available? It would be so great to have resolve/working-copy! thank you! – AnneTheAgile Jul 18 '12 at 11:59
  • Note that in addition to resolving conflicts you'll need to merge any non-conflicting changes from right-to-left as well. And, after clicking "Team->Mark Resolved", select "Conflicts resolved in file" if you've manually edited like the above answer suggests. – Madbreaks Apr 26 '13 at 18:18
  • @sequoiamcdowell The link is broken. Equivalent link from waybackmachine is https://web.archive.org/web/20140717222639/http://svnbook.spears.at/nightly/en/svn-book.html#svn.ref.svn.c.resolve – Kingsly Feb 18 '15 at 20:25
  • Honestly the conflict view of eclipse is just terribad. There is no feature to just jump to the next conflict, If you are trying to use it on a large file with a lot of changes you will go insane. – wlfbck Feb 11 '19 at 11:19
11

I know this thread is old, but if someone is looking for an updated answer, my experience can help.
I'm using subclipse 1.8. Right-clicking on the original file and selecting "Mark Resolved...", you'll have several options, among others, take the local file or the base file as the correct version. You can save time with these options.

eternay
  • 3,754
  • 2
  • 29
  • 27
4

I can't find "Mark Resolved" so instead I clicked "Mark as Merged" after manually deleting the generated files.

princepiero
  • 1,287
  • 3
  • 15
  • 28
0

Do the following steps:

  • Copy your latest working updates to a safe place.

  • Select the file which has conflicts..right click > select replace with>>Select Latest from Repository.

  • Then go back to your saved working copy and manually replace the current file contents (which has been overwritten in above step) with yours.

  • Then from team select Commit... This way conflicts should be resolved and you saved your latest updates to SVN Repository.

Pang
  • 9,564
  • 146
  • 81
  • 122
Hasan
  • 33
  • 5