The purpose of the hg mq plugin is to be able to make perfect commits to your repository, not confusing the changes that you made in your absent-minded ADHD induced rambling through your code;
For instance....
I'm working on bug x when I notice bug y and start working on it instead. At this point you are supposed to create a new patch in the patch queue so as not to confuse the changes when it is hg qfinish
committed to your repository.
Now suppose for a minute that you forget make the new patch and in the process hg qrefresh
. Then later realizing your mistake you wish to separate the changes from that one patch into two patches.
I realize that it has to do with editing your patch file (and a new patch file) in the queue to separate the changes into separate patches and later commits. However, I'm not yet skilled at editing the diff patch files.
Where can I learn about this? And how might one go about this?
Another option (assuming it runs on your platform) is version 2.0 of TortoiseHG. The 'inappropriately' named Shelve utility allows for moving of chunks and files between patches, or into the working directory. It's available for Windows, Linux and possibly OSX.
http://tortoisehg.bitbucket.io/
As noted in this related SO question, check out the "Split a patch into multiple patches" section of the MQ tutorial.
You can activate the record extension, adding to .hgrc the following lines:
[extensions]
hgext.record =
You can clear your current patch with
hg qrefresh nothing
(note that the "nothing
" is just a random string: the arguments to qrefresh
is the list of files which must be included in the current patch, so anything that is not the name of a modified file will do - I usually use "0")
Now with hg qrecord <patchName>
you can choose interactively which changes must go in the new patch. The remaining changes can then be added to another patch with qnew
or another qrecord
. You can finally use qpop
, qfold
or edit .hg/patches/series
to merge and reorder the patches.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With