Many times I'm making two different changes to files in my repository, I want those changes to be treated as two consecutive commits.
For example, in repository
- prog.c
- prog.h
- README.txt
While fixing a bug prog.c
and prog.h
, I fixed a typo in README.txt
. Now I want to commit the change to prog.c
with its own commit message, and the change to README.txt
afterwards.
In git, I could easily do that with the index
git add prog.c prog.h
git commit -m 'bug #1234'
git commit README.txt -m 'some typos fixed'
What's the best way to do that in Mercurial?
Clarification: I used (before the edit) a toy example where each changeset spans over a single file. But I want the general answer, what should I do when there are many files in each changeset.