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

Uploaded Source

Built Distribution

merge3-0.0.10-py3-none-any.whl (17.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: merge3-0.0.10.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.7

File hashes

Hashes for merge3-0.0.10.tar.gz
Algorithm Hash digest
SHA256 841c688fc0b4054e30f6672a7af5acc9686d2b9875f9abd3954a14b590e4f626
MD5 3a1cae17cf54ac2a161e244c5da226e5
BLAKE2b-256 dda5d31be0033a9a7164282a5be0e00f66441a4e9f5fe222735b48d3fd431adf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: merge3-0.0.10-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.7

File hashes

Hashes for merge3-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 a6b25ae1d1b05b3325242360ced4d5a266de09e2cb2527f9a6dbeb17291bdfe7
MD5 2e6f88710525d2db6c3f839a489eba74
BLAKE2b-256 650d529f846cbb2b257404c6d371c1ab5d8925c83b3ceb80efdfdbe5b1a05391

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