comparison mercurial/copies.py @ 32564:6966e42f833a

copies: rename getfctx to getsrcfctx In the next patch we'll use getdstfctx. Let's rename getfctx to getsrcfctx in this patch.
author Stanislau Hlebik <stash@fb.com>
date Mon, 29 May 2017 05:58:08 -0700
parents e1e1cc97e05a
children 5313d98089f5
comparison
equal deleted inserted replaced
32563:e1e1cc97e05a 32564:6966e42f833a
629 # 629 #
630 # In the case there is both backward and forward renames (before and after 630 # In the case there is both backward and forward renames (before and after
631 # the base) this is more complicated as we must detect a divergence. 631 # the base) this is more complicated as we must detect a divergence.
632 # We use 'backwards = False' in that case. 632 # We use 'backwards = False' in that case.
633 backwards = not remotebase and base != tca and f in mb 633 backwards = not remotebase and base != tca and f in mb
634 getfctx = _makegetfctx(srcctx) 634 getsrcfctx = _makegetfctx(srcctx)
635 635
636 if msrc[f] == mb.get(f) and not remotebase: 636 if msrc[f] == mb.get(f) and not remotebase:
637 # Nothing to merge 637 # Nothing to merge
638 return 638 return
639 639
640 of = None 640 of = None
641 seen = {f} 641 seen = {f}
642 for oc in getfctx(f, msrc[f]).ancestors(): 642 for oc in getsrcfctx(f, msrc[f]).ancestors():
643 ocr = oc.linkrev() 643 ocr = oc.linkrev()
644 of = oc.path() 644 of = oc.path()
645 if of in seen: 645 if of in seen:
646 # check limit late - grab last rename before 646 # check limit late - grab last rename before
647 if ocr < limit: 647 if ocr < limit:
656 data['fullcopy'][f] = of 656 data['fullcopy'][f] = of
657 if of not in mdst: 657 if of not in mdst:
658 continue # no match, keep looking 658 continue # no match, keep looking
659 if mdst[of] == mb.get(of): 659 if mdst[of] == mb.get(of):
660 return # no merge needed, quit early 660 return # no merge needed, quit early
661 c2 = getfctx(of, mdst[of]) 661 c2 = getsrcfctx(of, mdst[of])
662 # c2 might be a plain new file on added on destination side that is 662 # c2 might be a plain new file on added on destination side that is
663 # unrelated to the droids we are looking for. 663 # unrelated to the droids we are looking for.
664 cr = _related(oc, c2, tca.rev()) 664 cr = _related(oc, c2, tca.rev())
665 if cr and (of == f or of == c2.path()): # non-divergent 665 if cr and (of == f or of == c2.path()): # non-divergent
666 if backwards: 666 if backwards: