svn commit trouble

Programming, for all ages and all languages.
Post Reply
User avatar
salil_bhagurkar
Member
Member
Posts: 261
Joined: Mon Feb 19, 2007 10:40 am
Location: India

svn commit trouble

Post 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.
User avatar
Creature
Member
Member
Posts: 548
Joined: Sat Dec 27, 2008 2:34 pm
Location: Belgium

Re: svn commit trouble

Post 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).
When the chance of succeeding is 99%, there is still a 50% chance of that success happening.
User avatar
salil_bhagurkar
Member
Member
Posts: 261
Joined: Mon Feb 19, 2007 10:40 am
Location: India

Re: svn commit trouble

Post 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...
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: svn commit trouble

Post 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)
Every good solution is obvious once you've found it.
User avatar
salil_bhagurkar
Member
Member
Posts: 261
Joined: Mon Feb 19, 2007 10:40 am
Location: India

Re: svn commit trouble

Post by salil_bhagurkar »

Ok.. Thank you both Creature and Solar :) .. I think I will just update when it gives me an error..
Post Reply