Python implementation of 3-way merge
Project Links
Meta
Maintainer: Breezy Developers
Requires Python: >=3.9
Classifiers
Development Status
- 4 - Beta
Programming Language
- Python :: 3.9
- Python :: 3.10
- Python :: 3.11
- Python :: 3.12
- Python :: 3.13
- Python :: 3.14
- Python :: Implementation :: CPython
- Python :: Implementation :: PyPy
Operating System
- POSIX
A Python implementation of 3-way merge of texts.
Given BASE, OTHER, THIS, tries to produce a combined text incorporating the changes from both BASE->OTHER and BASE->THIS. All three will typically be sequences of lines.
Usage
From the command-line:
$ echo foo > mine $ echo bar > base $ echo blah > other $ python -m merge3 mine base other > merged $ cat merged
Or from Python:
>>> import merge3 >>> m3 = merge3.Merge3( ... ['common\n', 'base\n'], ... ['common\n', 'a\n'], ... ['common\n', 'b\n']) >>> list(m3.merge_annotated()) ['u | common\n', '<<<<\n', 'A | a\n', '----\n', 'B | b\n', '>>>>\n']
0.0.16
Oct 15, 2025
0.0.15
May 05, 2024
0.0.14
Sep 17, 2023
0.0.13
Feb 07, 2023
0.0.12
Nov 20, 2022
0.0.11
Oct 28, 2022
0.0.10
Oct 20, 2022
0.0.9
Sep 25, 2022
0.0.8
Mar 13, 2021
0.0.7
Mar 13, 2021
0.0.4
Feb 05, 2021
0.0.3
May 23, 2020
0.0.2
Aug 02, 2018
0.0.1
Jul 12, 2018