Disclaimer: I am not a hg user, so I read about hg, but I don't have much experience using it.
git provides some very powerful and flexible branch management tools in a “patch queue” style, so for many basic (and even some fairly complex) cases of using native git, it’s quite powerful.
As a rule, most projects maintain a central stable leading branch, which only receives new commits and never "rewinds", so the commits in the main branch are fixed.
In addition, the maintainer (or developer) can maintain one or more branches of the liquid of incomplete corrections (i.e., commits) that are based on a stable branch.
Typical patch management activities include:
restore the patch queue on the last stable branch - use git rebase ,
duplication of the fix queue on the old maintentance branch - use git branch and git rebase ,
reordering fixes in the queue - use git rebase --interactive (aka git rebase -i ) with a text editor to reorder the queues.
crush patches - use git rebase -i with squash directive
change patches or fix fix messages - use git rebase -i (specify a subject?) with an edit directive.
Any activity that modifies the patch in any way (i.e. its contents, description or parent) will create a new commit with a new commit identifier for that patch. The fact that old commits can be thrown away and replaced regularly before they are transferred to a stable leading branch is the only thing that makes them a “fix queue” and not a branch, but this is a project agreement and not any physical difference in the data that makes up the commits. For git, they are identical objects.
To push a patch to a “real” commit, simply move the patch to the queue and transfer it to the main branch. After moving the patch to the front of the queue, it will be exactly the same as a regular commit based on the main branch, so a simple merge is the main branch pointer forward to indicate the fixation of the patch.
Publishing this commit as a “stable” main patch is an action that states: now it is a commit that will not change and become part of the unchanging history of the project.