Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert N local topmost commits to an MQ patch?

I would like to arrange my last commits as an MQ patch. All the commits are local (never pushed to the server), but not all the local commits are to be converted.

Say, I did 10 commits (never pushed) and now I wish to convert the last 5 to a patch.

How do I do it?

like image 733
mark Avatar asked Sep 04 '11 07:09

mark


2 Answers

Short version:

$ hg qimport -r "-5:"

Long version:

$ hg qimport -r "last(all(), 5)"
like image 68
Idan K Avatar answered Nov 11 '22 11:11

Idan K


You can import changesets via hg qimport if you've already got an MQ repository initialised (via hg qinit. The command only accepts one patch at a time, so to import your last five changesets, you'd need to run the command five times and specify the revision to import via the --rev XXX parameter.

If your using TortoiseHG, you can import patches from within the TortoiseHG Workbench by right-clicking the changeset to import, then selecting Modify History -> Import to MQ.

like image 30
lee-m Avatar answered Nov 11 '22 11:11

lee-m