English 中文(简体)
can t commit to svn because working copy is always out of date
原标题:

I m trying to commit some work, but svn always fails and tells me that a file I modified is out of date. I tried updating first, that doesn t work. Cleanup doesn t work. If I revert the file, copy my changes over and try that, it still fails. It isn t just a particular file either, if I revert the whole thing back to a previous revision, and modify any file, this problem still occurs.

I am out of ideas. Anyone have anything?

Thanks.

最佳回答

Try creating a fresh checkout, then copying your changes to it. I had some inexplicable problems with TortoiseSVN too, and this was the only thing that helped.

问题回答

If you can update your file the working copy seems to work properly.

Did you update the directory or only the file? I had situations when svn could not commit because the directory properties changed in the repository. An update on the directory solved this problem.

Another try is to use svn cleanup.

New checkout is the last resort.

Here s a common scenario I ve seen cause a lot of people headaches. It s possible that you might be in this state:

  1. Working Copy is in broken state. SVN complains that file bar under foo directory is causing problems.
  2. Developer makes a backup copy of the foo directory.
  3. Developer deletes foo dir from working copy.
  4. Developer does svn update, foo and bar are reverted and svn is happy.
  5. Developer copies backup copy of foo back over into working copy and svn is no longer happy and no longer able to update and/or commit

The fatal mistake here was when the developer made a backup of dir foo , they also made a back up of all the hidden ".svn" directories nested inside foo.

So, the solution (in my experience), is to use tortoise svn s "export" capability to make a backup copy of foo. Tortoise svn Export will create a copy of the directory structure without any svn meta data (.svn dirs). This way, once you re back to step 3 and svn is happy, when you copy your backup back into your working copy directory, svn should be able to capture the changes correctly.

Then again, if it s only a single file you re creating a backup copy of, then, this won t help.

I had this error with renaming java packages (directories for svn).

I solved it by doing "Override and Update" on deleted directory (got empty one in my project). Then commited the new directory with files. After that deleted the renamed in project again and commited it again.

For me, this procedure worked: On a single file, I had reverted to an old version of the file. When I wanted to commit the project, I had the message that this particular file is out of date and it didn t commit.

What should be done is to copy the content of the file and get back to the latest svn version of this file.

Once it is done, copy to the file the content you saved and then commit. That worked for me.

If you are using eclipse, right click on the project and do update version.. and then select working copy in the drop down, select options that notify you about the merge conflicts. Refer the image for more info.enter image description here





相关问题
Best practices for Subversion and Visual Studio projects

I ve recently started working on various C# projects in Visual Studio as part of a plan for a large scale system that will be used to replace our current system that s built from a cobbling-together ...

Changing username in SVN+SSH URI on the fly in working copy

I am using SVN+SSH to check out a working copy of repository from an SVN server on which all developers are members of a developer group and have full read/write permissions on the repository ...

ASP.NET MVC: How should it work with subversion?

So, I have an asp.net mvc app that is being worked on by multiple developers in differing capacities. This is our first time working on a mvc app and my first time working with .NET. Our app does not ...

How to search for file in subversion server?

Is there a way to search for a file in a subversion repository? Something similar to Unix find command, with which I can find the location of a file in a repository. I know there is svn list, but ...

热门标签