Given the case I made two independent changes in one file: eg. added a new method and changed another method.
I often don't want to commit both changes as one commit, but as two independent commits.
On a git repository I would use the Interactive Mode of git-add(1) to split the hunk into smaller ones:
git add --patch
What's the easiest way to do this with Subversion? (Maybe even using an Eclipse plug-in)
Update:
In The Thing About Git, Ryan calls it: “The Tangled Working Copy Problem.”
I have done this using TortoiseSVN.
The built in merge utility allows you to show a diff between the repository version and your working copy.
Use the create backup function of the diff utility
You should now have all your changes committed, using two separate commits.
With git-svn you can make a local GIT repository of the remote SVN repository, work with it using the full GIT feature set (including partial commits) and then push it all back to the SVN repository.
git-svn (1)
Tortoise SVN 1.8 now supports this with it's "Restore after commit" feature. This allow you to make edits to a file, with all of the edits being undone after the commit
Per the documentation:
Try VisualSVN for Visual Studio. The latest 6.1 release introduces the QuickCommit feature. You can partially commit selected changes in a file using the new Commit this Block and Commit Selection context menu commands in the Visual Studio editor.
I used to do this:
This is a simplistic approach that assumes one set of changes is reasonably easy to undo. For more complex situations, I would give up and commit both changes without worrying about it.
Now that I use git, this is something I hope I'll never have to do again!
I use either a local darcs repo, or just merge the changes in gradually. With merging (opendiff opens FileMerge, a merge program that comes with Xcode; replace with your favorite merge tool):
merge the related changes, save the merge, quit the merge program
if more than one unrelated hunk in the file, rinse and repeat (but why would you wait so long before committing?!)
Also, if you know git, you can use git-svn to maintain a local git repo and sync your commits to an svn master server; works great in my limited experience.