changeset 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 93c2beb9047f
children dd97354b8891
files hgext/remotefilelog/__init__.py tests/test-remotefilelog-log.t
diffstat 2 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/remotefilelog/__init__.py	Fri Jan 11 16:44:39 2019 -0800
+++ b/hgext/remotefilelog/__init__.py	Fri Jan 11 14:07:35 2019 -0800
@@ -680,9 +680,10 @@
             for ancestor in fctx.ancestors():
                 if ancestor.path() == fn:
                     renamed = ancestor.renamed()
-                    rcache[fn][ancestor.rev()] = renamed
+                    rcache[fn][ancestor.rev()] = renamed and renamed[0]
 
-            return fctx.renamed()
+            renamed = fctx.renamed()
+            return renamed and renamed[0]
         except error.LookupError:
             return None
 
--- a/tests/test-remotefilelog-log.t	Fri Jan 11 16:44:39 2019 -0800
+++ b/tests/test-remotefilelog-log.t	Fri Jan 11 14:07:35 2019 -0800
@@ -108,7 +108,7 @@
   $ hg mv x z
   $ hg commit -m move
   $ hg log -f z -T '{desc} {file_copies}\n' -G
-  @  move z (x\x14\x06\xe7A\x18bv\x94&\x84\x17I\x1f\x01\x8aJ\x881R\xf0) (esc)
+  @  move z (x)
   :
   o  x