开发者

How to solve conflicts in Eclipse Subclipse

Using Subclipse and SVN 1.6

When you synchronize views with the repository, you get the conflicting files and you can edit them by hand. But sometimes, you accidentally update, getting lots of versions of your file. Example:

File.source
File.source.mine
File.source.r5875
File.source.r6150

I would like to understand what's the l开发者_开发问答ogic behind these files, and what tools does Subclipse provide to compare these files. Has File.source been merged with any of the revisions? Is the .mine file the one which has only my changes?

Thanks


Using the examples files you have posted:

File.source.r5875 This is the revision you had previously checked out before making your modifications.

File.source.r6150 This is the revision in the respository that is conflicting with your local modifications. This should be the latest version as you have just done an update.

File.source.mine This is your local version you had before you performed the update. So this file will have your modifications.

File.source This is the "conflicted" version that includes both your modifications as well as the modifications from r6150 together. The conflicting sections are delimited by ">>>>>>" "======" and "<<<<<<"

The standard eclipse comparison tools allow you to compare the different versions. Select 2 of the files, right click and select "Compare With" > "Each Other" from the menu.

By comparing File.source.r5875 with File.source.mine you can identify what you have changed.

By comparing File.source.r5875 with File.source.r6150 you can identify what has changed in the repository since your last update.


That happens when svn encounters a conflict: You changed a file, the file on the server was changed and it cannot (easily) be merged automatically. You need to decide what is the correct solution now.

Subversion just adds the diff into your source file (and creates files next to it, called OriginalName.mine (unchanged) and OriginalName.rsomething (unchanged, server version)).

Fix the conflict and tell subversion that this is resolved.

1)Just save your local changes whatever u have edited in the file

2)revert the file

3)update it from SVN

4)Paste your local changes

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜