Show More
@@ -126,33 +126,6 b' class Merge3Text(object):' | |||||
126 | else: |
|
126 | else: | |
127 | raise ValueError(what) |
|
127 | raise ValueError(what) | |
128 |
|
128 | |||
129 | def merge_annotated(self): |
|
|||
130 | """Return merge with conflicts, showing origin of lines. |
|
|||
131 |
|
||||
132 | Most useful for debugging merge. |
|
|||
133 | """ |
|
|||
134 | for t in self.merge_regions(): |
|
|||
135 | what = t[0] |
|
|||
136 | if what == 'unchanged': |
|
|||
137 | for i in range(t[1], t[2]): |
|
|||
138 | yield 'u | ' + self.base[i] |
|
|||
139 | elif what == 'a' or what == 'same': |
|
|||
140 | for i in range(t[1], t[2]): |
|
|||
141 | yield what[0] + ' | ' + self.a[i] |
|
|||
142 | elif what == 'b': |
|
|||
143 | for i in range(t[1], t[2]): |
|
|||
144 | yield 'b | ' + self.b[i] |
|
|||
145 | elif what == 'conflict': |
|
|||
146 | yield '<<<<\n' |
|
|||
147 | for i in range(t[3], t[4]): |
|
|||
148 | yield 'A | ' + self.a[i] |
|
|||
149 | yield '----\n' |
|
|||
150 | for i in range(t[5], t[6]): |
|
|||
151 | yield 'B | ' + self.b[i] |
|
|||
152 | yield '>>>>\n' |
|
|||
153 | else: |
|
|||
154 | raise ValueError(what) |
|
|||
155 |
|
||||
156 | def merge_groups(self): |
|
129 | def merge_groups(self): | |
157 | """Yield sequence of line groups. Each one is a tuple: |
|
130 | """Yield sequence of line groups. Each one is a tuple: | |
158 |
|
131 | |||
@@ -273,11 +246,6 b' class Merge3Text(object):' | |||||
273 | ia = aend |
|
246 | ia = aend | |
274 | ib = bend |
|
247 | ib = bend | |
275 |
|
248 | |||
276 | def mismatch_region(next_a, region_ia, next_b, region_ib): |
|
|||
277 | if next_a < region_ia or next_b < region_ib: |
|
|||
278 | return 'conflict', None, None, next_a, region_ia, next_b, region_ib |
|
|||
279 | mismatch_region = staticmethod(mismatch_region) |
|
|||
280 |
|
||||
281 | def find_sync_regions(self): |
|
249 | def find_sync_regions(self): | |
282 | """Return a list of sync regions, where both descendants match the base. |
|
250 | """Return a list of sync regions, where both descendants match the base. | |
283 |
|
251 |
General Comments 0
You need to be logged in to leave comments.
Login now