hg 移植失败 - 我如何“修复合并”正如它所暗示的那样?
我的branch2274 是从默认分支开始的。 Rev. 415 是第一个提交,它与 rev. 415 共享祖先。默认分支上的 412。
Branch2274 是一个错误修复,需要很快合并到默认值中,但我做了一件非常愚蠢的事情 - 我合并了功能分支的更改(版本 418)。
简单来说,我需要撤消版本带来的任何更改。 418. 似乎有很多方法可以尝试此操作,但我正在努力让其中任何一个发挥作用:
Mercurial 队列尝试:
我尝试导入转速 415、416、417、(跳过 418)、421、428到补丁队列中,这样我就可以将其应用到版本 425。
问题:tortoisehg 只允许我导入版本 428、421,但导入 417 呈灰色,但导入 418 只会给我错误“中止:无法导入合并修订
版 418”尝试:
patching file Portal/Instructor/Login.aspx.vb
Hunk #1 FAILED at 18
1 out of 1 hunks FAILED -- saving rejects to file Portal/Instructor/Login.aspx.vb.rej
applying 66b6b089ee01
abort: Fix up the merge and run hg transplant --continue
patch failed to apply
[command interrupted]
Login.aspx.vb 默认已更改,我明白合并失败的原因。
我如何“修复”合并?
或者,是否有更简单的方法让我接受 rev。 418并告诉mercurial撤消它在case2274上的新提交中带来的更改?
My branch2274 was branched from default. Rev. 415 was the first commit and it shares an ancestor with the rev. 412 on the default branch.
Branch2274 is a bug fix which needs merging into default soon BUT I did a very silly thing - I merged in changes from a feature branch (at rev. 418)
In simple terms, I need to undo whatever changes were brought in by rev. 418. There seems to be a lot of ways to attempt this but I'm struggling to get any of them to work:
Mercurial queues attempt:
I've tried importing revs 415, 416, 417, (skipping 418), 421, 428 into a patch queue so I can apply it to rev 425.
Problem: tortoisehg will only allow me to import revs 428, 421 but importing 417 is greyed out but importing 418 just gives me the error "abort: cannot import merge revision 418"
Transplant attempt:
patching file Portal/Instructor/Login.aspx.vb
Hunk #1 FAILED at 18
1 out of 1 hunks FAILED -- saving rejects to file Portal/Instructor/Login.aspx.vb.rej
applying 66b6b089ee01
abort: Fix up the merge and run hg transplant --continue
patch failed to apply
[command interrupted]
Login.aspx.vb has been changed on default and I understand why the merge has failed.
How do I 'fix up' the merge?
Alternatively, is there a simpler way for me to take rev. 418 and tell mercurial to undo the changes it brought in with a new commit on case2274?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为了不留下悬而未决的问题(!),我设法解决了这个问题,最终的答案是没有简单的方法可以自动解决它。移植涉及补丁、两个文件之间的差异,但没有考虑两个文件的共同祖先,因此很难知道当文件被同一位置的两个人更改时该怎么做。
解决方案是在文本编辑器中加载该文件并加载 .rej 文件,其中列出了补丁的失败部分。我只需要将添加的内容放在代码文件中的合理位置即可。
运行:
..允许我应用其他补丁。
如果有人愿意花一些时间通过一些见解或一些相关链接来扩展这个答案,那么答案就是他们的。
In the interests of not leaving a question unanswered (!), I managed to resolve this and the ultimate answer is that there's no simple way to resolve it automatically. Transplant deals in patches, differences between two files but doesn't take into account the common ancestry of the two files so struggles to know what to do when a file has been changed by two people in the same place.
The solution is to load the file in your text editor and load the .rej file which lists the failed parts of the patch. I just had to put my additions in a sensible place in the code file.
Running:
..allowed me to apply the other patches.
If anyone cares to spend some time expanding this answer with a little insight or a few relevant links, then the answer is theirs.