changeset 9916:3d718761157b

commands.log: getrenamed() cleanup
author Alexander Solovyov <piranha@piranha.org.ua>
date Tue, 24 Nov 2009 16:07:36 +0200
parents 806e6b6cb8d8
children 1746909b8878 9dfe34bf42c7
files mercurial/commands.py
diffstat 1 files changed, 2 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Tue Nov 24 09:49:23 2009 +0100
+++ b/mercurial/commands.py	Tue Nov 24 16:07:36 2009 +0200
@@ -2017,7 +2017,6 @@
     else:
         endrev = len(repo)
     rcache = {}
-    ncache = {}
     def getrenamed(fn, rev):
         '''looks up all renames for a file (up to endrev) the first
         time the file is given. It indexes on the changerev and only
@@ -2025,15 +2024,11 @@
         Returns rename info for fn at changerev rev.'''
         if fn not in rcache:
             rcache[fn] = {}
-            ncache[fn] = {}
             fl = repo.file(fn)
             for i in fl:
-                node = fl.node(i)
                 lr = fl.linkrev(i)
-                renamed = fl.renamed(node)
+                renamed = fl.renamed(fl.node(i))
                 rcache[fn][lr] = renamed
-                if renamed:
-                    ncache[fn][node] = renamed
                 if lr >= endrev:
                     break
         if rev in rcache[fn]:
@@ -2041,12 +2036,10 @@
 
         # If linkrev != rev (i.e. rev not found in rcache) fallback to
         # filectx logic.
-
         try:
             return repo[rev][fn].renamed()
         except error.LookupError:
-            pass
-        return None
+            return None
 
     df = False
     if opts["date"]: