Page 1 of 1

svn commit trouble

Posted: Sun Jun 21, 2009 1:55 am
by salil_bhagurkar
Hi.. I have been using TortoiseSVN on windows to commit my ViSE source code to the googlecode repository. But today i am facing a weird problem with the commit. The error i get:

Command: Commit
Modified: F:\vise
Error: Commit failed (details follow):
Error: File or directory '.' is out of date; try updating
Error: resource out of date; try updating
Finished!:

There is no one else who would commit to it as I am the only project owner. So this error seems weird. What could be the problem? The date and time of my PC is set properly and there are no problems with it.

Re: svn commit trouble

Posted: Sun Jun 21, 2009 3:45 am
by Creature
Do as it says; try updating first and then committing your sources. If nowone else is committing, it is indeed weird that it gives these kind of errors. Perhaps this might occur because Google Code updates its SVN server too every now and then and the repositories need to be reupdated (if that even makes sense, since the original repositories shouldn't be touched).

Anyhow, updating and then committing should make it work again (unless you receive conflicts, which would totally be bizarre).

Re: svn commit trouble

Posted: Sun Jun 21, 2009 4:32 am
by salil_bhagurkar
That actuall worked. I updated (first backed it up) and then committed and it worked. But the error indicates that the copy that google has is newer. In that case, if I update, then I might lose data...

Re: svn commit trouble

Posted: Sun Jun 21, 2009 6:14 am
by Solar
salil_bhagurkar wrote:...if I update, then I might lose data...
No, never. No version control system of any repute would ever delete your data. You might end up with a "conflict" file, containing two versions of the same section of code.

Let's say we've got a file "myprog.c". You checked out revision 5, which looks like this:

Code: Select all

int main()
{
    return 0;
}
You modified it, adding:

Code: Select all

int main()
{
    local_code();
    return 0;
}
Someone else, in the meantime, checked in revision 6 of myprog.c, looking like this:

Code: Select all

int main()
{
    repo_code();
    return 0;
}
If you run "svn update" now, you will end up with several files:
  • myprog.c.r5 (containing what you started with);
  • myprog.c.r6 (containing what is now in the repository);
  • myprog.c.mine (containing your local modified version);
  • myprog.c, containing a "conflict marker", looking like this:

Code: Select all

int main()
{
<<<<<<< .mine
    local_code();
=======
    repo_code();
>>>>>>> .r6
    return 0;
}
You resolve the conflict, and then commit again.

Bottom line, you will never lose information, unless you do something stupid. 8)

Re: svn commit trouble

Posted: Sun Jun 21, 2009 6:41 am
by salil_bhagurkar
Ok.. Thank you both Creature and Solar :) .. I think I will just update when it gives me an error..