/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: Andrew Bennetts
  • Date: 2010-04-19 05:41:54 UTC
  • mto: This revision was merged to the branch mainline in revision 5181.
  • Revision ID: andrew.bennetts@canonical.com-20100419054154-k5pq9dlm977cwpal
Allow Merge3 to work with objects, not just lists of strs.  This removes a lot of cruft from news_merge.

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