Search code examples
eclipsesvncommitsubversive

Can't commit at all with Subversive Eclipse; may have foobared whole project


I am having terrible trouble with SVN in Eclipse Indigo with my Java project.

I am not a hobby, not a professional programmer, but I have heard how important version control systems are for serious projects, and thought it was time I learned how to use one.

Now I find I can't commit, no matter what I try. I get different errors depending upon what I do.

I suspect the problem was caused by my checking the "Persist project refactoring history in project folder instead of workspace" box in Project > Properties > Refactoring History, but I am not sure. But since I did that, I got an error saying "svn: Path '.settings' not present" error. I tried again,unchecking the box for .settings/org.eclipse.ltk.core.refactoring.prefs. This time I got a different error upon an attempted commit, "Path 'gamecore' not present". ('gamecore' is a root-level package in the project, where I'm putting most classes until they can be moved somewhere more appropriate.)

I tried several permutations of fiddling with the project preferences I'd changed, and unchecking some files on attempted commits. All failed.

In desperation, I cut n' pasted the source files I'd changed to a text file, reverted to my previous version, then cut n' pasted the new versions over top of the old. This time I got "svn: File '/Space Game/.refactorings' is out of date".

So I am in a position where, no matter what i do, I can't commit. At this point I am considering expunging the whole repository and importing from my workspace (something I did when I accidentally deleted the project before, thinking there was a duplicate in the repository.)

I've searched the web for the errors I've had, and all the threads I have found seem to assume a lot more knowledge of version control than I have. Most include bash shell commands, which I don't have access to.

My questions are: 1) Is this the best course of action? 2) Is there another less drastic way to recover? 3) How to I prevent this error from recurring?

I am using Eclipse Indigo with Subversive SVN Connectors 2.2.2, Subversive SVN Team Provider 0.7.9 and SVNKit 1.3.5 Implementation 2.2.2.


Solution

  • This happenend beacuse you checked your eclipse metadata into source control and then moved it by changing those settings.

    1. So first do an update to get the meta files back. If you watch the svn console youl see something like: Restoring FILENAME
    2. After you have them back and assuming your project is still set to put the meta data in a separate folder then you can do an svn delete on them and commit the deletions.
    3. Set up an svn:ignore on all eclipse metadata ie:
      • .project
      • .settings
      • .buildpath
      • .refactorings

    If i were you i would close eclipse and do this all from the command line so it doesnt confused.:

    cd /path/to/project/root
    svn up
    svn rm .project .settings .buildpath .refactorings
    svn commit .project .settings .buildpath .refactorings -m "Deleting eclipse metadata."
    svn propedit svn:ignore .
    # this will open an editor ignored files are one per line  so your file should look like
    # the following without the "#" signs
    #
    # .project
    # .settings
    # .buildpath
    # .refactorings
    
    svn commit . -m "Adding ignores to eclipse metadata files."