/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/merge3.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-04-23 16:57:12 UTC
  • mfrom: (5158.5.3 object-3way-merge)
  • Revision ID: pqm@pqm.ubuntu.com-20100423165712-y00wbjl9yagw4g3q
(vila) Extend Merge3 API to also work with objects rather than text lines. (Andrew Bennetts)

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
    Given BASE, OTHER, THIS, tries to produce a combined text
67
67
    incorporating the changes from both BASE->OTHER and BASE->THIS.
68
68
    All three will typically be sequences of lines."""
69
 
    def __init__(self, base, a, b, is_cherrypick=False):
70
 
        check_text_lines(base)
71
 
        check_text_lines(a)
72
 
        check_text_lines(b)
 
69
 
 
70
    def __init__(self, base, a, b, is_cherrypick=False, allow_objects=False):
 
71
        """Constructor.
 
72
 
 
73
        :param base: lines in BASE
 
74
        :param a: lines in A
 
75
        :param b: lines in B
 
76
        :param is_cherrypick: flag indicating if this merge is a cherrypick.
 
77
            When cherrypicking b => a, matches with b and base do not conflict.
 
78
        :param allow_objects: if True, do not require that base, a and b are
 
79
            plain Python strs.  Also prevents BinaryFile from being raised.
 
80
            Lines can be any sequence of comparable and hashable Python
 
81
            objects.
 
82
        """
 
83
        if not allow_objects:
 
84
            check_text_lines(base)
 
85
            check_text_lines(a)
 
86
            check_text_lines(b)
73
87
        self.base = base
74
88
        self.a = a
75
89
        self.b = b