changeset 11901:a80577bfea29

cmdutil: code simplification
author Nicolas Dumazet <nicdumz.commits@gmail.com>
date Sun, 15 Aug 2010 23:38:00 +0900
parents cd7182358d9f
children 3c9a5ed9b1e2
files mercurial/cmdutil.py tests/test-log.t tests/test-mq-caches.t tests/test-mq-eol.t tests/test-mq-guards.t tests/test-mq-safety.t tests/test-mq.t
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Sun Aug 15 23:34:46 2010 +0900
+++ b/mercurial/cmdutil.py	Sun Aug 15 23:38:00 2010 +0900
@@ -1086,8 +1086,7 @@
                 revs.append((linkrev, parentlinkrevs,
                              follow and filelog.renamed(n)))
 
-            for rev in reversed(revs):
-                yield rev
+            return reversed(revs)
         def iterfiles():
             for filename in match.files():
                 yield filename, None
@@ -1124,8 +1123,7 @@
                 if flparentlinkrevs:
                     ancestors.update(flparentlinkrevs)
 
-                fncache.setdefault(rev, [])
-                fncache[rev].append(file_)
+                fncache.setdefault(rev, []).append(file_)
                 wanted.add(rev)
                 if copied:
                     copies.append(copied)