我应该将 -f 与“hg qimport”一起使用吗?
我有一个使用 Mercurial 队列的 Mercurial 存储库。假设以下场景。我创建了一个补丁 firstpatch
,然后弹出它。
我对代码库进行了一些更改,并创建了第二个补丁 secondpatch
。但是,当我尝试再次应用 firstpatch
时,我没有成功。
$ hg qimport .hg/patches/firstpatch
abort: patch "firstpatch" already exists
然后我尝试使用 -f 标志,但是在这种情况下
$ hg qimport -f .hg/patches/firstpatch
adding firstpatch to series file
,补丁不会显示在 hg log 命令的输出中。出了点问题;我做错了什么?
I have a mercurial repository which uses Mercurial queues. Assume the following scenario. I create a patch firstpatch
, and then pop it.
I make a few changes to the codebase, and create a second patch secondpatch
. However, when I try to apply firstpatch
again, I am unsuccessful.
$ hg qimport .hg/patches/firstpatch
abort: patch "firstpatch" already exists
Then I tried using the -f flag, and in that case
$ hg qimport -f .hg/patches/firstpatch
adding firstpatch to series file
However, the patch does not show up in the output of the hg log
command. Somethings off; what am I doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
hg qimport
导入补丁队列中尚不存在的补丁。您想要的是hg qpush
重新应用您之前 qpop-ed 的补丁。示例:
请注意,Mercurial 队列作为堆栈进行管理。创建和删除 firstpatch 允许在队列中将 secondpatch 插入到它之前。然后,
qpush
重新应用堆栈中的下一个补丁 (firstpatch)。使用hg qseries
查看整个补丁列表,使用hg qapplied
仅查看已应用的补丁。hg qimport
imports a patch that doesn't already exist in the patch queue. What you want ishg qpush
to reapply the patch you qpop-ed earlier.Example:
Note that a Mercurial queue is managed as a stack. Creating and removing firstpatch allows secondpatch to be inserted before it in the queue.
qpush
then reapplies the next patch in the stack (firstpatch). Usehg qseries
to see the entire patch list andhg qapplied
to see only the applied patches.