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?
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.
Commit uploads your changes on the CVS / SVN server, and Update overwrites the files on your localhost with the ones on the server.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With