comparison hgext/remotefilelog/__init__.py @ 41192:2338eab5f8b7

remotefilelog: fix {file_copies} template keyword remotefilelog overrides templatekw.getrenamedfn(). I changed the return type of that function in ec37df9042f9 (templatekw: make getrenamed() return only filename, not nodeid, 2018-03-26). So we need to change remotefilelog too. The function is used by the {file_copies} template keyword and by `hg log --copies`. Differential Revision: https://phab.mercurial-scm.org/D5576
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 11 Jan 2019 14:07:35 -0800
parents c61b8dfb07c8
children 312afd164009
comparison
equal deleted inserted replaced
41191:93c2beb9047f 41192:2338eab5f8b7
678 try: 678 try:
679 fctx = repo[rev].filectx(fn) 679 fctx = repo[rev].filectx(fn)
680 for ancestor in fctx.ancestors(): 680 for ancestor in fctx.ancestors():
681 if ancestor.path() == fn: 681 if ancestor.path() == fn:
682 renamed = ancestor.renamed() 682 renamed = ancestor.renamed()
683 rcache[fn][ancestor.rev()] = renamed 683 rcache[fn][ancestor.rev()] = renamed and renamed[0]
684 684
685 return fctx.renamed() 685 renamed = fctx.renamed()
686 return renamed and renamed[0]
686 except error.LookupError: 687 except error.LookupError:
687 return None 688 return None
688 689
689 return getrenamed 690 return getrenamed
690 691