Delete some files from the commit with Mercurial and Eclipse - eclipse

I am using Mercurial with Eclipse. I made a commit and I commited some files which shuld not been commited.
Do you know if there is a possiblity to delete those files from the commit.
Thank you.

rollback (if it's the most recent commit) or strip (if it's older) would do it for you. This post has more details on these commands. To do it with MercurialEclipse, right click on your project in Eclipse and do Team-->Undo-->Rollback or Team-->Undo-->Strip.
If those aren't options, you could just remove the files in question and then commit that as a separate changeset. That would, of course, preserve the fact that those files were once under Mercurial control. If that is not desirable, this page lists some more options. If you go the MQ route, the workflow listed there can be done in MercurialEclipse via the "Mercurial Patch Queue" view.

Related

Comments in git (egit)

We recently moved to git from svn (both using Eclipse). I am in the (perhaps bad) habit of writing my Java code first, getting everything to work and then going back and adding comments. In SVN this was easy. I would just create a Fisheye review with my Jira task. The review would have a list of all the files I changed and methods I added or modified. I would note it and abandon the review. Then I would edit all the files listed and add the comments.
However, Fisheye does not (I believe) work with git. I could do a git status to see the files I changed but the local branch is already updated so it will not list any files. And all it does is tell me I am something like one commit ahead of the remote branch but does not list any files.
Is there some way to see a lit of the files I have changed with git so I can add comments? And when I say I wait for my comments I really mean mostly for added classes and methods. If I do something like add a line or two to a method I will generally add the comment too.
changing comments on git commits is not that easy. Each git commit has a sha-checksum which also includes the previous git commit. If you change a commit you change the current commits sha-checksum. therefore you create a new commit. All following commits of your branch must now be rebased on top of this new commit.
The command line provides the git rebase -i [commitid] where you can do lots of modifications including changing comments on commits. I never did this with a GUI but egit might support that too. Just refer documentation on egits rebase feature.
I found out how to do this.
The "Synchronize Workspace" in eclipse appears to show all the changed files not yet pushed remotely. I have not done any pushes, so this showed me what files changed.

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.

Eclipse - SVN derived files are committed in background

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.

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.

How can I do a partial update (i.e., get isolated changesets) from subversion with subclipse?

If a file is committed several times with various changes, how can I fetch one change at a time, i.e., one changeset at a time?
I use eclipse, subversion, and subclipse, and I can't change the former two for the time being (or the MS platform..).
In my Team/Synchronization view in eclipse (using subclipse), choosing the changeset model, a file seems to be listed only in the latest relevant changeset even if all changesets are listed. So an earlier changeset doesn't necessarily show the full set of files in the original commit, nor the original diff for a file in a commit.
Update: I'm thinking about using changesets for simplified code review, so I'd like the partial update represented for all the files commited in one changeset. It's easy to get diffs and specific revisions for specific files in eclipse, but I'd like to step through all the changes in one specific commit/ changeset in a practical manner.
As I'm sure you know, svn up will by default grab the latest revision of the file.
However, you can use the -r parameter to svn up to grab a particular revision of a file. So if you know a file was committed in revisions 5, 7, and 9, you could do this:
svn up -r5 myfile
svn up -r7 myfile
svn up -r9 myfile
I believe (but I don't have an installation of it in front of me) that Subclipse has a similar option, labeled something like "Update to Revision..."
Subversion does not support atomic changesets.
(Note: If anyone can prove me wrong, I'll happily switch accepted answer.)
I've compared Git and Subversion using TortoiseGit and TortoiseSVN (and looked at what is possible on the command line).
With both Svn and Git I can update to a certain revision, or see and update to different versions of only one file at a time.
With both Tortoise clients can I see individual commits (revisions) from the repository and look at changes between a revision and the previous revision. (Note that I can't seem to do this in Eclipse, ref the question.)
Only with Git, however, can I update to or cherry-pick an isolated commit. The closest I've seen to this functionality in Subversion is to update to head and then revert a certain revision with a "subtractive merge"...
Test setup: make a project, check out or clone the project, make 2 separate commits to repository from elsewhere, including at least one file that is modified in both commits.
Then, with Git: fetch remote changes.
Then, with both Git and Subversion: look at the log.