Search code examples
eclipsesvncommitsubclipsedelete-file

Commiting new files to SVN through eclipse


I'm working on a project for which I'm using the plugin Subeclipse in Eclipse to commit changes to our SVN repository. It is the first time I'm using SVN and I was trying to create a branch when I accidentally got a commit in which all my files were deleted.

So I went back to a working revision and I want to commit it. However, because all the files are deleted the commit fails with a File not found and path not found error.

svn: File not found: transaction '5148-475', path '/ndeklein/MS/PyMS/pyMS/rPlots.py'
svn: '/svn/test/!svn/ver/5147/ndeklein/MS/PyMS/pyMS/rPlots.py' path not found: 404 Not Found (https://test.ac.uk)

I tried importing the whole project to SVN through the commandline with svn import, but this gives the following error:

svn: MKCOL of '/svn/barton/!svn/wrk/be218e50-2605-479e-af1c-ebd8b08b8164/ndeklein/MS/PyMS': 405 Method Not Allowed (https://test.ac.uk)

Doing an update removes all the files again (since the revision it is at now still has all the files removed)

So how can I commit a bunch of new files with SVN?


Solution

  • Subversion (inside and outside Eclipse) has no option to work on previous revisions. So you can do the following steps:

    • Ensure that your are current by doing an update.
    • Then copy the files you want to commit (again) in your working copy. You will of course loose the history of these items then.
    • Add them to your working copy (svn add).
    • Commit them at the end.

    Alternatively, you could copy the files on the server into the HEAD. By doing this, the history of the files is continued. Then you are able to do an update first, change what you want to change and commit your changes.