Skip to main content

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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for merge3-0.0.12.tar.gz
Algorithm Hash digest
SHA256 fd3fc873dcf60b9944606d125f72643055c739ff41793979ccbdea3ea6818d36
MD5 1e62f7b01f2336f8771ec2edb6b9f991
BLAKE2b-256 7d1d1a2a0ff25b18cc3b7af41180821099696c2c34e4459fff09a2d19729281e

See more details on using hashes here.

File details

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

File metadata

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

Hashes for merge3-0.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 ae65e506488778a046af040e424ceb041d0cee4b493c2ef2daac852cc92a8b84
MD5 8ced7a7d8feff0235e3f58b51af24a0e
BLAKE2b-256 125627d09d7bcc9222522f71aac3b0b1696132af4a11f9e0cdccd53bb32b6bfe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page