Let's say that I'm working on a project, with files A, B, and C. I get halfway through adding a feature, modifying A and B, before I realize that something needs cleaning. Because of the circumstances, it's optimal to interrupt the feature work to do the cleaning. This involves making changes in A, B, and C.
After I'm done with the feature, I want to check in my code. There are two different sets of changes, so to speak: those for adding the feature, and those for the cleanup. They do not conflict in any way. Is it possible to commit these changes separately, for a clean repo history?
Alternatively, what if I decided to check in the cleanup as soon as I was done with it, but didn't want to check in the halfway-completed feature in A and B?
I'm not sure if it's possible to do this in Mercurial or SVN, but I am interested in learning about either. (What about TortoiseHg?)