Eclipse - SVN derived files are committed in background - eclipse

I have several projects in eclipse and sometimes I mark a file as derived so SVN ignores the file and it doesn't get committed. For a while this worked for me but somehow I have some problems now. Some of these files get committed from my account. Svn history tells me that I did commit those files but I'm 100% sure I did not.
I have 3 files committed in the history but the dialog did only show 2 of them. Is there a problem when I put versioned files on derived ? So they somehow get committed in the background ? Because that's what it looks like to me. I never saw those files in my commit dialogue but Eclipse (4.2.1) Subversive (SVNKit 1.7.5v1) did commit them somehow.
Is there a better way to ignore those files in further commits ? They need to be in version control and I do have some local changes to these files who shouldn't be committed. So svn ignore is not an option.

Related

Restoring SVN history links after commit

In Eclipse I moved and renamed a few files and committed. I now understand that I should have used svn move and svn rename or done Repair move in TortoiseSVN before the commit. But I didn't do, and commited. Now the history is not linked for those files. Is it possible to recover the history?
I was using Subclipse before, and I didn't face this problem. But now I don't have Subclipse installed. So I am guessing that if Subclipse is installed, it handles this by changing the refactoring behavior of Eclipse. Is this true?
Once you have committed the changes the only way to fix this would be to start over. Delete the items and commit, and then go back and do a proper move and commit. You might also be able to use svn copy to copy the old item from history if needed.
If you were using Subclipse when you refactor the files they would be moved automatically so you would not have had this problem.

How do I restore entire project in eclipse?

I was playing around with my project and accidentally clicked something that deleted my entire project except for the JAR files. I restored most of the project from my local history. However, some files are still missing(I think it is only the web.xml but I am not very sure). My question is that, is there any way I can restore my entire project to the way it was 20 mins back? I did make an initial commit on SVN but for some reason that doesn't show up either.
Thanks
If you did the initial commit, then you can svn checkout the working copy again and start over.
Apache Subversion does not track uncommitted changes, so your uncomitted work is not recoverable from the version-control.

Github and Eclipse: not all files are commited

I´m using Github in Eclipse, and commiting my changes to it. I have added some files to my project, and I have clicked on Team->"Add to index" in each of them, for them to be commited when I make a commit of the whole project. However, these files are not added to be commited, and when I click in "Commit", they arent´shown in the list of modified files. How can I force them to be commited?
Thanks.
It sounds like you may be confusing the usage of Git wit SVN. In SVN when you add a file to be tracked, updates to the file will always be committed automatically.
In Git, when you add a file to the index, only the current version of that file is recorded. If you subsequently update the file and commit, the new updates won't be included. The solution is to do an "Add to index" on the root of your project right before you commit: the equivalent of git add . on the commandline. Make sure your .gitignore is set up correctly so you don't commit things you don't intend to.
An equivalent action is to do a git commit -a, which automatically adds all files previously in the index and updates any deleted files as well. I believe the equivalent setting in Eclipse (for eGit) would be to Include selected untracked files as in the commit settings below.

Mark files before committing to SVN

Each time before committing I have a lot of changed files in my project. But also I have a lot of files that shouldn't be committed to SVN (it need me for local work). I need traverse all changed files and REMEMBER which of them should be committed.
Is that possible to mark(maybe with some Eclipse plugin) files for further selection and committing.
You can use changelists. See this Stackoverflow question on using changelists in Eclipse.
In Subversion 1.5 and higher, you can put your files into changelists. You can then commit, update, and revert only those files in that particular changelist. Put your "don't commit files" into one changelist, or the "I only want to check in these files into another changelist.
The svn:ignore won't work if these files are already checked into Subversion. It's only for adding new files.

svn: Item <folder> is out of date

[answer auto-selected by bounty system against my will]
I'm using subclipse, and always when delete a folder in Eclipse, and try to commit it, the following errors raise:
svn: Item <folder> is out of date
svn: DELETE of <folder>: 409 Conflict (http://myintranet)
Deleting and commiting via command line works fine, but what's wrong with doing it via subclipse? Is anyone more experiencing this problem?
(I experienced this problem in Ubuntu 9.10 and 10.04; last Eclipse version; and subclipse 1.4 - as the next versions of subclipse have much more bugs)
--updated: Its when I delete folders, not files
Isn't that addressed by the Subclipse FAQ?
Whenever you see "out of date" in an error message it means that the revision of the item in the repository is newer than the copy in your local working copy.
The solution is always going to be to run an update, so that your working copy is up to date with the repository, and then do the commit again (assuming that the update did not generate any conflicts).
For files, this is usually pretty easy to understand how and why this happens.
However, Subversion also versions folders, and it is usually with folders that this problem most often happens.
Subversion does not allow you to delete/rename a folder OR change its versioned properties, UNLESS the local copy of the folder is at the HEAD revision of the folder in the repository.
Your next question might be:
"OK, I can maybe understand that, but why is my folder out of date? I am the only person working in this repository."
That is a valid question, the answer lies in the way that Subversion works.
When you commit a change to a file, the revision of the file in your working copy is updated to that new revision when the commit completes, however the version of the parent folder(s) of that file is not updated.
This is because there may have been adds/deletes to other files in that folder and until you have run an update, the folder is not really at that new revision.
This is called "mixed revision working copies".
In summary, the answer is always to do an update so that the folder or file is updated to its HEAD revision.
About "Mixed Revision Working Copies":
One special kind of flexibility is the ability to have a working copy containing files and directories with a mix of different working revision numbers.
One of the fundamental rules of Subversion is that a “push” action does not cause a “pull,” nor vice versa.
Just because you're ready to submit new changes to the repository doesn't mean you're ready to receive changes from other people.
The fact is, every time you run svn commit your working copy ends up with some mixture of revisions.
The things you just committed are marked as having larger working revisions than everything else. After several commits (with no updates in between), your working copy will contain a whole mixture of revisions
(and that is why, I believe, you cannot reproduce your "out of date" message on subsequent commits with folder deleted: your update did solve the "mixed revision" state.)
Mixed revisions have limitations
You cannot commit the deletion of a file or directory that isn't fully up to date.
If a newer version of the item exists in the repository, your attempt to delete will be rejected to prevent you from accidentally destroying changes you've not yet seen.
i think if you UPDATE before that it should work.. it did work for me
There's a simple solution without installing some extra software. I also had this "problem" and what you can do is the following:
1) open the SVN Repository view
2) there go to the folder you want to get rid of and delete it
3) go back to the java view
4) update the folder in your project you actually deleted / update your project should also work
That solved the problem in my case, as updating only retrieved the files I deleted
Subclipse has many problems like this. It works 90% of time, and then it just DOES NOT work as it should! I am using subclipse, since it is very well integrated into eclipse, and when I have problem or some bigger moves needed in svn (like merging some branch) I use Tortoisse.
I had the thing with directory like you. Then I just run the TortoiseSVN like #luiscolorado suggests, and it helped. Tortoise is so great tool (it has many great features for diffing, applying patches, getting patches and so on.).
Today I had a problem when I have removed a file, and someone had changed the same file! Then subclipse shows conflict (up to this point everything is ok), so I wanted to revert! But then the revert button is missing (disappears when inconflict mode!) so I have to do merge, and merge does not work, throws some kind of error. I didn't bother to read (maybe I should read and file it as a bug to subclipse maintainers ;-(), I knew the tortoisse will work, and you know what, it worked. There was a REVERT option.
So #Tom Brito, try command line, try Tortoisse, and then you can look at the subclipse changelog and file a bug. I think that subclipse just forgets to show us some directory changes and updates (or it is designed not to do it?), but I may be wrong.
Tom,
You might want to try TortoiseSVN, and manually update the project workspace. Find the location of your project directory in your hard drive, and then try TortoiseSVN (or the command line if it's your preference) to do the update.
A frequent cause of this problem is to delete the directory without "informing" SVN. For instance, if you manually delete the directory using the operating system instead of using SVN, you will have this problem.
If you removed the directory before you installed the subversion plug-in, but the project already existed in the repository, you will experiment this problem. A solution, in this case, would be to recreate the directory, updating/committing, and then delete again the directory.
Good luck.
My solution to this was
Delete all items in folder
Commit to repository
Update folder to HEAD
Delete folder in Eclipse
Commit to repository
A bit cumbersome, maybe, but it always works
The only working way in same cases is via command line. The subclipse is still not perfect..