How does Mercurial handle splitted files?

后端 未结 2 505
北海茫月
北海茫月 2021-01-18 08:09

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,

相关标签:
2条回答
  • 2021-01-18 08:36

    I just did a little experiment. I created one repository (foo) with one big file. Then I cloned that into bar, used hg cp to copy the file into two files, and removed one half in both files. Then I made a change affecting the whole file in foo, and merged that into bar.

    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.

    0 讨论(0)
  • 2021-01-18 08:49

    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.

    0 讨论(0)
提交回复
热议问题