Mercurial > hg
comparison mercurial/copies.py @ 29216:ead25aa27a43
py3: convert to next() function
next(..) was introduced in py2.6 and .next() is not available in py3
https://docs.python.org/2/library/functions.html#next
author | timeless <timeless@mozdev.org> |
---|---|
date | Mon, 16 May 2016 21:30:53 +0000 |
parents | d4247c306d82 |
children | 12cac1e4d6d9 |
comparison
equal
deleted
inserted
replaced
29215:f5983805574e | 29216:ead25aa27a43 |
---|---|
482 g1, g2 = f1.ancestors(), f2.ancestors() | 482 g1, g2 = f1.ancestors(), f2.ancestors() |
483 try: | 483 try: |
484 f1r, f2r = f1.linkrev(), f2.linkrev() | 484 f1r, f2r = f1.linkrev(), f2.linkrev() |
485 | 485 |
486 if f1r is None: | 486 if f1r is None: |
487 f1 = g1.next() | 487 f1 = next(g1) |
488 if f2r is None: | 488 if f2r is None: |
489 f2 = g2.next() | 489 f2 = next(g2) |
490 | 490 |
491 while True: | 491 while True: |
492 f1r, f2r = f1.linkrev(), f2.linkrev() | 492 f1r, f2r = f1.linkrev(), f2.linkrev() |
493 if f1r > f2r: | 493 if f1r > f2r: |
494 f1 = g1.next() | 494 f1 = next(g1) |
495 elif f2r > f1r: | 495 elif f2r > f1r: |
496 f2 = g2.next() | 496 f2 = next(g2) |
497 elif f1 == f2: | 497 elif f1 == f2: |
498 return f1 # a match | 498 return f1 # a match |
499 elif f1r == f2r or f1r < limit or f2r < limit: | 499 elif f1r == f2r or f1r < limit or f2r < limit: |
500 return False # copy no longer relevant | 500 return False # copy no longer relevant |
501 except StopIteration: | 501 except StopIteration: |