Mercurial > hg
comparison mercurial/simplemerge.py @ 22056:83df50a8d61c
simplemerge: remove dead code
The following functions in simplemerge are dead code. I reran "make
test-merge*" after this change, and it passed. Looks like cruft that
we've been carrying since we nabbed this code from bzr.
author | Jordi Gutiérrez Hermoso <jordigh@octave.org> |
---|---|
date | Thu, 07 Aug 2014 12:51:45 -0400 |
parents | 372ae2745acf |
children | 241a1324a180 |
comparison
equal
deleted
inserted
replaced
22055:ba5fc3f81f15 | 22056:83df50a8d61c |
---|---|
124 yield self.b[i] | 124 yield self.b[i] |
125 yield end_marker + newline | 125 yield end_marker + newline |
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 |
159 'unchanged', lines | 132 'unchanged', lines |
160 Lines unchanged from base | 133 Lines unchanged from base |
271 yield 'unchanged', zmatch, zend | 244 yield 'unchanged', zmatch, zend |
272 iz = zend | 245 iz = zend |
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 |
284 Generates a list of (base1, base2, a1, a2, b1, b2). There is | 252 Generates a list of (base1, base2, a1, a2, b1, b2). There is |
285 always a zero-length sync region at the end of all the files. | 253 always a zero-length sync region at the end of all the files. |