comparison mercurial/copies.py @ 39945:85c8ff26d698

copies: inline a variable that's used only once By inlining it, we also avoid calculating the value when "if of in seen" is false (probably not significant). Differential Revision: https://phab.mercurial-scm.org/D4831
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 21 Jun 2018 22:07:34 -0700
parents a41497b5117c
children 707c3804e607
comparison
equal deleted inserted replaced
39944:75b53b809e87 39945:85c8ff26d698
814 return 814 return
815 815
816 of = None 816 of = None
817 seen = {f} 817 seen = {f}
818 for oc in getsrcfctx(f, msrc[f]).ancestors(): 818 for oc in getsrcfctx(f, msrc[f]).ancestors():
819 ocr = oc.linkrev()
820 of = oc.path() 819 of = oc.path()
821 if of in seen: 820 if of in seen:
822 # check limit late - grab last rename before 821 # check limit late - grab last rename before
823 if ocr < limit: 822 if oc.linkrev() < limit:
824 break 823 break
825 continue 824 continue
826 seen.add(of) 825 seen.add(of)
827 826
828 # remember for dir rename detection 827 # remember for dir rename detection