D5576: remotefilelog: fix {file_copies} template keyword

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Sat Jan 12 01:03:18 UTC 2019


martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  remotefilelog overrides templatekw.getrenamedfn(). I changed the
  return type of that function in https://phab.mercurial-scm.org/rHGec37df9042f9f074a90131c5ac83a8803e83d238 (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`.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D5576

AFFECTED FILES
  hgext/remotefilelog/__init__.py
  tests/test-remotefilelog-log.t

CHANGE DETAILS

diff --git a/tests/test-remotefilelog-log.t b/tests/test-remotefilelog-log.t
--- a/tests/test-remotefilelog-log.t
+++ b/tests/test-remotefilelog-log.t
@@ -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
   
diff --git a/hgext/remotefilelog/__init__.py b/hgext/remotefilelog/__init__.py
--- a/hgext/remotefilelog/__init__.py
+++ b/hgext/remotefilelog/__init__.py
@@ -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
 



To: martinvonz, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list