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

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.

This happenend beacuse you checked your eclipse metadata into source control and then moved it by changing those settings.
So first do an update to get the meta files back. If you watch the svn console youl see something like: Restoring FILENAME
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.
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."

Related

bin-dir does not get ignored with SVN

I am working on a project using Eclipse 4.19.0. I also have Subclipse installed. However I started using TortoiseSVN 1.10. I have ignored files in a nested project (trunk > subproject > right click > TortoiseSVN > Properties) like:
However, if I trunk > right click > Commit, changes in subproject/bin/someFolder does still get shown. Weirdly the ignore works for subproject/build/*.
Any idea what could be the cause?
If a file has been commited to SVN then it doesn't matter if it is ignored or not. It will be handled like any other file you have checked out from the SVN repository.
So if you want to ignore files that have already been committed to SVN you first have to delete them from SVN.
TortoiseSVN has a functionality that combines deleting the file in SVN (but keeping it locally) and adding it to ignore list:
Unversion and add to ignore list:
The other ways like deleting the file locally and commit it or delete the file in SVN via SVN repo browser will end up in the local file being deleted. So you chose this way make sure to first copy the local files to a backup location so that you are able to restore the file(s) once the delete operation has been applied.

Eclipse ignored resource are still showing as changed, how do I stop this behavior?

I have a Java project that is committed to an SVN repository. I'm using the Subclipse plugin in Eclipse Luna. The .project file was initially committed, but we don't want to commit any updates to the .project file that eclipse makes. I've added a .project entry in the ignored resources, but the .project file still shows up as a change, for example, when I rename the project folder, or do anything else that might cause Eclipse to change that file. I see the out of synch star for the top-level folder (of course the .project file is not shown in the project explorer), but the .project file does appear in the synchronization window and the commit dialog. What is the issue here? How can I get Eclipse to actually ignore changes to this file?
SVN, like most version control systems, won't let you ignore files that are already in the repository. To quote the book (emphasis added):
Subversion's support for ignorable file patterns extends only to the
one-time process of adding unversioned files and directories to
version control. Once an object is under Subversion's control, the
ignore pattern mechanisms no longer apply to it. In other words, don't
expect Subversion to avoid committing changes you've made to a
versioned file simply because that file's name matches an ignore
pattern—Subversion always notices all of its versioned objects.

SVN on Eclipse still try to synchronize eclipse .settings directory despite svn:ignore flag

In my python/pydev project home directory, eclipse create 3 files/directory :
.settings
.project
.pydevproject
As I do not want to share these files, I set a svn:ignore flag on the home project directory with these 3 files/directory specified in it.
It works well for .projet and .pydevproject, but not for .settings :
From time to time, .settings reappears into the "team synchronize perpective" as to be synchronized/committed into the svn repository.
How can I get the eclipse '.settings' definitively ignored during svn commit in eclipse gui ?
Do you have checked in .settings before adding it to ignored? If so, you should remove it from svn (not the working copy of cause).
If the .settings folder was previously under SVN (i.e. commited) then you should remove it from you SVN first.
If you still want to keep it in your working copy, you can do:
svn remove .settings --keep-local
in command line, and do svn ls (if you see this folder listed, you haven't removed it from SVN!!!)
If you already removed it and still have a problem you can try one of 2 things:
1. Deleting the folder manually (assuming no complex\unique settings were made)
and letting Eclipse recreate it
2. Deleting only the inner folder `.svn` (only the one inside .settings),
and then running svn cleanup (Team -> Cleanup)
The first one is preferred, since it is never the best idea to mess around with SVN's files.
You can (and should) exit eclipse, back this folder up, and update your working copy before this process.
if you have installed subversive you should also install the "subversive svn jdt ignore extensions".
you will find it here:
help > install new software ...
select your eclipse download site. in my case its "Helios - http://download.eclipse.org/releases/helios"
you'll find it under collaboration > Subversive SVN JDT Ignore Extensions (optional) (Incubation)
That sounds you have sometimes added this folder under version control and checked it it. You need to first removed it (svn rm via command line or via TortoiseSVN on windows) and do a commit. This needs to be done outside from Eclipse. After you changed that you can start Eclipse again.

Prevent perforce from demanding eclipse project files be checked out

I'm currently working on several eclipse projects, using Perforce as my source control. I have the perforce eclipse plugin installed.
My problem is that eclipse likes to, for no particularly good reason, write to my .project or .classpath files. It also loves to change the order in which things appear. As such, it demands that I have these files checked out almost all the time. I've somewhat worked around this by creating a pending changelist called "Files which I've checked out for convenience" and stuffing all of the metadata objects that eclipse asks about there.
This has the downside that if anyone updates some metadata (for example, adding a new project reference or changing the classpaths) I now have to resolve differences before they'll show up, adding extra time and trouble to my project.
Coming from Subversion, this is a really rude surprise. With SVN I could just wait until I checked in and move these files to the ignore-on-commit changelist, as needed. SVN would also merge new updates into these files without bugging me.
Basically, is there any way to prevent eclipse from constantly futzing with my projects, or am I just stuck here?
I'm assuming the .classpath and .project files are in version control, since that what causes them to be read only. There is an option in Perforce using P4V to make just those files always writable. Right click the files and select 'Change Filetype...' and select the +w Always writable in workspace option. This will affect all clients using that branch / stream, but now changes can be made without marking for edit first.
If you would like that to be the default for all of your depots, then you can have a Perforce admin to change the p4 typemap so that any new .classpath and .project files will be writable.
See http://www.perforce.com/perforce/r12.1/manuals/cmdref/o.ftypes.html
Have you tried adding a .p4ignore file to the project root dir, containing
.classpath
.project
Support docs for P4IGNORE

How do you commit ONLY files you've "added" to version control in subclipse?

I just spent a fair amount of time selecting the files and directories I wanted under version control. I'm running subclipse under eclipse. I right clicked, Team, Add to Version Control. Now I want ONLY those files committed without right clicking the whole directory which contains a huge number of media files that I don't want handled by version control. If I go Team/Commit under that directory it hangs for a very long time... I thought by "Add to Version Control" there was an option to commit those files only. I just don't know how to do it.
I hope I explained the question properly..
UPDATE:
Since people are talking more about ways to ignore files rather than committing what you're marked as "Add"ed to Version Control, let me put this a different way. What does "Add to version control" do exactly? It seems to be a feature without use.
Subclipse includes both unversioned files and files you specifically marked for addition when you open the commit dialog. It does not perfectly mirror the behavior of the command-line client. You have two options: uncheck each file you do not want to commit in the Subclipse commit dialog or use the command-line svn tool to commit. The command-line tool will only commit files you have marked for addition and will ignore the other files. Here's a simple example:
$ touch file
$ svn status
? file
$ svn add file
A file
$ svn status
A file
$ touch file2
$ svn status
? file2
A file
$ svn commit -m "Added empty file"
Adding file
Transmitting file data .
Committed revision 2.
? denotes a file that it unknown to svn and will not be put under version control automatically by svn commit. A denotes a new file that is scheduled for addition. Subclipse is trying to mirror this behavior by allowing you to "add a file to version control", which is the equivalent of the command-line svn add. but also includes unversioned files not scheduled for addition in its commit dialog (which I personally find somewhat annoying). If you run svn status on the command-line, those files which you "added to version control" in Subclipse will be marked with an A while those you did not will be marked with a ?. You won't have to run any svn add commands since you did that already in Subclipse.
You can add a pattern in Preferences/Team/Ignored resources (it's not the same as svn:ignore). You can also delete it, if it is no longer helpful.
use svn:ignore for the resources you don't need under version control (Team > Add to svn:ignore)