Mercurial 如何处理分割的文件?
Mercurial 如何处理分割的文件?如果我创建一个分支并拆分一个文件会发生什么。我可以轻松地从修改原始未分割文件的另一个分支中提取更改吗?
How does mercurial handle splitted files? What will happen if I create a branch and split a file. Can I easily pull changes from another branch which modifies the original, unsplitted file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我只是做了一个小实验。我使用一个大文件创建了一个存储库 (
foo
)。然后我将其克隆到bar
中,使用hg cp
将文件复制到两个文件中,并删除了两个文件中的一半。然后我做了一个影响foo
中整个文件的更改,并将其合并到bar
中。结果,各个分割文件包含的部分被正确合并,而我在删除的部分上遇到了冲突:我的本地版本是空的,而另一个版本是从
foo
进行的更改。因此,如果您乐于在每次合并时消除此类冲突,那么这对您来说可能就足够了。
I just did a little experiment. I created one repository (
foo
) with one big file. Then I cloned that intobar
, usedhg cp
to copy the file into two files, and removed one half in both files. Then I made a change affecting the whole file infoo
, and merged that intobar
.As a result, the parts contained by the respective split file were merged correctly, while I got a conflict for the removed parts: my local version was empty, while the other version was the change from
foo
.So if you're happy with removing these kinds of conflicts every time you merge, this might be good enough for you.
看完澄清评论后,答案是否定的。 Mercurial 跟踪文件,而不是大量代码,因此据我所知,它无法做到这一点。
After reading the clarification comment, the answer is no. Mercurial tracks files, not hunks of code, so it can't do that as far as I know.