This answer shows how you can demote a commit to a patch, but how can I convert an mq patch to local changes only?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Short answer
Make sure the patch is applied, then:
Long answer
First, you need to make sure no changes are tracked by the patch. To do that, use
nothingis just a random file name that is not in the repository. I usually usehg qref 0for brevity.hg qrefreshaccepts an optional file pattern. If it is given, the patch will track the changes that match the pattern – and only those. When nothing matches the file pattern, no changes will be tracked by the patch, and thus there will be local changes only.Now you have a useless patch lying around, and you have some local changes. To clean up, you can do
to pop the patch even though there are local changes. Finally, to remove the dead, empty and unapplied patch you can use
You can’t remove an applied patch, which is why you need the
hg qpop --keep-changesstep.(Note:
hg qrmandhg qremoveare aliases ofhg qdelete.)If using TortoiseHg
With TortoiseHg, exporting the patch to the clipboard (Workbench > right-click the patch > Export > Copy Patch), then unapplying the patch, and finally importing from the clipboard with the destination being “Working Directory” seems to work. Here are some screen captures demonstrating this procedure:
