Mercurial > public > mercurial-scm > hg
comparison mercurial/simplemerge.py @ 41759:aaad36b88298
cleanup: use () to wrap long lines instead of \
This is a little less brittle, and often helps indentation. In a
surprising number of cases the entire cleanup was deleting the \, as
the expression was *already* parenthesized in a workable way.
Differential Revision: https://phab.mercurial-scm.org/D5993
author | Augie Fackler <augie@google.com> |
---|---|
date | Wed, 20 Feb 2019 19:28:51 -0500 |
parents | e7aa113b14f7 |
children | 2372284d9457 |
comparison
equal
deleted
inserted
replaced
41758:15d3facfa40a | 41759:aaad36b88298 |
---|---|
287 alen = a2 - a1 | 287 alen = a2 - a1 |
288 blen = b2 - b1 | 288 blen = b2 - b1 |
289 | 289 |
290 # find matches at the front | 290 # find matches at the front |
291 ii = 0 | 291 ii = 0 |
292 while ii < alen and ii < blen and \ | 292 while (ii < alen and ii < blen and |
293 self.a[a1 + ii] == self.b[b1 + ii]: | 293 self.a[a1 + ii] == self.b[b1 + ii]): |
294 ii += 1 | 294 ii += 1 |
295 startmatches = ii | 295 startmatches = ii |
296 | 296 |
297 # find matches at the end | 297 # find matches at the end |
298 ii = 0 | 298 ii = 0 |
299 while ii < alen and ii < blen and \ | 299 while (ii < alen and ii < blen and |
300 self.a[a2 - ii - 1] == self.b[b2 - ii - 1]: | 300 self.a[a2 - ii - 1] == self.b[b2 - ii - 1]): |
301 ii += 1 | 301 ii += 1 |
302 endmatches = ii | 302 endmatches = ii |
303 | 303 |
304 if startmatches > 0: | 304 if startmatches > 0: |
305 yield 'same', a1, a1 + startmatches | 305 yield 'same', a1, a1 + startmatches |
348 asub = amatch + (intbase - abase) | 348 asub = amatch + (intbase - abase) |
349 bsub = bmatch + (intbase - bbase) | 349 bsub = bmatch + (intbase - bbase) |
350 aend = asub + intlen | 350 aend = asub + intlen |
351 bend = bsub + intlen | 351 bend = bsub + intlen |
352 | 352 |
353 assert self.base[intbase:intend] == self.a[asub:aend], \ | 353 assert self.base[intbase:intend] == self.a[asub:aend], ( |
354 (self.base[intbase:intend], self.a[asub:aend]) | 354 (self.base[intbase:intend], self.a[asub:aend])) |
355 | 355 |
356 assert self.base[intbase:intend] == self.b[bsub:bend] | 356 assert self.base[intbase:intend] == self.b[bsub:bend] |
357 | 357 |
358 sl.append((intbase, intend, | 358 sl.append((intbase, intend, |
359 asub, aend, | 359 asub, aend, |