Python implementation of 3-way merge
Project description
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']
Project details
Release history Release notifications | RSS feed
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.11.tar.gz
(16.5 kB
view details)
Built Distribution
merge3-0.0.11-py3-none-any.whl
(17.9 kB
view details)
File details
Details for the file merge3-0.0.11.tar.gz
.
File metadata
- Download URL: merge3-0.0.11.tar.gz
- Upload date:
- Size: 16.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 859ee1c31595c148f0961c55402779bc98c1c63dfdfca2f2cd7d443be6f0ab9c |
|
MD5 | ee9a2b9054b3123d6a783fc94f388ee6 |
|
BLAKE2b-256 | 1bef6543392d9dcca7694c9c9bff93562107c3a3c104165f98348de41a080cd3 |
File details
Details for the file merge3-0.0.11-py3-none-any.whl
.
File metadata
- Download URL: merge3-0.0.11-py3-none-any.whl
- Upload date:
- Size: 17.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef82fd95aeac124ea9a1616a6e2ef9368bc4ed0ba3cce5f21323ee9028d86206 |
|
MD5 | 706b507d120b71f10c1839f45f4f40a7 |
|
BLAKE2b-256 | 402863ad6466eb4f0237476f822479567dfae0ccd512cb0d128d471fd6e48774 |