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']
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
merge3-0.0.7.tar.gz
(16.9 kB
view details)
File details
Details for the file merge3-0.0.7.tar.gz.
File metadata
- Download URL: merge3-0.0.7.tar.gz
- Upload date:
- Size: 16.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0cd4eecba802733866ace6ca4e68eacbea31e4ca88eb410a09622d9631520258
|
|
| MD5 |
8e7dc81be76ce440069858c0552d9699
|
|
| BLAKE2b-256 |
9a3acd00ce76e31e5a011ea1025c6063c1897b34650f7f6752d26715546bd860
|