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

冷暖自知 提交于 2019-12-10 12:39:53

问题


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?


回答1:


Short version:

$ hg qimport -r "-5:"

Long version:

$ hg qimport -r "last(all(), 5)"



回答2:


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.



来源:https://stackoverflow.com/questions/7297889/how-to-convert-n-local-topmost-commits-to-an-mq-patch

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!