我应该将 -f 与“hg qimport”一起使用吗?

发布于 2024-09-30 22:06:50 字数 466 浏览 5 评论 0原文

我有一个使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

看春风乍起 2024-10-07 22:06:50

hg qimport 导入补丁队列中尚不存在的补丁。您想要的是 hg qpush 重新应用您之前 qpop-ed 的补丁。

示例:

C:\db> hg init
C:\db> echo >file1
C:\db> hg ci -Am codebase         # original codebase <contains file1>
adding file1
C:\db> echo >file2
C:\db> hg add
adding file2
C:\db> hg qnew firstpatch         # firstpatch <contains file2>
C:\db> hg qpop                    # remove firstpatch
popping firstpatch
patch queue now empty
C:\db> echo >file3
C:\db> hg add
adding file3
C:\db> hg qnew secondpatch        # secondpatch <contains file3>
C:\db> hg qpush                   # reapply firstpatch
applying firstpatch
now at: firstpatch
C:\db> hg manifest                # all files present
file1
file2
file3

请注意,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 is hg qpush to reapply the patch you qpop-ed earlier.

Example:

C:\db> hg init
C:\db> echo >file1
C:\db> hg ci -Am codebase         # original codebase <contains file1>
adding file1
C:\db> echo >file2
C:\db> hg add
adding file2
C:\db> hg qnew firstpatch         # firstpatch <contains file2>
C:\db> hg qpop                    # remove firstpatch
popping firstpatch
patch queue now empty
C:\db> echo >file3
C:\db> hg add
adding file3
C:\db> hg qnew secondpatch        # secondpatch <contains file3>
C:\db> hg qpush                   # reapply firstpatch
applying firstpatch
now at: firstpatch
C:\db> hg manifest                # all files present
file1
file2
file3

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). Use hg qseries to see the entire patch list and hg qapplied to see only the applied patches.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文