How to programmatically merge text files with potential conflicts (ala git or svn, etc)?

后端 未结 2 1694
青春惊慌失措
青春惊慌失措 2021-02-07 22:06

As part of a larger project, I want the ability to take two bodies of text and hand them to a merge algorithm which returns either an auto-merged result (in cases where the chan

2条回答
  •  囚心锁ツ
    2021-02-07 23:03

    You're probably searching for merge algorithms like 3-way merging, which you can find in many open source projects, e.g. in the bazaar VCS (merge3.py source).

提交回复
热议问题