我有一个使用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
命令的输出中。有些事情;我做错了什么?
答案 0 :(得分:1)
hg qimport
导入补丁队列中尚不存在的补丁。你想要的是hg qpush
重新应用你之前编写过的补丁。
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
查看已应用的修补程序。