commands.log: getrenamed() cleanup
authorAlexander Solovyov <piranha@piranha.org.ua>
Tue, 24 Nov 2009 16:07:36 +0200
changeset 9916 3d718761157b
parent 9915 806e6b6cb8d8
child 9917 1746909b8878
child 9925 9dfe34bf42c7
commands.log: getrenamed() cleanup
mercurial/commands.py
--- 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"]: