Patchwork D3666: templatekw: make getrenamed() return only filename, not nodeid

login
register
mail settings
Submitter phabricator
Date May 28, 2018, 12:57 p.m.
Message ID <7e1d1455c4164ec97f5dc660b5bda3a5@localhost.localdomain>
Download mbox | patch
Permalink /patch/31890/
State Not Applicable
Headers show

Comments

phabricator - May 28, 2018, 12:57 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGec37df9042f9: templatekw: make getrenamed() return only filename, not nodeid (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3666?vs=8911&id=8912

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

AFFECTED FILES
  mercurial/logcmdutil.py
  mercurial/templatekw.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/templatekw.py b/mercurial/templatekw.py
--- a/mercurial/templatekw.py
+++ b/mercurial/templatekw.py
@@ -111,16 +111,17 @@ 
             for i in fl:
                 lr = fl.linkrev(i)
                 renamed = fl.renamed(fl.node(i))
-                rcache[fn][lr] = renamed
+                rcache[fn][lr] = renamed and renamed[0]
                 if lr >= endrev:
                     break
         if rev in rcache[fn]:
             return rcache[fn][rev]
 
         # If linkrev != rev (i.e. rev not found in rcache) fallback to
         # filectx logic.
         try:
-            return repo[rev][fn].renamed()
+            renamed = repo[rev][fn].renamed()
+            return renamed and renamed[0]
         except error.LookupError:
             return None
 
@@ -318,7 +319,7 @@ 
         for fn in ctx.files():
             rename = getrenamed(fn, ctx.rev())
             if rename:
-                copies.append((fn, rename[0]))
+                copies.append((fn, rename))
 
     copies = util.sortdict(copies)
     return compatdict(context, mapping, 'file_copy', copies,
diff --git a/mercurial/logcmdutil.py b/mercurial/logcmdutil.py
--- a/mercurial/logcmdutil.py
+++ b/mercurial/logcmdutil.py
@@ -865,7 +865,7 @@ 
             for fn in ctx.files():
                 rename = getrenamed(fn, ctx.rev())
                 if rename:
-                    copies.append((fn, rename[0]))
+                    copies.append((fn, rename))
         edges = edgefn(type, char, state, rev, parents)
         firstedge = next(edges)
         width = firstedge[2]
@@ -893,7 +893,7 @@ 
             for fn in ctx.files():
                 rename = getrenamed(fn, rev)
                 if rename:
-                    copies.append((fn, rename[0]))
+                    copies.append((fn, rename))
         displayer.show(ctx, copies=copies)
         displayer.flush(ctx)
     displayer.close()