43
votes

In my repository, I have two revisions. The src code is on revision 2, but I had a file that messed up, so I reverted it to revision 1.

After a few hours of debugging, that javafile works, but I can't commit it. SVN says that the javafile is out of date. This is probably because I'm editing javafile.java rev1, right?

How do I resolve this? I know I could copy/paste my modified javafile rev1 code into its rev2 counterpart, and then commit, but is there another way? Am I using SVN incorrectly?

3
Note this is covered in the "basic usage" sections of the SVN book: svnbook.red-bean.com/en/1.7/…Ben

3 Answers

67
votes

Updating the working copy should fix it.

From the command line:

X:\WorkingCopy>svn up

or right-click and choose SVN Update... in TortoiseSVN

When you update, you may come across conflicts, which will be marked in your code with

>>>>>
...
-----
...
<<<<<

You'll need to manually resolve these. When you're done, don't forget to mark the file as resolved.

X:\WorkingCopy>svn resolve \path\to\file

or right-click and choose TortoiseSVN -> Mark as Resolved... in TortoiseSVN

9
votes

I had this issue in Eclipse (Windows 10). It was solved by right clicking on the folder in question > Team > Update to HEAD

4
votes

Update your working copy, and resolve the merge conflicts by copying the resulting file that has your locally modified version over the version with conflict markers in in. Run svn resolved on it, and check that in. This does assume there are no other changes that you want to preserve.