There are two ways to split a changeset, depending on whether or not you’ve already committed the changes that you wish to split:
To selectively commit changes from your working directory (if you haven’t committed your changes yet):
- Use
hg record. (This is similar to usinggit commit --patch.)
To split an existing changeset (if you’ve already committed your changes):
-
Use
hg histeditand select the edit option on the changeset you want to edit.
(This is similar to usinggit rebase -i.) -
Use
hg recordto selectively commit your changes as separate changesets. -
Use
hg histedit --continuewhen you’re done. The remaining uncommitted changes will be included in a final changeset.
As others have mentioned, you can use hg crecord in the place of hg record.