Edit Mercurial.ini (Windows) or .hgrc (Linux/OSX):
[extenstions]
mq =
Create new patches with hg qnew patch-name
and then update them with new changes with hg qrefresh
:
hg qnew myFirstPatch // Creates a new patch called "myFirstPatch"
... // Edit some files
hg qrefresh // Updates "myFirstPatch" with changes
hg qnew mySecondPatch // Creates a new patch called "mySecondPatch" on top of "myFirstPatch"
... // Edid some files
hg qrefresh // Updates "mySecondPatch" with changes
Create new patch with commit message:
hg qnew -m "My first patch" myFirstPatch
Update commit message of current patch:
hg qrefresh -m "My new message"
Update commit message (multiline) of current patch:
hg qrefresh -e
Pushing a patch applies the patch to the repository while poping a patch unapplies the patch from the repository.
Pop the current patch off the queue with hg qpop
and push it back onto the queue with hg qpush
:
hg qpop
hg qpush
Pop all patches:
hg qpop -a
PUsh all patches:
hg qpush -a
Finishing patches makes them permanent changesets.
Finish first applied patch in the queue:
hg qfinish
Finish all applied patches in the queue:
hg qfinish -a
To rebase with latest changesets in upstream repository:
hg qpop -a // Pop all patches
hg pull -u // Pull in changesets from upstream repo and update
hg qpush -a // Push all patches on top of new changesets
If there are any conflicts you will be forced to merge your patches.
To fold (combine) two patches:
hg qnew firstPatch // Create first patch
hg qnew secondPatch // Create second patch
hg qpop // Pop secondPatch
hg qfold secondPatch // Fold secondPatch with firstPatch
More than one queue may be created. Each queue can be thought of as a separate branch.
hg qqueue --create foo // Create a new queue called "foo"
hg qqueue --list // List all queues
hg qqueue --active // Print name of active queue
hg qqueue --rename bar // Rename active queue "foo" to "bar"
hg qqueue --delete bar // delete queue "bar"
Create two queues and switch between them:
hg qqueue --create foo // Create a new queue called "foo" and make it active
hg qqueue --create bar // Create a new queue called "bar" and make it active
hg qqueue foo // Switch back to queue "foo"
Deprecated: