如何将补丁分成两部分(使用 pbranch)?
我正在开发一个 Mercurial 存储库,并使用 pbrach 来处理一组补丁。
假设我有两个文件A和B,以及两个补丁patchA(修改A)和patchAB(修改A和B)。 pgraph 如下所示:
o patchAB
|
@ patchA
|
o default
我错误地将文件 B 的更改提交到了 patchA 中。
如何将补丁 A 分成两部分,以便最终得到: patchA=patchA' + newPatch,其中 patchA=原始补丁,patchA'=文件 A 中 patchA 的更改,P2=文件 B 中 patchA 的更改。
o patchAB
|
| o newPatch // rest of original patchA without changes already in patchA'
|/
@ patchA' // with only the changes to file A
|
o default
(我搜索类似于使用mq 但对于 pbranch)。
I am working on a mercurial repository and using pbrach for working on a set of patches.
Assume I have two files A and B, and two patches patchA (modifies A) and patchAB (modifies A and B).
The pgraph looks like this:
o patchAB
|
@ patchA
|
o default
By mistake, I committed a change to file B into patchA.
How do I split the patch A into 2 parts, so that I end up with: patchA=patchA' + newPatch, where patchA=Original Patch, patchA'=changes of patchA in file A, P2=changes of patchA in file B.
o patchAB
|
| o newPatch // rest of original patchA without changes already in patchA'
|/
@ patchA' // with only the changes to file A
|
o default
(I search something similar to splitting patches with mq but for pbranch).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最后我自己找到了一个相对较短的解决方案。
首先,我得到最后一个“好”提交的修订号(比如 1),以及错误的提交(比如 2)。
1) 我更新到 patchA,恢复 fileB 上的更改,然后提交它,然后向上合并更改:
2) 再次更新到 patchA,恢复错误的提交并创建一个新补丁:
我们现在在 patchA 中有 fileA 的更改,并且其余的在 patchA2 中。
Finally, I found a relatively short solution myself.
First I get the revision number of the last 'good' commit (say 1), and the wrong commit (say 2).
1) I update to patchA, revert the change on fileB, and commit it, and pmerge the changes upwards:
2) Update to patchA again, revert the wrong commit and create a new patch:
We now have the changes of fileA in patchA and the rest in patchA2.