Mercurial > hg
comparison mercurial/copies.py @ 32559:c8c9feffbd35
copies: rename m1 to msrc
Small refactoring that renames `m1` parameter name to a more clearer name
`msrc`.
author | Stanislau Hlebik <stash@fb.com> |
---|---|
date | Mon, 29 May 2017 05:52:15 -0700 |
parents | bd872f64a8ba |
children | 931b7707179f |
comparison
equal
deleted
inserted
replaced
32558:aa91085cadf3 | 32559:c8c9feffbd35 |
---|---|
596 elif f1r == f2r or f1r < limit or f2r < limit: | 596 elif f1r == f2r or f1r < limit or f2r < limit: |
597 return False # copy no longer relevant | 597 return False # copy no longer relevant |
598 except StopIteration: | 598 except StopIteration: |
599 return False | 599 return False |
600 | 600 |
601 def _checkcopies(ctx, f, m1, m2, base, tca, remotebase, limit, data): | 601 def _checkcopies(ctx, f, msrc, m2, base, tca, remotebase, limit, data): |
602 """ | 602 """ |
603 check possible copies of f from m1 to m2 | 603 check possible copies of f from msrc to m2 |
604 | 604 |
605 ctx = starting context for f in m1 | 605 ctx = starting context for f in msrc |
606 f = the filename to check (as in m1) | 606 f = the filename to check (as in msrc) |
607 m1 = the source manifest | 607 msrc = the source manifest |
608 m2 = the destination manifest | 608 m2 = the destination manifest |
609 base = the changectx used as a merge base | 609 base = the changectx used as a merge base |
610 tca = topological common ancestor for graft-like scenarios | 610 tca = topological common ancestor for graft-like scenarios |
611 remotebase = True if base is outside tca::ctx, False otherwise | 611 remotebase = True if base is outside tca::ctx, False otherwise |
612 limit = the rev number to not search beyond | 612 limit = the rev number to not search beyond |
630 # the base) this is more complicated as we must detect a divergence. | 630 # the base) this is more complicated as we must detect a divergence. |
631 # We use 'backwards = False' in that case. | 631 # We use 'backwards = False' in that case. |
632 backwards = not remotebase and base != tca and f in mb | 632 backwards = not remotebase and base != tca and f in mb |
633 getfctx = _makegetfctx(ctx) | 633 getfctx = _makegetfctx(ctx) |
634 | 634 |
635 if m1[f] == mb.get(f) and not remotebase: | 635 if msrc[f] == mb.get(f) and not remotebase: |
636 # Nothing to merge | 636 # Nothing to merge |
637 return | 637 return |
638 | 638 |
639 of = None | 639 of = None |
640 seen = {f} | 640 seen = {f} |
641 for oc in getfctx(f, m1[f]).ancestors(): | 641 for oc in getfctx(f, msrc[f]).ancestors(): |
642 ocr = oc.linkrev() | 642 ocr = oc.linkrev() |
643 of = oc.path() | 643 of = oc.path() |
644 if of in seen: | 644 if of in seen: |
645 # check limit late - grab last rename before | 645 # check limit late - grab last rename before |
646 if ocr < limit: | 646 if ocr < limit: |