Mercurial 在合并期间删除文件
我有一个名为“开发”的分支,具有特定状态的文件,发行号为 500,其中包含 a.java 和 b.java 。
步 - a.java 已从开发中删除,然后推送(501)。 - 从 501 创建一个名为 (my_branch) 的分支; - 在 my_branch 中我添加了新版本的 a.java 和新文件 c.java;
问题 当我尝试将 my_branch 与开发合并时,mercurial 删除 a.java。结果是带有 b.java 和 c.java 的 my_branch;
我认为 Mercurial 知道之前删除了 a.java,并且在不提示警告的情况下删除该文件,即使我在 my_branch 中再次添加了该文件。
如何强制合并 my_branch 的文件?
I have a branch called "developing" with a certain status o files with a release number 500 with a.java and b.java inside.
STEP
- a.java has been deleted from developing and then pushed (501).
- a branch is created from 501 called (my_branch);
- in my_branch I have added a new version of a.java and a new file c.java;
PROBLEM
When I try to merge my_branch with developing, mercurial delete a.java. The result is my_branch with b.java and c.java;
What I think is that mercurial is aware of previusly deleting of a.java and, without prompting a warning, delete the file even if I have added again in my_branch.
How can I force my_branch's file to be merged?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我刚刚尝试了所描述的场景。 Mercurial 不会删除先前删除的文件的新版本。
重现步骤:
hg update -C 2
合并两个头会生成文件 a.txt 和 b.txt
I just tried the described scenario. The mercurial doesn't delete new version of previously deleted file.
Steps to reproduce:
hg update -C 2
Merging two heads results in files a.txt and b.txt
我同意@bbaja42,你的描述中缺少一些细节——这在正常使用中不会发生。
也就是说,解决起来很容易——只需在提交合并之前将所需的文件放在适当的位置即可——合并始终在 Mercurial 中手动提交。
I'm with @bbaja42 that there's some detail missing in your description -- this doesn't happen in normal usage.
That said, it's easy to work around -- just put the file you want in place before you commit the merge -- merges are always manually committed in Mercurial.