~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge3.py

  • Committer: Robert Collins
  • Date: 2005-10-24 13:59:18 UTC
  • mfrom: (1185.20.1)
  • Revision ID: robertc@robertcollins.net-20051024135918-024629d7ee347b5c
fix upgrading of trees with no commits

Show diffs side-by-side

added added

removed removed

Lines of Context:
76
76
    def merge_lines(self,
77
77
                    name_a=None,
78
78
                    name_b=None,
79
 
                    start_marker='<<<<<<<<',
80
 
                    mid_marker='========',
81
 
                    end_marker='>>>>>>>>',
82
 
                    show_base=False):
 
79
                    name_base=None,
 
80
                    start_marker='<<<<<<<',
 
81
                    mid_marker='=======',
 
82
                    end_marker='>>>>>>>',
 
83
                    base_marker=None):
83
84
        """Return merge in cvs-like form.
84
85
        """
85
86
        if name_a:
86
87
            start_marker = start_marker + ' ' + name_a
87
88
        if name_b:
88
89
            end_marker = end_marker + ' ' + name_b
 
90
        if name_base and base_marker:
 
91
            base_marker = base_marker + ' ' + name_base
89
92
            
90
93
        for t in self.merge_regions():
91
94
            what = t[0]
102
105
                yield start_marker + '\n'
103
106
                for i in range(t[3], t[4]):
104
107
                    yield self.a[i]
 
108
                if base_marker is not None:
 
109
                    yield base_marker + '\n'
 
110
                    for i in range(t[1], t[2]):
 
111
                        yield self.base[i]
105
112
                yield mid_marker + '\n'
106
113
                for i in range(t[5], t[6]):
107
114
                    yield self.b[i]