Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I fix this SVN commit which fails as "out of date"?

Tags:

svn

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?

like image 835
lemon Avatar asked Oct 23 '09 01:10

lemon


People also ask

Is out of date svn commit failed?

An svn commit of the file will fail with an “out-of-date” error. The file should be updated first; an svn update command will attempt to merge the public changes with the local changes. If Subversion can't complete the merge in a plausible way automatically, it leaves it to the user to resolve the conflict.

What is svn commit and update?

Commit uploads your changes on the CVS / SVN server, and Update overwrites the files on your localhost with the ones on the server.


1 Answers

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

like image 180
Benny Hallett Avatar answered Oct 06 '22 20:10

Benny Hallett