mercurial/templatekw.py
changeset 42503 88ba0ff94605
parent 42436 dc5bd66a8270
child 43076 2372284d9457
--- a/mercurial/templatekw.py	Tue Jun 18 23:19:24 2019 -0700
+++ b/mercurial/templatekw.py	Wed Jun 19 09:59:45 2019 -0700
@@ -301,14 +301,10 @@
     cache = context.resource(mapping, 'cache')
     copies = context.resource(mapping, 'revcache').get('copies')
     if copies is None:
-        if 'getrenamed' not in cache:
-            cache['getrenamed'] = scmutil.getrenamedfn(repo)
-        copies = []
-        getrenamed = cache['getrenamed']
-        for fn in ctx.files():
-            rename = getrenamed(fn, ctx.rev())
-            if rename:
-                copies.append((fn, rename))
+        if 'getcopies' not in cache:
+            cache['getcopies'] = scmutil.getcopiesfn(repo)
+        getcopies = cache['getcopies']
+        copies = getcopies(ctx)
     return templateutil.compatfilecopiesdict(context, mapping, 'file_copy',
                                              copies)