Skip to main content

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


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.14.tar.gz (17.7 kB view details)

Uploaded Source

Built Distribution

merge3-0.0.14-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file merge3-0.0.14.tar.gz.

File metadata

  • Download URL: merge3-0.0.14.tar.gz
  • Upload date:
  • Size: 17.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for merge3-0.0.14.tar.gz
Algorithm Hash digest
SHA256 30406e99386f4a65280fb9c43e681890fa2a1d839cac2759d156c7cc16030159
MD5 e20464fec7d124550c3e2c1616c1a0e9
BLAKE2b-256 af4098be4a5641b0244be5881ff5e00057f8227ff183d8675a697bdfeae43b1a

See more details on using hashes here.

File details

Details for the file merge3-0.0.14-py3-none-any.whl.

File metadata

  • Download URL: merge3-0.0.14-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for merge3-0.0.14-py3-none-any.whl
Algorithm Hash digest
SHA256 7ac0aadbd9ff5bea89ba9bd3796cb26e0df361dc86a381055ce0a45a7b8726ec
MD5 8546ae3fc037d69070d23ec5a0d8a831
BLAKE2b-256 17a85e085653871c70d1b139d7888d0f79ba82d130106157cfc16a9e8078d086

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page