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.16.tar.gz (15.9 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.16-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: merge3-0.0.16.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for merge3-0.0.16.tar.gz
Algorithm Hash digest
SHA256 0852de4381cb46be5ef4ed49e3ac20c5a4a0cd46a8ff4bbb870bc27aab543306
MD5 5ffb277cce58a4b6efa4c4518c69035c
BLAKE2b-256 1271daaa7978561b9a7bfdcee4ba5ec2ead6162f6a9d2e2edf069def96085c6b

See more details on using hashes here.

Provenance

The following attestation bundles were made for merge3-0.0.16.tar.gz:

Publisher: wheels.yaml on breezy-team/merge3

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: merge3-0.0.16-py3-none-any.whl
  • Upload date:
  • Size: 16.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for merge3-0.0.16-py3-none-any.whl
Algorithm Hash digest
SHA256 b9d907b7281213a5dca1d711d168c4f8fe8aca20d74e2456bb177c4f31dfd927
MD5 75dc834bf9855d9117865946b1b5d695
BLAKE2b-256 e3e9a94184895f008ecc70ae4d227deb6a4209bb4f86c5f35b79b8cf6fc23ee4

See more details on using hashes here.

Provenance

The following attestation bundles were made for merge3-0.0.16-py3-none-any.whl:

Publisher: wheels.yaml on breezy-team/merge3

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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