从 Mercurial MQ 补丁中删除文件
我在 Mercurial 中应用了大型 MQ 补丁。发生的情况是我已经完成了 qrefresh 并在我的补丁中包含了我不想包含的文件。有没有办法从我的补丁中删除对这些文件的更改,而无需手动编辑它?在这种情况下,如果我只是在没有 MQ 的情况下工作,我所要做的就是 hg revert。
I have large MQ patch applied in Mercurial. What has happened is I have done qrefresh and included files in my patch that I do not want to include. Is there a way to remove the changes to these file from my patch with out manually editing it? In this case if I was just working without MQ, all I would have to do is hg revert.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
应用补丁后:
将取出补丁的 file1 到 fileN。完成后,输入
hg status
以验证文件现在是否已标记为已修改,因此不再是补丁的一部分。With the patch applied:
Will take out file1 to fileN of the patch. After completing that, type
hg status
to verify that the files are now marked as modified, and therefore not part of the patch any longer .我认为您可以使用使补丁成为当前补丁(已应用并位于堆栈顶部),然后使用
hg忘记
和hg qrefresh
。当然,
hg忘记
只是hg删除
,不需要额外的选项来避免文件删除。I think you can use make the patch the current patch (applied and at the top of the stack) and then
hg forget
andhg qrefresh
.And of course
hg forget
is justhg remove
without requiring extra options to avoid file deletion.最简单的方法是对除要删除的文件之外的所有文件执行
hg qrefresh
- 这将从补丁中删除更改而不丢弃它们。The easiest way to do this is to do
hg qrefresh
with all the files except the one you want to remove - that'll take the changes out of the patch without discarding them.