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

Uploaded Source

File details

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

File metadata

  • Download URL: merge3-0.0.2.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.6

File hashes

Hashes for merge3-0.0.2.tar.gz
Algorithm Hash digest
SHA256 35f2d6a5ea45d6dc16afb577205e5dd131146f2f8aa446e34f4228eb09afc52f
MD5 d5b14233bd3de5b93bb046272fa57c79
BLAKE2b-256 8b5cbaef7edc9e570a48a82be3bcf92db86fe3d3dcbebe40ef1113e614149f58

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